From 0881a91e96128c58613342e14c7b69c5380a8c23 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 14 Aug 2016 22:53:40 +0200 Subject: [PATCH] precompile all display load functions --- addons/events/CfgEventHandlers.hpp | 4 ++-- addons/events/XEH_preStart.sqf | 3 +++ ...playLoad.sqf => fnc_curatorDisplayLoad.sqf} | 0 ...playLoad.sqf => fnc_missionDisplayLoad.sqf} | 0 addons/help/CfgEventhandlers.hpp | 18 ++++++++++++------ addons/help/XEH_preStart.sqf | 4 ++++ addons/keybinding/CfgEventHandlers.hpp | 8 +++++++- addons/keybinding/XEH_preStart.sqf | 3 +++ ...ayLoad.sqf => fnc_configureDisplayLoad.sqf} | 0 addons/settings/CfgEventHandlers.hpp | 4 ++-- addons/settings/XEH_preStart.sqf | 4 ++++ ...initDisplay.sqf => fnc_gui_initDisplay.sqf} | 0 ...ed.sqf => fnc_gui_initDisplay_disabled.sqf} | 0 .../{init3DEN.sqf => fnc_init3DEN.sqf} | 0 addons/xeh/CfgEventHandlers.hpp | 2 +- ...DisplayLoad.sqf => fnc_3DENDisplayLoad.sqf} | 0 addons/xeh/fnc_preStart.sqf | 2 ++ 17 files changed, 40 insertions(+), 12 deletions(-) rename addons/events/{XEH_curatorDisplayLoad.sqf => fnc_curatorDisplayLoad.sqf} (100%) rename addons/events/{XEH_missionDisplayLoad.sqf => fnc_missionDisplayLoad.sqf} (100%) create mode 100644 addons/help/XEH_preStart.sqf create mode 100644 addons/keybinding/XEH_preStart.sqf rename addons/keybinding/{XEH_configureDisplayLoad.sqf => fnc_configureDisplayLoad.sqf} (100%) rename addons/settings/{gui_initDisplay.sqf => fnc_gui_initDisplay.sqf} (100%) rename addons/settings/{gui_initDisplay_disabled.sqf => fnc_gui_initDisplay_disabled.sqf} (100%) rename addons/settings/{init3DEN.sqf => fnc_init3DEN.sqf} (100%) rename addons/xeh/{XEH_3DENDisplayLoad.sqf => fnc_3DENDisplayLoad.sqf} (100%) diff --git a/addons/events/CfgEventHandlers.hpp b/addons/events/CfgEventHandlers.hpp index c77e7398d..2c46fb182 100644 --- a/addons/events/CfgEventHandlers.hpp +++ b/addons/events/CfgEventHandlers.hpp @@ -19,9 +19,9 @@ class Extended_PostInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayMission { - ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad)); + ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(missionDisplayLoad)')); }; class RscDisplayCurator { - ADDON = QUOTE(_this call COMPILE_FILE(XEH_curatorDisplayLoad)); + ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(curatorDisplayLoad)')); }; }; diff --git a/addons/events/XEH_preStart.sqf b/addons/events/XEH_preStart.sqf index f7e90974d..89a21ecb6 100644 --- a/addons/events/XEH_preStart.sqf +++ b/addons/events/XEH_preStart.sqf @@ -3,3 +3,6 @@ PREP(keyHandler); PREP(keyHandlerDown); PREP(keyHandlerUp); + +PREP(missionDisplayLoad); +PREP(curatorDisplayLoad); diff --git a/addons/events/XEH_curatorDisplayLoad.sqf b/addons/events/fnc_curatorDisplayLoad.sqf similarity index 100% rename from addons/events/XEH_curatorDisplayLoad.sqf rename to addons/events/fnc_curatorDisplayLoad.sqf diff --git a/addons/events/XEH_missionDisplayLoad.sqf b/addons/events/fnc_missionDisplayLoad.sqf similarity index 100% rename from addons/events/XEH_missionDisplayLoad.sqf rename to addons/events/fnc_missionDisplayLoad.sqf diff --git a/addons/help/CfgEventhandlers.hpp b/addons/help/CfgEventhandlers.hpp index c5950d8cf..1803a6e18 100644 --- a/addons/help/CfgEventhandlers.hpp +++ b/addons/help/CfgEventhandlers.hpp @@ -1,4 +1,10 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + class Extended_PreInit_EventHandlers { class ADDON { clientInit = QUOTE(call COMPILE_FILE(XEH_preClientInit)); @@ -13,15 +19,15 @@ class Extended_PostInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayMain { - CBA_helpVersion = QUOTE(_this call COMPILE_FILE(fnc_setVersionLine)); - CBA_helpCredits = QUOTE(_this call COMPILE_FILE(fnc_setCreditsLine)); + CBA_helpVersion = QUOTE(_this call (uiNamespace getVariable 'FUNC(setVersionLine)')); + CBA_helpCredits = QUOTE(_this call (uiNamespace getVariable 'FUNC(setCreditsLine)')); }; class RscDisplayInterrupt { - CBA_helpVersion = QUOTE(_this call COMPILE_FILE(fnc_setVersionLine)); - CBA_helpCredits = QUOTE(_this call COMPILE_FILE(fnc_setCreditsLine)); + CBA_helpVersion = QUOTE(_this call (uiNamespace getVariable 'FUNC(setVersionLine)')); + CBA_helpCredits = QUOTE(_this call (uiNamespace getVariable 'FUNC(setCreditsLine)')); }; class RscDisplayMPInterrupt { - CBA_helpVersion = QUOTE(_this call COMPILE_FILE(fnc_setVersionLine)); - CBA_helpCredits = QUOTE(_this call COMPILE_FILE(fnc_setCreditsLine)); + CBA_helpVersion = QUOTE(_this call (uiNamespace getVariable 'FUNC(setVersionLine)')); + CBA_helpCredits = QUOTE(_this call (uiNamespace getVariable 'FUNC(setCreditsLine)')); }; }; diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf new file mode 100644 index 000000000..d4839fb3f --- /dev/null +++ b/addons/help/XEH_preStart.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +PREP(setVersionLine); +PREP(setCreditsLine); diff --git a/addons/keybinding/CfgEventHandlers.hpp b/addons/keybinding/CfgEventHandlers.hpp index a5a470efd..bf32cea7a 100644 --- a/addons/keybinding/CfgEventHandlers.hpp +++ b/addons/keybinding/CfgEventHandlers.hpp @@ -1,4 +1,10 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); @@ -7,6 +13,6 @@ class Extended_PreInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayConfigure { - ADDON = QUOTE(_this call COMPILE_FILE(XEH_configureDisplayLoad)); + ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(configureDisplayLoad)')); }; }; diff --git a/addons/keybinding/XEH_preStart.sqf b/addons/keybinding/XEH_preStart.sqf new file mode 100644 index 000000000..5f7882920 --- /dev/null +++ b/addons/keybinding/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +PREP(configureDisplayLoad); diff --git a/addons/keybinding/XEH_configureDisplayLoad.sqf b/addons/keybinding/fnc_configureDisplayLoad.sqf similarity index 100% rename from addons/keybinding/XEH_configureDisplayLoad.sqf rename to addons/keybinding/fnc_configureDisplayLoad.sqf diff --git a/addons/settings/CfgEventHandlers.hpp b/addons/settings/CfgEventHandlers.hpp index 4da075d49..275f3dad9 100644 --- a/addons/settings/CfgEventHandlers.hpp +++ b/addons/settings/CfgEventHandlers.hpp @@ -19,9 +19,9 @@ class Extended_PostInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayGameOptions { - ADDON = QUOTE(if (isNil 'ADDON') then {_this call COMPILE_FILE(gui_initDisplay_disabled)} else {_this call COMPILE_FILE(gui_initDisplay)};); + ADDON = QUOTE(if (isNil 'ADDON') then {_this call (uiNamespace getVariable 'FUNC(gui_initDisplay_disabled)')} else {_this call (uiNamespace getVariable 'FUNC(gui_initDisplay)')};); }; class Display3DEN { - ADDON = QUOTE(_this call COMPILE_FILE(init3DEN)); + ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(init3DEN)')); }; }; diff --git a/addons/settings/XEH_preStart.sqf b/addons/settings/XEH_preStart.sqf index 43f1adee3..1ae37f38a 100644 --- a/addons/settings/XEH_preStart.sqf +++ b/addons/settings/XEH_preStart.sqf @@ -1,3 +1,7 @@ #include "script_component.hpp" #include "XEH_PREP.sqf" + +PREP(gui_initDisplay); +PREP(gui_initDisplay_disabled); +PREP(init3DEN); diff --git a/addons/settings/gui_initDisplay.sqf b/addons/settings/fnc_gui_initDisplay.sqf similarity index 100% rename from addons/settings/gui_initDisplay.sqf rename to addons/settings/fnc_gui_initDisplay.sqf diff --git a/addons/settings/gui_initDisplay_disabled.sqf b/addons/settings/fnc_gui_initDisplay_disabled.sqf similarity index 100% rename from addons/settings/gui_initDisplay_disabled.sqf rename to addons/settings/fnc_gui_initDisplay_disabled.sqf diff --git a/addons/settings/init3DEN.sqf b/addons/settings/fnc_init3DEN.sqf similarity index 100% rename from addons/settings/init3DEN.sqf rename to addons/settings/fnc_init3DEN.sqf diff --git a/addons/xeh/CfgEventHandlers.hpp b/addons/xeh/CfgEventHandlers.hpp index b586ea286..3f43549d6 100644 --- a/addons/xeh/CfgEventHandlers.hpp +++ b/addons/xeh/CfgEventHandlers.hpp @@ -81,7 +81,7 @@ class Extended_Reloaded_EventHandlers {}; // display xeh class Extended_DisplayLoad_EventHandlers { class Display3DEN { - ADDON = QUOTE(call COMPILE_FILE(XEH_3DENDisplayLoad)); + ADDON = QUOTE(call (uiNamespace getVariable 'FUNC(3DENDisplayLoad)')); }; }; class Extended_DisplayUnload_EventHandlers {}; diff --git a/addons/xeh/XEH_3DENDisplayLoad.sqf b/addons/xeh/fnc_3DENDisplayLoad.sqf similarity index 100% rename from addons/xeh/XEH_3DENDisplayLoad.sqf rename to addons/xeh/fnc_3DENDisplayLoad.sqf diff --git a/addons/xeh/fnc_preStart.sqf b/addons/xeh/fnc_preStart.sqf index c3f54663b..6b0b55725 100644 --- a/addons/xeh/fnc_preStart.sqf +++ b/addons/xeh/fnc_preStart.sqf @@ -29,6 +29,8 @@ with uiNamespace do { SLX_XEH_COMPILE = compileFinal "compile preprocessFileLineNumbers _this"; //backwards comps SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp + PREP(3DENDisplayLoad); + // call PreStart events { private _eventFunc = "";