2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-11-15 18:15:25 +00:00
|
|
|
/*
|
|
|
|
* Author: jaynus
|
|
|
|
* Updates fire mode on javelin display (top/dir)
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_javelin_fnc_showFireMode
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2016-05-30 16:37:03 +00:00
|
|
|
|
2019-01-31 04:11:01 +00:00
|
|
|
(if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapon}) then {
|
|
|
|
weaponState ACE_player
|
|
|
|
} else {
|
|
|
|
_turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath};
|
|
|
|
weaponState [vehicle ACE_player, _turretPath]
|
|
|
|
}) params ["_weapon", "", "_mode"];
|
|
|
|
|
|
|
|
private _currentFireMode = getText (configFile >> "CfgWeapons" >> _weapon >> _mode >> QEGVAR(missileGuidance,attackProfile));
|
2016-05-30 16:37:03 +00:00
|
|
|
|
2019-01-31 04:11:01 +00:00
|
|
|
TRACE_3("showFireMode",_weapon,_mode,_currentFireMode);
|
|
|
|
|
|
|
|
if (_currentFireMode == "") then { // backwards compatiblity for addons using ace_javelin (CUP)
|
|
|
|
private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player};
|
|
|
|
_currentFireMode = _currentShooter getVariable ["ace_missileguidance_attackProfile", "JAV_TOP"];
|
|
|
|
TRACE_1("using getVar",_currentFireMode);
|
|
|
|
};
|
2016-11-15 18:15:25 +00:00
|
|
|
|
|
|
|
if (_currentFireMode == "JAV_TOP") then {
|
2016-05-30 16:37:03 +00:00
|
|
|
__JavelinIGUITop ctrlSetTextColor __ColorGreen;
|
|
|
|
__JavelinIGUIDir ctrlSetTextColor __ColorGray;
|
|
|
|
} else {
|
|
|
|
__JavelinIGUITop ctrlSetTextColor __ColorGray;
|
|
|
|
__JavelinIGUIDir ctrlSetTextColor __ColorGreen;
|
2016-07-06 01:58:32 +00:00
|
|
|
};
|