Skip to content

Commit

Permalink
Change Icon Setting to List
Browse files Browse the repository at this point in the history
  • Loading branch information
mrschick committed Oct 9, 2024
1 parent e092e63 commit d2fbb4f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions addons/main/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,9 @@
<Key ID="STR_dui_radar_enable_seat_icons_desc">
<English>When enabled will show if a unit is in a vehicle or not.</English>
</Key>
<Key ID="STR_dui_radar_enable_seat_icons_sameVehicle">
<English>Only in the same vehicle</English>
</Key>
<Key ID="STR_dui_radar_pointer_style">
<English>Pointer style</English>
<Chinesesimp>指向风格</Chinesesimp>
Expand Down
4 changes: 2 additions & 2 deletions addons/radar/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ private _curCat = localize "STR_dui_cat_compass";

[
QGVAR(enable_seat_icons)
,"CHECKBOX"
,"LIST"
,[localize "STR_dui_radar_enable_seat_icons", localize "STR_dui_radar_enable_seat_icons_desc"]
,[CBA_SETTINGS_CAT, _curCat]
,true
,[[0, 1, 2], [localize "STR_dui_show_dir_opt1", localize "STR_dui_radar_enable_seat_icons_sameVehicle", localize "STR_dui_show_dir_opt3"], 2]
,false
] call CBA_fnc_addSetting;

Expand Down
2 changes: 1 addition & 1 deletion addons/radar/functions/fnc_cacheLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private _speakingArray = ["", EGVAR(main,speakingIcon), EGVAR(main,speakingRadio
{
if (alive _x) then {
_x setVariable [QGVAR(compass_icon), [_x, _iconNamespace, _player, true] call FUNC(getIcon)];
_x setVariable [QGVAR(icon), [_x, _iconNamespace] call FUNC(getIcon)];
_x setVariable [QGVAR(icon), [_x, _iconNamespace, _player] call FUNC(getIcon)];
};
} forEach _group;

Expand Down
5 changes: 4 additions & 1 deletion addons/radar/functions/fnc_getIcon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ if (!_forCompass && {GVAR(showRank)}) exitWith {
_namespace getVariable [rank _unit, DUI_RANK_PRIVATE];
};

if (GVAR(enable_seat_icons) && {!(isNull objectParent _unit || {_forCompass})}) exitWith {
if (
(GVAR(enable_seat_icons) == 2 || {GVAR(enable_seat_icons) == 1 && {vehicle _unit == vehicle _player}}) &&
{!(isNull objectParent _unit || {_forCompass})}
) exitWith {
private _crewInfo = ((fullCrew (vehicle _unit)) select {_x select 0 isEqualTo _unit}) select 0;
_crewInfo params ["", "_role", "", "", "_isTurret"];

Expand Down

0 comments on commit d2fbb4f

Please sign in to comment.