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

Skip some unused compiles in XEH #285

Merged
merged 1 commit into from
Mar 5, 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
2 changes: 1 addition & 1 deletion addons/xeh/fnc_compileEventHandlers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private _resultNames = [];
_result pushBack ["", _eventName, _eventFunc];
_resultNames pushBack _customName;
} forEach configProperties [_baseConfig >> XEH_FORMAT_CONFIG_NAME(_eventName)];
} forEach ["preStart", "preInit", "postInit"];
} forEach ["preInit", "postInit"];

// object events
{
Expand Down
2 changes: 1 addition & 1 deletion addons/xeh/fnc_postInit_unscheduled.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (CBA_missionTime == -1) then {
// call PostInit events
{
if (_x select 1 == "postInit") then {
call (_x select 2);
[] call (_x select 2);
};
} forEach GVAR(allEventHandlers);

Expand Down
2 changes: 1 addition & 1 deletion addons/xeh/fnc_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ GVAR(fallbackRunning) = false;
{
if (_x select 0 == "") then {
if (_x select 1 == "preInit") then {
call (_x select 2);
[] call (_x select 2);
};
} else {
_x params ["_className", "_eventName", "_eventFunc", "_allowInheritance", "_excludedClasses"];
Expand Down
20 changes: 17 additions & 3 deletions addons/xeh/fnc_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,24 @@ with uiNamespace do {

// call PreStart events
{
if (_x select 1 == "preStart") then {
call (_x select 2);
private _eventFunc = "";

if (isClass _x) then {
private _entry = _x >> "init";

if (isText _entry) then {
_eventFunc = _eventFunc + getText _entry + ";";
};
} else {
if (isText _x) then {
_eventFunc = getText _x + ";";
};
};

if !(_eventFunc isEqualTo "") then {
[] call compile _eventFunc;
};
} forEach (configFile call CBA_fnc_compileEventHandlers);
} forEach configProperties [configFile >> XEH_FORMAT_CONFIG_NAME("preStart")];

#ifdef DEBUG_MODE_FULL
diag_log text format ["isScheduled = %1", call CBA_fnc_isScheduled];
Expand Down