From 2a9f4d779da6f3f9d25a132fa233d8cb6efe23fd Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 03:09:26 +0200 Subject: [PATCH 1/6] Lowercased beginning of function names --- .../{fnc_AddSelectableItem.sqf => fnc_addSelectableItem.sqf} | 0 .../interaction/functions/{fnc_MoveDown.sqf => fnc_moveDown.sqf} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename addons/interaction/functions/{fnc_AddSelectableItem.sqf => fnc_addSelectableItem.sqf} (100%) rename addons/interaction/functions/{fnc_MoveDown.sqf => fnc_moveDown.sqf} (100%) diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf similarity index 100% rename from addons/interaction/functions/fnc_AddSelectableItem.sqf rename to addons/interaction/functions/fnc_addSelectableItem.sqf diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf similarity index 100% rename from addons/interaction/functions/fnc_MoveDown.sqf rename to addons/interaction/functions/fnc_moveDown.sqf From 50d5e845ee517ca28d10393adfe6cf399d8ea0f3 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 03:12:28 +0200 Subject: [PATCH 2/6] Lowercased beginning of functions pt2 --- addons/interaction/functions/fnc_moveDown.sqf | 4 ++-- addons/interaction/functions/fnc_openMenuSelectUI.sqf | 2 +- addons/interaction/functions/fnc_prepareSelectMenu.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf index eac30e4008..3b7a7074e9 100644 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -11,8 +11,8 @@ Nothing Example: - 1 call FUNC(MoveDown); - -1 call FUNC(MoveDown); + 1 call FUNC(moveDown); + -1 call FUNC(moveDown); */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index a13fa6a9f0..55eaba6423 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -26,7 +26,7 @@ _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_In [_x] call EFUNC(common,getName), QUOTE(PATHTOF(UI\dot_ca.paa)), _forEachIndex - ] call FUNC(AddSelectableItem); + ] call FUNC(addSelectableItem); }; } forEach _cargo; diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index 593f0d4c47..34a1bfea5b 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -9,7 +9,7 @@ 1: TEXT - Approve button text Returns: - ARRAY/NUMBER - container object for use with AddSelectableItem. + ARRAY/NUMBER - container object for use with addSelectableItem. Example: ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); From 2ff372e2a1f56801935340684018dbd4c68a870c Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 04:47:15 +0200 Subject: [PATCH 3/6] Function headers per Coding Guidelines for Interaction --- .../functions/fnc_addPassengerActions.sqf | 5 +- .../functions/fnc_addPassengersActions.sqf | 7 ++- .../functions/fnc_addSelectableItem.sqf | 34 ++++++------- .../functions/fnc_applyButtons.sqf | 17 ++++++- .../functions/fnc_canBecomeLeader.sqf | 4 +- .../functions/fnc_canInteractWithCivilian.sqf | 19 +++++-- .../functions/fnc_canJoinGroup.sqf | 17 ++++++- .../interaction/functions/fnc_canJoinTeam.sqf | 17 ++++++- .../functions/fnc_canTapShoulder.sqf | 18 ++++++- .../functions/fnc_doBecomeLeader.sqf | 4 +- addons/interaction/functions/fnc_getDoor.sqf | 18 ++++++- .../functions/fnc_getDoorAnimations.sqf | 19 ++++++- addons/interaction/functions/fnc_getDown.sqf | 12 +++-- .../functions/fnc_getSelectedButton.sqf | 16 +++++- .../functions/fnc_getWeaponPos.sqf | 5 +- addons/interaction/functions/fnc_hideMenu.sqf | 30 +++++------ .../functions/fnc_hideMouseHint.sqf | 31 ++++++----- .../interaction/functions/fnc_isInRange.sqf | 14 +++-- addons/interaction/functions/fnc_joinTeam.sqf | 17 ++++++- .../functions/fnc_moduleInteraction.sqf | 14 +++-- addons/interaction/functions/fnc_moveDown.sqf | 29 +++++------ .../interaction/functions/fnc_onButtonUp.sqf | 16 +++++- addons/interaction/functions/fnc_onClick.sqf | 16 +++++- .../functions/fnc_onSelectMenuDblClick.sqf | 16 +++++- addons/interaction/functions/fnc_openDoor.sqf | 17 ++++++- .../functions/fnc_openMenuSelectUI.sqf | 51 ++++++++++++------- .../functions/fnc_openSelectMenu.sqf | 45 ++++++++-------- .../functions/fnc_prepareSelectMenu.sqf | 30 +++++------ addons/interaction/functions/fnc_push.sqf | 15 ++++-- .../interaction/functions/fnc_removeTag.sqf | 16 +++++- addons/interaction/functions/fnc_sendAway.sqf | 32 +++++++----- .../functions/fnc_showMouseHint.sqf | 35 +++++++------ .../functions/fnc_sortOptionsByPriority.sqf | 16 +++++- .../interaction/functions/fnc_tapShoulder.sqf | 17 ++++++- .../functions/fnc_updateTooltipPosition.sqf | 18 ++++++- 35 files changed, 490 insertions(+), 197 deletions(-) diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 82e3b3b4fb..f17ca649c2 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Mount unit actions inside passenger submenu * - * Argument: + * Arguments: * 0: Vehicle * 1: Player * 3: Parameters @@ -10,6 +10,9 @@ * Return value: * Children actions * + * Example: + * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengerAction + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index c446be3737..661c43a643 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Create one action per passenger * - * Argument: + * Arguments: * 0: Vehicle * 1: Player * 3: Parameters @@ -10,6 +10,9 @@ * Return value: * Children actions * + * Example: + * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengersActions + * * Public: No */ #include "script_component.hpp" @@ -39,4 +42,4 @@ _actions = []; }; } forEach crew _vehicle; -_actions \ No newline at end of file +_actions diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 498b852635..8f5676b4ca 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -1,21 +1,21 @@ /* - Author: Garth de Wet (LH) - - Description: - Adds an item to the select menu - - Parameters: - 0: ARRAY/NUMBER - List container - 1: String - Display Name - 2: String - Picture - 3: String/code - data - - Returns: - ARRAY/Number - - Example: -*/ - + * Author: Garth de Wet (LH) + * Adds an item to the select menu + * + * Arguments: + * 0: List container + * 1: Display name + * 2: Picture + * 3: Data + * + * Return value: + * Container + * + * Example: + * _array = [_actions, "Banana", "UI\dot_ca.paa", data] call ace_interaction_fnc_addSelectableItem + * + * Public: No + */ #include "script_component.hpp" private ["_container", "_displayName", "_picture", "_data", "_index"]; diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf index be35b34877..5baa158eb5 100644 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -1,5 +1,18 @@ -// by commy2 - +/* + * Author: commy2 + * Applies buttons + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_applyButtons + * + * Public: No + */ #include "script_component.hpp" private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; diff --git a/addons/interaction/functions/fnc_canBecomeLeader.sqf b/addons/interaction/functions/fnc_canBecomeLeader.sqf index 11234ad6d7..0bb555c49a 100644 --- a/addons/interaction/functions/fnc_canBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_canBecomeLeader.sqf @@ -7,10 +7,10 @@ * 1: player * * Return Value: - * + * Able to become leader of group * * Example: - * [player, player] call ace_interaction_fnc_canBecomeLeader + * _bool = [player, player] call ace_interaction_fnc_canBecomeLeader * * Public: No */ diff --git a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf index 6408d66aa8..c89f4c9868 100644 --- a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf +++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf @@ -1,5 +1,18 @@ -// by commy2 - +/* + * Author: commy2 + * Checks if the player can interact with civilian + * + * Arguments: + * 0: Target + * + * Return value: + * Able to interact with civilian + * + * Example: + * _bool = [target] call ace_interaction_fnc_canInteractWithCivilian + * + * Public: No + */ #include "script_component.hpp" EXPLODE_2_PVT(_this,_unit,_isCivilian); @@ -8,4 +21,4 @@ if (isNil "_isCivilian") then {_isCivilian = true}; alive _unit && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian -//&& {count (weapons _unit) == 0} \ No newline at end of file +//&& {count (weapons _unit) == 0} diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index d299524925..26597ca0a0 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Checks if the player can join a group + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to join a group + * + * Example: + * _bool = [player, target] call ace_interaction_fnc_canJoinGroup + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_target"]; diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 45f96393a9..4312981978 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Checks if the player can join a team + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to join a team + * + * Example: + * _bool = [player, target] call ace_interaction_fnc_canJoinTeam + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_target"]; diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index 4ea9836117..2be9bf70a9 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -1,5 +1,19 @@ -// by commy2 - +/* + * Author: commy2 + * Checks if the player can tap a shoulder + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to tap a shoulder + * + * Example: + * _bool = [player, target] call ace_interaction_fnc_canTapShoulder + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_target"]; diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index 24bfa66c11..0fd81cbc96 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -3,8 +3,8 @@ * Become Leader of group * * Arguments: - * 0: target - * 1: player + * 0: Target + * 1: Player * * Return Value: * None diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 91c2161d9f..460a325954 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -1,4 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Get door + * + * Arguments: + * 0: Distance + * + * Return value: + * House objects and door + * 0: House + * 1: Door Name + * + * Example: + * _array = [player, target] call ace_interaction_fnc_getDoor + * + * Public: No + */ #include "script_component.hpp" private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index ca59ec177c..cb0b7122b0 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,4 +1,21 @@ -// by commy2 +/* + * Author: commy2 + * Get door animations + * + * Arguments: + * 0: House + * 1: Door + * + * Return value: + * Animation and Locked variable + * 0: Animation + * 1: Locked variable + * + * Example: + * _array = [target, "door"] call ace_interaction_fnc_getDoorAnimations + * + * Public: No + */ #include "script_component.hpp" private ["_house", "_door", "_animations", "_lockedVariable"]; diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index ead5dcd290..9e7daecb46 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -1,13 +1,17 @@ /* * Author: KoffeinFlummi - * - * Forces a civilian to the ground. (chance of failure). + * Forces a civilian to the ground (with a chance of failure) * * Arguments: - * 0: Unit to be sent away (Object) + * 0: Unit * * Return value: - * none + * None + * + * Example: + * [target] call ace_interaction_fnc_getDown + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_getSelectedButton.sqf b/addons/interaction/functions/fnc_getSelectedButton.sqf index d1c801e1dc..52ba3d67e0 100644 --- a/addons/interaction/functions/fnc_getSelectedButton.sqf +++ b/addons/interaction/functions/fnc_getSelectedButton.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Get selected button + * + * Arguments: + * None + * + * Return value: + * Angle + * + * Example: + * _number = call ace_interaction_fnc_getSelectedButton + * + * Public: No + */ #include "script_component.hpp" #define MIN_DISTANCE 0.0065 diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index 477e74f9bf..35ea202b1d 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -2,12 +2,15 @@ * Author: esteldunedain * Return a suitable position for the action point for the current weapon * - * Argument: + * Arguments: * None * * Return value: * Children actions * + * Example: + * _array = call ace_interaction_fnc_getWeaponPos + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf index 54263ef032..89dc49be40 100644 --- a/addons/interaction/functions/fnc_hideMenu.sqf +++ b/addons/interaction/functions/fnc_hideMenu.sqf @@ -1,22 +1,22 @@ /* - Author: Garth de Wet (LH) - - Description: - Closes the Interaction menu - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call FUNC(hideMenu); -*/ + * Author: Garth de Wet (LH) + * Closes the Interaction menu + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_hideMenu + * + * Public: No + */ #include "script_component.hpp" closeDialog 0; (findDisplay 1713999) closeDisplay 1; (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; GVAR(MainButton) = nil; -call FUNC(hideMouseHint); \ No newline at end of file +call FUNC(hideMouseHint); diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index d910352076..69acba25a2 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -1,22 +1,21 @@ /* - Author(s): - Garth de Wet (LH) - - Description: - Hides the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call FUNC(hideMouseHint); -*/ + * Author: Garth de Wet (LH) + * Hides the interaction helper text with the mouse buttons at the bottom middle of the screen + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_hideMouseHint + * + * Public: No + */ #include "script_component.hpp" if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{}; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -showHUD true; \ No newline at end of file +showHUD true; diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 5048b66001..05677d7060 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -1,14 +1,18 @@ /* * Author: commy2 - * * Check if the vehicle is in range of the player. * - * Argument: - * 0: Vehicke (Object) - * 1: Distance in meters (Number) + * Arguments: + * 0: Vehicle + * 1: Distance in meters * * Return value: - * (Bool) + * Vehicle in range of player + * + * Example: + * _bool = [target, 5] call ace_interaction_fnc_isInRange + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 2e4d1f2898..cf6889d90a 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Assigns a unit to the team + * + * Arguments: + * 0: Unit + * 1: Team + * + * Return value: + * None + * + * Example: + * [target, "YELLOW"] call ace_interaction_fnc_joinTeam + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_team", "_message"]; diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 37b7bacba5..925847c028 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -1,13 +1,19 @@ /* * Author: bux578 - * - * Initializes the Interaction module. + * Initializes the Interaction module * * Arguments: - * Whatever the module provides. (I dunno.) + * 0: Logic + * 1: ??? + * 2: Activation State * - * Return Value: + * Return value: * None + * + * Example: + * [logic, ???, activationState] call ace_interaction_fnc_moduleInteraction + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf index 3b7a7074e9..eb946a5f10 100644 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -1,19 +1,18 @@ /* - Author: Garth de Wet (LH) - - Description: - Depending on the passed value, either scrolls down through the list or up. - - Parameters: - NUMBER - Amount to increase current interaction target - - Returns: - Nothing - - Example: - 1 call FUNC(moveDown); - -1 call FUNC(moveDown); -*/ + * Author: Garth de Wet (LH) + * Scrolls through the list down or up + * + * Arguments: + * 0: Amount + * + * Return value: + * None + * + * Example: + * [2] call ace_interaction_fnc_moveDown + * + * Public: No + */ #include "script_component.hpp" #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index cee524c55f..151ce67c98 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * On button up + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_onButtonUp + * + * Public: No + */ #include "script_component.hpp" private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 29fffb8b94..6f9882281f 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * On click + * + * Arguments: + * Index + * + * Return value: + * None + * + * Example: + * 5 call ace_interaction_fnc_onClick + * + * Public: No + */ #include "script_component.hpp" private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; diff --git a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf index 25d307a2eb..18b69ba40d 100644 --- a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf +++ b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf @@ -1,4 +1,18 @@ -// by CorruptedHeart, commy2 +/* + * Author: CorruptedHeart, commy2 + * On select menu double click + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_onSelectMenuDblClick + * + * Public: No + */ #include "script_component.hpp" call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index e175e752cb..3e776f3538 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Opens door + * + * Arguments: + * 0: House + * 1: Door + * + * Return value: + * None + * + * Example: + * [house, "door"] call ace_interaction_fnc_openDoor + * + * Public: No + */ #include "script_component.hpp" private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index 55eaba6423..e755869ed1 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Opens menu select UI + * + * Arguments: + * 0: Unit + * 1: Vehicle + * + * Return value: + * None + * + * Example: + * [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_vehicle", "_cargo"]; @@ -20,25 +35,25 @@ _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_In // prepare: add all cargo units as options to select menu { - if (_x != _unit) then { - _actions = [ - _actions, - [_x] call EFUNC(common,getName), - QUOTE(PATHTOF(UI\dot_ca.paa)), - _forEachIndex - ] call FUNC(addSelectableItem); - }; + if (_x != _unit) then { + _actions = [ + _actions, + [_x] call EFUNC(common,getName), + QUOTE(PATHTOF(UI\dot_ca.paa)), + _forEachIndex + ] call FUNC(addSelectableItem); + }; } forEach _cargo; // open select menu [ - _actions, - { - call FUNC(hideMenu); - [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); - GVAR(InteractionMenu_Crew) = nil; - }, - { - call FUNC(hideMenu); - } + _actions, + { + call FUNC(hideMenu); + [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); + GVAR(InteractionMenu_Crew) = nil; + }, + { + call FUNC(hideMenu); + } ] call FUNC(openSelectMenu); diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index de5459f88c..13e02fb044 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -1,26 +1,27 @@ /* - Author: Garth de Wet (LH) - - Description: - Opens the select menu UI and sets up the UI - - Parameters: - 0: ARRAY - items - ARRAY - 0 = Text - 1 = statement to execute - 2 = condition before execute - 3 = showDisabled - 4 = priority - 5 = icon - 6 = extra variables. Passed to the code. - 1: Code - select action - 2: Code - Cancel Action - Returns: - Nothing - - Example: -*/ + * Author: Garth de Wet (LH) + * Opens the select menu UI and sets up the UI + * + * Arguments: + * 0: Items + * 0: Text + * 1: Statement to execute + * 2: Condition before execute + * 3: showDisabled + * 4: Priority + * 5: Icon + * 6: Extra variables passed to the code + * 1: Select Action + * 2: Cancel Action + * + * Return value: + * None + * + * Example: + * [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu + * + * Public: No + */ #include "script_component.hpp" if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index 34a1bfea5b..f43ec75c4e 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -1,19 +1,19 @@ /* - Author: Garth de Wet (LH) - - Description: - Prepares the select menu for use. - - Parameters: - 0: TEXT - Header text - 1: TEXT - Approve button text - - Returns: - ARRAY/NUMBER - container object for use with addSelectableItem. - - Example: - ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); -*/ + * Author: Garth de Wet (LH) + * Prepares the select menu for use + * + * Arguments: + * 0: Header Text + * 1: Approve Button Text + * + * Return value: + * Container object + * + * Example: + * _array = ["Select Explosive", "Place"] call ace_interaction_fnc_prepareSelectMenu + * + * Public: No + */ #include "script_component.hpp" private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index f52a9d40de..580f687f64 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -1,22 +1,27 @@ /* * Author: KoffeinFlummi - * - * Pushes a boat away from the player. + * Pushes a boat away from the player * * Arguments: - * 0: Boat (object) - * 1: Velocity (vectorlike array) + * 0: Boat + * 1: Velocity * * Return Value: * None + * + * Example: + * [target, [vector]] call ace_interaction_fnc_push + * + * Public: No */ + #include "script_component.hpp" _boat = _this select 0; _velocity = _this select 1; if !(local _boat) exitWith { - [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); + [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); }; _boat setVelocity _velocity; diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index 0894520149..d1a16bf88b 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Removes tag + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_removeTag + * + * Public: No + */ #include "script_component.hpp" 0 spawn { diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 5cd6a9d43a..1a48725644 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -1,14 +1,18 @@ /* * Author: KoffeinFlummi - * - * Sends a civilian crowd away (chance of failure). + * Sends a civilian crowd away with a chance of failure * * Arguments: - * 0: Unit to be sent away (Object) + * 0: Unit * * Return value: - * none -*/ + * None + * + * Example: + * [target] call ace_interaction_fnc_sendAway + * + * Public: No + */ #include "script_component.hpp" #define DISTANCE 50 @@ -21,16 +25,16 @@ _unit = _this select 0; ACE_player playActionNow "GestureGo"; if (count weapons ACE_player > 0) then { - _chance = 0.8; + _chance = 0.8; } else { - _chance = 0.5; + _chance = 0.5; }; { - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - (_this select 0) setUnitPos "AUTO"; - (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; - }, [_x, ACE_player]] call CBA_fnc_globalExecute; - }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); + if (count (weapons _unit) == 0 and random 1 < _chance) then { + [-2, { + (_this select 0) setUnitPos "AUTO"; + (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; + }, [_x, ACE_player]] call CBA_fnc_globalExecute; + }; +} forEach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 5cb96a0eae..a64114d009 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -1,21 +1,20 @@ /* - Author(s): - Garth de Wet (LH) - - Description: - Shows the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - 0: STRING - Left click text - 1: STRING - Right click text - 3: STRING - (Optional) Scroll text - - Returns: - Nothing - - Example: - ["Place Explosive", "Cancel"] call FUNC(showMouseHint); -*/ + * Author: Garth de Wet (LH) + * Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + * + * Arguments: + * 0: Left Click Text + * 1: Right Click Text + * 2: Scroll Text (Optional) + * + * Return value: + * None + * + * Example: + * ["Place Explosive", "Cancel"] call ace_interaction_fnc_showMouseHint + * + * Public: No + */ #include "script_component.hpp" #define GUI_GRID_W (0.025) @@ -51,4 +50,4 @@ if (_scroll == "") exitWith { (_display displayCtrl 1201) ctrlCommit 0; }; (_display displayCtrl 1002) ctrlSetText _scroll; -showHUD false; \ No newline at end of file +showHUD false; diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf index 28daa4e7e5..ce4c714d79 100644 --- a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf +++ b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Sort options by priority + * + * Arguments: + * Actions + * + * Return value: + * None + * + * Example: + * _customActions call ace_interaction_fnc_sortOptionsByPriority + * + * Public: No + */ #include "script_component.hpp" private ["_actions", "_count", "_index", "_actionN", "_actionM"]; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 11fc6b7881..f18c9c2c30 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Taps a shoulder + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * None + * + * Example: + * [player, target] call ace_interaction_fnc_tapShoulder + * + * Public: No + */ #include "script_component.hpp" EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index 27148c5aa3..c194102b41 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -1,4 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Updates tooltip's position + * + * Arguments: + * 0: Tooltip Display + * 1: X Coordinate + * 2: Y Coordinate + * + * Return value: + * None + * + * Example: + * [player, 0.5, 0.5] call ace_interaction_fnc_updateTooltipPosition + * + * Public: No + */ #include "script_component.hpp" disableSerialization; From e9abd8c27a423c65aa39fd1ba18014f394194d60 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 04:55:41 +0200 Subject: [PATCH 4/6] Fixed lowercasing, improved examples --- addons/interaction/functions/fnc_addPassengerActions.sqf | 2 +- addons/interaction/functions/fnc_addPassengersActions.sqf | 2 +- addons/interaction/functions/fnc_addSelectableItem.sqf | 2 +- addons/interaction/functions/fnc_canBecomeLeader.sqf | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index f17ca649c2..4474378bcc 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -11,7 +11,7 @@ * Children actions * * Example: - * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengerAction + * _array = [target, player, [params]] call ace_interaction_fnc_addPassengerAction * * Public: No */ diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 661c43a643..d1565f8d9a 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -11,7 +11,7 @@ * Children actions * * Example: - * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengersActions + * _array = [target, player, [params]] call ace_interaction_fnc_addPassengersActions * * Public: No */ diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 8f5676b4ca..6f1339d25a 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -12,7 +12,7 @@ * Container * * Example: - * _array = [_actions, "Banana", "UI\dot_ca.paa", data] call ace_interaction_fnc_addSelectableItem + * _array = [_actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem * * Public: No */ diff --git a/addons/interaction/functions/fnc_canBecomeLeader.sqf b/addons/interaction/functions/fnc_canBecomeLeader.sqf index 0bb555c49a..c79f879525 100644 --- a/addons/interaction/functions/fnc_canBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_canBecomeLeader.sqf @@ -3,8 +3,8 @@ * Test if can Become Leader of group * * Arguments: - * 0: target - * 1: player + * 0: Target + * 1: Player * * Return Value: * Able to become leader of group From 633e94a1141766c8947ac1ae5103a6bbed744305 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 22:14:00 +0200 Subject: [PATCH 5/6] CBA Macros to Interaction functions --- .../functions/fnc_addPassengerActions.sqf | 4 ++-- .../functions/fnc_addSelectableItem.sqf | 8 ++------ .../interaction/functions/fnc_canJoinGroup.sqf | 5 +---- addons/interaction/functions/fnc_canJoinTeam.sqf | 5 +---- .../interaction/functions/fnc_canTapShoulder.sqf | 5 +---- addons/interaction/functions/fnc_getDoor.sqf | 5 +++-- .../functions/fnc_getDoorAnimations.sqf | 5 ++--- addons/interaction/functions/fnc_getDown.sqf | 6 +++--- .../interaction/functions/fnc_getWeaponPos.sqf | 2 +- addons/interaction/functions/fnc_isInRange.sqf | 5 ++--- addons/interaction/functions/fnc_joinTeam.sqf | 5 ++--- .../functions/fnc_moduleInteraction.sqf | 2 ++ addons/interaction/functions/fnc_moveDown.sqf | 2 ++ addons/interaction/functions/fnc_onButtonUp.sqf | 4 +--- addons/interaction/functions/fnc_onClick.sqf | 3 +-- addons/interaction/functions/fnc_openDoor.sqf | 8 +++----- .../functions/fnc_openMenuSelectUI.sqf | 16 +++++++--------- .../interaction/functions/fnc_openSelectMenu.sqf | 9 ++++++--- .../functions/fnc_prepareSelectMenu.sqf | 7 ++++--- addons/interaction/functions/fnc_push.sqf | 3 +-- addons/interaction/functions/fnc_removeTag.sqf | 2 ++ addons/interaction/functions/fnc_sendAway.sqf | 4 ++-- .../interaction/functions/fnc_showMouseHint.sqf | 12 ++++++------ addons/interaction/functions/fnc_tapShoulder.sqf | 2 +- .../functions/fnc_updateTooltipPosition.sqf | 8 +++++--- 25 files changed, 63 insertions(+), 74 deletions(-) diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 4474378bcc..914edeed28 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -18,9 +18,9 @@ #include "script_component.hpp" EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); +EXPLODE_1_PVT(_parameters,_unit); -private ["_unit","_actions"]; -_unit = _parameters select 0; +private ["_varName", "_actionTrees", "_actions"]; _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; _actionTrees = missionNamespace getVariable [_varName, []]; diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 6f1339d25a..4875ba2c97 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -18,17 +18,13 @@ */ #include "script_component.hpp" -private ["_container", "_displayName", "_picture", "_data", "_index"]; - -_container = _this select 0; -_displayName = _this select 1; -_picture = _this select 2; -_data = _this select 3; +PARAMS_4(_container,_displayName,_picture,_data); if (_picture == "" || _picture == "PictureThing") then { _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); }; +private ["_index"]; _index = lbAdd [_container, _displayName]; lbSetData [_container, _index, str _data]; lbSetPicture [_container, _index, _picture]; diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index 26597ca0a0..33b4623c4c 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -16,10 +16,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 4312981978..ba894c7a13 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -16,10 +16,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index 2be9bf70a9..1b48d3280d 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -16,10 +16,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); _target isKindOf "CAManBase" && {alive _target} && diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 460a325954..fdf1447828 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -17,9 +17,9 @@ */ #include "script_component.hpp" -private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; +PARAMS_1(_distance); -_distance = _this select 0; +private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"]; _position0 = positionCameraToWorld [0, 0, 0]; _position1 = positionCameraToWorld [0, 0, _distance]; @@ -38,4 +38,5 @@ _intersections = [_house, "GEOM"] intersect [_position0, _position1]; _door = _intersections select 0 select 0; if (isNil "_door") exitWith {[_house, ""]}; + [_house, _door] diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index cb0b7122b0..6f85ef644b 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -18,10 +18,9 @@ */ #include "script_component.hpp" -private ["_house", "_door", "_animations", "_lockedVariable"]; +PARAMS_2(_house,_door); -_house = _this select 0; -_door = _this select 1; +private ["_index", "_animations", "_lockedVariable"]; _index = [ "door_1", diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index 9e7daecb46..09d651eadf 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -17,9 +17,9 @@ #define RADIUS 10 -private ["_unit", "_chance", "_x"]; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_chance", "_x"]; ACE_player playActionNow "GestureGo"; // put something else here. @@ -35,4 +35,4 @@ if (count (weapons ACE_player) > 0) then { _this setUnitPos "DOWN"; }, _x] call CBA_fnc_globalExecute; }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); +} forEach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index 35ea202b1d..1e3c8b32ec 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_target); -private ["_weaponDir","_refSystem"]; +private ["_weaponDir", "_refSystem"]; _weaponDir = _target weaponDirection currentWeapon _target; _refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 05677d7060..490ddf05e5 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_distance", "_player"]; +PARAMS_2(_vehicle,_distance); -_vehicle = _this select 0; -_distance = _this select 1; +private ["_player", "_position0", "_position1"]; _player = ACE_player; diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index cf6889d90a..cd2ea8c880 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -private ["_unit", "_team", "_message"]; +PARAMS_2(_unit,_team); -_unit = _this select 0; -_team = _this select 1; +private ["_message"]; _unit setVariable [QGVAR(assignedFireTeam), _team, true]; [_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 925847c028..bd02093aa0 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -17,6 +17,8 @@ */ #include "script_component.hpp" +private ["_logic", "_activated"]; + _logic = _this select 0; _activated = _this select 2; diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf index eb946a5f10..f2e675b256 100644 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +private ["_count", "_player", "_vehicle", "_dlgInteractionDialog", "_top", "_i", "", "_ctrl", "_index", "_action", "_color", "_current", "_infoText"]; + #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) if (isNil QGVAR(MainButton)) exitWith{}; if (isNil QGVAR(Buttons)) exitWith{}; diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index 151ce67c98..da1b55b613 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"]; _player = ACE_player; _vehicle = vehicle _player; @@ -34,11 +34,9 @@ _action = if (_index != -1 && {_index < _count}) then { closeDialog 0; - _statement = _action select 1; _condition = _action select 2; _conditionShow = _action select 7; -_exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 6f9882281f..a240823710 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -14,7 +14,7 @@ * Public: No */ #include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_distance"]; _player = ACE_player; _vehicle = vehicle _player; @@ -43,7 +43,6 @@ if (count _subMenu < 2) then { _statement = _action select 1; _condition = _action select 2; _conditionShow = _action select 7; - _exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 3e776f3538..6b34c49ca9 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -16,19 +16,17 @@ */ #include "script_component.hpp" -private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; +private ["_info", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; _info = [2] call FUNC(getDoor); -_house = _info select 0; -_door = _info select 1; +EXPLODE_2_PVT(_info,_house,_door); if (isNull _house) exitWith {}; _animations = [_house, _door] call FUNC(getDoorAnimations); -_lockedVariable = _animations select 1; -_animations = _animations select 0; +EXPLODE_2_PVT(_animations,_animations,_lockedVariable); if (count _animations == 0) exitWith {}; diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index e755869ed1..e1b6a30df1 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -16,24 +16,22 @@ */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_cargo"]; +PARAMS_2(_unit,_vehicle); -_unit = _this select 0; -_vehicle = _this select 1; +private ["_cargo", "_actions"]; -// allow interaction with all cargo slots and all ffv slots +// Allow interaction with all cargo slots and all FFV slots _cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew); -// you can only interact if you are in cargo or ffv yourself. exit otherwise +// You can only interact if you are in cargo or FFV yourself. exit otherwise if !(_unit in _cargo) exitWith {}; GVAR(InteractionMenu_Crew) = _cargo; -// prepare: add header and "OK" button to select menu -private "_actions"; +// Prepare: add header and "OK" button to select menu _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_Interaction_Interact"] call FUNC(prepareSelectMenu); -// prepare: add all cargo units as options to select menu +// Prepare: add all cargo units as options to select menu { if (_x != _unit) then { _actions = [ @@ -45,7 +43,7 @@ _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_In }; } forEach _cargo; -// open select menu +// Open select menu [ _actions, { diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index 13e02fb044..a12ceefa6c 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -27,11 +27,14 @@ if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { GVAR(SelectAccept) = _this select 1; GVAR(SelectCancel) = _this select 2; - buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel - buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept + buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel + buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept lbSetCurSel [8866, 0]; }else{ - _customActions = _this select 0; + PARAMS_1(_customActions); + + private ["_count", "_action"]; + _count = count _customActions; if (_count == 0) exitWith {}; _customActions call FUNC(sortOptionsByPriority); diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index f43ec75c4e..05b1bc8e35 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -16,13 +16,14 @@ */ #include "script_component.hpp" -private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; +PARAMS_2(_header,_buttonText); + closeDialog 0; -_header = _this select 0; -_buttonText = _this select 1; + if (isNil "_buttonText" or {_buttonText == ""}) then { _buttonText = localize "STR_ACE_Interaction_MakeSelection"; }; + createDialog "RscACE_SelectAnItem"; ctrlSetText [8860, _buttonText]; ctrlSetText [8870, _header]; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index 580f687f64..946a5118be 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -17,8 +17,7 @@ #include "script_component.hpp" -_boat = _this select 0; -_velocity = _this select 1; +PARAMS_2(_boat,_velocity); if !(local _boat) exitWith { [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index d1a16bf88b..b017c203b2 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -16,6 +16,8 @@ #include "script_component.hpp" 0 spawn { + private ["_index"]; + waitUntil {player getVariable ["ACE_Name", ""] != ""}; _name = player getVariable ["ACE_Name", ""]; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 1a48725644..0dd106de08 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -18,9 +18,9 @@ #define DISTANCE 50 #define RADIUS 10 -private ["_unit", "_chance", "_x"]; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_chance", "_x"]; ACE_player playActionNow "GestureGo"; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index a64114d009..e3a9b45f94 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -19,9 +19,10 @@ #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -private ["_leftClick", "_rightClick", "_scroll"]; -_leftClick = _this select 0; -_rightClick = _this select 1; + +private ["_scroll", "_display"]; + +PARAMS_2(_leftClick,_rightClick); _scroll = ""; if (count _this > 2) then { _scroll = _this select 2; @@ -43,9 +44,8 @@ if (isNull _display) exitWith{}; if (_scroll == "") exitWith { (_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1202) ctrlShow false; - - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; (_display displayCtrl 1001) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0; }; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index f18c9c2c30..510fa4497f 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -28,7 +28,7 @@ if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; -private "_message"; +private ["_message"]; //localize is converting the escaped <> symbols, so just add them here instead of in the stringtable if (_shoulderNum == 0) then { _message = format ["%1 >", (localize "STR_ACE_Interaction_YouWereTappedRight")]; diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index c194102b41..27eb36e976 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -17,12 +17,14 @@ */ #include "script_component.hpp" +PARAMS_3(_tooltip,_coordinateX,_coordinateY); + disableSerialization; -_ctrl = ctrlParent (_this select 0) displayCtrl 40; +_ctrl = ctrlParent _tooltip displayCtrl 40; _ctrl ctrlSetPosition [ - (_this select 1) + 0.01 * safezoneW, - (_this select 2) + 0.01 * safezoneH, + _coordinateX + 0.01 * safezoneW, + _coordinateY + 0.01 * safezoneH, 2.0 / 16 * safezoneW, 0.3 / 9 * safezoneH ]; From 1a2e7d0596e0fb2bf7746839882d52aa6f10ed3a Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 22:25:48 +0200 Subject: [PATCH 6/6] Tabs to Spaces, Removed unused GUI class --- addons/interaction/CfgVehicles.hpp | 1084 ++++++++++++++-------------- addons/interaction/Menu_Config.hpp | 324 +++++---- addons/interaction/README.md | 1 - addons/interaction/config.cpp | 30 +- 4 files changed, 716 insertions(+), 723 deletions(-) diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 5548311718..5afaf21c28 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -1,566 +1,564 @@ class CfgVehicles { - - class Module_F; - class ACE_ModuleInteraction: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Interaction System"; - function = "ACE_Interaction_fnc_moduleInteraction"; - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); - class Arguments { - class EnableTeamManagement { - displayName = "Enable Team Management"; - description = "Should players be allowed to use the Team Management Menu? Default: Yes"; - typeName = "BOOL"; - class values { - class Yes { default = 1; name = "Yes"; value = 1;}; - class No { name = "No"; value = 0; }; + class Module_F; + class ACE_ModuleInteraction: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Interaction System"; + function = "ACE_Interaction_fnc_moduleInteraction"; + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); + class Arguments { + class EnableTeamManagement { + displayName = "Enable Team Management"; + description = "Should players be allowed to use the Team Management Menu? Default: Yes"; + typeName = "BOOL"; + class values { + class Yes { default = 1; name = "Yes"; value = 1;}; + class No { name = "No"; value = 0; }; + }; + }; }; - }; - }; - }; - - class Man; - class CAManBase: Man { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - distance = 4; - condition = QUOTE(true); - statement = ""; - icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; - selection = "pelvis"; - - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); - statement = ""; - showDisabled = 0; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; - - class ACE_AssignTeamRed { - displayName = "$STR_ACE_Interaction_AssignTeamRed"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_red_ca.paa); - priority = 2.4; - hotkey = "R"; - }; - class ACE_AssignTeamGreen { - displayName = "$STR_ACE_Interaction_AssignTeamGreen"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_green_ca.paa); - priority = 2.3; - hotkey = "G"; - }; - class ACE_AssignTeamBlue { - displayName = "$STR_ACE_Interaction_AssignTeamBlue"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_blue_ca.paa); - priority = 2.2; - hotkey = "B"; - }; - class ACE_AssignTeamYellow { - displayName = "$STR_ACE_Interaction_AssignTeamYellow"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - priority = 2.1; - hotkey = "Y"; - }; - - class ACE_UnassignTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); - statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_white_ca.paa); - priority = 2.5; - hotkey = "N"; - }; - }; - - class ACE_JoinGroup { - displayName = "$STR_ACE_Interaction_JoinGroup"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); - statement = QUOTE([_player] joinSilent group _target); - showDisabled = 0; - priority = 2.6; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "J"; - }; - - class ACE_GetDown { - displayName = "$STR_ACE_Interaction_GetDown"; - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(getDown)); - showDisabled = 0; - priority = 2.2; - }; - class ACE_SendAway { - displayName = "$STR_ACE_Interaction_SendAway"; - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(sendAway)); - showDisabled = 0; - priority = 2.0; - }; - class ACE_Pardon { - displayName = "$STR_ACE_Interaction_Pardon"; - condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); - statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); - showDisabled = 0; - priority = 2.5; - }; - }; - class ACE_Torso { - displayName = "$STR_ACE_Interaction_Torso"; - selection = "spine3"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_Head { - displayName = "$STR_ACE_Interaction_Head"; - selection = "pilot"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_ArmLeft { - displayName = "$STR_ACE_Interaction_ArmLeft"; - selection = "LeftForeArm"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_ArmRight { - displayName = "$STR_ACE_Interaction_ArmRight"; - selection = "RightForeArm"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_LegLeft { - displayName = "$STR_ACE_Interaction_LegLeft"; - selection = "LKnee"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_LegRight { - displayName = "$STR_ACE_Interaction_LegRight"; - selection = "RKnee"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_Weapon { - displayName = "$STR_ACE_Interaction_Weapon"; - position = QUOTE(call FUNC(getWeaponPos)); - distance = 1.50; - condition = ""; - statement = ""; - }; - - class ACE_TapShoulderRight { - displayName = "$STR_ACE_Interaction_TapShoulder"; - selection = "rightshoulder"; - distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); - statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); - }; - class ACE_TapShoulderLeft { - displayName = "$STR_ACE_Interaction_TapShoulder"; - selection = "leftshoulder"; - distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); - statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); - }; }; - class ACE_SelfActions { - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; - condition = QUOTE(GVAR(EnableTeamManagement)); - exceptions[] = {"isNotInside"}; - statement = ""; - showDisabled = 1; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; + class Man; + class CAManBase: Man { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + distance = 4; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = "pelvis"; - class ACE_JoinTeamRed { - displayName = "$STR_ACE_Interaction_JoinTeamRed"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.4; - icon = PATHTOF(UI\team\team_red_ca.paa); - hotkey = "R"; - }; - class ACE_JoinTeamGreen { - displayName = "$STR_ACE_Interaction_JoinTeamGreen"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.3; - icon = PATHTOF(UI\team\team_green_ca.paa); - hotkey = "G"; - }; - class ACE_JoinTeamBlue { - displayName = "$STR_ACE_Interaction_JoinTeamBlue"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.2; - icon = PATHTOF(UI\team\team_blue_ca.paa); - hotkey = "B"; - }; - class ACE_JoinTeamYellow { - displayName = "$STR_ACE_Interaction_JoinTeamYellow"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - hotkey = "Y"; + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); + statement = ""; + showDisabled = 0; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + + class ACE_AssignTeamRed { + displayName = "$STR_ACE_Interaction_AssignTeamRed"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_red_ca.paa); + priority = 2.4; + hotkey = "R"; + }; + class ACE_AssignTeamGreen { + displayName = "$STR_ACE_Interaction_AssignTeamGreen"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_green_ca.paa); + priority = 2.3; + hotkey = "G"; + }; + class ACE_AssignTeamBlue { + displayName = "$STR_ACE_Interaction_AssignTeamBlue"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_blue_ca.paa); + priority = 2.2; + hotkey = "B"; + }; + class ACE_AssignTeamYellow { + displayName = "$STR_ACE_Interaction_AssignTeamYellow"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + priority = 2.1; + hotkey = "Y"; + }; + + class ACE_UnassignTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); + statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_white_ca.paa); + priority = 2.5; + hotkey = "N"; + }; + }; + + class ACE_JoinGroup { + displayName = "$STR_ACE_Interaction_JoinGroup"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); + statement = QUOTE([_player] joinSilent group _target); + showDisabled = 0; + priority = 2.6; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "J"; + }; + + class ACE_GetDown { + displayName = "$STR_ACE_Interaction_GetDown"; + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([_target] call DFUNC(getDown)); + showDisabled = 0; + priority = 2.2; + }; + class ACE_SendAway { + displayName = "$STR_ACE_Interaction_SendAway"; + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([_target] call DFUNC(sendAway)); + showDisabled = 0; + priority = 2.0; + }; + class ACE_Pardon { + displayName = "$STR_ACE_Interaction_Pardon"; + condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); + statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); + showDisabled = 0; + priority = 2.5; + }; + }; + class ACE_Torso { + displayName = "$STR_ACE_Interaction_Torso"; + selection = "spine3"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_Head { + displayName = "$STR_ACE_Interaction_Head"; + selection = "pilot"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_ArmLeft { + displayName = "$STR_ACE_Interaction_ArmLeft"; + selection = "LeftForeArm"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_ArmRight { + displayName = "$STR_ACE_Interaction_ArmRight"; + selection = "RightForeArm"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_LegLeft { + displayName = "$STR_ACE_Interaction_LegLeft"; + selection = "LKnee"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_LegRight { + displayName = "$STR_ACE_Interaction_LegRight"; + selection = "RKnee"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_Weapon { + displayName = "$STR_ACE_Interaction_Weapon"; + position = QUOTE(call FUNC(getWeaponPos)); + distance = 1.50; + condition = ""; + statement = ""; + }; + + class ACE_TapShoulderRight { + displayName = "$STR_ACE_Interaction_TapShoulder"; + selection = "rightshoulder"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); + statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); + }; + class ACE_TapShoulderLeft { + displayName = "$STR_ACE_Interaction_TapShoulder"; + selection = "leftshoulder"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); + statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); + }; }; - class ACE_LeaveTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; - condition = QUOTE(assignedTeam _player != 'MAIN'); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.5; - icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "N"; - }; - class ACE_BecomeLeader { - displayName = "$STR_ACE_Interaction_BecomeLeader"; - condition = QUOTE(_this call DFUNC(canBecomeLeader)); - exceptions[] = {"isNotInside"}; - statement = QUOTE(_this call DFUNC(doBecomeLeader)); - showDisabled = 1; - priority = 1.0; - icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "L"; - }; - class ACE_LeaveGroup { - displayName = "$STR_ACE_Interaction_LeaveGroup"; - condition = QUOTE(count (units group _player) > 1); - exceptions[] = {"isNotInside"}; - statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); - showDisabled = 1; - priority = 1.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; - }; - }; + class ACE_SelfActions { + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; + condition = QUOTE(GVAR(EnableTeamManagement)); + exceptions[] = {"isNotInside"}; + statement = ""; + showDisabled = 1; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; - class ACE_Gestures { - displayName = "$STR_ACE_Interaction_Gestures"; - condition = "canStand _target"; - statement = ""; - showDisabled = 1; - priority = 3.5; - icon = PATHTOF(UI\gestures_ca.paa); - hotkey = "G"; + class ACE_JoinTeamRed { + displayName = "$STR_ACE_Interaction_JoinTeamRed"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.4; + icon = PATHTOF(UI\team\team_red_ca.paa); + hotkey = "R"; + }; + class ACE_JoinTeamGreen { + displayName = "$STR_ACE_Interaction_JoinTeamGreen"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.3; + icon = PATHTOF(UI\team\team_green_ca.paa); + hotkey = "G"; + }; + class ACE_JoinTeamBlue { + displayName = "$STR_ACE_Interaction_JoinTeamBlue"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.2; + icon = PATHTOF(UI\team\team_blue_ca.paa); + hotkey = "B"; + }; + class ACE_JoinTeamYellow { + displayName = "$STR_ACE_Interaction_JoinTeamYellow"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + hotkey = "Y"; + }; - /*class ACE_Gesture_Advance { - displayName = "$STR_ACE_Interaction_Gestures_Attack"; - condition = "canStand _target"; - statement = "_target playActionNow 'gestureAttack';"; - showDisabled = 1; - priority = 2.0; - };*/ - class ACE_Gesture_Advance { - displayName = "$STR_ACE_Interaction_Gestures_Advance"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureAdvance';); - showDisabled = 1; - priority = 1.9; - hotkey = "1"; - }; - class ACE_Gesture_Go { - displayName = "$STR_ACE_Interaction_Gestures_Go"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); - showDisabled = 1; - priority = 1.8; - hotkey = "2"; - }; - class ACE_Gesture_Follow { - displayName = "$STR_ACE_Interaction_Gestures_Follow"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFollow';); - showDisabled = 1; - priority = 1.7; - hotkey = "3"; - }; - /*class ACE_Gesture_Point { - displayName = "$STR_ACE_Interaction_Gestures_Point"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gesturePoint';); - showDisabled = 1; - priority = 1.6; - };*/ - class ACE_Gesture_Up { - displayName = "$STR_ACE_Interaction_Gestures_Up"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureUp';); - showDisabled = 1; - priority = 1.5; - hotkey = "4"; - }; - class ACE_Gesture_Cover { - displayName = "$STR_ACE_Interaction_Gestures_Cover"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCover';); - showDisabled = 1; - priority = 1.4; - hotkey = "5"; - }; - class ACE_Gesture_CeaseFire { - displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCeaseFire';); - showDisabled = 1; - priority = 1.3; - hotkey = "6"; - }; - class ACE_Gesture_Freeze { - displayName = "$STR_ACE_Interaction_Gestures_Freeze"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFreeze';); - showDisabled = 1; - priority = 1.2; - hotkey = "7"; - }; - class ACE_Gesture_Yes { - displayName = "$STR_ACE_Interaction_Gestures_Yes"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); - showDisabled = 1; - priority = 1.1; - hotkey = "8"; - }; - class ACE_Gesture_No { - displayName = "$STR_ACE_Interaction_Gestures_No"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureNo';); - showDisabled = 1; - priority = 1.0; - hotkey = "9"; - }; - class ACE_Gesture_Hi { - displayName = "$STR_ACE_Interaction_Gestures_Hi"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); - showDisabled = 1; - priority = 0.9; - hotkey = "0"; - }; - }; + class ACE_LeaveTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; + condition = QUOTE(assignedTeam _player != 'MAIN'); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.5; + icon = PATHTOF(UI\team\team_white_ca.paa); + hotkey = "N"; + }; + class ACE_BecomeLeader { + displayName = "$STR_ACE_Interaction_BecomeLeader"; + condition = QUOTE(_this call DFUNC(canBecomeLeader)); + exceptions[] = {"isNotInside"}; + statement = QUOTE(_this call DFUNC(doBecomeLeader)); + showDisabled = 1; + priority = 1.0; + icon = PATHTOF(UI\team\team_white_ca.paa); + hotkey = "L"; + }; + class ACE_LeaveGroup { + displayName = "$STR_ACE_Interaction_LeaveGroup"; + condition = QUOTE(count (units group _player) > 1); + exceptions[] = {"isNotInside"}; + statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); + showDisabled = 1; + priority = 1.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + }; + }; - class ACE_Equipment { - displayName = "$STR_ACE_Interaction_Equipment"; - condition = QUOTE(true); - exceptions[] = {"isNotInside","notOnMap"}; - statement = ""; - showDisabled = 1; - priority = 4.5; - icon = ""; // @todo - hotkey = "E"; - }; - }; - }; + class ACE_Gestures { + displayName = "$STR_ACE_Interaction_Gestures"; + condition = "canStand _target"; + statement = ""; + showDisabled = 1; + priority = 3.5; + icon = PATHTOF(UI\gestures_ca.paa); + hotkey = "G"; - class LandVehicle; - class Car: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class Tank: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; + /*class ACE_Gesture_Advance { + displayName = "$STR_ACE_Interaction_Gestures_Attack"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureAttack';"; + showDisabled = 1; + priority = 2.0; + };*/ + class ACE_Gesture_Advance { + displayName = "$STR_ACE_Interaction_Gestures_Advance"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureAdvance';); + showDisabled = 1; + priority = 1.9; + hotkey = "1"; + }; + class ACE_Gesture_Go { + displayName = "$STR_ACE_Interaction_Gestures_Go"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); + showDisabled = 1; + priority = 1.8; + hotkey = "2"; + }; + class ACE_Gesture_Follow { + displayName = "$STR_ACE_Interaction_Gestures_Follow"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFollow';); + showDisabled = 1; + priority = 1.7; + hotkey = "3"; + }; + /*class ACE_Gesture_Point { + displayName = "$STR_ACE_Interaction_Gestures_Point"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gesturePoint';); + showDisabled = 1; + priority = 1.6; + };*/ + class ACE_Gesture_Up { + displayName = "$STR_ACE_Interaction_Gestures_Up"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureUp';); + showDisabled = 1; + priority = 1.5; + hotkey = "4"; + }; + class ACE_Gesture_Cover { + displayName = "$STR_ACE_Interaction_Gestures_Cover"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCover';); + showDisabled = 1; + priority = 1.4; + hotkey = "5"; + }; + class ACE_Gesture_CeaseFire { + displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCeaseFire';); + showDisabled = 1; + priority = 1.3; + hotkey = "6"; + }; + class ACE_Gesture_Freeze { + displayName = "$STR_ACE_Interaction_Gestures_Freeze"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFreeze';); + showDisabled = 1; + priority = 1.2; + hotkey = "7"; + }; + class ACE_Gesture_Yes { + displayName = "$STR_ACE_Interaction_Gestures_Yes"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); + showDisabled = 1; + priority = 1.1; + hotkey = "8"; + }; + class ACE_Gesture_No { + displayName = "$STR_ACE_Interaction_Gestures_No"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureNo';); + showDisabled = 1; + priority = 1.0; + hotkey = "9"; + }; + class ACE_Gesture_Hi { + displayName = "$STR_ACE_Interaction_Gestures_Hi"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); + showDisabled = 1; + priority = 0.9; + hotkey = "0"; + }; + }; - class Air; - class Helicopter: Air { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + class ACE_Equipment { + displayName = "$STR_ACE_Interaction_Equipment"; + condition = QUOTE(true); + exceptions[] = {"isNotInside","notOnMap"}; + statement = ""; + showDisabled = 1; + priority = 4.5; + icon = ""; // @todo + hotkey = "E"; + }; }; - }; }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class Plane: Air { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + + class LandVehicle; + class Car: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class Ship; - class Ship_F: Ship { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - - class ACE_Push { - displayName = "$STR_ACE_Interaction_Push"; - distance = 6; - condition = QUOTE(getMass _target < 1000 && {alive _target}); - statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push);); - showDisabled = 0; - priority = -1; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + class Tank: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class StaticWeapon: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = "gunnerview"; - distance = 2; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; - }; }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class thingX; - class ReammoBox_F: thingX { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 2; - condition = "true"; - }; + class Air; + class Helicopter: Air { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class Plane: Air { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; }; - class ACE_SelfActions {}; - }; + class Ship; + class Ship_F: Ship { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + + class ACE_Push { + displayName = "$STR_ACE_Interaction_Push"; + distance = 6; + condition = QUOTE(getMass _target < 1000 && {alive _target}); + statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push);); + showDisabled = 0; + priority = -1; + }; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class StaticWeapon: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = "gunnerview"; + distance = 2; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class thingX; + class ReammoBox_F: thingX { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 2; + condition = "true"; + }; + }; + class ACE_SelfActions {}; + }; }; diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp index 38f12066e0..790874a1ac 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/Menu_Config.hpp @@ -1,46 +1,44 @@ - #define HSPACE 0.5-2.0/16/2 #define VSPACE 0.5-0.3/9/2 -class RscStructuredText; class ACE_Interaction_Button_Base { - tooltip = ""; - //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; - action = ""; + tooltip = ""; + //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; + action = ""; - idc = -1; - access = 0; - type = 1; - text = ""; - font = "PuristaMedium"; - sizeEx = "0.8 / 40 / (getResolution select 5)"; - shadow = 2; + idc = -1; + access = 0; + type = 1; + text = ""; + font = "PuristaMedium"; + sizeEx = "0.8 / 40 / (getResolution select 5)"; + shadow = 2; - style = 2; - x = 0; - y = 0; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; + style = 2; + x = 0; + y = 0; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; - offsetX = 0.003; - offsetY = 0.003; - offsetPressedX = 0.002; - offsetPressedY = 0.002; - borderSize = 0; + offsetX = 0.003; + offsetY = 0.003; + offsetPressedX = 0.002; + offsetPressedY = 0.002; + borderSize = 0; - colorText[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,1}; - colorBackground[] = {0,0,0,0.8}; - colorBackgroundDisabled[] = {0,0,0,0.8}; - colorBackgroundActive[] = {1,1,1,0}; - colorFocused[] = {1,1,1,1}; - colorShadow[] = {0,0,0,0}; - colorBorder[] = {1,1,1,0.8}; + colorText[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,1}; + colorBackground[] = {0,0,0,0.8}; + colorBackgroundDisabled[] = {0,0,0,0.8}; + colorBackgroundActive[] = {1,1,1,0}; + colorFocused[] = {1,1,1,1}; + colorShadow[] = {0,0,0,0}; + colorBorder[] = {1,1,1,0.8}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; }; class RscListbox; @@ -49,86 +47,86 @@ class RscText; #define X_OFFSET 0.2 class RscACE_SelectAnItem { - idd = 8854; - movingEnable = 0; - class controls { - class back:IGUIBack { - x = X_OFFSET; - y = 0; - w = 0.6; - h = 0.71; - colorBackground[] = {0, 0, 0, 0.2}; - }; - class header: RscText{ - idc = 8870; - x = X_OFFSET + 0.005; - y = 0.005; - w = 0.59; - h = 0.05; - style = 0x02; - text = ""; - }; - class itemList:RscListBox { - onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; - idc = 8866; - x = X_OFFSET + 0.005; - w = 0.59; - h = 0.54; - y = 0.06; - }; + idd = 8854; + movingEnable = 0; + class controls { + class back:IGUIBack { + x = X_OFFSET; + y = 0; + w = 0.6; + h = 0.71; + colorBackground[] = {0, 0, 0, 0.2}; + }; + class header: RscText{ + idc = 8870; + x = X_OFFSET + 0.005; + y = 0.005; + w = 0.59; + h = 0.05; + style = 0x02; + text = ""; + }; + class itemList:RscListBox { + onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; + idc = 8866; + x = X_OFFSET + 0.005; + w = 0.59; + h = 0.54; + y = 0.06; + }; - class cancelBtnBackground: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = -1; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.605; - }; - class approveBtnBackground: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = -1; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = X_OFFSET + 0.445; - y = 0.605; - h = 0.1; - w = 0.15; - }; + class cancelBtnBackground: ACE_Interaction_Button_Base { + type = 0; + style = 2; + idc = -1; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + }; + class approveBtnBackground: ACE_Interaction_Button_Base { + type = 0; + style = 2; + idc = -1; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + }; - class cancelBtn: ACE_Interaction_Button_Base { - idc = 8855; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.605; - style = 2; - text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; - action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; + class cancelBtn: ACE_Interaction_Button_Base { + idc = 8855; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + style = 2; + text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; + action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + }; + class approveBtn: ACE_Interaction_Button_Base { + idc = 8860; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + style = 2; + text = $STR_ACE_Interaction_MakeSelection; + action = "call ACE_Interaction_fnc_hideMenu;"; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + }; }; - class approveBtn: ACE_Interaction_Button_Base { - idc = 8860; - x = X_OFFSET + 0.445; - y = 0.605; - h = 0.1; - w = 0.15; - style = 2; - text = $STR_ACE_Interaction_MakeSelection; - action = "call ACE_Interaction_fnc_hideMenu;"; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; - }; - }; }; #define GUI_GRID_W (0.025) @@ -136,64 +134,64 @@ class RscACE_SelectAnItem { class RscPicture; class RscInteractionIcon: RscPicture { - x = 19.25 * GUI_GRID_W; - y = 15.75 * GUI_GRID_H; - w = 2*GUI_GRID_H; - h = 2*GUI_GRID_H; + x = 19.25 * GUI_GRID_W; + y = 15.75 * GUI_GRID_H; + w = 2*GUI_GRID_H; + h = 2*GUI_GRID_H; }; class RscInteractionHelperIcon: RscInteractionIcon { - x = 20 * GUI_GRID_W; - y = 16 * GUI_GRID_H; - w = GUI_GRID_H; - h = GUI_GRID_H; + x = 20 * GUI_GRID_W; + y = 16 * GUI_GRID_H; + w = GUI_GRID_H; + h = GUI_GRID_H; }; class RscInteractionText: RscText{ - x = 21 * GUI_GRID_W; - y = 16 * GUI_GRID_H; - w = 8 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; + x = 21 * GUI_GRID_W; + y = 16 * GUI_GRID_H; + w = 8 * GUI_GRID_W; + h = 1.5 * GUI_GRID_H; }; class RscTitles { - class GVAR(InteractionHelper) { - idd = 9930; - enableSimulation = 1; - movingEnable = 0; - fadeIn=0.5; - fadeOut=0.5; - duration = 10e10; - onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; + class GVAR(InteractionHelper) { + idd = 9930; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0.5; + fadeOut=0.5; + duration = 10e10; + onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; - class controls { - class SelectIcon: RscInteractionHelperIcon{ - idc = 1200; - text = PATHTOF(UI\mouse_left_ca.paa); - y = 17.5 * GUI_GRID_H; - }; - class SelectText: RscInteractionText{ - idc = 1000; - y = 17 * GUI_GRID_H; - text = $STR_ACE_Interaction_MakeSelection; - }; - class GoBackIcon: RscInteractionHelperIcon{ - idc = 1201; - text = PATHTOF(UI\mouse_right_ca.paa); - y = 19.5 * GUI_GRID_H; - }; - class GoBackText: RscInteractionText{ - idc = 1001; - y = 19 * GUI_GRID_H; - text = $STR_ACE_Interaction_Back; - }; - class ScrollIcon: RscInteractionHelperIcon{ - idc = 1202; - text = PATHTOF(UI\mouse_scroll_ca.paa); - y = 18.5 * GUI_GRID_H; - }; - class ScrollText: RscInteractionText{ - idc = 1002; - y = 18 * GUI_GRID_H; - text = $STR_ACE_Interaction_ScrollHint; - }; + class controls { + class SelectIcon: RscInteractionHelperIcon{ + idc = 1200; + text = PATHTOF(UI\mouse_left_ca.paa); + y = 17.5 * GUI_GRID_H; + }; + class SelectText: RscInteractionText{ + idc = 1000; + y = 17 * GUI_GRID_H; + text = $STR_ACE_Interaction_MakeSelection; + }; + class GoBackIcon: RscInteractionHelperIcon{ + idc = 1201; + text = PATHTOF(UI\mouse_right_ca.paa); + y = 19.5 * GUI_GRID_H; + }; + class GoBackText: RscInteractionText{ + idc = 1001; + y = 19 * GUI_GRID_H; + text = $STR_ACE_Interaction_Back; + }; + class ScrollIcon: RscInteractionHelperIcon{ + idc = 1202; + text = PATHTOF(UI\mouse_scroll_ca.paa); + y = 18.5 * GUI_GRID_H; + }; + class ScrollText: RscInteractionText{ + idc = 1002; + y = 18 * GUI_GRID_H; + text = $STR_ACE_Interaction_ScrollHint; + }; + }; }; - }; }; diff --git a/addons/interaction/README.md b/addons/interaction/README.md index 92401b2547..8e841e9a58 100644 --- a/addons/interaction/README.md +++ b/addons/interaction/README.md @@ -3,7 +3,6 @@ ace_interaction Provides interaction options between units. - ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index cfca73a90b..7d10e1bef5 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -1,26 +1,24 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interact_menu"}; - author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; - authorUrl = "https://github.com/commy2/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interact_menu"}; + author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; }; #include "CfgEventHandlers.hpp" - #include "CfgVehicles.hpp" - -#include +#include "Menu_Config.hpp" class ACE_Settings { - class GVAR(EnableTeamManagement) { - value = 1; - typeName = "BOOL"; - }; + class GVAR(EnableTeamManagement) { + value = 1; + typeName = "BOOL"; + }; };