From a193cc83c073cb79dc1b191907cc739b3c6c5dbc Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Fri, 4 Oct 2024 01:14:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D1=81=D0=B5=D0=B9?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=B0=20=D1=83?= =?UTF-8?q?=D0=BA=D1=80=D0=B0=D0=BB=D0=B8!=20=D0=B7=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B8=D1=82=20=D0=B1=D1=83=D0=B4=D0=B5=D0=BC=20=D1=81=D0=B0?= =?UTF-8?q?=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt | 7 ++++++- .../kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt index 6ce5570d5..726a5eab2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatteryScreen.kt @@ -761,6 +761,11 @@ abstract class MatteryScreen(menu: T, inventory: Inventory, tit const val MAX_ROWS = 6 var lastScroll = 0 - var lastRows by ClientConfig.GUI::EXOPACK_INVENTORY_ROWS + var lastRows: Int + get() = ClientConfig.GUI::EXOPACK_INVENTORY_ROWS.get() + set(value) { + ClientConfig.GUI::EXOPACK_INVENTORY_ROWS.set(value) + ClientConfig.spec.save() + } } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt index 98e7277eb..b76938fb9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/config/AbstractConfig.kt @@ -11,7 +11,8 @@ import ru.dbotthepony.mc.otm.core.math.defineDecimal import ru.dbotthepony.mc.otm.core.util.WriteOnce abstract class AbstractConfig(private val configName: String, private val type: ModConfig.Type = ModConfig.Type.SERVER) { - private var spec: ModConfigSpec by WriteOnce() + var spec: ModConfigSpec by WriteOnce() + private set protected val builder = ModConfigSpec.Builder() private var registered = false