Code Cleanup Interaction

This commit is contained in:
commy2 2015-09-28 14:35:05 +02:00
parent af24428363
commit 4b536425b1
12 changed files with 137 additions and 119 deletions

View File

@ -83,6 +83,8 @@
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); ["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler);
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler);
if (isServer) then { if (isServer) then {
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler); ["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);

View File

@ -1,3 +1,4 @@
class ACE_Settings { class ACE_Settings {
class GVAR(EnableTeamManagement) { class GVAR(EnableTeamManagement) {
value = 1; value = 1;

View File

@ -1,6 +1,5 @@
class ACE_ZeusActions { class ACE_ZeusActions {
// _target = curatorLogic
// curatorSelected = [objects,groups,waypoints,markers]
class ZeusUnits { class ZeusUnits {
displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa";
@ -29,12 +28,14 @@ class ACE_ZeusActions {
statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);";
}; };
}; };
class remoteControl { class remoteControl {
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa"; icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa";
statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];"; statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];";
}; };
}; };
class ZeusGroups { class ZeusGroups {
displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa";
@ -67,6 +68,7 @@ class ACE_ZeusActions {
statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);";
}; };
}; };
class speed { class speed {
displayName = "$STR_HC_Menu_Speed"; displayName = "$STR_HC_Menu_Speed";
@ -86,6 +88,7 @@ class ACE_ZeusActions {
statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);"; statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);";
}; };
}; };
class formation { class formation {
displayName = "$STR_Formation"; displayName = "$STR_Formation";
@ -136,6 +139,7 @@ class ACE_ZeusActions {
}; };
}; };
}; };
class ZeusWaypoints { class ZeusWaypoints {
displayName = "Waypoints"; displayName = "Waypoints";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa";
@ -168,6 +172,7 @@ class ACE_ZeusActions {
statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);"; statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);";
}; };
}; };
class speed { class speed {
displayName = "$STR_HC_Menu_Speed"; displayName = "$STR_HC_Menu_Speed";
@ -187,6 +192,7 @@ class ACE_ZeusActions {
statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);"; statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);";
}; };
}; };
class formation { class formation {
displayName = "$STR_Formation"; displayName = "$STR_Formation";
@ -237,6 +243,7 @@ class ACE_ZeusActions {
}; };
}; };
}; };
class ZeusMarkers { class ZeusMarkers {
displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip"; displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa";

View File

@ -1,6 +1,7 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) ); init = QUOTE(call COMPILE_FILE(XEH_preInit));
}; };
}; };

View File

