aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-06-10 16:45:58 -0500
committeringlettronald <inglettronald@gmail.com>2023-06-10 16:45:58 -0500
commit22508bb83e8d5846a7a68dd5346e8a2013e1c710 (patch)
treec1d1cea4acd3a7560b6e813f0081fe7e89feb8a6 /src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
parent8b69b68978e32d6f8e66fca06a8c7ed36523062f (diff)
downloadDulkirMod-Fabric-22508bb83e8d5846a7a68dd5346e8a2013e1c710.tar.gz
DulkirMod-Fabric-22508bb83e8d5846a7a68dd5346e8a2013e1c710.tar.bz2
DulkirMod-Fabric-22508bb83e8d5846a7a68dd5346e8a2013e1c710.zip
more shortcuts stuff
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt')
-rw-r--r--src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
index a34016d..9e3fbaf 100644
--- a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
+++ b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt
@@ -14,8 +14,9 @@
package com.dulkirfabric.config
import com.dulkirfabric.DulkirModFabric.mc
-import com.dulkirfabric.config.ListHelper.mkKeyField
-import com.dulkirfabric.config.ListHelper.mkStringField
+import com.dulkirfabric.config.ConfigHelper.mkKeyField
+import com.dulkirfabric.config.ConfigHelper.mkStringField
+import com.dulkirfabric.config.ConfigHelper.mkToggle
import kotlinx.serialization.Serializable
import kotlinx.serialization.UseSerializers
import kotlinx.serialization.decodeFromString
@@ -48,10 +49,9 @@ class DulkirConfig {
val entryBuilder = builder.entryBuilder()
val general = builder.getOrCreateCategory(Text.literal("General"))
general.addEntry(
- entryBuilder.startBooleanToggle(Text.literal("Custom Inventory Scale Toggle"), configOptions.invScaleBool)
- .setTooltip(Text.literal("WAHOO!"))
- .setSaveConsumer { newValue -> configOptions.invScaleBool = newValue }
- .build()
+ entryBuilder.mkToggle(Text.literal("Inventory Scale Toggle"),
+ configOptions::invScaleBool,
+ Text.literal("This is a tooltip"))
)
general.addEntry(
entryBuilder.startIntSlider(Text.literal("Inventory Scale"), configOptions.inventoryScale, 1, 5)
@@ -59,10 +59,13 @@ class DulkirConfig {
.setSaveConsumer { newValue -> configOptions.inventoryScale = newValue }
.build()
)
+ general.addEntry(
+ entryBuilder.mkToggle(Text.literal("Ignore Reverse Third Person"), configOptions::ignoreReverseThirdPerson)
+ )
val shortcuts = builder.getOrCreateCategory(Text.literal("Shortcuts"))
shortcuts.addEntry(
- ListHelper.mkConfigList(
+ ConfigHelper.mkConfigList(
Text.literal("Macros"),
configOptions::macrosList,
{ Macro(UNKNOWN_KEY, "") },
@@ -80,10 +83,12 @@ class DulkirConfig {
screen = builder.build()
}
+ @Serializable
data class ConfigOptions(
- var invScaleBool: Boolean = true,
- var inventoryScale: Int = 1,
- var macrosList: List<Macro> = listOf(Macro(UNKNOWN_KEY, ""))
+ var invScaleBool: Boolean = false,
+ var inventoryScale: Int = 3,
+ var macrosList: List<Macro> = listOf(Macro(UNKNOWN_KEY, "")),
+ var ignoreReverseThirdPerson: Boolean = false
)
@Serializable
@@ -125,7 +130,6 @@ class DulkirConfig {
}
configOptions = json.decodeFromString<ConfigOptions>(configFile.readText())
}
-
}
}