Skip to content

feat: add SliderSetting#491

Open
Suor wants to merge 1 commit into
MSUTeam:developmentfrom
Suor:feature/slider-setting
Open

feat: add SliderSetting#491
Suor wants to merge 1 commit into
MSUTeam:developmentfrom
Suor:feature/slider-setting

Conversation

@Suor
Copy link
Copy Markdown
Contributor

@Suor Suor commented Apr 23, 2026

Adds SliderSetting — looks like RangeSetting that operates over a fixed array of values instead of a range plus step. Works as a more convenient and glancable alternative for both RangeSetting and EnumSetting.

Examples from Bro Studio and Challanges mods:

  1. Skip boring values:
::Challenges.SliderSetting("foodPriceMult", 1,
    [1, 2, 3, 5, 10, 20], null,
    "Food Price Multiplier");
  1. Using non-numeric qualitative values:
page.add(::BroStudio.SliderSetting("attrsVeteranBoostValue", "off",
    ["off" "slight" "classic" "high"],
    null,
    "Veteran Boost", ...));

# or only qualitative labels with numbers under the hood

page.add(::BroStudio.SliderSetting("attrsVeteranBoostValue", 0,
    [0, 0.1, 0.1667, 0.25],
    ["off" "slight" "classic" "high"],
    "Veteran Boost", ...));
  1. Mix those two:
def.add(::Challenges.SliderSetting("maxItemsPerBattle", -1,
    [-1, 5, 4, 3, 2, 1, 0],
    ["off" "5" "4" "3" "2" "1" "none"],
    "Max Equipment Drops Per Battle", ...));

@Suor
Copy link
Copy Markdown
Contributor Author

Suor commented Apr 24, 2026

The widget was heavily tested in this form within Bro Studio. The js code might be merged with RangedSetting one though to make it both less monkey and less self-contained.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Suor Suor force-pushed the feature/slider-setting branch from eb25119 to 284b5ac Compare April 24, 2026 00:36
@LordMidas LordMidas requested a review from TaroEld April 26, 2026 04:08
Copy link
Copy Markdown
Member

@TaroEld TaroEld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good conceptually, I'll rewrite the JS code to be less monkey as you mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants