Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions components/ftMemberMarkers/fn_createFireteamMarkerHook.sqf
Original file line number Diff line number Diff line change
@@ -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];
1 change: 1 addition & 0 deletions components/ftMemberMarkers/fn_drawFireteamMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions components/squadMarkers/fn_beginSquadMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
51 changes: 24 additions & 27 deletions components/squadMarkers/fn_createSquadMarkerHook.sqf
Original file line number Diff line number Diff line change
@@ -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];
2 changes: 1 addition & 1 deletion components/squadMarkers/fn_drawSquadMarkers.sqf
Original file line number Diff line number Diff line change
@@ -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"];
Expand Down
10 changes: 3 additions & 7 deletions components/squadMarkers/fn_initSquadMarkerManager.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 0 additions & 2 deletions components/squadMarkers/globals.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "macros.hpp"

f_var_hideSquadMarkers = false;

f_var_squadMarker_colourChoices =
[
'Red',
Expand Down
10 changes: 1 addition & 9 deletions components/squadMarkers/init_component.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 3 additions & 3 deletions configuration/acre_radio_configuration.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:

Expand Down Expand Up @@ -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).
Expand Down
11 changes: 0 additions & 11 deletions configuration/mapMarkers.hpp

This file was deleted.

33 changes: 33 additions & 0 deletions configuration/mapMarkers.sqf
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 3 additions & 0 deletions startup/configuration/groups/clientConfigGroup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@

// Squad markers
#include "..\internals\squadMarkers.sqf"

// Map markers
#include "..\internals\mapMarkers.sqf"
1 change: 0 additions & 1 deletion startup/configuration/internals/configMacros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions startup/configuration/internals/mapMarkers.sqf
Original file line number Diff line number Diff line change
@@ -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.")
};