Skip to content

Commit

Permalink
Settings - More appropriate slider speeds (#963)
Browse files Browse the repository at this point in the history
* Fix color setting slider speed

* Change slider speed based on range
  • Loading branch information
mharis001 authored and commy2 committed Aug 24, 2018
1 parent 46ead80 commit b75ca63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/settings/fnc_gui_settingColor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ for "_index" from 0 to ((count _currentValue max 3 min 4) - 1) do {

_ctrlColor sliderSetRange [0, 1];
_ctrlColor sliderSetPosition (_currentValue param [_index, 0]);
_ctrlColor sliderSetSpeed [0.05, 0.1];

_ctrlColor setVariable [QGVAR(params), [_setting, _source, _currentValue, _color, _index]];
_ctrlColor ctrlAddEventHandler ["SliderPosChanged", {
Expand Down
2 changes: 2 additions & 0 deletions addons/settings/fnc_gui_settingSlider.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ private _ctrlSlider = _controlsGroup controlsGroupCtrl IDC_SETTING_SLIDER;

_ctrlSlider sliderSetRange [_min, _max];
_ctrlSlider sliderSetPosition _currentValue;
private _range = _max - _min;
_ctrlSlider sliderSetSpeed [0.05 * _range, 0.1 * _range];

_ctrlSlider setVariable [QGVAR(params), [_setting, _source, _trailingDecimals]];
_ctrlSlider ctrlAddEventHandler ["SliderPosChanged", {
Expand Down

0 comments on commit b75ca63

Please sign in to comment.