@ -1,3 +1,4 @@
class CfgVehicles { class CfgVehicles {
class ACE_Module; class ACE_Module;
class ACE_ModuleInteraction: ACE_Module { class ACE_ModuleInteraction: ACE_Module {
@ -8,6 +9,7 @@ class CfgVehicles {
scope = 2; scope = 2;
isGlobal = 1; isGlobal = 1;
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
class Arguments { class Arguments {
class EnableTeamManagement { class EnableTeamManagement {
displayName = CSTRING(EnableTeamManagement_DisplayName); displayName = CSTRING(EnableTeamManagement_DisplayName);
@ -16,6 +18,7 @@ class CfgVehicles {
defaultValue = 1; defaultValue = 1;
}; };
}; };
class ModuleDescription { class ModuleDescription {
description = CSTRING(Module_Description); description = CSTRING(Module_Description);
}; };
@ -77,7 +80,6 @@ class CfgVehicles {
priority = 2.1; priority = 2.1;
hotkey = "Y"; hotkey = "Y";
}; };
class ACE_UnassignTeam { class ACE_UnassignTeam {
displayName = CSTRING(LeaveTeam); displayName = CSTRING(LeaveTeam);
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'});
@ -98,7 +100,6 @@ class CfgVehicles {
icon = PATHTOF(UI\team\team_management_ca.paa); icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "J"; hotkey = "J";
}; };
class ACE_GetDown { class ACE_GetDown {
displayName = CSTRING(GetDown); displayName = CSTRING(GetDown);
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
@ -121,6 +122,7 @@ class CfgVehicles {
priority = 2.5; priority = 2.5;
}; };
}; };
class ACE_Torso { class ACE_Torso {
displayName = CSTRING(Torso); displayName = CSTRING(Torso);
selection = "spine3"; selection = "spine3";
@ -170,7 +172,6 @@ class CfgVehicles {
condition = ""; condition = "";
statement = ""; statement = "";
}; };
class ACE_TapShoulderRight { class ACE_TapShoulderRight {
displayName = CSTRING(TapShoulder); displayName = CSTRING(TapShoulder);
selection = "rightshoulder"; selection = "rightshoulder";
@ -238,7 +239,6 @@ class CfgVehicles {
icon = PATHTOF(UI\team\team_yellow_ca.paa); icon = PATHTOF(UI\team\team_yellow_ca.paa);
hotkey = "Y"; hotkey = "Y";
}; };
class ACE_LeaveTeam { class ACE_LeaveTeam {
displayName = CSTRING(LeaveTeam); displayName = CSTRING(LeaveTeam);
condition = QUOTE(assignedTeam _player != 'MAIN'); condition = QUOTE(assignedTeam _player != 'MAIN');
@ -405,6 +405,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Passengers { class ACE_Passengers {
displayName = CSTRING(Passengers); displayName = CSTRING(Passengers);
@ -414,6 +415,7 @@ class CfgVehicles {
}; };
}; };
}; };
class Tank: LandVehicle { class Tank: LandVehicle {
class ACE_Actions { class ACE_Actions {
class ACE_MainActions { class ACE_MainActions {
@ -429,6 +431,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Passengers { class ACE_Passengers {
displayName = CSTRING(Passengers); displayName = CSTRING(Passengers);
@ -455,6 +458,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Passengers { class ACE_Passengers {
displayName = CSTRING(Passengers); displayName = CSTRING(Passengers);
@ -464,6 +468,7 @@ class CfgVehicles {
}; };
}; };
}; };
class Plane: Air { class Plane: Air {
class ACE_Actions { class ACE_Actions {
class ACE_MainActions { class ACE_MainActions {
@ -479,6 +484,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Passengers { class ACE_Passengers {
displayName = CSTRING(Passengers); displayName = CSTRING(Passengers);
@ -501,7 +507,7 @@ class CfgVehicles {
class ACE_Push { class ACE_Push {
displayName = CSTRING(Push); displayName = CSTRING(Push);
distance = 6; distance = 6;
condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3}); condition = QUOTE(getMass _target <= 2600 && {alive _target} && {vectorMagnitude velocity _target < 3});
statement = QUOTE(_this call FUNC(push)); statement = QUOTE(_this call FUNC(push));
showDisabled = 0; showDisabled = 0;
priority = -1; priority = -1;
@ -514,6 +520,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Passengers { class ACE_Passengers {
displayName = CSTRING(Passengers); displayName = CSTRING(Passengers);
@ -539,6 +546,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Passengers { class ACE_Passengers {
displayName = CSTRING(Passengers); displayName = CSTRING(Passengers);
@ -551,6 +559,7 @@ class CfgVehicles {
class StaticMGWeapon: StaticWeapon {}; class StaticMGWeapon: StaticWeapon {};
class HMG_01_base_F: StaticMGWeapon {}; class HMG_01_base_F: StaticMGWeapon {};
class HMG_01_high_base_F: HMG_01_base_F { class HMG_01_high_base_F: HMG_01_base_F {
class ACE_Actions: ACE_Actions { class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions { class ACE_MainActions: ACE_MainActions {
@ -558,6 +567,7 @@ class CfgVehicles {
}; };
}; };
}; };
class AA_01_base_F: StaticMGWeapon { class AA_01_base_F: StaticMGWeapon {
class ACE_Actions: ACE_Actions { class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions { class ACE_MainActions: ACE_MainActions {
@ -565,6 +575,7 @@ class CfgVehicles {
}; };
}; };
}; };
class AT_01_base_F: StaticMGWeapon { class AT_01_base_F: StaticMGWeapon {
class ACE_Actions: ACE_Actions { class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions { class ACE_MainActions: ACE_MainActions {
@ -581,6 +592,7 @@ class CfgVehicles {
selection = ""; selection = "";
distance = 2; distance = 2;
condition = "true"; condition = "true";
class ACE_OpenBox { class ACE_OpenBox {
displayName = CSTRING(OpenBox); displayName = CSTRING(OpenBox);
condition = QUOTE(alive _target); condition = QUOTE(alive _target);
@ -590,6 +602,7 @@ class CfgVehicles {
}; };
}; };
}; };
class ACE_SelfActions {}; class ACE_SelfActions {};
}; };
@ -602,6 +615,7 @@ class CfgVehicles {
condition = "true"; condition = "true";
}; };
}; };
class ACE_SelfActions {}; class ACE_SelfActions {};
}; };
}; };

View File

@ -1,3 +1,4 @@
#define HSPACE 0.5-2.0/16/2 #define HSPACE 0.5-2.0/16/2
#define VSPACE 0.5-0.3/9/2 #define VSPACE 0.5-0.3/9/2
@ -44,13 +45,15 @@ class ACE_Interaction_Button_Base {
class RscListbox; class RscListbox;
class IGUIBack; class IGUIBack;
class RscText; class RscText;
#define X_OFFSET 0.2 #define X_OFFSET 0.2
class RscACE_SelectAnItem { class RscACE_SelectAnItem {
idd = 8854; idd = 8854;
movingEnable = 0; movingEnable = 0;
class controls { class controls {
class back:IGUIBack { class back: IGUIBack {
x = X_OFFSET; x = X_OFFSET;
y = 0; y = 0;
w = 0.6; w = 0.6;
@ -66,7 +69,7 @@ class RscACE_SelectAnItem {
style = 0x02; style = 0x02;
text = ""; text = "";
}; };
class itemList:RscListBox { class itemList: RscListBox {
onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick";
idc = 8866; idc = 8866;
x = X_OFFSET + 0.005; x = X_OFFSET + 0.005;
@ -139,18 +142,21 @@ class RscInteractionIcon: RscPicture {
w = 2*GUI_GRID_H; w = 2*GUI_GRID_H;
h = 2*GUI_GRID_H; h = 2*GUI_GRID_H;
}; };
class RscInteractionHelperIcon: RscInteractionIcon { class RscInteractionHelperIcon: RscInteractionIcon {
x = 20 * GUI_GRID_W; x = 20 * GUI_GRID_W;
y = 16 * GUI_GRID_H; y = 16 * GUI_GRID_H;
w = GUI_GRID_H; w = GUI_GRID_H;
h = GUI_GRID_H; h = GUI_GRID_H;
}; };
class RscInteractionText: RscText{ class RscInteractionText: RscText{
x = 21 * GUI_GRID_W; x = 21 * GUI_GRID_W;
y = 16 * GUI_GRID_H; y = 16 * GUI_GRID_H;
w = 8 * GUI_GRID_W; w = 8 * GUI_GRID_W;
h = 1.5 * GUI_GRID_H; h = 1.5 * GUI_GRID_H;
}; };
class RscTitles { class RscTitles {
class GVAR(InteractionHelper) { class GVAR(InteractionHelper) {
idd = 9930; idd = 9930;

View File

@ -1,37 +1,22 @@
// by commy2 and esteldunedain // by commy2 and esteldunedain
#include "script_component.hpp" #include "script_component.hpp"
ACE_Modifier = 0; ACE_Modifier = 0;
//SelectLeader Event Handler for BecomeLeader action:
[QGVAR(selectLeader), {
PARAMS_2(_group,_leader);
_group selectLeader _leader;
}] call EFUNC(common,addEventHandler);
//Pushing boats from FUNC(push)
[QGVAR(pushBoat), {
params ["_boat", "_newVelocity"];
_boat setVelocity _newVelocity;
}] call EFUNC(common,addEventHandler);
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
GVAR(isOpeningDoor) = false; GVAR(isOpeningDoor) = false;
// restore global fire teams for JIP // restore global fire teams for JIP
private ["_team"]; private "_team";
{ {
_team = _x getVariable [QGVAR(assignedFireTeam), ""]; _team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team}; if (_team != "") then {_x assignTeam _team};
} forEach allUnits; false
} count allUnits;
// add keybinds
// Add keybinds ["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), {
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor),
{
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific // Conditions: specific
@ -40,18 +25,16 @@ private ["_team"];
// Statement // Statement
call EFUNC(interaction,openDoor); call EFUNC(interaction,openDoor);
true true
}, }, {
{
//Probably don't want any condidtions here, so variable never gets locked down //Probably don't want any condidtions here, so variable never gets locked down
// Statement // Statement
GVAR(isOpeningDoor) = false; GVAR(isOpeningDoor) = false;
true true
}, },
[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space [57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), ["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), {
{
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific // Conditions: specific
@ -62,10 +45,9 @@ private ["_team"];
true true
}, },
{false}, {false},
[20, [true, false, false]], false] call cba_fnc_addKeybind; [20, [true, false, false]], false] call CBA_fnc_addKeybind;
["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), ["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), {
{
// Conditions: canInteract // Conditions: canInteract
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed //if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
@ -73,13 +55,12 @@ private ["_team"];
ACE_Modifier = 1; ACE_Modifier = 1;
// Return false so it doesn't block other actions // Return false so it doesn't block other actions
false false
}, }, {
{
//Probably don't want any condidtions here, so variable never gets locked down //Probably don't want any condidtions here, so variable never gets locked down
ACE_Modifier = 0; ACE_Modifier = 0;
false; false;
}, },
[29, [false, false, false]], false] call cba_fnc_addKeybind; [29, [false, false, false]], false] call CBA_fnc_addKeybind;
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);

View File

@ -14,6 +14,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "Menu_Config.hpp" #include "RscTitles.hpp"
#include "ACE_Settings.hpp" #include "ACE_Settings.hpp"
#include "ACE_ZeusActions.hpp" #include "ACE_ZeusActions.hpp"

View File

@ -1,13 +1,13 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
* Mount unit actions inside passenger submenu * Mount unit actions inside passenger submenu.
* *
* Arguments: * Arguments:
* 0: Vehicle <OBJECT> * 0: Vehicle <OBJECT>
* 1: Player <OBJECT> * 1: Player <OBJECT>
* 3: Parameters <ARRAY> * 3: Parameters <ARRAY>
* *
* Return value: * Return Value:
* Children actions <ARRAY> * Children actions <ARRAY>
* *
* Example: * Example:
@ -17,8 +17,8 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); params ["", "", "_parameters"];
EXPLODE_1_PVT(_parameters,_unit); _parameters params ["_unit"];
private ["_varName", "_actionTrees", "_actions"]; private ["_varName", "_actionTrees", "_actions"];
@ -26,11 +26,13 @@ _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
_actionTrees = missionNamespace getVariable [_varName, []]; _actionTrees = missionNamespace getVariable [_varName, []];
_actions = []; _actions = [];
// Mount unit MainActions menu
// Mount unit MainActions menu
{ {
EXPLODE_2_PVT(_x,_actionData,_children); _x params ["_actionData", "_children"];
_actions pushBack [_actionData, _children, _unit]; _actions pushBack [_actionData, _children, _unit];
} forEach ((_actionTrees select 0) select 1); false
} count (_actionTrees select 0 select 1);
_actions _actions

View File

@ -1,6 +1,6 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
* Create one action per passenger * Create one action per passenger.
* *
* Arguments: * Arguments:
* 0: Vehicle <OBJECT> * 0: Vehicle <OBJECT>
@ -17,39 +17,43 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); params ["_vehicle", "_player"];
private ["_actions"]; private "_actions";
_actions = []; _actions = [];
{ {
private ["_unit", "_icon"]; private ["_unit", "_icon"];
_unit = _x; _unit = _x;
if ((_unit != _player) && {(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"}) then {
_icon = switch _unit do { if (_unit != _player && {getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation") != "UAVPilot"}) then {
case (driver _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa) }; _icon = [
case (gunner _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa) }; "",
case (commander _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa) }; "A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa",
default { "" }; "A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
}; "A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa"
] select (([driver _vehicle, gunner _vehicle, commander _vehicle] find _unit) + 1);
if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then { if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then {
_icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa)); _icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa));
}; };
_actions pushBack
_actions pushBack [
[ [
[ format ["%1", _unit],
str(_unit),
[_unit, true] call EFUNC(common,getName), [_unit, true] call EFUNC(common,getName),
_icon, _icon,
{}, {},
{true}, {true},
{_this call FUNC(addPassengerActions);}, {_this call FUNC(addPassengerActions)},
[_unit] [_unit]
] call EFUNC(interact_menu,createAction), ] call EFUNC(interact_menu,createAction),
[], [],
_unit _unit
]; ];
}; };
} forEach crew _vehicle; false
} count crew _vehicle;
_actions _actions

View File

@ -4,7 +4,7 @@
* *
* Arguments: * Arguments:
* 0: Target <OBJECT> * 0: Target <OBJECT>
* 1: Player <OBJECT> * 1: Unit <OBJECT>
* *
* Return Value: * Return Value:
* None * None
@ -16,6 +16,6 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_target,_player); params ["_target", "_unit"];
[QGVAR(selectLeader), (units group _player), [(group _player), _player]] call EFUNC(common,targetEvent); ["selectLeader", units group _unit, [group _unit, _unit]] call EFUNC(common,targetEvent);

View File

@ -4,7 +4,7 @@
* *
* Arguments: * Arguments:
* 0: Boat <OBJECT> * 0: Boat <OBJECT>
* 1: Player <OBJECT> * 1: Unit <OBJECT>
* *
* Return Value: * Return Value:
* None * None
@ -14,13 +14,13 @@
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_boat", "_player"]; params ["_boat", "_unit"];
private ["_newVelocity"]; private "_newVelocity";
_newVelocity = vectorDir _unit;
_newVelocity set [2, 0.25];
_newVelocity = _newVelocity vectorMultiply 2;
_newVelocity = [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]; ["setVelocity", [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent);
[QGVAR(pushBoat), [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent);