Skip to content

Commit

Permalink
Fix initSliderEdit not dividing percentage input (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharis001 authored Sep 7, 2019
1 parent 9629ff0 commit 7a45c4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/common/functions/fnc_initSliderEdit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ private _fnc_formatValue = {
_ctrlSlider sliderSetRange [_min, _max];
_ctrlSlider sliderSetSpeed [_speed, _speed];
_ctrlSlider sliderSetPosition _value;
_ctrlSlider setVariable [QGVAR(params), [_ctrlEdit, _formatting, _isPercentage, _fnc_formatValue]];
_ctrlSlider setVariable [QGVAR(params), [_ctrlEdit, _isPercentage, _formatting, _fnc_formatValue]];

_ctrlSlider ctrlAddEventHandler ["SliderPosChanged", {
params ["_ctrlSlider", "_value"];
(_ctrlSlider getVariable QGVAR(params)) params ["_ctrlEdit", "_formatting", "_isPercentage", "_fnc_formatValue"];
(_ctrlSlider getVariable QGVAR(params)) params ["_ctrlEdit", "_isPercentage", "_formatting", "_fnc_formatValue"];

_ctrlEdit ctrlSetText call _fnc_formatValue;
}];

_ctrlEdit ctrlSetText call _fnc_formatValue;
_ctrlEdit setVariable [QGVAR(params), [_ctrlSlider, _formatting, _isPercentage, _fnc_formatValue]];
_ctrlEdit setVariable [QGVAR(params), [_ctrlSlider, _isPercentage, _formatting, _fnc_formatValue]];

_ctrlEdit ctrlAddEventHandler ["KeyUp", {
params ["_ctrlEdit"];
(_ctrlEdit getVariable QGVAR(params)) params ["_ctrlSlider"];
(_ctrlEdit getVariable QGVAR(params)) params ["_ctrlSlider", "_isPercentage"];

private _value = parseNumber ctrlText _ctrlEdit;

Expand All @@ -75,7 +75,7 @@ _ctrlEdit ctrlAddEventHandler ["KeyUp", {

_ctrlEdit ctrlAddEventHandler ["KillFocus", {
params ["_ctrlEdit"];
(_ctrlEdit getVariable QGVAR(params)) params ["_ctrlSlider", "_formatting", "_isPercentage", "_fnc_formatValue"];
(_ctrlEdit getVariable QGVAR(params)) params ["_ctrlSlider", "_isPercentage", "_formatting", "_fnc_formatValue"];

private _value = sliderPosition _ctrlSlider;
_ctrlEdit ctrlSetText call _fnc_formatValue;
Expand Down

0 comments on commit 7a45c4d

Please sign in to comment.