diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt index 4bee1a4..0cb3d09 100644 --- a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt @@ -36,6 +36,8 @@ object GlintConfig : Config( framedItem.reset(true) shinyPots.reset(true) armorColor = OneColor(defaultColor) + save() + openGui() } @Button( @@ -50,6 +52,8 @@ object GlintConfig : Config( droppedItem.reset2() framedItem.reset2() shinyPots.reset2() + save() + openGui() } @Button( @@ -64,6 +68,8 @@ object GlintConfig : Config( potionGlintBackground = false potionBasedColor = false potionGlintForeground = false + save() + openGui() } @Color( @@ -83,18 +89,20 @@ object GlintConfig : Config( ) var applyColors = Runnable { /* Singular Colors */ - heldItem.glintColor = OneColor(globalColor.rgb) - guiItem.glintColor = OneColor(globalColor.rgb) - droppedItem.glintColor = OneColor(globalColor.rgb) - framedItem.glintColor = OneColor(globalColor.rgb) - shinyPots.glintColor = OneColor(globalColor.rgb) - armorColor = OneColor(globalColor.rgb) + heldItem.glintColor = globalColor.clone().also { it.setChromaSpeed(globalColor.dataBit) } + guiItem.glintColor = globalColor.clone().also { it.setChromaSpeed(globalColor.dataBit) } + droppedItem.glintColor = globalColor.clone().also { it.setChromaSpeed(globalColor.dataBit) } + framedItem.glintColor = globalColor.clone().also { it.setChromaSpeed(globalColor.dataBit) } + shinyPots.glintColor = globalColor.clone().also { it.setChromaSpeed(globalColor.dataBit) } + armorColor = globalColor.clone().also { it.setChromaSpeed(globalColor.dataBit) } /* Stroke */ heldItem.individualStrokes = false guiItem.individualStrokes = false droppedItem.individualStrokes = false framedItem.individualStrokes = false shinyPots.individualStrokes = false + save() + openGui() } @Button( @@ -110,6 +118,9 @@ object GlintConfig : Config( droppedItem.glintColor = OneColor(oldGlintValue) framedItem.glintColor = OneColor(oldGlintValue) shinyPots.glintColor = OneColor(oldGlintValue) + + save() + openGui() } /* Held Items */ @@ -146,6 +157,8 @@ object GlintConfig : Config( ) var resetArmor = Runnable { armorColor = OneColor(defaultColor) + save() + openGui() } @Color( diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintEffectOptions.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintEffectOptions.kt index d6d8f32..fa772b3 100644 --- a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintEffectOptions.kt +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintEffectOptions.kt @@ -14,6 +14,8 @@ class GlintEffectOptions { ) var resetColor = Runnable { reset(false) + GlintConfig.save() + GlintConfig.openGui() } @Button( @@ -25,6 +27,8 @@ class GlintEffectOptions { ) var resetTransforms = Runnable { reset2() + GlintConfig.save() + GlintConfig.openGui() } @Switch(