Explosives - Allow setting custom timer limits (#6882)

This commit is contained in:
PabstMirror 2019-03-21 09:01:50 -05:00 committed by GitHub
parent 61e88abf22
commit 711e9073a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -15,6 +15,9 @@
* Public: No
*/
#define TIMER_VALUE_MIN_CUSTOM (missionNamespace getVariable [QGVAR(customTimerMin), TIMER_VALUE_MIN])
#define TIMER_VALUE_MAX_CUSTOM (missionNamespace getVariable [QGVAR(customTimerMax), TIMER_VALUE_MAX])
params ["_explosive"];
TRACE_1("Opening timer UI",_explosive);
@ -23,6 +26,9 @@ private _display = uiNamespace getVariable [QGVAR(timerDisplay), displayNull];
// Update slider speed to 1s
(_display displayCtrl IDC_TIMER_SLIDER) sliderSetSpeed [1, 1];
(_display displayCtrl IDC_TIMER_SLIDER) sliderSetRange [TIMER_VALUE_MIN_CUSTOM, TIMER_VALUE_MAX_CUSTOM];
(_display displayCtrl IDC_TIMER_SLIDER) sliderSetPosition (TIMER_VALUE_DEFAULT max TIMER_VALUE_MIN_CUSTOM min TIMER_VALUE_MAX_CUSTOM);
// Add confirm button action
GVAR(explosive) = _explosive;
@ -52,7 +58,7 @@ _display displayAddEventHandler ["MouseZChanged", {
if (cba_events_control) then {_change = _change * 10};
private _slider = _display displayCtrl IDC_TIMER_SLIDER;
private _value = (sliderPosition _slider + _change) max TIMER_VALUE_MIN min TIMER_VALUE_MAX;
private _value = (sliderPosition _slider + _change) max TIMER_VALUE_MIN_CUSTOM min TIMER_VALUE_MAX_CUSTOM;
_slider sliderSetPosition _value;
}];

View File

@ -204,3 +204,9 @@ Jammer that blocks RF triggers:
true
}] call ace_explosives_fnc_addDetonateHandler;
```
#### 5.4 Custom timer limits
`Added in 3.12.7`
Can set custom min and max time for the timer trigger, can set one or both, time in seconds
`ace_explosives_customTimerMin` / `ace_explosives_customTimerMax`