-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1715 from CBATeam/getMacros
Add `CBA_fnc_getMacro`
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
switch (_this) do { | ||
case "__DATE_ARR__": { [__DATE_ARR__] }; // [2024,11,10,16,19,39] | ||
case "__DATE_STR__": { __DATE_STR__ }; // "2024/11/10, 16:19:39" | ||
case "__DATE_STR_ISO8601__": { __DATE_STR_ISO8601__ }; // "2024-11-10T22:19:39Z" | ||
case "__TIME__": { '__TIME__' }; // 16:19:39 (quoted because invalid number) | ||
case "__TIME_UTC__": { '__TIME_UTC__' }; // 22:19:39 | ||
case "__TIMESTAMP_UTC__": { '__TIMESTAMP_UTC__' }; // 1731277179 (quoted because float will not have precision for 32+ bits) | ||
case "__DAY__": { __DAY__ }; // 10 | ||
case "__MONTH__": { __MONTH__ }; // 11 | ||
case "__YEAR__": { __YEAR__ }; // 2024 | ||
case "__GAME_VER__": { '__GAME_VER__' }; // 2.18.152302 (quoted because invalid number) | ||
case "__GAME_VER_MAJ__": { __GAME_VER_MAJ__ }; // 2 | ||
case "__GAME_VER_MIN__": { __GAME_VER_MIN__ }; // 18 | ||
case "__GAME_BUILD__": { __GAME_BUILD__ }; // 152302 | ||
case "__A3_DIAG__": { | ||
#if __A3_DIAG__ | ||
true | ||
#else | ||
false | ||
#endif | ||
}; | ||
case "__A3_DEBUG__": { | ||
#if __A3_DEBUG__ | ||
true | ||
#else | ||
false | ||
#endif | ||
}; | ||
case "__A3_EXPERIMENTAL__": { | ||
#if __A3_EXPERIMENTAL__ | ||
true | ||
#else | ||
false | ||
#endif | ||
}; | ||
case "__A3_PROFILING__": { | ||
#if __A3_PROFILING__ | ||
true | ||
#else | ||
false | ||
#endif | ||
}; | ||
default { "ERROR-invalid macro"}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "script_component.hpp" | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_getMacro | ||
Description: | ||
Gets the value of special macros | ||
Parameters: | ||
0: Macro Name <STRING> | ||
Returns: | ||
None | ||
Examples: | ||
(begin example) | ||
"__DATE_ARR__" call CBA_fnc_getMacro; | ||
(end) | ||
Author: | ||
PabstMirror | ||
---------------------------------------------------------------------------- */ | ||
|
||
params ["_macro"]; | ||
|
||
_macro call compileScript [QPATHTOF(fnc_getMacro.inc.sqf)] |