Skip to content

Commit

Permalink
update markers
Browse files Browse the repository at this point in the history
  • Loading branch information
tbox1911 committed Aug 31, 2024
1 parent 4f5ffc3 commit 6d62e58
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
36 changes: 27 additions & 9 deletions core.liberation/GREUH/Scripts/GREUH_playermarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ while { true } do {
waitUntil {sleep 1; GRLIB_MapOpen };

// Players and units
private _marked_players_bak = [];
private _players_list = (units GRLIB_side_friendly - units group chimeraofficer) select { alive _x && isNull objectParent _x };
private _players_markers_bak = [];
private _players_list = (units GRLIB_side_friendly + units GRLIB_side_civilian) select { alive _x && isNull objectParent _x && !isNil {_x getVariable "PAR_Grp_ID"} };
{
private _nextunit = _x;
private _nextmarker = format ["playermarker_%1", (_nextunit call BIS_fnc_netId)];
private _groupunit = (_nextunit in (units group player));
// in cache ?
if (_players_markers find _nextmarker < 0) then {
_marker = createMarkerLocal [_nextmarker, getPosATL _nextunit];
Expand All @@ -28,33 +29,50 @@ while { true } do {
_marker setMarkerSizeLocal [ 0.6, 0.6 ];
};
_marker setMarkerColorLocal GRLIB_color_friendly;
_marked_players_bak pushback _marker;
_players_markers_bak pushback _marker;
} else {
_nextmarker setMarkerPosLocal (getPosATL _nextunit);
_marked_players_bak pushback _nextmarker;
_players_markers_bak pushback _nextmarker;
};
if (isPlayer _nextunit) then {
_nextmarker setMarkerDirLocal (getDir _nextunit);
} else {
_nextmarker setMarkerTextLocal format ["%1. %2", [_nextunit] call F_getUnitPositionId, name _nextunit];
if (side group _nextunit == GRLIB_side_civilian) then {
_nextmarker setMarkerTextLocal format ["Medic. %1", name _nextunit];
} else {
_nextmarker setMarkerTextLocal format ["%1. %2", [_nextunit] call F_getUnitPositionId, name _nextunit];
};
if (_nextunit getVariable ["PAR_isUnconscious", false]) then {
_nextmarker setMarkerTypeLocal "MinefieldAP";
_nextmarker setMarkerColorLocal GRLIB_color_enemy_bright;
if (_groupunit) then {
_nextmarker setMarkerColorLocal GRLIB_color_enemy_bright;
} else {
_nextmarker setMarkerColorLocal GRLIB_color_enemy;
};
} else {
_nextmarker setMarkerTypeLocal "mil_triangle";
_nextmarker setMarkerColorLocal GRLIB_color_friendly;
if (_groupunit) then {
_nextmarker setMarkerColorLocal GRLIB_color_friendly_bright;
} else {
if (side group _nextunit == GRLIB_side_civilian) then {
_nextmarker setMarkerColorLocal "ColorGUER";
} else {
_nextmarker setMarkerColorLocal GRLIB_color_friendly;
};
};
};
};
} foreach _players_list;

{ deleteMarkerLocal _x } foreach (_players_markers - _marked_players_bak);
_players_markers = _marked_players_bak;
{ deleteMarkerLocal _x } foreach (_players_markers - _players_markers_bak);
_players_markers = _players_markers_bak;

// Vehicles
private _vehicles_markers_bak = [];
private _vehicles_list = vehicles select {
(alive _x) && !(isObjectHidden _x) &&
(count (crew _x) > 0) && (side _x == GRLIB_side_friendly) &&
(_x getVariable ["GRLIB_vehicle_owner", ""] != "server") &&
!(typeOf _x in (uavs + static_vehicles_AI))
};
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ private _vehmarkers = [];
while { true } do {
waitUntil {sleep 1; GRLIB_MapOpen };
_veh_list = vehicles select {
(alive _x) && !(isObjectHidden _x) &&
(_x distance2D lhd > GRLIB_fob_range) &&
(getObjectType _x >= 8) && (isDamageAllowed _x) &&
!([_x, _no_marker_classnames] call F_itemIsInClass) &&
(alive _x) && !(isObjectHidden _x) && isNull (attachedTo _x) &&
(count (crew _x) == 0 || typeOf _x in (uavs + static_vehicles_AI)) &&
(isNull (_x getVariable ["R3F_LOG_est_transporte_par", objNull])) &&
(
Expand Down Expand Up @@ -92,7 +92,7 @@ while { true } do {
_nextmarker setMarkerSizeLocal [1.4, 1.4];
};
if (typeOf _nextvehicle == canister_fuel_typename) then {
_marker_color = "ColorEAST";
_marker_color = "Color1_FD_F";
_marker_type = "loc_refuel";
_nextmarker setMarkerSizeLocal [1.4, 1.4];
};
Expand Down
1 change: 1 addition & 0 deletions core.liberation/scripts/shared/classnames.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ GRLIB_side_resistance = RESISTANCE;
// *** COLORS ***
// Default WEST
GRLIB_color_friendly = "ColorBLUFOR";
GRLIB_color_friendly_bright = "ColorBlue";

// Default EAST
GRLIB_color_enemy = "ColorOPFOR";
Expand Down

0 comments on commit 6d62e58

Please sign in to comment.