add dayOfWeek and updateMemory to Own File

Update some Comments
Fixing Spelling Issue
This commit is contained in:
jokoho48 2015-08-14 02:22:15 +02:00
parent 183aac1911
commit 84685f4a84
9 changed files with 55 additions and 26 deletions

View File

@ -15,23 +15,6 @@ PREP(restoreUserData);
PREP(storeUserData);
PREP(updateDisplay);
PREP(updateImpellerState);
PREP(updateMemory);
PREP(dayOfWeek)
ADDON = true;
FUNC(updateMemory) = {
params ["_slot", "_value"];
GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value];
};
FUNC(dayOfWeek) = {
private "_table";
params ["_year", "_month", "_day"];
_table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];
if (_month < 3) then {
_year = _year - 1;
};
(_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7
};

View File

@ -6,9 +6,10 @@
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* call ace_kestrel4500_fnc_createKestrelDialog
*
* Public: No
*/

View File

@ -0,0 +1,25 @@
/*
* Author: Ruthberg
* Calculate Current Day in the Week
*
* Arguments:
* 0: Year <NUMBER>
* 1: Month <NUMBER>
* 2: Day <NUMBER>
*
* Return Value:
* Day of The Week <NUMBER>
*
* Example:
* [1995, 10, 21] call ace_kestrel4500_fnc_buttonPressed
*
* Public: No
*/
private "_table";
params ["_year", "_month", "_day"];
_table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];
if (_month < 3) then {
_year = _year - 1;
};
(_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7

View File

@ -6,10 +6,10 @@
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* call ace_kestrel4500_fnc_displayKestrell
* call ace_kestrel4500_fnc_displayKestrel
*
* Public: No
*/

View File

@ -25,7 +25,7 @@
* 15: Center Line 6 <STRING>
*
* Example:
* _var = call ace_kestrell4500_fnc_generateOutputData
* _var = call ace_kestrel4500_fnc_generateOutputData
*
* Public: No
*/

View File

@ -1,6 +1,6 @@
/*
* Author: Ruthberg
* Called if Kestrell Dialog is closed
* Called if Kestrel Dialog is closed
*
* Arguments:
* None

View File

@ -1,6 +1,6 @@
/*
* Author: Ruthberg
* Called if Kestrell Display is closed
* Called if Kestrel Display is closed
*
* Arguments:
* None

View File

@ -0,0 +1,20 @@
/*
* Author: Ruthberg
* Update Memory of Kestrel
*
* Arguments:
* 0: Slot <NUMBER>
* 1: Value <STRING>
*
* Return Value:
* None
*
* Example:
* [1, "test"] call ace_kestrel4500_fnc_updateMemory
*
* Public: No
*/
params ["_slot", "_value"];
GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value];

View File

@ -1 +1 @@
#include "\z\ace\addons\kestrel4500\script_component.hpp"
#include "\z\ace\addons\kestrel4500\script_component.hpp"