Skip to content

Commit

Permalink
Fix get default marker color from configFile
Browse files Browse the repository at this point in the history
  • Loading branch information
tekig committed Jul 11, 2021
1 parent ce530de commit d0ccd8c
Showing 1 changed file with 4 additions and 42 deletions.
46 changes: 4 additions & 42 deletions addons/@ocap/addons/ocap/functions/fn_handleMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,12 @@ ocap_markers_handle = ["ocap_handleMarker", {
ocap_markers_tracked pushBackUnique _mrk_name;

private _mrk_color = "";
private _mrk_colorRaw = getarray (configfile >> "CfgMarkerColors" >> _color >> "color");
if ((_mrk_colorRaw # 0) isEqualType "" || _color == "Default") then {
_typeSplit = _type select [0, 2];
if (
_color == "ColorEAST" ||
_typeSplit == "o_"
) then {
_mrk_color = "#800000";
} else {
if (
_color == "ColorWEST" ||
_typeSplit == "b_"
) then {
_mrk_color = "#004C99";
} else {
if (
_color == "ColorGUER" ||
_typeSplit == "n_"
) then {
_mrk_color = "#008000";
} else {
if (
_color == "ColorCIV" ||
_typeSplit == "c_"
) then {
_mrk_color = "#660080";
} else {
if (
_color == "ColorUNKNOWN" ||
_typeSplit == "u_"
) then {
_mrk_color = "#B29900";
} else {
_mrk_color = "#000000";
};
};
};
};
};
if (_color == "Default") then {
_mrk_color = (configfile >> "CfgMarkers" >> _type >> "color") call BIS_fnc_colorConfigToRGBA call bis_fnc_colorRGBtoHTML;
} else {
_mrk_colorRaw = getarray (configfile >> "CfgMarkerColors" >> _color >> "color");
_mrk_color = (_mrk_colorRaw call bis_fnc_colorRGBtoHTML);
_mrk_colorRaw = getarray (configfile >> "CfgMarkerColors" >> _color >> "color") call bis_fnc_colorRGBtoHTML;
};

private ["_sideOfMarker"];
if (_mrk_owner isEqualTo objNull) then {
_forceGlobal = true;
Expand Down

0 comments on commit d0ccd8c

Please sign in to comment.