Skip to content

Commit

Permalink
fix chroma for global glint + saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jun 23, 2024
1 parent 1aa4737 commit f9bcd2c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ object GlintConfig : Config(
framedItem.reset(true)
shinyPots.reset(true)
armorColor = OneColor(defaultColor)
save()
openGui()
}

@Button(
Expand All @@ -50,6 +52,8 @@ object GlintConfig : Config(
droppedItem.reset2()
framedItem.reset2()
shinyPots.reset2()
save()
openGui()
}

@Button(
Expand All @@ -64,6 +68,8 @@ object GlintConfig : Config(
potionGlintBackground = false
potionBasedColor = false
potionGlintForeground = false
save()
openGui()
}

@Color(
Expand All @@ -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(
Expand All @@ -110,6 +118,9 @@ object GlintConfig : Config(
droppedItem.glintColor = OneColor(oldGlintValue)
framedItem.glintColor = OneColor(oldGlintValue)
shinyPots.glintColor = OneColor(oldGlintValue)

save()
openGui()
}

/* Held Items */
Expand Down Expand Up @@ -146,6 +157,8 @@ object GlintConfig : Config(
)
var resetArmor = Runnable {
armorColor = OneColor(defaultColor)
save()
openGui()
}

@Color(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class GlintEffectOptions {
)
var resetColor = Runnable {
reset(false)
GlintConfig.save()
GlintConfig.openGui()
}

@Button(
Expand All @@ -25,6 +27,8 @@ class GlintEffectOptions {
)
var resetTransforms = Runnable {
reset2()
GlintConfig.save()
GlintConfig.openGui()
}

@Switch(
Expand Down

0 comments on commit f9bcd2c

Please sign in to comment.