9
0
mirror of https://github.com/Auxilor/EcoMenus.git synced 2025-12-21 07:59:28 +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 {
override val row: Int = config.getInt("location.row")
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()) }
.getOrElse { MenuLayer.MIDDLE }

View File

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

View File

@@ -87,7 +87,7 @@ slots:
location:
row: 6
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.
# The layer can be any of: lower, middle, upper, or top (defaults to middle)