Skip to content

Commit 85b809e

Browse files
committed
Merge branch '1.21.5' into refactor/collection-codec
2 parents 78ebb6b + d27fa5c commit 85b809e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/kotlin/com/lambda/config/settings/comparable/EnumSetting.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.lambda.config.settings.comparable
1919

20+
import com.google.gson.JsonElement
2021
import com.google.gson.reflect.TypeToken
2122
import com.lambda.brigadier.CommandResult.Companion.failure
2223
import com.lambda.brigadier.CommandResult.Companion.success
@@ -52,6 +53,11 @@ class EnumSetting<T : Enum<T>>(
5253
value = value.enumValues[to % value.enumValues.size]
5354
}
5455

56+
override fun loadFromJson(serialized: JsonElement) {
57+
super.loadFromJson(serialized)
58+
index = value.ordinal // super bug fix for imgui
59+
}
60+
5561
override fun ImGuiBuilder.buildLayout() {
5662
val values = value.enumValues
5763
val currentDisplay = value.displayValue

0 commit comments

Comments
 (0)