Merge pull request #1192 from acemod/persistentKestrelMenu

Made the Kestrel menu persistent
This commit is contained in:
ulteq 2015-05-14 16:41:12 +02:00
commit 6a0f7343d8
6 changed files with 47 additions and 7 deletions

View File

@ -22,4 +22,6 @@ GVAR(MeasuredWindSpeed) = 0;
GVAR(ImpellerState) = 0;
GVAR(Kestrel4500) = false;
GVAR(Overlay) = false;
GVAR(Overlay) = false;
[] call FUNC(restoreUserData);

View File

@ -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;

View File

@ -51,3 +51,4 @@ switch (_this) do {
};
[] call FUNC(updateDisplay);
[] call FUNC(storeUserData);

View File

@ -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;

View 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);

View 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)];