-
Notifications
You must be signed in to change notification settings - Fork 15
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
Show slider value in mod settings #224
Conversation
} | ||
|
||
public override float Value | ||
{ | ||
public override float Value { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JS style 😋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whaat, why didn't VS auto fix this 😠
|
||
namespace OWML.ModHelper.Menus | ||
{ | ||
public class ModSliderInput : ModInput<float>, IModSliderInput | ||
{ | ||
public float Min { get; set; } | ||
public float Max { get; set; } | ||
public bool HasValueText => _valueText != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this line: https://github.com/amazingalek/owml/pull/224/files#diff-a4fa79456d54d033ef6fe8039ce95a34R97
I use this so that the template slider element is one that has a value being displayed. For instance, FOV slider would be a good template (because it shows the value), but Gamma slider wouldn't.
FOV is the first slider in the graphics tab so getting the first slider would still work, but if they add a new slider or change the order in an update it could break.
Awesome! What does it look like in game? |
Looks just like the sliders with value that the game already has (like FOV slider). Didn't test with float values yet though, need to see. Think I'll need to limit the decimal points. |
There does't seem to be a way to just toggle the display of the value inside the slider handle; seems like the elements are created in the editor, and then the text has to be updated manually (which is kinda crazy).
Had to change the slider template since the one being used before didn't include this text inside the handle.
I made it so every slider always shows the currently selected value. Could make it optional, but I felt like it was unnecessary.
Closes #223