diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index c6a2c572ad..ccaf9041ab 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -19,15 +19,4 @@ call FUNC(determineZoom); ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; }; -// Note: doesn't work on postInit in SP, therefore use default setting -(findDisplay 12 displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); - -["mapDisplayLoaded", { - //hint str _this; systemChat str _this; diag_log str _this; - - if (_this select 1 == "ingame") then { - ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); - }; -}] call FUNC(addEventhandler); - ADDON = true; diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index 7899c6a637..c5645a52e7 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -8,6 +8,7 @@ PREP(blueForceTrackingUpdate); PREP(determineMapLight); PREP(determineZoom); PREP(moduleMap); +PREP(onDrawMap); PREP(updateMapEffects); ADDON = true; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index d9dae47bd3..cb3cbc8d6d 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -89,7 +89,8 @@ class RscMapControl { class RscDisplayMainMap { // Tweak map styling class controlsBackground { - class CA_Map : RscMapControl { + class CA_Map: RscMapControl { + onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawMap)); #include "MapTweaks.hpp" }; }; @@ -147,6 +148,13 @@ class RscDisplayDiary { // BRIEFING SCREEN class RscDisplayGetReady: RscDisplayMainMap { + // Tweak map styling + class controlsBackground { + class CA_Map: RscMapControl { + onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawMap)); + //#include "MapTweaks.hpp" @todo Shouldn't this apply to briefing too? + }; + }; // get rid of the "center to player position" - button (as it works even on elite) class controls { class TopRight: RscControlsGroup { diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf new file mode 100644 index 0000000000..2d17c24962 --- /dev/null +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -0,0 +1,5 @@ +// by commy2 +#include "script_component.hpp" + +diag_log text str diag_frameno; +((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates);