9
0
mirror of https://github.com/Auxilor/EcoMenus.git synced 2025-12-21 16:09:25 +00:00

Leaving the page unspecified will now make the slot appear on all

This commit is contained in:
Auxilor
2023-06-05 14:44:47 +01:00
parent 454bcf43ce
commit 8df0e5ca8d
3 changed files with 3 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ class ConfigurableSlot(
) : PositionedComponent { ) : PositionedComponent {
override val row: Int = config.getInt("location.row") override val row: Int = config.getInt("location.row")
override val column: Int = config.getInt("location.column") override val column: Int = config.getInt("location.column")
val page: Int = config.getInt("location.page") val page: Int? = config.getIntOrNull("location.page")
override val layer = runCatching { enumValueOf<MenuLayer>(config.getString("location.layer").uppercase()) } override val layer = runCatching { enumValueOf<MenuLayer>(config.getString("location.layer").uppercase()) }
.getOrElse { MenuLayer.MIDDLE } .getOrElse { MenuLayer.MIDDLE }

View File

@@ -82,7 +82,7 @@ fun buildMenu(plugin: EcoPlugin, menu: EcoMenu, config: Config): Menu {
setMask(mask) setMask(mask)
for (slot in slots) { for (slot in slots) {
if (pageNumber != slot.page) { if (slot.page != null && pageNumber != slot.page) {
continue continue
} }

View File

@@ -87,7 +87,7 @@ slots:
location: location:
row: 6 row: 6
column: 5 column: 5
page: 1 page: 1 # If you don't specify a page, it will be on all pages
# (Optional) You can specify the layer of the slot. # (Optional) You can specify the layer of the slot.
# The layer can be any of: lower, middle, upper, or top (defaults to middle) # The layer can be any of: lower, middle, upper, or top (defaults to middle)