Skip to content

Commit

Permalink
Fix sliders for whole numbers (CBATeam#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored and commy2 committed Dec 16, 2017
1 parent c70616f commit 8278650
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addons/settings/fnc_gui_settingSlider.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _ctrlSlider ctrlAddEventHandler ["SliderPosChanged", {

private _controlsGroup = ctrlParentControlsGroup _ctrlSlider;
private _ctrlSliderEdit = _controlsGroup controlsGroupCtrl IDC_SETTING_SLIDER_EDIT;
_ctrlSliderEdit ctrlSetText ([_value, 1, _trailingDecimals] call CBA_fnc_formatNumber);
_ctrlSliderEdit ctrlSetText ([_value, 1, _trailingDecimals max 0] call CBA_fnc_formatNumber);

SET_TEMP_NAMESPACE_VALUE(_setting,_value,_source);

Expand All @@ -33,7 +33,7 @@ _ctrlSlider ctrlAddEventHandler ["SliderPosChanged", {
}];

private _ctrlSliderEdit = _controlsGroup controlsGroupCtrl IDC_SETTING_SLIDER_EDIT;
_ctrlSliderEdit ctrlSetText ([_currentValue, 1, _trailingDecimals] call CBA_fnc_formatNumber);
_ctrlSliderEdit ctrlSetText ([_currentValue, 1, _trailingDecimals max 0] call CBA_fnc_formatNumber);

_ctrlSliderEdit setVariable [QGVAR(params), [_setting, _source, _trailingDecimals]];
_ctrlSliderEdit ctrlAddEventHandler ["KeyUp", {
Expand Down Expand Up @@ -76,7 +76,7 @@ _ctrlSliderEdit ctrlAddEventHandler ["KillFocus", {
_value = round _value;
};

_ctrlSliderEdit ctrlSetText ([_value, 1, _trailingDecimals] call CBA_fnc_formatNumber);
_ctrlSliderEdit ctrlSetText ([_value, 1, _trailingDecimals max 0] call CBA_fnc_formatNumber);

// if new value is same as default value, grey out the default button
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
Expand All @@ -93,7 +93,7 @@ _controlsGroup setVariable [QFUNC(updateUI), {
private _ctrlSliderEdit = _controlsGroup controlsGroupCtrl IDC_SETTING_SLIDER_EDIT;

_ctrlSlider sliderSetPosition _value;
_ctrlSliderEdit ctrlSetText ([_value, 1, _trailingDecimals] call CBA_fnc_formatNumber);
_ctrlSliderEdit ctrlSetText ([_value, 1, _trailingDecimals max 0] call CBA_fnc_formatNumber);

// if new value is same as default value, grey out the default button
private _ctrlDefault = _controlsGroup controlsGroupCtrl IDC_SETTING_DEFAULT;
Expand Down

0 comments on commit 8278650

Please sign in to comment.