ACE3/addons/missileguidance/functions/fnc_gps_pbModeCycle.sqf

37 lines
869 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: Brandon (TCVM)
* Cycle pre-briefed mission mode
*
* Arguments:
* Direction <NUMBER>
*
* Return Value:
* None
*
* Example:
* [1] call ace_missileguidance_fnc_gps_pbModeCycle
*
* Public: No
*/
params ["_direction"];
private _display = uiNamespace getVariable QGVAR(gpsAttackOptionDisplay);
[GVAR(gps_pbMode)] call FUNC(gps_saveAttackSettings);
if (_direction > 0) then {
2021-05-02 05:04:08 +00:00
// right
GVAR(gps_pbMode) = (GVAR(gps_pbMode) + 1) % MAX_PB_MODES
} else {
2021-05-02 05:04:08 +00:00
// left
GVAR(gps_pbMode) = (GVAR(gps_pbMode) - 1);
if (GVAR(gps_pbMode) < 0) then {
GVAR(gps_pbMode) = MAX_PB_MODES - 1;
};
GVAR(gps_pbMode) = GVAR(gps_pbMode) % MAX_PB_MODES;
};
[GVAR(gps_pbMode)] call FUNC(gps_loadAttackSettings);
(_display displayCtrl GPS_UI_PB_MISSION) ctrlSetText format ["PP %1", GVAR(gps_pbMode) + 1];