diff --git a/addons/AIO_AIMENU/XEH_preInit.sqf b/addons/AIO_AIMENU/XEH_preInit.sqf index dbc995e..bf4cc39 100644 --- a/addons/AIO_AIMENU/XEH_preInit.sqf +++ b/addons/AIO_AIMENU/XEH_preInit.sqf @@ -50,8 +50,8 @@ Finally, to bind your function to a key, call CBA_fnc_addKeybind: ["My Awesome Mod","show_breathing_key", "Show Breathing", {_this call mymod_fnc_showGameHint}, "", [DIK_B, [true, true, false]]] call CBA_fnc_addKeybind; */ - -["AIO_useVoiceChat", "CHECKBOX", "Use Voice Chat", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; +["AIO_enableMod", "CHECKBOX", "Enable All-in-One Command Menu", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; +["AIO_useVoiceChat", "CHECKBOX", "Use radio chat for reporting", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; ["AIO_Init_Message", "CHECKBOX", "Show Initialization Message", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; ["AIO_Zeus_Enabled", "CHECKBOX", "Create Zeus Module", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; ["AIO_HC_Module_Enabled", "CHECKBOX", "Create High Command Module", "All-In-One Command Menu", false, 1] call CBA_Settings_fnc_init; @@ -63,9 +63,9 @@ Finally, to bind your function to a key, call CBA_fnc_addKeybind: ["AIO_use_HC_driver", "CHECKBOX", "Use High Command Driver", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; ["AIO_use_doMove_command", "CHECKBOX", "Use doMove instead of CommandMove for Driver", "All-In-One Command Menu" ,true, 1] call CBA_Settings_fnc_init; ["AIO_becomeLeaderOnSwitch", "CHECKBOX", "Become Leader on Team Switch", "All-In-One Command Menu" ,false, 1] call CBA_Settings_fnc_init; -["AIO_AdvancedCtrlMode", "LIST", "Advanced Control Mode", "All-In-One Command Menu" ,[[false, true], ["Toggle", "Hold"], 0], 1] call CBA_Settings_fnc_init; -["AIO_DriverFixWatchDir", "LIST", "Player Watch Direction During Adv Ctrl", "All-In-One Command Menu" ,[[false, true], ["Watch Ahead", "Fixed"], 0], 1] call CBA_Settings_fnc_init; -["AIO_useExactStanceCopy", "LIST", "Copy My Stance Mode", "All-In-One Command Menu" ,[[true, false], ["Exact Stance", "Standard Stance"], 0], 1] call CBA_Settings_fnc_init; +["AIO_AdvancedCtrlMode", "LIST", "Advanced Driving Control Mode", "All-In-One Command Menu" ,[[false, true], ["Toggle", "Hold"], 0], 1] call CBA_Settings_fnc_init; +["AIO_DriverFixWatchDir", "LIST", "Player Watch Direction During Adv. Driving Ctrl", "All-In-One Command Menu" ,[[false, true], ["Watch Ahead", "Fixed"], 0], 1] call CBA_Settings_fnc_init; +["AIO_useExactCopyStance", "LIST", "Copy My Stance Mode", "All-In-One Command Menu" ,[[true, false], ["Exact Stance", "Standard Stance"], 0], 1] call CBA_Settings_fnc_init; ["All-In-One Command Menu","AIO_AIMenu_initKey", "Show Menu", {_this call AIO_keyspressed}, "", [21, [false, false, false]], false] call CBA_fnc_addKeybind; ["All-In-One Command Menu","AIO_follow_stance_key", "Toggle Copy My Stance", {if !(AIO_copy_my_stance) then {[(groupSelectedUnits player)] spawn AIO_copy_my_stance_fnc} else {AIO_copy_my_stance = false; {_x setUnitPos "AUTO"} forEach ((units group player) - [player]);}}, "", [DIK_C, [true, true, false]], false] call CBA_fnc_addKeybind; diff --git a/addons/AIO_AIMENU/init.sqf b/addons/AIO_AIMENU/init.sqf index 187fe23..0985357 100644 --- a/addons/AIO_AIMENU/init.sqf +++ b/addons/AIO_AIMENU/init.sqf @@ -1,15 +1,4 @@ -//////////////////////////////// -// Grab config values and start -//////////////////////////////// -//AIO_debug = getnumber(configfile>> "AIO_AICOVER_Key_Setting" >> "AIO_DEBUG"); - -//AIO_key = getnumber(configfile>> "AIO_AIMENU_Key_Setting" >> "AIO_key"); -//AIO_mapkey = getnumber(configfile>> "AIO_AIMENU_Key_Setting" >> "AIO_mapkey"); -//AIO_key = 73; -//AIO_HC_Module_Enabled = 1; AIO_Zeus_Enabled = 1; AIO_force_Zeus_enabled = false; -//AIO_Zeus_Enabled = getNumber (configfile >> "AIO_AIMENU_Settings" >> "AIO_Zeus_Enabled"); -//AIO_HC_Module_Enabled = getNumber (configfile >> "AIO_AIMENU_Settings" >> "AIO_High_Command_Enabled"); - +if !(AIO_enableMod) exitWith {}; 0 = [] execVM "AIO_AIMENU\postInit.sqf"; 0 = [1] execVM "AIO_AIMENU\zeus.sqf"; 0 = [] execVM "AIO_AIMENU\createHCmodule.sqf"; diff --git a/addons/AIO_AIMENU/postInit.sqf b/addons/AIO_AIMENU/postInit.sqf index 3fab5d6..936d222 100644 --- a/addons/AIO_AIMENU/postInit.sqf +++ b/addons/AIO_AIMENU/postInit.sqf @@ -22,7 +22,7 @@ AIO_nearPlane = []; AIO_nearHeli = []; AIO_nearcargo = []; AIO_rearmTargets = []; -AIO_copyExactStance = AIO_useExactStanceCopy; +AIO_copyExactStance = AIO_useExactCopyStance; if (isNil "AIO_unitsToHoldFire") then {AIO_unitsToHoldFire = []}; if (isNil "AIO_dismissedUnits") then {AIO_dismissedUnits = []}; if (isNil "AIO_recruitedUnits") then {AIO_recruitedUnits = []}; diff --git a/addons/AIO_AIMENU/switchseat.sqf b/addons/AIO_AIMENU/switchseat.sqf index a531759..b97d36b 100644 --- a/addons/AIO_AIMENU/switchseat.sqf +++ b/addons/AIO_AIMENU/switchseat.sqf @@ -3,122 +3,153 @@ _grp = _this select 0; _vehrole = _this select 1; _unit = _grp select 0; _veh = vehicle _unit; -if (_vehrole == 1) then { - _unit action ["movetoDriver", _veh]; - if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToDriver";}; - _unitrole = assignedVehicleRole _unit; - _unitrole1 = _unitrole select 0; - if (_unitrole1 != "Driver") then { - if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; - _driver = driver vehicle _unit; - moveOut _unit; - if (!isNull _driver) then { - moveOut _driver; - _text = format["%3 moveIn%1 %2", _unitrole1, _text, _driver]; - call compile _text; - }; - _unit moveInDriver _veh; - }; +_moveInFnc = +{ + params ["_unit","_unitrole1", "_vehSeat"]; + if (_unitrole1 == "Cargo") then {_unit moveInCargo _vehSeat}; + if (_unitrole1 == "Turret") then {_unit moveInTurret _vehSeat}; + if (_unitrole1 == "Driver") then {_unit moveInDriver _vehSeat}; + if (_unitrole1 == "Commander") then {_unit moveInCommander _vehSeat}; + if (_unitrole1 == "Gunner") then {_unit moveInGunner _vehSeat}; }; -if (_vehrole == 2) then { - private _switched = false; - if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToCommander";}; - private _numcopilot = count(allTurrets [_veh, true]); - private _numcommander = count(fullCrew [_veh, "commander", true]); - if (_numcopilot!=0) then { - _unit action ["moveToTurret", _veh, [0]]; +switch (_vehrole) do { + case 1: + { + _unit action ["movetoDriver", _veh]; + if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToDriver";}; _unitrole = assignedVehicleRole _unit; _unitrole1 = _unitrole select 0; - if (_unitrole1 != "Turret") then { - if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; - _driver = ((fullCrew [_veh, "Turret", true]) select 0) select 0; + if (_unitrole1 != "Driver") then { + _driver = driver (vehicle _unit); moveOut _unit; if !(isNull _driver) then { moveOut _driver; - _text = format["%3 movein%1 %2", _unitrole1, _text, _driver]; - call compile _text; - }; - _unit moveInTurret [_veh, [0]]; - }; - _switched = true; - }; - if (_numcommander!=0 && !(_switched)) then { - _unit action ["moveToCommander", _veh]; - _unitrole = assignedVehicleRole _unit; - _unitrole1 = _unitrole select 0; - if (_unitrole1 != "Commander") then { - if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; - _driver = Commander vehicle _unit; - moveOut _unit; - if (!isNull _driver) then { - moveOut _driver; - _text = format["%3 moveIn%1 %2", _unitrole1, _text, _driver]; - call compile _text; + if (count _unitrole == 2 && _unitrole1 != "Cargo") then { + [_driver, _unitrole1, [_veh, (_unitrole select 1)]] call _moveInFnc; + } else { + [_driver, _unitrole1, _veh] call _moveInFnc; + }; }; _unit moveInDriver _veh; }; - - }; -}; -if (_vehrole == 3) then { - private _switched = false; - if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToGunner";}; - private _turretPaths = allTurrets [_veh, true]; - if (count(fullCrew [_veh, "Gunner", true])!=0) then { - _unit action ["movetogunner", _veh]; - _unitrole = assignedVehicleRole _unit; - _unitrole1 = _unitrole select 0; - if (_unitrole1 != "Gunner") then { - if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; - _driver = gunner vehicle _unit; - moveOut _unit; - if !(isNull _driver) then { - moveOut _driver; - _text = format["%3 movein%1 %2", _unitrole1, _text, _driver]; - call compile _text; - }; - _unit moveInGunner _veh; }; - _switched = true; - }; - _unitrole = assignedVehicleRole _unit; - if (!(_switched) && (count _turretPaths > 1)) then { - for "_i" from 1 to (count _turretPaths -1) do { - sleep 0.5; - if !((_turretPaths select _i) in _unitrole OR _switched) then { - _unit action ["moveToTurret", _veh, (_turretPaths select _i)]; - _unitrole = assignedVehicleRole _unit; - _unitrole1 = _unitrole select 0; - if (_unitrole1 != "Turret") then { - if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; - _driver = ((fullCrew [_veh, "Turret", true]) select _i) select 0; - moveOut _unit; - if !(isNull _driver) then { - moveOut _driver; - _text = format["%3 movein%1 %2", _unitrole1, _text, _driver]; - call compile _text; + + case 2: + { + private _switched = false; + if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToCommander";}; + private _numcopilot = count(allTurrets [_veh, true]); + private _numcommander = count(fullCrew [_veh, "commander", true]); + if (_numcopilot!=0) then { + _unit action ["moveToTurret", _veh, [0]]; + _unitrole = assignedVehicleRole _unit; + _unitrole1 = _unitrole select 0; + if (_unitrole1 != "Turret") then { + if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; + _driver = ((fullCrew [_veh, "Turret", true]) select 0) select 0; + moveOut _unit; + if !(isNull _driver) then { + moveOut _driver; + if (count _unitrole == 2 && _unitrole1 != "Cargo") then { + [_driver, _unitrole1, [_veh, (_unitrole select 1)]] call _moveInFnc; + } else { + [_driver, _unitrole1, _veh] call _moveInFnc; }; - _unit moveInTurret [_veh, (_turretPaths select _i)]; + }; + _unit moveInTurret [_veh, [0]]; }; _switched = true; + }; + if (_numcommander!=0 && !(_switched)) then { + _unit action ["moveToCommander", _veh]; + _unitrole = assignedVehicleRole _unit; + _unitrole1 = _unitrole select 0; + if (_unitrole1 != "Commander") then { + if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; + _driver = Commander (vehicle _unit); + moveOut _unit; + if !(isNull _driver) then { + moveOut _driver; + if (count _unitrole == 2 && _unitrole1 != "Cargo") then { + [_driver, _unitrole1, [_veh, (_unitrole select 1)]] call _moveInFnc; + } else { + [_driver, _unitrole1, _veh] call _moveInFnc; + }; }; + _unit moveInDriver _veh; + }; + }; + }; + case 3: + { + private _switched = false; + if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToGunner";}; + private _turretPaths = allTurrets [_veh, true]; + if (count(fullCrew [_veh, "Gunner", true])!=0) then { + _unit action ["movetogunner", _veh]; + _unitrole = assignedVehicleRole _unit; + _unitrole1 = _unitrole select 0; + if (_unitrole1 != "Gunner") then { + if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; + _driver = gunner (vehicle _unit); + moveOut _unit; + if !(isNull _driver) then { + moveOut _driver; + if (count _unitrole == 2 && _unitrole1 != "Cargo") then { + [_driver, _unitrole1, [_veh, (_unitrole select 1)]] call _moveInFnc; + } else { + [_driver, _unitrole1, _veh] call _moveInFnc; + }; + }; + _unit moveInGunner _veh; }; -}; - -if (_vehrole == 4) then { - _unit action ["MovetoCargo", _veh, 0]; - if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToCargo";}; - _unitrole = assignedVehicleRole _unit; - _unitrole1 = _unitrole select 0; - if (_unitrole1 != "Cargo") then { - moveOut _unit; - _unit moveInCargo _veh; + _switched = true; }; - if (vehicle _unit == _unit) then { - if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; - _text = format["%3 movein%1 %2", _unitrole1, _text, _unit]; - call compile _text; - } -}; + _unitrole = assignedVehicleRole _unit; + if (!(_switched) && (count _turretPaths > 1)) then { + for "_i" from 1 to (count _turretPaths -1) do { + sleep 0.5; + if !((_turretPaths select _i) in _unitrole OR _switched) then { + _unit action ["moveToTurret", _veh, (_turretPaths select _i)]; + _unitrole = assignedVehicleRole _unit; + _unitrole1 = _unitrole select 0; + if (_unitrole1 != "Turret") then { + if (count _unitrole == 2 && _unitrole1 != "Cargo") then {_text = format["[%1, %2]", _veh, (_unitrole select 1)]} else {_text = format["%1", _veh]}; + _driver = ((fullCrew [_veh, "Turret", true]) select _i) select 0; + moveOut _unit; + if !(isNull _driver) then { + moveOut _driver; + if (count _unitrole == 2 && _unitrole1 != "Cargo") then { + [_driver, _unitrole1, [_veh, (_unitrole select 1)]] call _moveInFnc; + } else { + [_driver, _unitrole1, _veh] call _moveInFnc; + }; + }; + _unit moveInTurret [_veh, (_turretPaths select _i)]; + }; + _switched = true; + }; + }; + }; + }; + case 4: + { + _unit action ["MovetoCargo", _veh, 0]; + if (_unit != player && AIO_useVoiceChat) then {player groupRadio "SentCmdSwitchToCargo";}; + _unitrole = assignedVehicleRole _unit; + _unitrole1 = _unitrole select 0; + if (_unitrole1 != "Cargo") then { + moveOut _unit; + _unit moveInCargo _veh; + }; + if (vehicle _unit == _unit) then { + if (count _unitrole == 2 && _unitrole1 != "Cargo") then { + [_unit, _unitrole1, [_veh, (_unitrole select 1)]] call _moveInFnc; + } else { + [_unit, _unitrole1, _veh] call _moveInFnc; + }; + } + }; +};