#include "script_component.hpp"

#include "XEH_PREP.hpp"

[QUOTE(TBD_M119), "init", {_this call FUNC(init)}] call CBA_fnc_addClassEventHandler;
[QUOTE(TBD_M119), "fired", {_this call FUNC(fired)}] call CBA_fnc_addClassEventHandler;

ADDON = true;

[
	QGVAR(loadShell),
	{
		params ["_arty", "_shell", "_turret"];
		
		// Remove all mags in given turret
		private _mags = _arty magazinesTurret [_turret];
		{
			_arty removeMagazineTurret [_x, [_turret]];
		} forEach _mags;

		_arty addMagazineTurret [_shell, [_turret], 1];
	}
] call CBA_fnc_addEventHandler;


[LLSTRING(name), "RotateRight", [LLSTRING(rotright), LLSTRING(rotright_desc)], {
    if (vehicle player == player) exitWith {};
	if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
	call FUNC(rotateRight);
}, {},
[0x20, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind;

[LLSTRING(name), "RotateLeft", [LLSTRING(rotleft), LLSTRING(rotleft_desc)], {
    if (vehicle player == player) exitWith {};
	if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
	call FUNC(rotateLeft);
}, {},
[0x1E, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind;
