From d1e16a47819509ed645bb93e1a173e0a97025cef Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 8 Jan 2025 19:25:29 +0100 Subject: build: Move mod to subproject --- .../kotlin/moe/nea/ledger/config/DebugOptions.kt | 13 ++++++++ .../kotlin/moe/nea/ledger/config/LedgerConfig.kt | 35 ++++++++++++++++++++++ .../kotlin/moe/nea/ledger/config/MainOptions.kt | 27 +++++++++++++++++ .../nea/ledger/config/SynchronizationOptions.kt | 11 +++++++ .../main/kotlin/moe/nea/ledger/config/UpdateUi.kt | 17 +++++++++++ .../kotlin/moe/nea/ledger/config/UpdateUiMarker.kt | 6 ++++ 6 files changed, 109 insertions(+) create mode 100644 mod/src/main/kotlin/moe/nea/ledger/config/DebugOptions.kt create mode 100644 mod/src/main/kotlin/moe/nea/ledger/config/LedgerConfig.kt create mode 100644 mod/src/main/kotlin/moe/nea/ledger/config/MainOptions.kt create mode 100644 mod/src/main/kotlin/moe/nea/ledger/config/SynchronizationOptions.kt create mode 100644 mod/src/main/kotlin/moe/nea/ledger/config/UpdateUi.kt create mode 100644 mod/src/main/kotlin/moe/nea/ledger/config/UpdateUiMarker.kt (limited to 'mod/src/main/kotlin/moe/nea/ledger/config') diff --git a/mod/src/main/kotlin/moe/nea/ledger/config/DebugOptions.kt b/mod/src/main/kotlin/moe/nea/ledger/config/DebugOptions.kt new file mode 100644 index 0000000..fd5ed3d --- /dev/null +++ b/mod/src/main/kotlin/moe/nea/ledger/config/DebugOptions.kt @@ -0,0 +1,13 @@ +package moe.nea.ledger.config + +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class DebugOptions { + @ConfigOption(name = "Log entries to chat", + desc = "Appends all logged entries into the chat as they are logged. This option does not persist on restarts.") + @Transient + @ConfigEditorBoolean + @JvmField + var logEntries = false +} diff --git a/mod/src/main/kotlin/moe/nea/ledger/config/LedgerConfig.kt b/mod/src/main/kotlin/moe/nea/ledger/config/LedgerConfig.kt new file mode 100644 index 0000000..91ee5c1 --- /dev/null +++ b/mod/src/main/kotlin/moe/nea/ledger/config/LedgerConfig.kt @@ -0,0 +1,35 @@ +package moe.nea.ledger.config + +import io.github.notenoughupdates.moulconfig.Config +import io.github.notenoughupdates.moulconfig.DescriptionRendereringBehaviour +import io.github.notenoughupdates.moulconfig.annotations.Category +import io.github.notenoughupdates.moulconfig.processor.ProcessedOption +import moe.nea.ledger.Ledger + +class LedgerConfig : Config() { + override fun getTitle(): String { + return "§6Ledger §7- §6Hypixel SkyBlock data logger §7by §anea89o" + } + + override fun saveNow() { + super.saveNow() + Ledger.managedConfig.saveToFile() + } + + override fun getDescriptionBehaviour(option: ProcessedOption?): DescriptionRendereringBehaviour { + return DescriptionRendereringBehaviour.EXPAND_PANEL + } + + @Category(name = "Ledger", desc = "") + @JvmField + val main = MainOptions() + + @Category(name = "Synchronization", desc = "") + @JvmField + val synchronization = SynchronizationOptions() + + @Category(name = "Debug", desc = "") + @JvmField + val debug = DebugOptions() + +} \ No newline at end of file diff --git a/mod/src/main/kotlin/moe/nea/ledger/config/MainOptions.kt b/mod/src/main/kotlin/moe/nea/ledger/config/MainOptions.kt new file mode 100644 index 0000000..1efa970 --- /dev/null +++ b/mod/src/main/kotlin/moe/nea/ledger/config/MainOptions.kt @@ -0,0 +1,27 @@ +package moe.nea.ledger.config + +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class MainOptions { + @ConfigOption(name = "Marker for Update UI", desc = "_") + @JvmField + @UpdateUiMarker + @Transient + var testOption = Unit + + @ConfigOption(name = "Check for Updates", desc = "Automatically check for updates on startup") + @ConfigEditorDropdown + @JvmField + var updateCheck = UpdateCheckBehaviour.SEMI + + enum class UpdateCheckBehaviour(val label: String) { + SEMI("Semi-Automatic"), + FULL("Full-Automatic"), + NONE("Don't check"); + + override fun toString(): String { + return label + } + } +} diff --git a/mod/src/main/kotlin/moe/nea/ledger/config/SynchronizationOptions.kt b/mod/src/main/kotlin/moe/nea/ledger/config/SynchronizationOptions.kt new file mode 100644 index 0000000..b8c740b --- /dev/null +++ b/mod/src/main/kotlin/moe/nea/ledger/config/SynchronizationOptions.kt @@ -0,0 +1,11 @@ +package moe.nea.ledger.config + +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class SynchronizationOptions { + @ConfigOption(name = "Test Option", desc = "Test Description") + @ConfigEditorBoolean + @JvmField + var testOption = false +} \ No newline at end of file diff --git a/mod/src/main/kotlin/moe/nea/ledger/config/UpdateUi.kt b/mod/src/main/kotlin/moe/nea/ledger/config/UpdateUi.kt new file mode 100644 index 0000000..86ccbf7 --- /dev/null +++ b/mod/src/main/kotlin/moe/nea/ledger/config/UpdateUi.kt @@ -0,0 +1,17 @@ +package moe.nea.ledger.config + +import io.github.notenoughupdates.moulconfig.gui.GuiComponent +import io.github.notenoughupdates.moulconfig.gui.component.TextComponent +import io.github.notenoughupdates.moulconfig.gui.editors.ComponentEditor +import io.github.notenoughupdates.moulconfig.processor.ProcessedOption +import moe.nea.ledger.Ledger + +class UpdateUi(option: ProcessedOption) : ComponentEditor(option) { + val delegate by lazy {// TODO + TextComponent("Hier könnte ihre werbung stehen") + } + + override fun getDelegate(): GuiComponent { + return delegate + } +} \ No newline at end of file diff --git a/mod/src/main/kotlin/moe/nea/ledger/config/UpdateUiMarker.kt b/mod/src/main/kotlin/moe/nea/ledger/config/UpdateUiMarker.kt new file mode 100644 index 0000000..7a0466a --- /dev/null +++ b/mod/src/main/kotlin/moe/nea/ledger/config/UpdateUiMarker.kt @@ -0,0 +1,6 @@ +package moe.nea.ledger.config + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.FIELD) +annotation class UpdateUiMarker { +} \ No newline at end of file -- cgit