Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging - Minor improvements #228

Merged
merged 3 commits into from
Nov 4, 2024
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
4 changes: 2 additions & 2 deletions addons/common/functions/fnc_createPlayerMarker.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: veteran29
* Create player owned marker.
* Create player owned marker locally.
*
* Arguments:
* 0: Marker position <ARRAY, OBJECT>
Expand Down Expand Up @@ -43,4 +43,4 @@ GVAR(playerMarkerIdx) = GVAR(playerMarkerIdx) + 1;

private _markerId = format ["_USER_DEFINED #%1/%2/%3", getPlayerID _player, _id, _channel];

createMarker [_markerId, _position, _channel, _player] // return
createMarkerLocal [_markerId, _position, _channel, _player] // return
13 changes: 6 additions & 7 deletions addons/tagging/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ if (hasInterface) then {
// Check if tag created on building by local player
if (!(_object isKindOf "Building") || {_unit isNotEqualTo player}) exitWith {};

private _colorIndex = {
if (_texture find _x != -1) exitWith {_forEachIndex};
-1
} forEach TEXTURE_COLORS;
private _colorIndex = TEXTURE_COLORS findIf {toLower _texture find _x != -1};

// no matching color, do not create marker
if (_colorIndex == -1) exitWith {};
if (_colorIndex == -1) exitWith {
WARNING_1("Unsupported tag color %1",_texture);
};

private _marker = [_object, "side", _unit] call EFUNC(common,createPlayerMarker);
_marker setMarkerShape "ICON";
_marker setMarkerType "hd_dot";
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "hd_dot";
_marker setMarkerColor (MARKER_COLORS select _colorIndex);

}] call CBA_fnc_addEventHandler;
Expand Down
4 changes: 2 additions & 2 deletions addons/tagging/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

#include "\z\afm\addons\main\script_macros.hpp"

#define MARKER_COLORS ["ColorRed", "ColorGreen", "ColorBlue", "ColorBlack"]
#define TEXTURE_COLORS ["red", "green", "blue", "black"]
#define MARKER_COLORS ["ColorRed", "ColorGreen", "ColorBlue", "ColorBlack", "ColorYellow", "ColorWhite"]
#define TEXTURE_COLORS ["red", "green", "blue", "black", "yellow", "white"]
Loading