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

Show slider value in mod settings #224

Merged
merged 5 commits into from
Jul 22, 2020
Merged

Conversation

Raicuparta
Copy link
Member

@Raicuparta Raicuparta commented Jul 22, 2020

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

}

public override float Value
{
public override float Value {
Copy link
Collaborator

Choose a reason for hiding this comment

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

JS style 😋

Copy link
Member Author

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Member Author

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.

@amazingalek
Copy link
Collaborator

Awesome! What does it look like in game?
Probably it's best to always show the value 😁

@Raicuparta
Copy link
Member Author

Awesome! What does it look like in game?
Probably it's best to always show the value 😁

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.

@Raicuparta Raicuparta requested a review from amazingalek July 22, 2020 18:33
amazingalek
amazingalek previously approved these changes Jul 22, 2020
@Raicuparta Raicuparta merged commit 8dbc01a into dev Jul 22, 2020
@Raicuparta Raicuparta deleted the raicuparta/show-slider-value branch July 26, 2020 10:19
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