mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1192 from acemod/persistentKestrelMenu
Made the Kestrel menu persistent
This commit is contained in:
commit
6a0f7343d8
@ -22,4 +22,6 @@ GVAR(MeasuredWindSpeed) = 0;
|
||||
GVAR(ImpellerState) = 0;
|
||||
|
||||
GVAR(Kestrel4500) = false;
|
||||
GVAR(Overlay) = false;
|
||||
GVAR(Overlay) = false;
|
||||
|
||||
[] call FUNC(restoreUserData);
|
@ -9,10 +9,11 @@ PREP(createKestrelDialog);
|
||||
PREP(displayKestrel);
|
||||
PREP(generateOutputData);
|
||||
PREP(measureWindSpeed);
|
||||
PREP(onCloseDialog);
|
||||
PREP(onCloseDisplay);
|
||||
PREP(restoreUserData);
|
||||
PREP(storeUserData);
|
||||
PREP(updateDisplay);
|
||||
PREP(updateImpellerState);
|
||||
|
||||
PREP(onCloseDialog);
|
||||
PREP(onCloseDisplay);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -51,3 +51,4 @@ switch (_this) do {
|
||||
};
|
||||
|
||||
[] call FUNC(updateDisplay);
|
||||
[] call FUNC(storeUserData);
|
||||
|
@ -42,9 +42,9 @@ if (GVAR(MinAvgMaxMode) == 1) then {
|
||||
|
||||
// Wind SPD
|
||||
_windSpeed = call FUNC(measureWindSpeed);
|
||||
GVAR(MIN) set [1, (GVAR(MIN) select 1) min abs(_windSpeed)];
|
||||
GVAR(MAX) set [1, abs(_windSpeed) max (GVAR(MAX) select 1)];
|
||||
GVAR(TOTAL) set [1, (GVAR(TOTAL) select 1) + abs(_windSpeed)];
|
||||
GVAR(MIN) set [1, (GVAR(MIN) select 1) min _windSpeed];
|
||||
GVAR(MAX) set [1, _windSpeed max (GVAR(MAX) select 1)];
|
||||
GVAR(TOTAL) set [1, (GVAR(TOTAL) select 1) + _windSpeed];
|
||||
|
||||
// CROSSWIND
|
||||
_crosswind = 0;
|
||||
|
18
addons/kestrel4500/functions/fnc_restoreUserData.sqf
Normal file
18
addons/kestrel4500/functions/fnc_restoreUserData.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Reads user data from profileNamespace
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_restore_user_data
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(Menu) = 0 max (profileNamespace getVariable ["ACE_Kestrel4500_menu", 0]) min ((count GVAR(Menus)) - 1);
|
18
addons/kestrel4500/functions/fnc_storeUserData.sqf
Normal file
18
addons/kestrel4500/functions/fnc_storeUserData.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Saves user data into profileNamespace
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_store_user_data
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
profileNamespace setVariable ["ACE_Kestrel4500_menu", GVAR(menu)];
|
Loading…
Reference in New Issue
Block a user