Skip to content

Commit

Permalink
feat: reuse SETTING_MAX_VALUES for max
Browse files Browse the repository at this point in the history
  • Loading branch information
RuriYS authored and Wide-Cat committed Oct 25, 2024
1 parent 17676f4 commit c831138
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ else if (value instanceof Double) {
.name(setting.getName())
.description(getDescription(setting.getName()))
.defaultValue((double) setting.defaultValue)
.max(SETTING_MAX_VALUES.getOrDefault(setting.getName(), 10.0))
.sliderMax(SETTING_MAX_VALUES.getOrDefault(setting.getName(), 10.0))
.onChanged(aDouble -> setting.value = aDouble)
.onModuleActivated(doubleSetting -> doubleSetting.set((Double) setting.value))
Expand All @@ -120,6 +121,7 @@ else if (value instanceof Float) {
.name(setting.getName())
.description(getDescription(setting.getName()))
.defaultValue(((Float) setting.defaultValue).doubleValue())
.max(SETTING_MAX_VALUES.getOrDefault(setting.getName(), 10.0))
.sliderMax(SETTING_MAX_VALUES.getOrDefault(setting.getName(), 10.0))
.onChanged(aDouble -> setting.value = aDouble.floatValue())
.onModuleActivated(doubleSetting -> doubleSetting.set(((Float) setting.value).doubleValue()))
Expand Down

0 comments on commit c831138

Please sign in to comment.