Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PREP on game start #271

Merged
merged 1 commit into from
Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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