ACE3/addons/kestrel4500/functions/fnc_buttonPressed.sqf

54 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-04-07 15:58:54 +00:00
/*
* Author: Ruthberg
* Handles the Kestrel 4500 dialog button actions
*
* Arguments:
* buttonID <integer>
*
* Return Value:
* Nothing
*
* Example:
* 2 call ace_kestrel4500_fnc_buttonPressed
*
* Public: No
*/
#include "script_component.hpp"
switch (_this) do {
2015-04-07 18:19:35 +00:00
case 0: { // Enter
if (!GVAR(MinAvgMax) && (GVAR(Menu) == 2 || GVAR(Menu) == 3)) then {
2015-04-08 09:25:15 +00:00
GVAR(RefHeading) = getDir ACE_player;
2015-04-07 18:19:35 +00:00
};
if (GVAR(MinAvgMax) && GVAR(Menu) > 0 && GVAR(Menu) < 4) then {
if (GVAR(MinAvgMaxMode) != 1) then {
2015-04-07 18:19:35 +00:00
{
2015-04-08 09:25:15 +00:00
GVAR(MIN) set [_x, 0];
GVAR(MAX) set [_x, 0];
GVAR(TOTAL) set [_x, 0];
GVAR(ENTRIES) set [_x, 0];
2015-04-07 18:19:35 +00:00
} forEach [1, 2, 3];
};
GVAR(MinAvgMaxMode) = (GVAR(MinAvgMaxMode) + 1) % 3;
2015-04-07 18:19:35 +00:00
};
};
case 1: { // Top
2015-04-08 09:25:15 +00:00
GVAR(Menu) = (GVAR(Menu) - 1 + (count GVAR(Menus))) % (count GVAR(Menus));
2015-04-07 18:19:35 +00:00
};
case 2: { // Bottom
2015-04-08 09:25:15 +00:00
GVAR(Menu) = (GVAR(Menu) + 1 + (count GVAR(Menus))) % (count GVAR(Menus));
2015-04-07 18:19:35 +00:00
};
case 3: { // Left
GVAR(MinAvgMax) = !GVAR(MinAvgMax);
2015-04-07 18:19:35 +00:00
};
case 4: { // Right
GVAR(MinAvgMax) = !GVAR(MinAvgMax);
2015-04-07 18:19:35 +00:00
};
case 5: { // Memory
};
case 6: { // Backlight
};
};
[] call FUNC(updateDisplay);