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 param for slider setting to only be whole numbers #510

Closed
wants to merge 1 commit into from

Conversation

PabstMirror
Copy link
Contributor

Setting _trailingDecimals to be less than 0 will only allow whole numbers to be allowed.

E.G.

["Test_Setting_3", "SLIDER",   ["-test slider-",   "-tooltip-"], "My Category", [0, 10, 5, -1]] call cba_settings_fnc_init;

Useful for settings where the value needs to be an integer.
Like a max number of objects or a for "_i" from 0 to Test_Setting_3 {

@PabstMirror PabstMirror added this to the 3.1 milestone Sep 23, 2016
@jonpas
Copy link
Member

jonpas commented Sep 23, 2016

How is that different from setting it to 0?

@PabstMirror
Copy link
Contributor Author

With 0, the edit text will only say whole numbers, but the actual setting value will be a float.
So setting the slider about halfway between 0 and 10 and it would be 5.15010334

@jonpas
Copy link
Member

jonpas commented Sep 23, 2016

Ah, but is that intended behaviour? IMO it would be better to change the value it saves to the same amount of decimals as is displayed.

@commy2
Copy link
Contributor

commy2 commented Sep 23, 2016

Optional boolean parameter to make the value snap to however many decimals are set to be displayed?

@commy2 commy2 modified the milestones: 3.2, 3.1 Sep 30, 2016
@BaerMitUmlaut
Copy link
Contributor

Changelog of 1.66 had something about a stepped slider, does that deprecate this PR?

@commy2
Copy link
Contributor

commy2 commented Dec 8, 2016

No, this PR is still a thing. I'll merge it when I get back to https://github.com/commy2/CBA_A3/pull/4

@commy2 commy2 modified the milestones: 3.3, 3.2 Feb 5, 2017
@commy2
Copy link
Contributor

commy2 commented Mar 11, 2017

merged in #606

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

Successfully merging this pull request may close these issues.

None yet

4 participants