From 6d62e58deec710e023548eba82e1ca568e142d5a Mon Sep 17 00:00:00 2001 From: tbox1911 Date: Sat, 31 Aug 2024 17:31:29 +0200 Subject: [PATCH] update markers --- .../GREUH/Scripts/GREUH_playermarkers.sqf | 36 ++++++++++++++----- .../client/markers/empty_vehicles_marker.sqf | 4 +-- core.liberation/scripts/shared/classnames.sqf | 1 + 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/core.liberation/GREUH/Scripts/GREUH_playermarkers.sqf b/core.liberation/GREUH/Scripts/GREUH_playermarkers.sqf index 658afa1fe..14bfa1391 100644 --- a/core.liberation/GREUH/Scripts/GREUH_playermarkers.sqf +++ b/core.liberation/GREUH/Scripts/GREUH_playermarkers.sqf @@ -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]; @@ -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)) }; { diff --git a/core.liberation/scripts/client/markers/empty_vehicles_marker.sqf b/core.liberation/scripts/client/markers/empty_vehicles_marker.sqf index 45f2a5e35..cb2c85ffb 100644 --- a/core.liberation/scripts/client/markers/empty_vehicles_marker.sqf +++ b/core.liberation/scripts/client/markers/empty_vehicles_marker.sqf @@ -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])) && ( @@ -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]; }; diff --git a/core.liberation/scripts/shared/classnames.sqf b/core.liberation/scripts/shared/classnames.sqf index 8f2e09f5d..7897c2897 100644 --- a/core.liberation/scripts/shared/classnames.sqf +++ b/core.liberation/scripts/shared/classnames.sqf @@ -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";