Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TextMenuExt.FloatSlider #740

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

SnipUndercover
Copy link
Contributor

I think having an IntSlider, but for floats, for options like percentages or multipliers (something with like 2 digits of precision) would be useful.
It behaves almost identical to IntSlider, but also allows the user to input a number directly by going to OuiNumberInput.

At the moment only the class exists and can be used via something like this:

public float MySetting { get; set; }

public void CreateMySettingEntry(TextMenu menu, bool inGame) {
  menu.Add(
    new TextMenuExt.FloatSlider(Dialog.Clean("..."), 0, 100, MySetting, 1)
      .Change(value => MySetting = value)
  );
}

I'm planning on adding support for automatically creating FloatSliders if a property type is float, as well as customizing its parameters.

@maddie480 maddie480 added the dormant This PR is really old, do we really need it? label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dormant This PR is really old, do we really need it?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants