From 50dbbda8ebacef8995459073326dd7a9aef08230 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 8 Apr 2015 00:20:43 +0200 Subject: [PATCH 1/6] disable cursor showing map position --- addons/common/RscInfoType.hpp | 18 ++++++++++++++++++ addons/common/XEH_preInit.sqf | 10 ++++++++++ 2 files changed, 28 insertions(+) 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/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b7da27ea75..98b0d17c7d 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -283,6 +283,16 @@ if (hasInterface) then { ["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent); }; }, 0, []] call cba_fnc_addPerFrameHandler; + + // doesn't work on postInit in SP + ["mapDisplayLoaded", { + //hint str _this; systemChat str _this; diag_log str _this; + + if (_this select 1 == "ingame") then { + ((_this select 0) displayCtrl 1016) ctrlShow false; + }; + }] call FUNC(addEventhandler); + }; // Init toHex From 4834facccf64ab01443362c0220be2155e9e7358 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 8 Apr 2015 00:30:36 +0200 Subject: [PATCH 2/6] moving it to map --- addons/common/XEH_preInit.sqf | 10 ---------- addons/map/XEH_postInitClient.sqf | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 98b0d17c7d..b7da27ea75 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -283,16 +283,6 @@ if (hasInterface) then { ["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent); }; }, 0, []] call cba_fnc_addPerFrameHandler; - - // doesn't work on postInit in SP - ["mapDisplayLoaded", { - //hint str _this; systemChat str _this; diag_log str _this; - - if (_this select 1 == "ingame") then { - ((_this select 0) displayCtrl 1016) ctrlShow false; - }; - }] call FUNC(addEventhandler); - }; // Init toHex diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index ccaf9041ab..778b1c8191 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -19,4 +19,13 @@ call FUNC(determineZoom); ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; }; +// doesn't work on postInit in SP +["mapDisplayLoaded", { + hint str _this; systemChat str _this; diag_log str _this;// + + if (_this select 1 == "ingame") then { + ((_this select 0) displayCtrl 1016) ctrlShow false; + }; +}] call FUNC(addEventhandler); + ADDON = true; From 691ab012b4a1cbc1d7201160c10c7ae22061e95a Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 8 Apr 2015 00:44:14 +0200 Subject: [PATCH 3/6] fix map loaded on preInit --- addons/map/XEH_postInitClient.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 778b1c8191..f60fb696f6 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -19,12 +19,14 @@ call FUNC(determineZoom); ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; }; -// doesn't work on postInit in SP +// Note: doesn't work on postInit in SP, therefore use default setting +(findDisplay 12 displayCtrl 1016) ctrlShow (GETGVAR(showPositionOnCursor,false)); + ["mapDisplayLoaded", { - hint str _this; systemChat str _this; diag_log str _this;// + //hint str _this; systemChat str _this; diag_log str _this; if (_this select 1 == "ingame") then { - ((_this select 0) displayCtrl 1016) ctrlShow false; + ((_this select 0) displayCtrl 1016) ctrlShow (GETGVAR(showPositionOnCursor,false)); }; }] call FUNC(addEventhandler); From b18bcf883565f7a0bc4750643f5be82ac9b25889 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Wed, 8 Apr 2015 01:49:56 -0300 Subject: [PATCH 4/6] Add option to turn on/off cursor coordinates --- addons/map/CfgVehicles.hpp | 9 +++++++++ addons/map/XEH_postInitClient.sqf | 4 ++-- addons/map/config.cpp | 4 ++++ addons/map/functions/fnc_moduleMap.sqf | 7 ++++--- 4 files changed, 19 insertions(+), 5 deletions(-) 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_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index f60fb696f6..c6a2c572ad 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -20,13 +20,13 @@ call FUNC(determineZoom); }; // Note: doesn't work on postInit in SP, therefore use default setting -(findDisplay 12 displayCtrl 1016) ctrlShow (GETGVAR(showPositionOnCursor,false)); +(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 (GETGVAR(showPositionOnCursor,false)); + ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); }; }] call FUNC(addEventhandler); diff --git a/addons/map/config.cpp b/addons/map/config.cpp index e544a67c12..d9dae47bd3 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" 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."; From a47cdb9738290976b8e3e5b1e33b3d0ecfc15420 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 8 Apr 2015 10:45:57 +0200 Subject: [PATCH 5/6] disable map cursor coordinates in mp --- addons/map/XEH_postInitClient.sqf | 11 ----------- addons/map/XEH_preInit.sqf | 1 + addons/map/config.cpp | 10 +++++++++- addons/map/functions/fnc_onDrawMap.sqf | 5 +++++ 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 addons/map/functions/fnc_onDrawMap.sqf 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); From deece11689490ce26001a7e771cc4853c7d4ecaf Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 8 Apr 2015 10:47:56 +0200 Subject: [PATCH 6/6] remove debug --- addons/map/functions/fnc_onDrawMap.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf index 2d17c24962..bc147884e4 100644 --- a/addons/map/functions/fnc_onDrawMap.sqf +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -1,5 +1,4 @@ // by commy2 #include "script_component.hpp" -diag_log text str diag_frameno; ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates);