From 8278650e21a0ed317d850807ac720275397c82a2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 15 Dec 2017 22:21:22 -0600 Subject: [PATCH] Fix sliders for whole numbers (#834) --- addons/settings/fnc_gui_settingSlider.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/settings/fnc_gui_settingSlider.sqf b/addons/settings/fnc_gui_settingSlider.sqf index c6ce0e76e..29d6dc838 100644 --- a/addons/settings/fnc_gui_settingSlider.sqf +++ b/addons/settings/fnc_gui_settingSlider.sqf @@ -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); @@ -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", { @@ -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; @@ -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;