ACE3/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf

57 lines
1.7 KiB
Plaintext
Raw Normal View History

2015-04-05 06:57:24 +00:00
/*
* Author: PabstMirror
*
*
* Arguments:
*
* Return Value:
*
* Example:
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_player,_newVehicle);
if (isNull _newVehicle) exitWith {};
if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
[{
PARAMS_2(_args,_pfID);
EXPLODE_1_PVT(_args,_veh);
if ((vehicle ACE_player) != _veh) then {
[_pfID] call CBA_fnc_removePerFrameHandler;
} else {
2015-04-05 07:27:13 +00:00
if (shownArtilleryComputer && GVAR(noComputer)) then {
//Don't like this solution
closeDialog 0;
[parseText "Computer Disabled"] call EFUNC(common,displayTextStructured);
};
2015-04-05 06:57:24 +00:00
_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull];
if (isNull _display) exitWith {systemChat "null";};
_elevDeg = parseNumber ctrlText (_display displayCtrl 175);
2015-04-05 07:18:51 +00:00
if (GVAR(useMils)) then {
2015-04-05 06:57:24 +00:00
(_display displayCtrl 80175) ctrlSetText str round (_elevDeg * 6400 / 360);
} else {
(_display displayCtrl 80175) ctrlSetText str _elevDeg;
};
2015-04-05 07:18:51 +00:00
if (GVAR(noComputer)) then {
2015-04-05 06:57:24 +00:00
(_display displayCtrl 80176) ctrlSetText "";
} else {
_elevDeg = parseNumber ctrlText (_display displayCtrl 176);
if (_elevDeg <= 0) then {
(_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176));
} else {
2015-04-05 07:18:51 +00:00
if (GVAR(useMils)) then {
2015-04-05 06:57:24 +00:00
(_display displayCtrl 80176) ctrlSetText str round (_elevDeg * 6400 / 360);
} else {
(_display displayCtrl 80176) ctrlSetText str _elevDeg;
};
};
};
};
}, 0, [_newVehicle]] call CBA_fnc_addPerFrameHandler;