From f3cfed88e3427d09acc75f060b71f426681b6312 Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Thu, 17 May 2018 20:40:41 +0200 Subject: [PATCH 1/2] Cache CreditsLine entries --- addons/help/XEH_preStart.sqf | 12 ++++++++++++ addons/help/fnc_setCreditsLine.sqf | 6 +----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index d4839fb3f..360d16704 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -2,3 +2,15 @@ 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"); + ]; +}; diff --git a/addons/help/fnc_setCreditsLine.sqf b/addons/help/fnc_setCreditsLine.sqf index f26f4a426..0c37c6c8f 100644 --- a/addons/help/fnc_setCreditsLine.sqf +++ b/addons/help/fnc_setCreditsLine.sqf @@ -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 {}; From fe6980cebf39b45127ea4465c1379eae7966de25 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 May 2018 21:53:10 +0200 Subject: [PATCH 2/2] kill rogue newlines --- addons/help/XEH_preStart.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index 360d16704..97f9a3eb9 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -3,8 +3,6 @@ PREP(setVersionLine); PREP(setCreditsLine); - - //Cache for CBA_help_fnc_setCreditsLine if (!isClass (configFile >> "CfgPatches" >> "CBA_DisableCredits")) then { uiNamespace setVariable [QGVAR(creditsCache),