Skip to content

Commit

Permalink
Merge pull request #271 from CBATeam/prepongamestart
Browse files Browse the repository at this point in the history
Use PREP on game start
  • Loading branch information
Killswitch00 committed Feb 22, 2016
2 parents 47adbb9 + 5b2f13c commit 4201b5a
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 16 deletions.
6 changes: 6 additions & 0 deletions addons/common/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
3 changes: 3 additions & 0 deletions addons/common/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "script_component.hpp"

PREP(perFrameEngine);
6 changes: 6 additions & 0 deletions addons/diagnostic/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
3 changes: 3 additions & 0 deletions addons/diagnostic/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "script_component.hpp"

PREP(perf_loop);
7 changes: 7 additions & 0 deletions addons/events/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};

class Extended_PreInit_EventHandlers
{
class ADDON
Expand Down
6 changes: 6 additions & 0 deletions addons/events/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "script_component.hpp"

PREP(NetRunEventTOR);
PREP(NetRunEventCTS);
PREP(keyHandler);
PREP(remoteLocalEvent);
19 changes: 11 additions & 8 deletions addons/network/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
class Extended_PreInit_EventHandlers
{
class ADDON
{

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));
};
};

class Extended_PostInit_EventHandlers
{
class ADDON
{
class Extended_PostInit_EventHandlers {
class ADDON {
serverInit = QUOTE(call COMPILE_FILE(XEH_postServerInit));
};
};
6 changes: 6 additions & 0 deletions addons/network/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "script_component.hpp"

PREP(opc);
PREP(opd);
PREP(sync);
PREP(exec);
19 changes: 11 additions & 8 deletions addons/versioning/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
class Extended_PreInit_EventHandlers
{
class ADDON
{

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));
};
};

class Extended_PostInit_EventHandlers
{
class ADDON
{
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
serverInit = QUOTE(call COMPILE_FILE(XEH_postInitServer));
clientInit = QUOTE(if !(isServer) then { call COMPILE_FILE(XEH_postInitClient) });
Expand Down
3 changes: 3 additions & 0 deletions addons/versioning/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "script_component.hpp"

PREP(version_check);
6 changes: 6 additions & 0 deletions addons/xeh/fnc_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ Author:
---------------------------------------------------------------------------- */
#include "script_component.hpp"

// prevent this from being overwritten
uiNamespace setVariable ["", compileFinal ""];

// mission namespace does not exist yet.
// spawned threads will not continue.
with uiNamespace do {
SLX_XEH_DisableLogging = isClass (configFile >> "CfgPatches" >> "Disable_XEH_Logging");

XEH_LOG("XEH: PreStart started.");

SLX_XEH_COMPILE = compileFinal "compile preprocessFileLineNumbers _this"; //backwards comps
SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp

// call PreStart events
{
if (_x select 1 == "preStart") then {
Expand Down

0 comments on commit 4201b5a

Please sign in to comment.