From 690e415ffe00938deb66b1e8442dd951d0318b71 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 25 Mar 2017 11:36:37 -0500 Subject: [PATCH] Minor cleanup --- addons/medical/XEH_postInit.sqf | 15 ++++++++++----- addons/medical/functions/fnc_init.sqf | 3 ++- addons/medical_treatment/XEH_postInit.sqf | 5 ++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 00e297590c..a09e4fe14f 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -1,6 +1,7 @@ +// #define DEBUG_MODE_FULL #include "script_component.hpp" -["ace_interactMenuClosed", {[objNull, 0] call FUNC(displayPatientInformation); }] call CBA_fnc_addEventHandler; +["ace_interactMenuClosed", {[objNull, 0] call FUNC(displayPatientInformation);}] call CBA_fnc_addEventHandler; //Handle Deleting Bodies and creating litter on Server: if (isServer) then { @@ -32,7 +33,11 @@ if (!hasInterface) exitWith {}; }] call EFUNC(common,arithmeticSetSource); #ifdef DEBUG_MODE_FULL - if (hasInterface) then { + [{!isNull findDisplay 46}, { + INFO("Creating Debug Display"); + if (!isNull (uiNamespace getVariable [QGVAR(debugControl), controlNull])) then { + ctrlDelete (uiNamespace getVariable [QGVAR(debugControl), controlNull]); // cleanup on SP Restart + }; private _ctrl = findDisplay 46 ctrlCreate ["RscText", -1]; _ctrl ctrlSetPosition [ safeZoneX, @@ -51,8 +56,8 @@ if (!hasInterface) exitWith {}; if (!isNull cursorTarget && {cursorTarget isKindOf "CAManBase"}) then { private _targetState = [cursorTarget, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; - drawIcon3D ["", [0.6, 0, 0, 1], cursorTarget modelToWorld (cursorTarget selectionPosition "pelvis"), 0, 0, 0, format ["State: %1", _targetState], 2, 40 * pixelH, "RobotoCondensed"]; + drawIcon3D ["", [0.6, 0, 0, 1], cursorTarget modelToWorldVisual (cursorTarget selectionPosition "pelvis"), 0, 0, 0, format ["State: %1", _targetState], 2, 40 * pixelH, "RobotoCondensed"]; }; - }] call CBA_fnc_addPerFrameHandler; - }; + }, 0 ,[]] call CBA_fnc_addPerFrameHandler; + }, []] call CBA_fnc_waitUntilAndExecute; #endif diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 6a705a60e9..266c8dc501 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -78,5 +78,6 @@ _unit setVariable [QGVAR(allLogs), [], true]; [{ params ["_unit"]; + TRACE_2("Unit Init",_unit,local _unit); [QGVAR(initialized), [_unit]] call CBA_fnc_localEvent; -}, [_unit], 0.5, 0.1] call CBA_fnc_waitAndExecute; +}, [_unit], 0.5] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_treatment/XEH_postInit.sqf b/addons/medical_treatment/XEH_postInit.sqf index 99dfecd9d9..ee09953223 100644 --- a/addons/medical_treatment/XEH_postInit.sqf +++ b/addons/medical_treatment/XEH_postInit.sqf @@ -1,7 +1,8 @@ - #include "script_component.hpp" [QEGVAR(medical,initialized), FUNC(checkItems)] call CBA_fnc_addEventHandler; +["loadout", FUNC(checkItems)] call CBA_fnc_addPlayerEventHandler; + if (isServer) then { [QGVAR(createLitterServer), FUNC(litterHandleCreate)] call CBA_fnc_addEventHandler; @@ -20,5 +21,3 @@ if (isServer) then { [QGVAR(actionCheckPulseLocal), FUNC(actionCheckPulseLocal)] call CBA_fnc_addEventHandler; [QGVAR(actionCheckBloodPressureLocal), FUNC(actionCheckBloodPressureLocal)] call CBA_fnc_addEventHandler; [QGVAR(actionPlaceInBodyBag), FUNC(actionPlaceInBodyBag)] call CBA_fnc_addEventHandler; - -["loadout", FUNC(checkItems)] call CBA_fnc_addPlayerEventHandler;