diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index fe21b05265..429d1d7b02 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -28,3 +28,21 @@ class RscDisplayInventory { class RscDisplayChannel { onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel)); }; + +// map +class RscDisplayMainMap { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); +}; + +class RscDisplayGetReady: RscDisplayMainMap { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent);); +}; + +class RscDisplayServerGetReady: RscDisplayGetReady { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent);); +}; + + +class RscDisplayClientGetReady: RscDisplayGetReady { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent);); +}; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index b8d3a54d96..612cadb006 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -36,6 +36,15 @@ class CfgVehicles { class No { name = "No"; value = 0; default = 1;}; }; }; + class MapShowCursorCoordinates { + displayName = "Show cursor coordinates?"; + description = "Show the grid coordinates on the mouse pointer?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; }; + class No { name = "No"; value = 0; default = 1;}; + }; + }; }; }; 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 e544a67c12..cb3cbc8d6d 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -48,6 +48,10 @@ class ACE_Settings { value = 0; typeName = "BOOL"; }; + class GVAR(mapShowCursorCoordinates) { + value = 0; + typeName = "BOOL"; + }; }; #include "CfgEventHandlers.hpp" @@ -85,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" }; }; @@ -143,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_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index b6e556c92e..a22bbbb385 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -15,8 +15,9 @@ _activated = _this select 2; if !(_activated) exitWith {}; -[_logic, QGVAR(mapIllumination), "MapIllumination"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapIllumination), "MapIllumination" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule); diag_log text "[ACE]: Interaction Module Initialized."; diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf new file mode 100644 index 0000000000..bc147884e4 --- /dev/null +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates);