Skip to content

Commit

Permalink
Cache CreditsLine entries (#925)
Browse files Browse the repository at this point in the history
* Cache CreditsLine entries

* kill rogue newlines
  • Loading branch information
dedmen authored and commy2 committed May 17, 2018
1 parent ce5a2c2 commit 9b24ae3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 10 additions & 0 deletions addons/help/XEH_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@

PREP(setVersionLine);
PREP(setCreditsLine);

//Cache for CBA_help_fnc_setCreditsLine
if (!isClass (configFile >> "CfgPatches" >> "CBA_DisableCredits")) then {
uiNamespace setVariable [QGVAR(creditsCache),
"isText (_x >> 'author') &&
{getText (_x >> 'author') != localize 'STR_A3_Bohemia_Interactive'} &&
{getText (_x >> 'author') != ''}
" configClasses (configFile >> "CfgPatches");
];
};
6 changes: 1 addition & 5 deletions addons/help/fnc_setCreditsLine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ if (CBA_DisableCredits) exitWith {};

// find addon with author
private _config = configFile >> "CfgPatches";
private _entry = selectRandom ("
isText (_x >> 'author') &&
{getText (_x >> 'author') != localize 'STR_A3_Bohemia_Interactive'} &&
{getText (_x >> 'author') != ''}
" configClasses _config);
private _entry = selectRandom (uiNamespace getVariable [QGVAR(creditsCache), []]);

if (isNil "_entry") exitWith {};

Expand Down

0 comments on commit 9b24ae3

Please sign in to comment.