diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-30 03:55:49 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-30 03:55:49 -0500 |
commit | cd7b08b4799b5ee08f1dca6ff92a28e74d9db102 (patch) | |
tree | 86691df35e72dc3d4e15891f049e1edbc8a2bc3a /src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt | |
parent | f01846879e226b932d81fa842e4eee4567f0a28c (diff) | |
download | DulkirMod-Fabric-cd7b08b4799b5ee08f1dca6ff92a28e74d9db102.tar.gz DulkirMod-Fabric-cd7b08b4799b5ee08f1dca6ff92a28e74d9db102.tar.bz2 DulkirMod-Fabric-cd7b08b4799b5ee08f1dca6ff92a28e74d9db102.zip |
Added Alias Code And Implemented Dynamic Key
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt index da9f2d8..4fb42a8 100644 --- a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt +++ b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt @@ -17,6 +17,7 @@ import com.dulkirfabric.DulkirModFabric.mc import com.dulkirfabric.config.ConfigHelper.mkKeyField import com.dulkirfabric.config.ConfigHelper.mkStringField import com.dulkirfabric.config.ConfigHelper.mkToggle +import com.dulkirfabric.features.InventoryScale import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers import kotlinx.serialization.decodeFromString @@ -57,7 +58,19 @@ class DulkirConfig { general.addEntry( entryBuilder.startFloatField(Text.literal("Inventory Scale"), configOptions.inventoryScale) .setTooltip(Text.literal("Size of GUI whenever you're in an inventory screen")) - .setSaveConsumer { newValue -> configOptions.inventoryScale = newValue } + .setSaveConsumer { newValue -> + configOptions.inventoryScale = newValue + InventoryScale.scaleBuffer = newValue + InventoryScale.prevTickScale = newValue + InventoryScale.tickScale = newValue + InventoryScale.frameScale = newValue + } + .build() + ) + general.addEntry( + entryBuilder.startFloatField(Text.literal("Tooltip Scale"), configOptions.tooltipScale) + .setTooltip(Text.literal("Default Value for Scaling a particular tooltip without scroll input")) + .setSaveConsumer { newValue -> configOptions.tooltipScale = newValue } .build() ) general.addEntry( @@ -102,6 +115,22 @@ class DulkirConfig { ) ) + val aliases = builder.getOrCreateCategory(Text.literal("Shortcuts")) + aliases.addEntry( + ConfigHelper.mkConfigList( + Text.literal("Aliases (do not include '/')"), + configOptions::aliasList, + { Alias("", "") }, + Text.literal("Alias"), + { value -> + listOf( + entryBuilder.mkStringField(Text.literal("Command"), value::command), + entryBuilder.mkStringField(Text.literal("Alias"), value::alias) + ) + } + ) + ) + builder.transparentBackground() screen = builder.build() } @@ -111,13 +140,15 @@ class DulkirConfig { var invScaleBool: Boolean = false, var inventoryScale: Float = 1f, var macrosList: List<Macro> = listOf(Macro(UNKNOWN_KEY, "")), + var aliasList: List<Alias> = listOf(Alias("", "")), var ignoreReverseThirdPerson: Boolean = false, var dynamicKey: InputUtil.Key = UNKNOWN_KEY, var customBlockOutlines: Boolean = false, var blockOutlineThickness: Int = 3, var blockOutlineColor: Int = 0xFFFFFF, var abiPhoneDND: Boolean = false, - var abiPhoneCallerID: Boolean = false + var abiPhoneCallerID: Boolean = false, + var tooltipScale: Float = 1f ) @Serializable @@ -126,6 +157,12 @@ class DulkirConfig { var command: String, ) + @Serializable + data class Alias( + var alias: String, + var command: String + ) + /** * Object for storing all the actual config values that will be used in doing useful stuff with the config */ |