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

don't execute preInit when returning to 3den #283

Merged
merged 1 commit into from
Feb 29, 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: 5 additions & 1 deletion addons/xeh/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ class Extended_WeaponAssembled_EventHandlers {};
class Extended_WeaponDisassembled_EventHandlers {};

// display xeh
class Extended_DisplayLoad_EventHandlers {};
class Extended_DisplayLoad_EventHandlers {
class RscDisplayInterrupt {
GVAR(3denFix) = QUOTE(call COMPILE_FILE(XEH_interruptDisplayLoad));
};
};
class Extended_DisplayUnload_EventHandlers {};
11 changes: 11 additions & 0 deletions addons/xeh/XEH_interruptDisplayLoad.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "script_component.hpp"

disableSerialization;

params ["_display"];

private _ctrl = _display displayCtrl 104;

if (ctrlText _ctrl == localize "STR_3DEN_RscDisplayInterrupt_ButtonAbort_3DEN_text") then {
_ctrl ctrlAddEventHandler ["buttonClick", {uiNamespace setVariable [QGVAR(3denFix), true]}];
};
6 changes: 6 additions & 0 deletions addons/xeh/fnc_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Author:
---------------------------------------------------------------------------- */
#include "script_component.hpp"

// hack to fix 3den executing preInit unnecessarily when returning from a preview
if (uiNamespace getVariable [QGVAR(3denFix), false]) exitWith {
uiNamespace setVariable [QGVAR(3denFix), false];
diag_log text "[XEH]: 3den preview detected. Abort preInit.";
};

SLX_XEH_DisableLogging = uiNamespace getVariable ["SLX_XEH_DisableLogging", false]; // get from preStart

XEH_LOG("XEH: PreInit started. v" + getText (configFile >> "CfgPatches" >> "cba_common" >> "version") + ". " + PFORMAT_7("MISSIONINIT",missionName,worldName,isMultiplayer,isServer,isDedicated,hasInterface,didJIP));
Expand Down