UI - Fix UAVs not being considered vehicles for HUD elements (#9288)

* consider UAVs as vehicles for UI display

* fix condition

* readd reload ui condition

* improved UAV check

* use getConnectedUAVUnit

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Grim 2023-07-29 00:44:14 +03:00 committed by GitHub
parent 7f24dc2282
commit 4fea9669bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
class ACE_UI { class ACE_UI {
class ammoCount { class ammoCount {
class conditions { class conditions {
ADDON = "cameraOn == (getConnectedUAV ACE_player)"; ADDON = "false";
}; };
}; };
}; };

View File

@ -33,9 +33,10 @@ _cachedElement params ["_idd", "_elements", "_location", "_conditions"];
// Exit if main vehicle type condition not fitting // Exit if main vehicle type condition not fitting
private _canUseWeaponOrInCargo = ACE_player call CBA_fnc_canUseWeapon || {-1 < vehicle ACE_player getCargoIndex ACE_player}; private _canUseWeaponOrInCargo = ACE_player call CBA_fnc_canUseWeapon || {-1 < vehicle ACE_player getCargoIndex ACE_player};
private _inUAVCamera = !isNull getConnectedUAVUnit player; // explictly using player
if ( if (
(_canUseWeaponOrInCargo && {_location == VEHICLE_ONLY}) (_canUseWeaponOrInCargo && {!_inUAVCamera} && {_location == VEHICLE_ONLY})
|| {!_canUseWeaponOrInCargo && {_location == GROUND_ONLY}} || {(!_canUseWeaponOrInCargo || {_inUAVCamera}) && {_location == GROUND_ONLY}}
) exitWith { ) exitWith {
TRACE_3("skip location",_this,_canUseWeaponOrInCargo,_location); TRACE_3("skip location",_this,_canUseWeaponOrInCargo,_location);
false false
@ -51,7 +52,7 @@ if (
}; };
_show = false; _show = false;
}; };
} count _conditions; } forEach _conditions;
// Get setting from scripted API // Get setting from scripted API
if (!_force) then { if (!_force) then {
@ -85,8 +86,7 @@ private _success = false;
_control ctrlSetFade _fade; _control ctrlSetFade _fade;
_control ctrlCommit 0; _control ctrlCommit 0;
} count _displays; } forEach _displays;
nil } forEach _elements;
} count _elements;
_success _success