From 25f613b7125b8e3b1cec25fd6002e26ad929e607 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Thu, 4 Jun 2015 23:11:35 +0100 Subject: [PATCH 1/8] Initial implementation of static zeus menu --- addons/interact_menu/ACE_ZeusActions.hpp | 43 +++++++++ addons/interact_menu/XEH_clientInit.sqf | 8 ++ addons/interact_menu/XEH_preInit.sqf | 4 + addons/interact_menu/config.cpp | 2 + .../functions/fnc_compileMenuZeus.sqf | 94 +++++++++++++++++++ .../interact_menu/functions/fnc_keyDown.sqf | 3 +- .../functions/fnc_renderActionPoints.sqf | 42 +++++++-- .../functions/fnc_renderBaseMenu.sqf | 2 +- 8 files changed, 187 insertions(+), 11 deletions(-) create mode 100644 addons/interact_menu/ACE_ZeusActions.hpp create mode 100644 addons/interact_menu/functions/fnc_compileMenuZeus.sqf diff --git a/addons/interact_menu/ACE_ZeusActions.hpp b/addons/interact_menu/ACE_ZeusActions.hpp new file mode 100644 index 0000000000..ea5be4505c --- /dev/null +++ b/addons/interact_menu/ACE_ZeusActions.hpp @@ -0,0 +1,43 @@ +class ACE_ZeusActions { + class ZeusUnits { + displayName = "Units"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeunits_ca.paa"; + }; + class ZeusGroups { + displayName = "Groups"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modegroups_ca.paa"; + + class behaviour { + displayName = "Behaviour"; + + class aware { + displayName = "Aware"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; + statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);"; + }; + class combat { + displayName = "Combat"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; + statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);"; + }; + class safe { + displayName = "Safe"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; + statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);"; + }; + class stealth { + displayName = "Stealth"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; + statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; + }; + }; + }; + class ZeusWaypoints { + displayName = "Waypoints"; + icon = "\A3\UI_F_Curator\Data\CfgCurator\waypoint_ca.paa"; + }; + class ZeusMarkers { + displayName = "Markers"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modemarkers_ca.paa"; + }; +}; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index f6c712a668..99e9ad1a2a 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -72,3 +72,11 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);}; if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; }] call EFUNC(common,addEventHandler); + +// Let key work with zeus open (not perfect, enables all added hotkeys in zeus interface rather than only menu) +["zeusDisplayChanged",{ + if (_this select 1) then { + (finddisplay 312) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (finddisplay 312) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 1620349468..1539f8e2aa 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -6,6 +6,7 @@ PREP(addActionToClass); PREP(addActionToObject); PREP(compileMenu); PREP(compileMenuSelfAction); +PREP(compileMenuZeus); PREP(collectActiveActionTree); PREP(createAction); PREP(ctrlSetParsedTextCached); @@ -75,4 +76,7 @@ GVAR(lastTimeSearchedActions) = -1000; ["CAManBase"] call FUNC(compileMenu); ["CAManBase"] call FUNC(compileMenuSelfAction); +// Init zeus menu +[] call FUNC(compileMenuZeus); + ADDON = true; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index c1da3392e9..9ec0b75ebd 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -23,3 +23,5 @@ class CfgPatches { class ACE_Extensions { extensions[] += {"ace_break_line"}; }; + +#include "ACE_ZeusActions.hpp" diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf new file mode 100644 index 0000000000..9dc212ac40 --- /dev/null +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -0,0 +1,94 @@ +/* + * Author: SilentSpike + * Compile the zeus action menu (only to be done once) + * + * Argument: + * nil + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp"; + +// Exit if the action menu is already compiled for zeus +if !(isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {}; + +private "_recurseFnc"; +_recurseFnc = { + private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; + EXPLODE_1_PVT(_this,_actionsCfg); + _actions = []; + + { + _entryCfg = _x; + if(isClass _entryCfg) then { + _displayName = getText (_entryCfg >> "displayName"); + + _icon = getText (_entryCfg >> "icon"); + _statement = compile (getText (_entryCfg >> "statement")); + + _condition = getText (_entryCfg >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _insertChildren = compile (getText (_entryCfg >> "insertChildren")); + _modifierFunction = compile (getText (_entryCfg >> "modifierFunction")); + + _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; + _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; + _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; + _runOnHover = true; + if (isText (_entryCfg >> "runOnHover")) then { + _runOnHover = compile getText (_entryCfg >> "runOnHover"); + } else { + _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; + }; + + _condition = compile _condition; + _children = [_entryCfg] call _recurseFnc; + + _entry = [ + [ + configName _entryCfg, + _displayName, + _icon, + _statement, + _condition, + _insertChildren, + {}, + [0,0,0], + 10, //distace + [_showDisabled,_enableInside,_canCollapse,_runOnHover], + _modifierFunction + ], + _children + ]; + _actions pushBack _entry; + }; + } forEach (configProperties [_actionsCfg, "isClass _x", true]); + _actions +}; + +private ["_actionsCfg"]; +_actionsCfg = configFile >> "ACE_ZeusActions"; + +// Create a master action to base zeus actions on +GVAR(ZeusActions) = [ + [ + [ + "ACE_ZeusActions", + localize LSTRING(ZeusActionsRoot), + "\A3\Ui_F_Curator\Data\Logos\arma3_zeus_icon_ca.paa", + {true}, + {true}, + {}, + {}, + {[0,0,0]}, + 10, + [false,true,false] + ], + [_actionsCfg] call _recurseFnc + ] +]; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 50e911c878..2928953c81 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -34,6 +34,7 @@ GVAR(ParsedTextCached) = []; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || visibleMap || + (!isNull curatorCamera) || {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} || {(_menuType == 0) && GVAR(AlwaysUseCursorInteraction)}; @@ -46,7 +47,7 @@ for "_i" from 0 to (count GVAR(iconCtrls))-1 do { GVAR(iconCtrls) resize GVAR(iconCount); if (GVAR(useCursorMenu)) then { - (findDisplay 46) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// + (findDisplay ([312,46] select (isNull curatorCamera))) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; // The dialog sets: diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 707c3a3349..ca4bdbc037 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -118,24 +118,48 @@ _fnc_renderSelfActions = { } forEach _classActions; }; +_fnc_renderZeusActions = { + _target = _this; + + // Iterate through zeus actions, find base level actions and render them if appropiate + _pos = if !(GVAR(useCursorMenu)) then { + _virtualPoint = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition); + _wavesAtOrigin = [(positionCameraToWorld [0, 0, 0])] call EFUNC(common,waveHeightAt); + _wavesAtVirtualPoint = [_virtualPoint] call EFUNC(common,waveHeightAt); + _virtualPoint set [2, ((_virtualPoint select 2) - _wavesAtOrigin + _wavesAtVirtualPoint)]; + _virtualPoint + } else { + [0.5, 0.5] + }; + + { + _action = _x; + [_target, _action, _pos] call FUNC(renderBaseMenu); + } forEach GVAR(ZeusActions); +}; + GVAR(collectedActionPoints) resize 0; // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { - - if (vehicle ACE_player == ACE_player) then { - if (ACE_diagTime > GVAR(lastTimeSearchedActions) + 0.20) then { - // Once every 0.2 secs, collect nearby objects active and visible action points and render them - call _fnc_renderNearbyActions; + if (isNull curatorCamera) then { + if (vehicle ACE_player == ACE_player) then { + if (ACE_diagTime > GVAR(lastTimeSearchedActions) + 0.20) then { + // Once every 0.2 secs, collect nearby objects active and visible action points and render them + call _fnc_renderNearbyActions; + } else { + // The rest of the frames just draw the same action points rendered the last frame + call _fnc_renderLastFrameActions; + }; } else { - // The rest of the frames just draw the same action points rendered the last frame - call _fnc_renderLastFrameActions; + // Render vehicle self actions when in vehicle + (vehicle ACE_player) call _fnc_renderSelfActions; }; } else { - (vehicle ACE_player) call _fnc_renderSelfActions; + // Render zeus actions when zeus open + (getAssignedCuratorLogic player) call _fnc_renderZeusActions; }; - } else { ACE_player call _fnc_renderSelfActions; }; diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 5ee698b547..a844930a7c 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -36,7 +36,7 @@ _pos = if((count _this) > 2) then { }; // For non-self actions, exit if the action is too far away or ocluded -if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && +if (GVAR(openedMenuType) == 0 && (vehicle ACE_player == ACE_player) && (isNull curatorCamera) && { private ["_headPos","_actualDistance"]; _headPos = ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"); From 8a4b4a7e0c71500ea625d5bffac4f962e898fd4f Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Fri, 5 Jun 2015 18:37:29 +0100 Subject: [PATCH 2/8] Added a bunch of basic actions --- addons/interact_menu/ACE_ZeusActions.hpp | 256 +++++++++++++++++++++-- addons/interact_menu/stringtable.xml | 3 + 2 files changed, 244 insertions(+), 15 deletions(-) diff --git a/addons/interact_menu/ACE_ZeusActions.hpp b/addons/interact_menu/ACE_ZeusActions.hpp index ea5be4505c..0c9eae8566 100644 --- a/addons/interact_menu/ACE_ZeusActions.hpp +++ b/addons/interact_menu/ACE_ZeusActions.hpp @@ -1,43 +1,269 @@ class ACE_ZeusActions { + // _target = curatorLogic + // curatorSelected = [objects,groups,waypoints,markers] + class ZeusUnits { - displayName = "Units"; - icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeunits_ca.paa"; + displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; + + class remoteControl { + displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; + 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,''];"; + }; + class stance { + displayName = "$STR_A3_RscAttributeUnitPos_Title"; + + class limited { + displayName = "$STR_A3_RscAttributeUnitPos_Down_tooltip"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa"; + statement = "{_x setUnitPos 'DOWN';} forEach (curatorSelected select 0);"; + }; + class normal { + displayName = "$STR_A3_RscAttributeUnitPos_Crouch_tooltip"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa"; + statement = "{_x setUnitPos 'MIDDLE';} forEach (curatorSelected select 0);"; + }; + class full { + displayName = "$STR_A3_RscAttributeUnitPos_Up_tooltip"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa"; + statement = "{_x setUnitPos 'UP';} forEach (curatorSelected select 0);"; + }; + class auto { + displayName = "$STR_A3_RscAttributeUnitPos_Auto_tooltip"; + icon = "\A3\UI_F_Curator\Data\default_ca.paa"; + statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; + }; + }; }; class ZeusGroups { - displayName = "Groups"; - icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modegroups_ca.paa"; + displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; class behaviour { - displayName = "Behaviour"; + displayName = "$STR_disp_arcwp_semaphore"; + class careless { + displayName = "$STR_careless"; + statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);"; + }; + class safe { + displayName = "$STR_safe"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; + statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);"; + }; class aware { - displayName = "Aware"; + displayName = "$STR_aware"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);"; }; class combat { - displayName = "Combat"; + displayName = "$STR_combat"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);"; }; - class safe { - displayName = "Safe"; - icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; - statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);"; - }; class stealth { - displayName = "Stealth"; + displayName = "$STR_stealth"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; }; }; + class speed { + displayName = "$STR_disp_arcwp_speed"; + + class limited { + displayName = "$STR_speed_limited"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; + statement = "{_x setSpeedMode 'LIMITED';} forEach (curatorSelected select 1);"; + }; + class normal { + displayName = "$STR_speed_normal"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; + statement = "{_x setSpeedMode 'NORMAL';} forEach (curatorSelected select 1);"; + }; + class full { + displayName = "$STR_speed_full"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; + statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);"; + }; + }; + class stance { + displayName = "$STR_A3_RscAttributeUnitPos_Title"; + + class limited { + displayName = "$STR_A3_RscAttributeUnitPos_Down_tooltip"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa"; + statement = "{ {_x setUnitPos 'DOWN'} forEach (units _x); } forEach (curatorSelected select 1);"; + }; + class normal { + displayName = "$STR_A3_RscAttributeUnitPos_Crouch_tooltip"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa"; + statement = "{ {_x setUnitPos 'MIDDLE'} forEach (units _x); } forEach (curatorSelected select 1);"; + }; + class full { + displayName = "$STR_A3_RscAttributeUnitPos_Up_tooltip"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa"; + statement = "{ {_x setUnitPos 'UP'} forEach (units _x); } forEach (curatorSelected select 1);"; + }; + class auto { + displayName = "$STR_A3_RscAttributeUnitPos_Auto_tooltip"; + icon = "\A3\UI_F_Curator\Data\default_ca.paa"; + statement = "{ {_x setUnitPos 'AUTO'} forEach (units _x); } forEach (curatorSelected select 1);"; + }; + }; + class formation { + displayName = "$STR_disp_arcwp_form"; + + class wedge { + displayName = "$STR_wedge"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; + statement = "{_x setFormation 'WEDGE';} forEach (curatorSelected select 1);"; + }; + class vee { + displayName = "$STR_vee"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; + statement = "{_x setFormation 'VEE';} forEach (curatorSelected select 1);"; + }; + class line { + displayName = "$STR_line"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; + statement = "{_x setFormation 'LINE';} forEach (curatorSelected select 1);"; + }; + class column { + displayName = "$STR_column"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; + statement = "{_x setFormation 'COLUMN';} forEach (curatorSelected select 1);"; + }; + class file { + displayName = "$STR_file"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; + statement = "{_x setFormation 'FILE';} forEach (curatorSelected select 1);"; + }; + class stag_column { + displayName = "$STR_staggered"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; + statement = "{_x setFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + }; + class ech_left { + displayName = "$STR_echl"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; + statement = "{_x setFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + }; + class ech_right { + displayName = "$STR_echr"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; + statement = "{_x setFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + }; + class diamond { + displayName = "$STR_diamond"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; + statement = "{_x setFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + }; + }; }; class ZeusWaypoints { displayName = "Waypoints"; icon = "\A3\UI_F_Curator\Data\CfgCurator\waypoint_ca.paa"; + + class behaviour { + displayName = "$STR_disp_arcwp_semaphore"; + + class careless { + displayName = "$STR_careless"; + statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);"; + }; + class safe { + displayName = "$STR_safe"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; + statement = "{ _x setWaypointBehaviour 'SAFE'; } forEach (curatorSelected select 2);"; + }; + class aware { + displayName = "$STR_aware"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; + statement = "{ _x setWaypointBehaviour 'AWARE'; } forEach (curatorSelected select 2);"; + }; + class combat { + displayName = "$STR_combat"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; + statement = "{ _x setWaypointBehaviour 'COMBAT'; } forEach (curatorSelected select 2);"; + }; + class stealth { + displayName = "$STR_stealth"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; + statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);"; + }; + }; + class speed { + displayName = "$STR_disp_arcwp_speed"; + + class limited { + displayName = "$STR_speed_limited"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; + statement = "{ _x setWaypointSpeed 'LIMITED'; } forEach (curatorSelected select 2);"; + }; + class normal { + displayName = "$STR_speed_normal"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; + statement = "{ _x setWaypointSpeed 'NORMAL'; } forEach (curatorSelected select 2);"; + }; + class full { + displayName = "$STR_speed_full"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; + statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);"; + }; + }; + class formation { + displayName = "$STR_disp_arcwp_form"; + + class wedge { + displayName = "$STR_wedge"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; + statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 1);"; + }; + class vee { + displayName = "$STR_vee"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; + statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 1);"; + }; + class line { + displayName = "$STR_line"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; + statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 1);"; + }; + class column { + displayName = "$STR_column"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; + statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 1);"; + }; + class file { + displayName = "$STR_file"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; + statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 1);"; + }; + class stag_column { + displayName = "$STR_staggered"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; + statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + }; + class ech_left { + displayName = "$STR_echl"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; + statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + }; + class ech_right { + displayName = "$STR_echr"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; + statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + }; + class diamond { + displayName = "$STR_diamond"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; + statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + }; + }; }; class ZeusMarkers { - displayName = "Markers"; - icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modemarkers_ca.paa"; + displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa"; }; }; diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index 880edc3c71..f589a8c1da 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -85,6 +85,9 @@ Interazioni con veicoli Ações de Veículos + + Zeus Actions + Interaction - Text Max Interakcja - Tekst max From 5cc6abd49a25565c1ee9747f370c0a6949780a29 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 6 Jun 2015 16:20:22 +0100 Subject: [PATCH 3/8] Open menu over zeus inerface --- addons/interact_menu/functions/fnc_keyDown.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 2928953c81..cef1239278 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -47,7 +47,12 @@ for "_i" from 0 to (count GVAR(iconCtrls))-1 do { GVAR(iconCtrls) resize GVAR(iconCount); if (GVAR(useCursorMenu)) then { - (findDisplay ([312,46] select (isNull curatorCamera))) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// + // Don't close zeus interface if open + if (isNull curatorCamera) then { + (findDisplay 46) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// + } else { + createDialog QGVAR(cursorMenu); + }; (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; // The dialog sets: From 822dd11ec617afbf71332b23f7faeba0e9b7a84b Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 6 Jun 2015 17:33:13 +0100 Subject: [PATCH 4/8] Moved base ACE_ZeusActions to ace_interaction --- addons/interact_menu/config.cpp | 2 -- .../ACE_ZeusActions.hpp | 27 +++++++++---------- addons/interaction/config.cpp | 1 + addons/interaction/stringtable.xml | 12 +++++++++ 4 files changed, 26 insertions(+), 16 deletions(-) rename addons/{interact_menu => interaction}/ACE_ZeusActions.hpp (96%) diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 9ec0b75ebd..c1da3392e9 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -23,5 +23,3 @@ class CfgPatches { class ACE_Extensions { extensions[] += {"ace_break_line"}; }; - -#include "ACE_ZeusActions.hpp" diff --git a/addons/interact_menu/ACE_ZeusActions.hpp b/addons/interaction/ACE_ZeusActions.hpp similarity index 96% rename from addons/interact_menu/ACE_ZeusActions.hpp rename to addons/interaction/ACE_ZeusActions.hpp index 0c9eae8566..913e7a7c85 100644 --- a/addons/interact_menu/ACE_ZeusActions.hpp +++ b/addons/interaction/ACE_ZeusActions.hpp @@ -1,16 +1,10 @@ class ACE_ZeusActions { // _target = curatorLogic // curatorSelected = [objects,groups,waypoints,markers] - class ZeusUnits { displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; - class remoteControl { - displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; - 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,''];"; - }; class stance { displayName = "$STR_A3_RscAttributeUnitPos_Title"; @@ -35,16 +29,21 @@ class ACE_ZeusActions { statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; }; }; + class remoteControl { + displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; + 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,''];"; + }; }; class ZeusGroups { displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; class behaviour { - displayName = "$STR_disp_arcwp_semaphore"; + displayName = CSTRING(Zeus_Behaviour); class careless { - displayName = "$STR_careless"; + displayName = CSTRING(Zeus_Behaviour_careless); statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);"; }; class safe { @@ -69,7 +68,7 @@ class ACE_ZeusActions { }; }; class speed { - displayName = "$STR_disp_arcwp_speed"; + displayName = CSTRING(Zeus_Speed); class limited { displayName = "$STR_speed_limited"; @@ -112,7 +111,7 @@ class ACE_ZeusActions { }; }; class formation { - displayName = "$STR_disp_arcwp_form"; + displayName = CSTRING(Zeus_Formation); class wedge { displayName = "$STR_wedge"; @@ -166,10 +165,10 @@ class ACE_ZeusActions { icon = "\A3\UI_F_Curator\Data\CfgCurator\waypoint_ca.paa"; class behaviour { - displayName = "$STR_disp_arcwp_semaphore"; + displayName = CSTRING(Zeus_Behaviour); class careless { - displayName = "$STR_careless"; + displayName = CSTRING(Zeus_Behaviour_careless); statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);"; }; class safe { @@ -194,7 +193,7 @@ class ACE_ZeusActions { }; }; class speed { - displayName = "$STR_disp_arcwp_speed"; + displayName = CSTRING(Zeus_Speed); class limited { displayName = "$STR_speed_limited"; @@ -213,7 +212,7 @@ class ACE_ZeusActions { }; }; class formation { - displayName = "$STR_disp_arcwp_form"; + displayName = CSTRING(Zeus_Formation); class wedge { displayName = "$STR_wedge"; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 7a68b2c12a..0afb2fc0fe 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -16,3 +16,4 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "Menu_Config.hpp" #include "ACE_Settings.hpp" +#include "ACE_ZeusActions.hpp" diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index a1dad1a8e0..b06d0b1e9c 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -816,5 +816,17 @@ Na zarządzanie drużyną składa się: przydział kolorów dla członków drużyny, przejmowanie dowodzenia, dołączanie/opuszczanie drużyn. Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe. + + Behaviour + + + Careless + + + Formation + + + Speed Mode + From 85a281d5869ab7f512de9bf9bfea4ef2b143b415 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 6 Jun 2015 17:41:24 +0100 Subject: [PATCH 5/8] Fixed random missing english string --- addons/interaction/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index b06d0b1e9c..9e743d2cb4 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -812,7 +812,7 @@ Sollen Spieler das Gruppenverwaltungsmenü verwenden dürfen? Standard: Ja - + Team management allows color allocation for team members, taking team command and joining/leaving teams. Na zarządzanie drużyną składa się: przydział kolorów dla członków drużyny, przejmowanie dowodzenia, dołączanie/opuszczanie drużyn. Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe. From cb1b0c6262ccb2d4ae8800381163165d5c3f1c51 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 7 Jun 2015 20:21:51 +0100 Subject: [PATCH 6/8] Added zeus exception for interaction conditions --- addons/interact_menu/XEH_clientInit.sqf | 4 ---- addons/interact_menu/functions/fnc_keyDown.sqf | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 99e9ad1a2a..02bc94688c 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -30,8 +30,6 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; ["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [0] call FUNC(keyDown) },{[0,false] call FUNC(keyUp)}, @@ -39,8 +37,6 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; ["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [1] call FUNC(keyDown) },{[1,false] call FUNC(keyUp)}, diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index cef1239278..6533f0785f 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -16,6 +16,11 @@ EXPLODE_1_PVT(_this,_menuType); if (GVAR(openedMenuType) == _menuType) exitWith {true}; +// Conditions: canInteract (these don't apply to zeus) +if ((isNull curatorCamera) && { + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) +}) exitWith {false}; + while {dialog} do { closeDialog 0; }; From 246d303943c30ec4203c3076be571c814795f314 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 8 Jun 2015 13:00:03 +0100 Subject: [PATCH 7/8] menuClosed event before variable clearing --- addons/interact_menu/functions/fnc_keyUp.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 6f1d00276f..02e2d4db01 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -46,6 +46,8 @@ if(GVAR(actionSelected)) then { }; }; +["interactMenuClosed", [GVAR(openedMenuType)]] call EFUNC(common,localEvent); + GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(openedMenuType) = -1; @@ -54,6 +56,4 @@ GVAR(expanded) = false; GVAR(lastPath) = []; GVAR(menuDepthPath) = []; -["interactMenuClosed", [GVAR(openedMenuType)]] call EFUNC(common,localEvent); - true From f19320419512e617566e7588775b5aa2a4c596f0 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 8 Jun 2015 13:12:27 +0100 Subject: [PATCH 8/8] Simplify the renderZeus code --- .../functions/fnc_renderActionPoints.sqf | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index ca4bdbc037..8ca7f8aa33 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -119,22 +119,9 @@ _fnc_renderSelfActions = { }; _fnc_renderZeusActions = { - _target = _this; - - // Iterate through zeus actions, find base level actions and render them if appropiate - _pos = if !(GVAR(useCursorMenu)) then { - _virtualPoint = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition); - _wavesAtOrigin = [(positionCameraToWorld [0, 0, 0])] call EFUNC(common,waveHeightAt); - _wavesAtVirtualPoint = [_virtualPoint] call EFUNC(common,waveHeightAt); - _virtualPoint set [2, ((_virtualPoint select 2) - _wavesAtOrigin + _wavesAtVirtualPoint)]; - _virtualPoint - } else { - [0.5, 0.5] - }; - { _action = _x; - [_target, _action, _pos] call FUNC(renderBaseMenu); + [_this, _action, [0.5, 0.5]] call FUNC(renderBaseMenu); } forEach GVAR(ZeusActions); };