diff --git a/components/ftMemberMarkers/fn_createFireteamMarkerHook.sqf b/components/ftMemberMarkers/fn_createFireteamMarkerHook.sqf index dec74635..b06f61b9 100644 --- a/components/ftMemberMarkers/fn_createFireteamMarkerHook.sqf +++ b/components/ftMemberMarkers/fn_createFireteamMarkerHook.sqf @@ -1,25 +1,21 @@ #include "macros.hpp" -#ifdef ENABLE_FIRETEAM_MARKERS +RUN_AS_ASYNC(f_fnc_createFireteamMarkerHook); +WAIT_UNTIL_SETTINGS_READY(); - RUN_AS_ASYNC(f_fnc_createFireteamMarkerHook); - WAIT_UNTIL_SETTINGS_READY(); +params ["_display", "_control"]; - params ["_display", "_control"]; +if (_display getVariable ["f_var_ftMarker_eventId", -1] >= 0) exitWith +{ + DEBUG_FORMAT2_LOG("[FTMarkers] Aborted creating handler on display %1 with control %2 because it was already registered.",_display,_control) +}; - if (_display getVariable ["f_var_ftMarker_eventId", -1] >= 0) exitWith - { - DEBUG_FORMAT2_LOG("[FTMarkers] Aborted creating handler on display %1 with control %2 because it was already registered.",_display,_control) - }; +DEBUG_FORMAT2_LOG("[FTMarkers] Creating handler on display %1 with control %2.",_display,_control) - DEBUG_FORMAT2_LOG("[FTMarkers] Creating handler on display %1 with control %2.",_display,_control) +_eventId = _control ctrlAddEventHandler +[ + "Draw", + "_this call f_fnc_drawFireteamMarkers" +]; - _eventId = _control ctrlAddEventHandler - [ - "Draw", - "_this call f_fnc_drawFireteamMarkers" - ]; - - _display setVariable ["f_var_ftMarker_eventId", _eventId]; - -#endif +_display setVariable ["f_var_ftMarker_eventId", _eventId]; diff --git a/components/ftMemberMarkers/fn_drawFireteamMarkers.sqf b/components/ftMemberMarkers/fn_drawFireteamMarkers.sqf index c5fae694..2c43b53c 100644 --- a/components/ftMemberMarkers/fn_drawFireteamMarkers.sqf +++ b/components/ftMemberMarkers/fn_drawFireteamMarkers.sqf @@ -4,6 +4,7 @@ params ["_map"]; if !(alive player) exitWith {}; if !IS_TRUE(f_var_allSettingsReady) exitWith {}; +if !IS_TRUE(f_var_showFTMarkers) exitWith {}; #ifdef HIDE_DEAD_IN_SQUAD _group = (units player) select {alive _x}; diff --git a/components/squadMarkers/fn_beginSquadMarkers.sqf b/components/squadMarkers/fn_beginSquadMarkers.sqf index 7688d983..9fccaa64 100644 --- a/components/squadMarkers/fn_beginSquadMarkers.sqf +++ b/components/squadMarkers/fn_beginSquadMarkers.sqf @@ -7,11 +7,11 @@ WAIT_UNTIL_PLAYER_EXISTS(); [] spawn f_fnc_initSquadMarkerManager; [] spawn f_fnc_squadMarkerArtilleryComputerManager; -#ifdef ENABLE_MICRODAGR_SQUADMARKERS +if IS_TRUE(f_var_enableMicroDAGRSquadMarkers) then { if !(isNil 'ace_microDAGR_miniMapDrawHandlers') then { ace_microDAGR_miniMapDrawHandlers pushBack f_fnc_drawSquadMarkers; }; -#endif +}; diff --git a/components/squadMarkers/fn_createSquadMarkerHook.sqf b/components/squadMarkers/fn_createSquadMarkerHook.sqf index d2f655d7..287687c8 100644 --- a/components/squadMarkers/fn_createSquadMarkerHook.sqf +++ b/components/squadMarkers/fn_createSquadMarkerHook.sqf @@ -1,40 +1,37 @@ #include "macros.hpp" -#ifdef ENABLE_SQUAD_MARKERS - RUN_AS_ASYNC(f_fnc_createSquadMarkerHook); - WAIT_UNTIL_SETTINGS_READY(); +RUN_AS_ASYNC(f_fnc_createSquadMarkerHook); +WAIT_UNTIL_SETTINGS_READY(); - params ["_display", "_control"]; +params ["_display", "_control"]; - // If ft markers are enabled, wait until this display has ft markers hooked. Draw calls should occur in inverse order of registration. - #ifdef ENABLE_FIRETEAM_MARKERS +// If ft markers are enabled, wait until this display has ft markers hooked. Draw calls should occur in inverse order of registration. +if IS_TRUE(f_var_showFTMarkers) then { - if (_display getVariable ["f_var_ftMarker_eventId", -1] < 0) then + if (_display getVariable ["f_var_ftMarker_eventId", -1] < 0) then + { + DEBUG_FORMAT1_LOG("[SquadMarkers] Waiting for display %1 to get a ft-marker hook registered.",_display) + waitUntil { - DEBUG_FORMAT1_LOG("[SquadMarkers] Waiting for display %1 to get a ft-marker hook registered.",_display) - waitUntil - { - uiSleep 1; - _display getVariable ["f_var_ftMarker_eventId", -1] >= 0 - }; + uiSleep 1; + _display getVariable ["f_var_ftMarker_eventId", -1] >= 0 }; - - #endif - - if (_display getVariable ["f_var_squadMarker_eventId", -1] >= 0) exitWith - { - DEBUG_FORMAT2_LOG("[SquadMarkers] Aborted creating handler on display %1 with control %2 because it was already registered.",_display,_control) }; - DEBUG_FORMAT2_LOG("[SquadMarkers] Creating handler on display %1 with control %2.",_display,_control) +}; + +if (_display getVariable ["f_var_squadMarker_eventId", -1] >= 0) exitWith +{ + DEBUG_FORMAT2_LOG("[SquadMarkers] Aborted creating handler on display %1 with control %2 because it was already registered.",_display,_control) +}; - _eventId = _control ctrlAddEventHandler - [ - "Draw", - "_this call f_fnc_drawSquadMarkers" - ]; +DEBUG_FORMAT2_LOG("[SquadMarkers] Creating handler on display %1 with control %2.",_display,_control) - _display setVariable ["f_var_squadMarker_eventId", _eventId]; +_eventId = _control ctrlAddEventHandler +[ + "Draw", + "_this call f_fnc_drawSquadMarkers" +]; -#endif +_display setVariable ["f_var_squadMarker_eventId", _eventId]; diff --git a/components/squadMarkers/fn_drawSquadMarkers.sqf b/components/squadMarkers/fn_drawSquadMarkers.sqf index d9bbfed6..1d1bc8c7 100644 --- a/components/squadMarkers/fn_drawSquadMarkers.sqf +++ b/components/squadMarkers/fn_drawSquadMarkers.sqf @@ -1,7 +1,7 @@ #include "macros.hpp" if (isNil 'f_arr_squadMarkers') exitWith {}; -if (IS_TRUE(f_var_hideSquadMarkers)) exitWith {}; +if !IS_TRUE(f_var_showSquadMarkers) exitWith {}; if !IS_TRUE(f_var_squadMarkers_configLoaded) exitWith {}; params ["_map"]; diff --git a/components/squadMarkers/fn_initSquadMarkerManager.sqf b/components/squadMarkers/fn_initSquadMarkerManager.sqf index 55ee90c6..0958abe0 100644 --- a/components/squadMarkers/fn_initSquadMarkerManager.sqf +++ b/components/squadMarkers/fn_initSquadMarkerManager.sqf @@ -50,13 +50,9 @@ waitUntil if (_visible) then { _isAiOnly = ({isPlayer _x} count _units) <= 0; - -#ifdef SHOW_NPC_SQUADS - _shouldShow = true; -#endif -#ifndef SHOW_NPC_SQUADS - _shouldShow = !_isAiOnly; -#endif + + // Show squad if NPC squads are shown, or if it is not an NPC squad. + _shouldShow = IS_TRUE(f_var_showNPCSquads) or !_isAiOnly; if (_shouldShow) then { diff --git a/components/squadMarkers/globals.sqf b/components/squadMarkers/globals.sqf index e5571977..0728ce40 100644 --- a/components/squadMarkers/globals.sqf +++ b/components/squadMarkers/globals.sqf @@ -1,7 +1,5 @@ #include "macros.hpp" -f_var_hideSquadMarkers = false; - f_var_squadMarker_colourChoices = [ 'Red', diff --git a/components/squadMarkers/init_component.sqf b/components/squadMarkers/init_component.sqf index cfe586fb..1d7b1a67 100644 --- a/components/squadMarkers/init_component.sqf +++ b/components/squadMarkers/init_component.sqf @@ -4,12 +4,4 @@ CLIENT_ONLY; DEBUG_PRINT_LOG("initting squad markers") -#ifdef ENABLE_SQUAD_MARKERS - -[] call f_fnc_beginSquadMarkers; - -#else - -if (true) exitWith { DEBUG_PRINT_LOG("[SquadMarkers] init_component was called but ENABLE_SQUAD_MARKERS is not set.") }; - -#endif +[] call f_fnc_beginSquadMarkers; \ No newline at end of file diff --git a/configuration/acre_radio_configuration.sqf b/configuration/acre_radio_configuration.sqf index 787a4b30..d258fd3e 100644 --- a/configuration/acre_radio_configuration.sqf +++ b/configuration/acre_radio_configuration.sqf @@ -82,7 +82,7 @@ ["_radio", "_channelName", "_side", "_role"] Example: // Removes a SEM-52 long-range radio from all BLUFOR FTLs, which was tuned to "GROUND CMD". - ["ACRE_SEM52SL", "GROUND CMD", west, "ftl"] call f_fnc_acre_giveRadioToAllInRole; + ["ACRE_SEM52SL", "GROUND CMD", west, "ftl"] call f_fnc_acre_removeRadioFromAllInRole; f_fnc_acre_removeRadioFromAllInGroup Takes away a radio from every unit in the given group and side. @@ -100,7 +100,7 @@ ["_radio", "_channelName", "_side", "_role", "_groupName"]; Example: // Removes a short-range radio from an extremely suspicious individual in the BLUFOR ALPHA group, which was tuned to "ALPHA SR" net. - ["ACRE_PRC343", "ALPHA SR", west, "sus", "ALPHA"] call f_fnc_acre_giveRadioToAllInGroup; + ["ACRE_PRC343", "ALPHA SR", west, "sus", "ALPHA"] call f_fnc_acre_removeRadioFromRoleInGroup; LANGUAGE COMMAND ARGUMENTS REFERENCE: @@ -154,7 +154,7 @@ Example: // On the BLUFOR side, gives a very suspicious rifleman in CHARLIE the OPFOR language. Do the same for the CHARLIE FTL. // Because they are BLUFOR units, they will already have the BLUFOR language, so they will speak both. - ["opf", west, ["rif", "ftl"], "CHARLIE"] call f_fnc_acre_giveRadioToAllUnits; + ["opf", west, ["rif", "ftl"], "CHARLIE"] call f_fnc_acre_giveLanguagesToRoleInGroup; f_fnc_acre_removeLanguagesFromAllInGroup Removes the language(s) from all units in the given group(s). diff --git a/configuration/mapMarkers.hpp b/configuration/mapMarkers.hpp deleted file mode 100644 index 6bcc187c..00000000 --- a/configuration/mapMarkers.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// To disable squad markers on the map, comment-out or delete the line below. -#define ENABLE_SQUAD_MARKERS - -// To disable fireteam member markers on the map, comment-out or delete the line below. -#define ENABLE_FIRETEAM_MARKERS - -// To hide AI squads on the map, comment-out or delete the line below. -#define SHOW_NPC_SQUADS - -// To disable squadmarker MicroDAGR integration, comment-out or delete the line below. -#define ENABLE_MICRODAGR_SQUADMARKERS diff --git a/configuration/mapMarkers.sqf b/configuration/mapMarkers.sqf new file mode 100644 index 00000000..370a803e --- /dev/null +++ b/configuration/mapMarkers.sqf @@ -0,0 +1,33 @@ +/* + + Map marker configuration + + All settings below can be changed while the mission is running (except for MicroDAGR integration). + + These settings are individually changeable for each player. This is useful if some players should have markers and some should not. + To change these settings for everyone, make sure that the change is 'global'. Some examples are below: + + Example: disable squad markers for everyone (can be run mid-mission): + missionNamespace setVariable ["f_var_showSquadMarkers", false, true]; + + Example: disable squad markers for only the OPFOR side (can put this into the 'customStartup_server.sqf' file): + [missionNamespace, ["f_var_showSquadMarkers", false]] remoteExecCall ["setVariable", east, "ChangeOpforMarkers"]; + +*/ + +// To disable squad markers on the map, set the variable on the line below to false +// Note: This variable can be changed while the mission is running +f_var_showSquadMarkers = true; + +// To disable fireteam member markers on the map, set the variable on the line below to false +// Note: This variable can be changed while the mission is running +f_var_showFTMarkers = true; + +// To hide AI squads on the map, set the variable on the line below to false +// Note: This variable can be changed while the mission is running +f_var_showNPCSquads = true; + +// To disable squadmarker MicroDAGR integration, set the below variable to false. +// Note: MicroDAGR markers act like a normal GPS - they respect the configuration of the three settings above. +// Note: This variable cannot be changed while the mission is running +f_var_enableMicroDAGRSquadMarkers = true; diff --git a/startup/configuration/groups/clientConfigGroup.sqf b/startup/configuration/groups/clientConfigGroup.sqf index 716e22b9..0e52b55a 100644 --- a/startup/configuration/groups/clientConfigGroup.sqf +++ b/startup/configuration/groups/clientConfigGroup.sqf @@ -15,3 +15,6 @@ // Squad markers #include "..\internals\squadMarkers.sqf" + +// Map markers +#include "..\internals\mapMarkers.sqf" \ No newline at end of file diff --git a/startup/configuration/internals/configMacros.hpp b/startup/configuration/internals/configMacros.hpp index fec89322..5cad8473 100644 --- a/startup/configuration/internals/configMacros.hpp +++ b/startup/configuration/internals/configMacros.hpp @@ -9,7 +9,6 @@ #include "..\..\..\configuration\ceasefire.hpp" #include "..\..\..\configuration\killTracking.hpp" #include "..\..\..\configuration\gravestones.hpp" -#include "..\..\..\configuration\mapMarkers.hpp" #include "..\..\..\configuration\viewDistanceEditor.hpp" #include "..\..\..\configuration\identityReplacement.hpp" #include "..\..\..\configuration\insignia.hpp" diff --git a/startup/configuration/internals/mapMarkers.sqf b/startup/configuration/internals/mapMarkers.sqf new file mode 100644 index 00000000..5b59661d --- /dev/null +++ b/startup/configuration/internals/mapMarkers.sqf @@ -0,0 +1,12 @@ +#include "macros.hpp" + +if (isNil "f_var_mapMarkers_already_defined") then +{ + f_var_mapMarkers_already_defined = true; + + #include "..\..\..\configuration\mapMarkers.sqf" +} +else +{ + DEBUG_PRINT_LOG("[MapMarkers]: Map markers config tried running multiple times.") +};