diff options
author | Linnea Gräf <nea@nea.moe> | 2025-01-08 19:25:29 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-01-08 19:25:29 +0100 |
commit | d1e16a47819509ed645bb93e1a173e0a97025cef (patch) | |
tree | efbe886d9ac1ab4ea01788cb4842812fd0af9079 /mod/src/main/kotlin/moe/nea/ledger/config | |
parent | f694daf322bbb4ff530a9332547c5c8337c3e0c0 (diff) | |
download | LocalTransactionLedger-d1e16a47819509ed645bb93e1a173e0a97025cef.tar.gz LocalTransactionLedger-d1e16a47819509ed645bb93e1a173e0a97025cef.tar.bz2 LocalTransactionLedger-d1e16a47819509ed645bb93e1a173e0a97025cef.zip |
build: Move mod to subproject
Diffstat (limited to 'mod/src/main/kotlin/moe/nea/ledger/config')
6 files changed, 109 insertions, 0 deletions
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 |