Merge pull request #1071 from usecforce/interactionCodingGuidelines

Interaction coding guidelines
This commit is contained in:
Nicolás Badano
2015-05-14 11:58:17 -03:00
40 changed files with 1261 additions and 985 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +1,44 @@
#define HSPACE 0.5-2.0/16/2 #define HSPACE 0.5-2.0/16/2
#define VSPACE 0.5-0.3/9/2 #define VSPACE 0.5-0.3/9/2
class RscStructuredText;
class ACE_Interaction_Button_Base { class ACE_Interaction_Button_Base {
tooltip = ""; 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 = "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 = ""; action = "";
idc = -1; idc = -1;
access = 0; access = 0;
type = 1; type = 1;
text = ""; text = "";
font = "PuristaMedium"; font = "PuristaMedium";
sizeEx = "0.8 / 40 / (getResolution select 5)"; sizeEx = "0.8 / 40 / (getResolution select 5)";
shadow = 2; shadow = 2;
style = 2; style = 2;
x = 0; x = 0;
y = 0; y = 0;
w = 2.0 / 16 * safezoneW; w = 2.0 / 16 * safezoneW;
h = 0.3 / 9 * safezoneH; h = 0.3 / 9 * safezoneH;
offsetX = 0.003; offsetX = 0.003;
offsetY = 0.003; offsetY = 0.003;
offsetPressedX = 0.002; offsetPressedX = 0.002;
offsetPressedY = 0.002; offsetPressedY = 0.002;
borderSize = 0; borderSize = 0;
colorText[] = {1,1,1,1}; colorText[] = {1,1,1,1};
colorDisabled[] = {0.5,0.5,0.5,1}; colorDisabled[] = {0.5,0.5,0.5,1};
colorBackground[] = {0,0,0,0.8}; colorBackground[] = {0,0,0,0.8};
colorBackgroundDisabled[] = {0,0,0,0.8}; colorBackgroundDisabled[] = {0,0,0,0.8};
colorBackgroundActive[] = {1,1,1,0}; colorBackgroundActive[] = {1,1,1,0};
colorFocused[] = {1,1,1,1}; colorFocused[] = {1,1,1,1};
colorShadow[] = {0,0,0,0}; colorShadow[] = {0,0,0,0};
colorBorder[] = {1,1,1,0.8}; colorBorder[] = {1,1,1,0.8};
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",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}; soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",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}; soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
}; };
class RscListbox; class RscListbox;
@ -49,86 +47,86 @@ class RscText;
#define X_OFFSET 0.2 #define X_OFFSET 0.2
class RscACE_SelectAnItem { class RscACE_SelectAnItem {
idd = 8854; idd = 8854;
movingEnable = 0; movingEnable = 0;
class controls { class controls {
class back:IGUIBack { class back:IGUIBack {
x = X_OFFSET; x = X_OFFSET;
y = 0; y = 0;
w = 0.6; w = 0.6;
h = 0.71; h = 0.71;
colorBackground[] = {0, 0, 0, 0.2}; colorBackground[] = {0, 0, 0, 0.2};
}; };
class header: RscText{ class header: RscText{
idc = 8870; idc = 8870;
x = X_OFFSET + 0.005; x = X_OFFSET + 0.005;
y = 0.005; y = 0.005;
w = 0.59; w = 0.59;
h = 0.05; h = 0.05;
style = 0x02; style = 0x02;
text = ""; text = "";
}; };
class itemList:RscListBox { class itemList:RscListBox {
onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick";
idc = 8866; idc = 8866;
x = X_OFFSET + 0.005; x = X_OFFSET + 0.005;
w = 0.59; w = 0.59;
h = 0.54; h = 0.54;
y = 0.06; y = 0.06;
}; };
class cancelBtnBackground: ACE_Interaction_Button_Base { class cancelBtnBackground: ACE_Interaction_Button_Base {
type = 0; type = 0;
style = 2; style = 2;
idc = -1; idc = -1;
colorBackground[] = {0,0,0,0.5}; colorBackground[] = {0,0,0,0.5};
colorBackgroundDisabled[] = {0,0,0,0.5}; colorBackgroundDisabled[] = {0,0,0,0.5};
x = X_OFFSET + 0.005; x = X_OFFSET + 0.005;
w = 0.15; w = 0.15;
h = 0.1; h = 0.1;
y = 0.605; y = 0.605;
}; };
class approveBtnBackground: ACE_Interaction_Button_Base { class approveBtnBackground: ACE_Interaction_Button_Base {
type = 0; type = 0;
style = 2; style = 2;
idc = -1; idc = -1;
colorBackground[] = {0,0,0,0.5}; colorBackground[] = {0,0,0,0.5};
colorBackgroundDisabled[] = {0,0,0,0.5}; colorBackgroundDisabled[] = {0,0,0,0.5};
x = X_OFFSET + 0.445; x = X_OFFSET + 0.445;
y = 0.605; y = 0.605;
h = 0.1; h = 0.1;
w = 0.15; w = 0.15;
}; };
class cancelBtn: ACE_Interaction_Button_Base { class cancelBtn: ACE_Interaction_Button_Base {
idc = 8855; idc = 8855;
x = X_OFFSET + 0.005; x = X_OFFSET + 0.005;
w = 0.15; w = 0.15;
h = 0.1; h = 0.1;
y = 0.605; y = 0.605;
style = 2; style = 2;
text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; 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; action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf;
colorBackground[] = {0,0,0,0}; colorBackground[] = {0,0,0,0};
colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0};
colorBackgroundActive[] = {1,1,1,0.2}; colorBackgroundActive[] = {1,1,1,0.2};
colorFocused[] = {0,0,0,0}; 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) #define GUI_GRID_W (0.025)
@ -136,64 +134,64 @@ class RscACE_SelectAnItem {
class RscPicture; class RscPicture;
class RscInteractionIcon: RscPicture { class RscInteractionIcon: RscPicture {
x = 19.25 * GUI_GRID_W; x = 19.25 * GUI_GRID_W;
y = 15.75 * GUI_GRID_H; y = 15.75 * GUI_GRID_H;
w = 2*GUI_GRID_H; w = 2*GUI_GRID_H;
h = 2*GUI_GRID_H; h = 2*GUI_GRID_H;
}; };
class RscInteractionHelperIcon: RscInteractionIcon { class RscInteractionHelperIcon: RscInteractionIcon {
x = 20 * GUI_GRID_W; x = 20 * GUI_GRID_W;
y = 16 * GUI_GRID_H; y = 16 * GUI_GRID_H;
w = GUI_GRID_H; w = GUI_GRID_H;
h = GUI_GRID_H; h = GUI_GRID_H;
}; };
class RscInteractionText: RscText{ class RscInteractionText: RscText{
x = 21 * GUI_GRID_W; x = 21 * GUI_GRID_W;
y = 16 * GUI_GRID_H; y = 16 * GUI_GRID_H;
w = 8 * GUI_GRID_W; w = 8 * GUI_GRID_W;
h = 1.5 * GUI_GRID_H; h = 1.5 * GUI_GRID_H;
}; };
class RscTitles { class RscTitles {
class GVAR(InteractionHelper) { class GVAR(InteractionHelper) {
idd = 9930; idd = 9930;
enableSimulation = 1; enableSimulation = 1;
movingEnable = 0; movingEnable = 0;
fadeIn=0.5; fadeIn=0.5;
fadeOut=0.5; fadeOut=0.5;
duration = 10e10; duration = 10e10;
onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];";
class controls { class controls {
class SelectIcon: RscInteractionHelperIcon{ class SelectIcon: RscInteractionHelperIcon{
idc = 1200; idc = 1200;
text = PATHTOF(UI\mouse_left_ca.paa); text = PATHTOF(UI\mouse_left_ca.paa);
y = 17.5 * GUI_GRID_H; y = 17.5 * GUI_GRID_H;
}; };
class SelectText: RscInteractionText{ class SelectText: RscInteractionText{
idc = 1000; idc = 1000;
y = 17 * GUI_GRID_H; y = 17 * GUI_GRID_H;
text = $STR_ACE_Interaction_MakeSelection; text = $STR_ACE_Interaction_MakeSelection;
}; };
class GoBackIcon: RscInteractionHelperIcon{ class GoBackIcon: RscInteractionHelperIcon{
idc = 1201; idc = 1201;
text = PATHTOF(UI\mouse_right_ca.paa); text = PATHTOF(UI\mouse_right_ca.paa);
y = 19.5 * GUI_GRID_H; y = 19.5 * GUI_GRID_H;
}; };
class GoBackText: RscInteractionText{ class GoBackText: RscInteractionText{
idc = 1001; idc = 1001;
y = 19 * GUI_GRID_H; y = 19 * GUI_GRID_H;
text = $STR_ACE_Interaction_Back; text = $STR_ACE_Interaction_Back;
}; };
class ScrollIcon: RscInteractionHelperIcon{ class ScrollIcon: RscInteractionHelperIcon{
idc = 1202; idc = 1202;
text = PATHTOF(UI\mouse_scroll_ca.paa); text = PATHTOF(UI\mouse_scroll_ca.paa);
y = 18.5 * GUI_GRID_H; y = 18.5 * GUI_GRID_H;
}; };
class ScrollText: RscInteractionText{ class ScrollText: RscInteractionText{
idc = 1002; idc = 1002;
y = 18 * GUI_GRID_H; y = 18 * GUI_GRID_H;
text = $STR_ACE_Interaction_ScrollHint; text = $STR_ACE_Interaction_ScrollHint;
}; };
};
}; };
};
}; };

View File

@ -3,7 +3,6 @@ ace_interaction
Provides interaction options between units. Provides interaction options between units.
## Maintainers ## Maintainers
The people responsible for merging changes to this component or answering potential questions. The people responsible for merging changes to this component or answering potential questions.

View File

@ -1,26 +1,24 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interact_menu"}; requiredAddons[] = {"ace_interact_menu"};
author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"};
authorUrl = "https://github.com/commy2/"; authorUrl = "https://github.com/commy2/";
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "Menu_Config.hpp"
#include <Menu_Config.hpp>
class ACE_Settings { class ACE_Settings {
class GVAR(EnableTeamManagement) { class GVAR(EnableTeamManagement) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";
}; };
}; };

View File

@ -1,36 +0,0 @@
/*
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:
*/
#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;
if (_picture == "" || _picture == "PictureThing") then {
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
};
_index = lbAdd [_container, _displayName];
lbSetData [_container, _index, str _data];
lbSetPicture [_container, _index, _picture];
_container

View File

@ -2,7 +2,7 @@
* Author: esteldunedain * Author: esteldunedain
* Mount unit actions inside passenger submenu * Mount unit actions inside passenger submenu
* *
* Argument: * Arguments:
* 0: Vehicle <OBJECT> * 0: Vehicle <OBJECT>
* 1: Player <OBJECT> * 1: Player <OBJECT>
* 3: Parameters <ARRAY> * 3: Parameters <ARRAY>
@ -10,14 +10,17 @@
* Return value: * Return value:
* Children actions <ARRAY> * Children actions <ARRAY>
* *
* Example:
* _array = [target, player, [params]] call ace_interaction_fnc_addPassengerAction
*
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
EXPLODE_1_PVT(_parameters,_unit);
private ["_unit","_actions"]; private ["_varName", "_actionTrees", "_actions"];
_unit = _parameters select 0;
_varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
_actionTrees = missionNamespace getVariable [_varName, []]; _actionTrees = missionNamespace getVariable [_varName, []];

View File

@ -2,7 +2,7 @@
* Author: esteldunedain * Author: esteldunedain
* Create one action per passenger * Create one action per passenger
* *
* Argument: * Arguments:
* 0: Vehicle <OBJECT> * 0: Vehicle <OBJECT>
* 1: Player <OBJECT> * 1: Player <OBJECT>
* 3: Parameters <ARRAY> * 3: Parameters <ARRAY>
@ -10,6 +10,9 @@
* Return value: * Return value:
* Children actions <ARRAY> * Children actions <ARRAY>
* *
* Example:
* _array = [target, player, [params]] call ace_interaction_fnc_addPassengersActions
*
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -39,4 +42,4 @@ _actions = [];
}; };
} forEach crew _vehicle; } forEach crew _vehicle;
_actions _actions

View File

@ -0,0 +1,32 @@
/*
* Author: Garth de Wet (LH)
* Adds an item to the select menu
*
* Arguments:
* 0: List container <ARRAY/NUMBER>
* 1: Display name <STRING>
* 2: Picture <STRING>
* 3: Data <STRING/CODE>
*
* Return value:
* Container <ARRAY/NUMBER>
*
* Example:
* _array = [_actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem
*
* Public: No
*/
#include "script_component.hpp"
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];
_container

View File

@ -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" #include "script_component.hpp"
private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"];

View File

@ -3,14 +3,14 @@
* Test if can Become Leader of group * Test if can Become Leader of group
* *
* Arguments: * Arguments:
* 0: target <OBJECT> * 0: Target <OBJECT>
* 1: player <OBJECT> * 1: Player <OBJECT>
* *
* Return Value: * Return Value:
* <BOOL> * Able to become leader of group <BOOL>
* *
* Example: * Example:
* [player, player] call ace_interaction_fnc_canBecomeLeader * _bool = [player, player] call ace_interaction_fnc_canBecomeLeader
* *
* Public: No * Public: No
*/ */

View File

@ -1,5 +1,18 @@
// by commy2 /*
* Author: commy2
* Checks if the player can interact with civilian
*
* Arguments:
* 0: Target <OBJECT>
*
* Return value:
* Able to interact with civilian <BOOL>
*
* Example:
* _bool = [target] call ace_interaction_fnc_canInteractWithCivilian
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_isCivilian); EXPLODE_2_PVT(_this,_unit,_isCivilian);
@ -8,4 +21,4 @@ if (isNil "_isCivilian") then {_isCivilian = true};
alive _unit alive _unit
&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian
//&& {count (weapons _unit) == 0} //&& {count (weapons _unit) == 0}

View File

@ -1,10 +1,22 @@
// by commy2 /*
* Author: commy2
* Checks if the player can join a group
*
* Arguments:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Able to join a group <BOOL>
*
* Example:
* _bool = [player, target] call ace_interaction_fnc_canJoinGroup
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; PARAMS_2(_unit,_target);
_unit = _this select 0;
_target = _this select 1;
alive _target alive _target
&& {!(_target getVariable ["ACE_isUnconscious", false])} && {!(_target getVariable ["ACE_isUnconscious", false])}

View File

@ -1,10 +1,22 @@
// by commy2 /*
* Author: commy2
* Checks if the player can join a team
*
* Arguments:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Able to join a team <BOOL>
*
* Example:
* _bool = [player, target] call ace_interaction_fnc_canJoinTeam
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; PARAMS_2(_unit,_target);
_unit = _this select 0;
_target = _this select 1;
alive _target alive _target
&& {!(_target getVariable ["ACE_isUnconscious", false])} && {!(_target getVariable ["ACE_isUnconscious", false])}

View File

@ -1,11 +1,22 @@
// by commy2 /*
* Author: commy2
* Checks if the player can tap a shoulder
*
* Arguments:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Able to tap a shoulder <BOOL>
*
* Example:
* _bool = [player, target] call ace_interaction_fnc_canTapShoulder
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; PARAMS_2(_unit,_target);
_unit = _this select 0;
_target = _this select 1;
_target isKindOf "CAManBase" && _target isKindOf "CAManBase" &&
{alive _target} && {alive _target} &&

View File

@ -3,8 +3,8 @@
* Become Leader of group * Become Leader of group
* *
* Arguments: * Arguments:
* 0: target <OBJECT> * 0: Target <OBJECT>
* 1: player <OBJECT> * 1: Player <OBJECT>
* *
* Return Value: * Return Value:
* None * None

View File

@ -1,9 +1,25 @@
// by commy2 /*
* Author: commy2
* Get door
*
* Arguments:
* 0: Distance <NUMBER>
*
* Return value:
* House objects and door <ARRAY>
* 0: House <OBJECT>
* 1: Door Name <STRING>
*
* Example:
* _array = [player, target] call ace_interaction_fnc_getDoor
*
* Public: No
*/
#include "script_component.hpp" #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]; _position0 = positionCameraToWorld [0, 0, 0];
_position1 = positionCameraToWorld [0, 0, _distance]; _position1 = positionCameraToWorld [0, 0, _distance];
@ -22,4 +38,5 @@ _intersections = [_house, "GEOM"] intersect [_position0, _position1];
_door = _intersections select 0 select 0; _door = _intersections select 0 select 0;
if (isNil "_door") exitWith {[_house, ""]}; if (isNil "_door") exitWith {[_house, ""]};
[_house, _door] [_house, _door]

View File

@ -1,10 +1,26 @@
// by commy2 /*
* Author: commy2
* Get door animations
*
* Arguments:
* 0: House <OBJECT>
* 1: Door <STRING>
*
* Return value:
* Animation and Locked variable <ARRAY>
* 0: Animation <STRING>
* 1: Locked variable <STRING>
*
* Example:
* _array = [target, "door"] call ace_interaction_fnc_getDoorAnimations
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_house", "_door", "_animations", "_lockedVariable"]; PARAMS_2(_house,_door);
_house = _this select 0; private ["_index", "_animations", "_lockedVariable"];
_door = _this select 1;
_index = [ _index = [
"door_1", "door_1",

View File

@ -1,21 +1,25 @@
/* /*
* Author: KoffeinFlummi * Author: KoffeinFlummi
* * Forces a civilian to the ground (with a chance of failure)
* Forces a civilian to the ground. (chance of failure).
* *
* Arguments: * Arguments:
* 0: Unit to be sent away (Object) * 0: Unit <OBJECT>
* *
* Return value: * Return value:
* none * None
*
* Example:
* [target] call ace_interaction_fnc_getDown
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
#define RADIUS 10 #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. ACE_player playActionNow "GestureGo"; // put something else here.
@ -31,4 +35,4 @@ if (count (weapons ACE_player) > 0) then {
_this setUnitPos "DOWN"; _this setUnitPos "DOWN";
}, _x] call CBA_fnc_globalExecute; }, _x] call CBA_fnc_globalExecute;
}; };
} foreach (_unit nearEntities ["Civilian", RADIUS]); } forEach (_unit nearEntities ["Civilian", RADIUS]);

View File

@ -1,4 +1,18 @@
// by commy2 /*
* Author: commy2
* Get selected button
*
* Arguments:
* None
*
* Return value:
* Angle <NUMBER>
*
* Example:
* _number = call ace_interaction_fnc_getSelectedButton
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
#define MIN_DISTANCE 0.0065 #define MIN_DISTANCE 0.0065

View File

@ -2,18 +2,21 @@
* Author: esteldunedain * Author: esteldunedain
* Return a suitable position for the action point for the current weapon * Return a suitable position for the action point for the current weapon
* *
* Argument: * Arguments:
* None * None
* *
* Return value: * Return value:
* Children actions <ARRAY> * Children actions <ARRAY>
* *
* Example:
* _array = call ace_interaction_fnc_getWeaponPos
*
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
// IGNORE_PRIVATE_WARNING(_target); // IGNORE_PRIVATE_WARNING(_target);
private ["_weaponDir","_refSystem"]; private ["_weaponDir", "_refSystem"];
_weaponDir = _target weaponDirection currentWeapon _target; _weaponDir = _target weaponDirection currentWeapon _target;
_refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); _refSystem = _weaponDir call EFUNC(common,createOrthonormalReference);

View File

@ -1,22 +1,22 @@
/* /*
Author: Garth de Wet (LH) * Author: Garth de Wet (LH)
* Closes the Interaction menu
Description: *
Closes the Interaction menu * Arguments:
* None
Parameters: *
Nothing * Return value:
* None
Returns: *
Nothing * Example:
* call ace_interaction_fnc_hideMenu
Example: *
call FUNC(hideMenu); * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
closeDialog 0; closeDialog 0;
(findDisplay 1713999) closeDisplay 1; (findDisplay 1713999) closeDisplay 1;
(uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0;
GVAR(MainButton) = nil; GVAR(MainButton) = nil;
call FUNC(hideMouseHint); call FUNC(hideMouseHint);

View File

@ -1,22 +1,21 @@
/* /*
Author(s): * Author: Garth de Wet (LH)
Garth de Wet (LH) * Hides the interaction helper text with the mouse buttons at the bottom middle of the screen
*
Description: * Arguments:
Hides the interaction helper text with the mouse buttons at the bottom middle of the screen * None
*
Parameters: * Return value:
Nothing * None
*
Returns: * Example:
Nothing * call ace_interaction_fnc_hideMouseHint
*
Example: * Public: No
call FUNC(hideMouseHint); */
*/
#include "script_component.hpp" #include "script_component.hpp"
if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{}; if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{};
(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
showHUD true; showHUD true;

View File

@ -1,21 +1,24 @@
/* /*
* Author: commy2 * Author: commy2
*
* Check if the vehicle is in range of the player. * Check if the vehicle is in range of the player.
* *
* Argument: * Arguments:
* 0: Vehicke (Object) * 0: Vehicle <OBJECT>
* 1: Distance in meters (Number) * 1: Distance in meters <NUMBER>
* *
* Return value: * Return value:
* (Bool) * Vehicle in range of player <BOOL>
*
* Example:
* _bool = [target, 5] call ace_interaction_fnc_isInRange
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_distance", "_player"]; PARAMS_2(_vehicle,_distance);
_vehicle = _this select 0; private ["_player", "_position0", "_position1"];
_distance = _this select 1;
_player = ACE_player; _player = ACE_player;

View File

@ -1,10 +1,24 @@
// by commy2 /*
* Author: commy2
* Assigns a unit to the team
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Team <STRING>
*
* Return value:
* None
*
* Example:
* [target, "YELLOW"] call ace_interaction_fnc_joinTeam
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_team", "_message"]; PARAMS_2(_unit,_team);
_unit = _this select 0; private ["_message"];
_team = _this select 1;
_unit setVariable [QGVAR(assignedFireTeam), _team, true]; _unit setVariable [QGVAR(assignedFireTeam), _team, true];
[_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); [_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc);

View File

@ -1,16 +1,24 @@
/* /*
* Author: bux578 * Author: bux578
* * Initializes the Interaction module
* Initializes the Interaction module.
* *
* Arguments: * Arguments:
* Whatever the module provides. (I dunno.) * 0: Logic <NUMBER>
* 1: ???
* 2: Activation State <BOOL>
* *
* Return Value: * Return value:
* None * None
*
* Example:
* [logic, ???, activationState] call ace_interaction_fnc_moduleInteraction
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_logic", "_activated"];
_logic = _this select 0; _logic = _this select 0;
_activated = _this select 2; _activated = _this select 2;

View File

@ -1,21 +1,22 @@
/* /*
Author: Garth de Wet (LH) * Author: Garth de Wet (LH)
* Scrolls through the list down or up
Description: *
Depending on the passed value, either scrolls down through the list or up. * Arguments:
* 0: Amount <NUMBER>
Parameters: *
NUMBER - Amount to increase current interaction target * Return value:
* None
Returns: *
Nothing * Example:
* [2] call ace_interaction_fnc_moveDown
Example: *
1 call FUNC(MoveDown); * Public: No
-1 call FUNC(MoveDown); */
*/
#include "script_component.hpp" #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}}) #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(MainButton)) exitWith{};
if (isNil QGVAR(Buttons)) exitWith{}; if (isNil QGVAR(Buttons)) exitWith{};

View File

@ -1,7 +1,21 @@
// by commy2 /*
* Author: commy2
* On button up
*
* Arguments:
* None
*
* Return value:
* None
*
* Example:
* call ace_interaction_fnc_onButtonUp
*
* Public: No
*/
#include "script_component.hpp" #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; _player = ACE_player;
_vehicle = vehicle _player; _vehicle = vehicle _player;
@ -20,11 +34,9 @@ _action = if (_index != -1 && {_index < _count}) then {
closeDialog 0; closeDialog 0;
_statement = _action select 1; _statement = _action select 1;
_condition = _action select 2; _condition = _action select 2;
_conditionShow = _action select 7; _conditionShow = _action select 7;
_exceptions = _action select 8;//
_distance = _action select 9; _distance = _action select 9;
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {

View File

@ -1,6 +1,20 @@
// by commy2 /*
* Author: commy2
* On click
*
* Arguments:
* Index <NUMBER>
*
* Return value:
* None
*
* Example:
* 5 call ace_interaction_fnc_onClick
*
* Public: No
*/
#include "script_component.hpp" #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; _player = ACE_player;
_vehicle = vehicle _player; _vehicle = vehicle _player;
@ -29,7 +43,6 @@ if (count _subMenu < 2) then {
_statement = _action select 1; _statement = _action select 1;
_condition = _action select 2; _condition = _action select 2;
_conditionShow = _action select 7; _conditionShow = _action select 7;
_exceptions = _action select 8;//
_distance = _action select 9; _distance = _action select 9;
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {

View File

@ -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" #include "script_component.hpp"
call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept); call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept);

View File

@ -1,19 +1,32 @@
// by commy2 /*
* Author: commy2
* Opens door
*
* Arguments:
* 0: House <OBJECT>
* 1: Door <STRING>
*
* Return value:
* None
*
* Example:
* [house, "door"] call ace_interaction_fnc_openDoor
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; private ["_info", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"];
_info = [2] call FUNC(getDoor); _info = [2] call FUNC(getDoor);
_house = _info select 0; EXPLODE_2_PVT(_info,_house,_door);
_door = _info select 1;
if (isNull _house) exitWith {}; if (isNull _house) exitWith {};
_animations = [_house, _door] call FUNC(getDoorAnimations); _animations = [_house, _door] call FUNC(getDoorAnimations);
_lockedVariable = _animations select 1; EXPLODE_2_PVT(_animations,_animations,_lockedVariable);
_animations = _animations select 0;
if (count _animations == 0) exitWith {}; if (count _animations == 0) exitWith {};

View File

@ -1,44 +1,57 @@
// by commy2 /*
* Author: commy2
* Opens menu select UI
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Vehicle <OBJECT>
*
* Return value:
* None
*
* Example:
* [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_vehicle", "_cargo"]; PARAMS_2(_unit,_vehicle);
_unit = _this select 0; private ["_cargo", "_actions"];
_vehicle = _this select 1;
// 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); _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 {}; if !(_unit in _cargo) exitWith {};
GVAR(InteractionMenu_Crew) = _cargo; GVAR(InteractionMenu_Crew) = _cargo;
// prepare: add header and "OK" button to select menu // Prepare: add header and "OK" button to select menu
private "_actions";
_actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_Interaction_Interact"] call FUNC(prepareSelectMenu); _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 { if (_x != _unit) then {
_actions = [ _actions = [
_actions, _actions,
[_x] call EFUNC(common,getName), [_x] call EFUNC(common,getName),
QUOTE(PATHTOF(UI\dot_ca.paa)), QUOTE(PATHTOF(UI\dot_ca.paa)),
_forEachIndex _forEachIndex
] call FUNC(AddSelectableItem); ] call FUNC(addSelectableItem);
}; };
} forEach _cargo; } forEach _cargo;
// open select menu // Open select menu
[ [
_actions, _actions,
{ {
call FUNC(hideMenu); call FUNC(hideMenu);
[0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu);
GVAR(InteractionMenu_Crew) = nil; GVAR(InteractionMenu_Crew) = nil;
}, },
{ {
call FUNC(hideMenu); call FUNC(hideMenu);
} }
] call FUNC(openSelectMenu); ] call FUNC(openSelectMenu);

View File

@ -1,36 +1,40 @@
/* /*
Author: Garth de Wet (LH) * Author: Garth de Wet (LH)
* Opens the select menu UI and sets up the UI
Description: *
Opens the select menu UI and sets up the UI * Arguments:
* 0: Items <ARRAY>
Parameters: * 0: Text <STRING>
0: ARRAY - items * 1: Statement to execute <CODE>
ARRAY * 2: Condition before execute <CODE>
0 = Text * 3: showDisabled <BOOL>
1 = statement to execute * 4: Priority <NUMBER>
2 = condition before execute * 5: Icon <STRING>
3 = showDisabled * 6: Extra variables passed to the code <ARRAY>
4 = priority * 1: Select Action <CODE>
5 = icon * 2: Cancel Action <CODE>
6 = extra variables. Passed to the code. *
1: Code - select action * Return value:
2: Code - Cancel Action * None
Returns: *
Nothing * Example:
* [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu
Example: *
*/ * Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then {
GVAR(SelectAccept) = _this select 1; GVAR(SelectAccept) = _this select 1;
GVAR(SelectCancel) = _this select 2; GVAR(SelectCancel) = _this select 2;
buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel
buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept
lbSetCurSel [8866, 0]; lbSetCurSel [8866, 0];
}else{ }else{
_customActions = _this select 0; PARAMS_1(_customActions);
private ["_count", "_action"];
_count = count _customActions; _count = count _customActions;
if (_count == 0) exitWith {}; if (_count == 0) exitWith {};
_customActions call FUNC(sortOptionsByPriority); _customActions call FUNC(sortOptionsByPriority);

View File

@ -1,28 +1,29 @@
/* /*
Author: Garth de Wet (LH) * Author: Garth de Wet (LH)
* Prepares the select menu for use
Description: *
Prepares the select menu for use. * Arguments:
* 0: Header Text <STRING>
Parameters: * 1: Approve Button Text <STRING>
0: TEXT - Header text *
1: TEXT - Approve button text * Return value:
* Container object <ARRAY/NUMBER>
Returns: *
ARRAY/NUMBER - container object for use with AddSelectableItem. * Example:
* _array = ["Select Explosive", "Place"] call ace_interaction_fnc_prepareSelectMenu
Example: *
["Select Explosive", "Place"] call FUNC(prepareSelectMenu); * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; PARAMS_2(_header,_buttonText);
closeDialog 0; closeDialog 0;
_header = _this select 0;
_buttonText = _this select 1;
if (isNil "_buttonText" or {_buttonText == ""}) then { if (isNil "_buttonText" or {_buttonText == ""}) then {
_buttonText = localize "STR_ACE_Interaction_MakeSelection"; _buttonText = localize "STR_ACE_Interaction_MakeSelection";
}; };
createDialog "RscACE_SelectAnItem"; createDialog "RscACE_SelectAnItem";
ctrlSetText [8860, _buttonText]; ctrlSetText [8860, _buttonText];
ctrlSetText [8870, _header]; ctrlSetText [8870, _header];

View File

@ -1,22 +1,26 @@
/* /*
* Author: KoffeinFlummi * Author: KoffeinFlummi
* * Pushes a boat away from the player
* Pushes a boat away from the player.
* *
* Arguments: * Arguments:
* 0: Boat (object) * 0: Boat <OBJECT>
* 1: Velocity (vectorlike array) * 1: Velocity <ARRAY>
* *
* Return Value: * Return Value:
* None * None
*
* Example:
* [target, [vector]] call ace_interaction_fnc_push
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
_boat = _this select 0; PARAMS_2(_boat,_velocity);
_velocity = _this select 1;
if !(local _boat) exitWith { 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; _boat setVelocity _velocity;

View File

@ -1,7 +1,23 @@
// by commy2 /*
* Author: commy2
* Removes tag
*
* Arguments:
* None
*
* Return value:
* None
*
* Example:
* call ace_interaction_fnc_removeTag
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
0 spawn { 0 spawn {
private ["_index"];
waitUntil {player getVariable ["ACE_Name", ""] != ""}; waitUntil {player getVariable ["ACE_Name", ""] != ""};
_name = player getVariable ["ACE_Name", ""]; _name = player getVariable ["ACE_Name", ""];

View File

@ -1,36 +1,40 @@
/* /*
* Author: KoffeinFlummi * Author: KoffeinFlummi
* * Sends a civilian crowd away with a chance of failure
* Sends a civilian crowd away (chance of failure).
* *
* Arguments: * Arguments:
* 0: Unit to be sent away (Object) * 0: Unit <OBJECT>
* *
* Return value: * Return value:
* none * None
*/ *
* Example:
* [target] call ace_interaction_fnc_sendAway
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
#define DISTANCE 50 #define DISTANCE 50
#define RADIUS 10 #define RADIUS 10
private ["_unit", "_chance", "_x"]; PARAMS_1(_unit);
_unit = _this select 0; private ["_chance", "_x"];
ACE_player playActionNow "GestureGo"; ACE_player playActionNow "GestureGo";
if (count weapons ACE_player > 0) then { if (count weapons ACE_player > 0) then {
_chance = 0.8; _chance = 0.8;
} else { } else {
_chance = 0.5; _chance = 0.5;
}; };
{ {
if (count (weapons _unit) == 0 and random 1 < _chance) then { if (count (weapons _unit) == 0 and random 1 < _chance) then {
[-2, { [-2, {
(_this select 0) setUnitPos "AUTO"; (_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]; (_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; }, [_x, ACE_player]] call CBA_fnc_globalExecute;
}; };
} foreach (_unit nearEntities ["Civilian", RADIUS]); } forEach (_unit nearEntities ["Civilian", RADIUS]);

View File

@ -1,28 +1,28 @@
/* /*
Author(s): * Author: Garth de Wet (LH)
Garth de Wet (LH) * Shows the interaction helper text with the mouse buttons at the bottom middle of the screen
*
Description: * Arguments:
Shows the interaction helper text with the mouse buttons at the bottom middle of the screen * 0: Left Click Text <STRING>
* 1: Right Click Text <STRING>
Parameters: * 2: Scroll Text <STRING> (Optional)
0: STRING - Left click text *
1: STRING - Right click text * Return value:
3: STRING - (Optional) Scroll text * None
*
Returns: * Example:
Nothing * ["Place Explosive", "Cancel"] call ace_interaction_fnc_showMouseHint
*
Example: * Public: No
["Place Explosive", "Cancel"] call FUNC(showMouseHint); */
*/
#include "script_component.hpp" #include "script_component.hpp"
#define GUI_GRID_W (0.025) #define GUI_GRID_W (0.025)
#define GUI_GRID_H (0.04) #define GUI_GRID_H (0.04)
private ["_leftClick", "_rightClick", "_scroll"];
_leftClick = _this select 0; private ["_scroll", "_display"];
_rightClick = _this select 1;
PARAMS_2(_leftClick,_rightClick);
_scroll = ""; _scroll = "";
if (count _this > 2) then { if (count _this > 2) then {
_scroll = _this select 2; _scroll = _this select 2;
@ -44,11 +44,10 @@ if (isNull _display) exitWith{};
if (_scroll == "") exitWith { if (_scroll == "") exitWith {
(_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1002) ctrlShow false;
(_display displayCtrl 1202) 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 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 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 1001) ctrlCommit 0;
(_display displayCtrl 1201) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0;
}; };
(_display displayCtrl 1002) ctrlSetText _scroll; (_display displayCtrl 1002) ctrlSetText _scroll;
showHUD false; showHUD false;

View File

@ -1,4 +1,18 @@
// by commy2 /*
* Author: commy2
* Sort options by priority
*
* Arguments:
* Actions <ARRAY>
*
* Return value:
* None
*
* Example:
* _customActions call ace_interaction_fnc_sortOptionsByPriority
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_actions", "_count", "_index", "_actionN", "_actionM"]; private ["_actions", "_count", "_index", "_actionN", "_actionM"];

View File

@ -1,4 +1,19 @@
// by commy2 /*
* Author: commy2
* Taps a shoulder
*
* Arguments:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* None
*
* Example:
* [player, target] call ace_interaction_fnc_tapShoulder
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum);
@ -13,7 +28,7 @@ if (_target != ACE_player) exitWith {
addCamShake [4, 0.5, 5]; 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 //localize is converting the escaped <> symbols, so just add them here instead of in the stringtable
if (_shoulderNum == 0) then { if (_shoulderNum == 0) then {
_message = format ["%1 &gt;", (localize "STR_ACE_Interaction_YouWereTappedRight")]; _message = format ["%1 &gt;", (localize "STR_ACE_Interaction_YouWereTappedRight")];

View File

@ -1,12 +1,30 @@
// by commy2 /*
* Author: commy2
* Updates tooltip's position
*
* Arguments:
* 0: Tooltip Display <NUMBER>
* 1: X Coordinate <NUMBER>
* 2: Y Coordinate <NUMBER>
*
* Return value:
* None
*
* Example:
* [player, 0.5, 0.5] call ace_interaction_fnc_updateTooltipPosition
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_tooltip,_coordinateX,_coordinateY);
disableSerialization; disableSerialization;
_ctrl = ctrlParent (_this select 0) displayCtrl 40; _ctrl = ctrlParent _tooltip displayCtrl 40;
_ctrl ctrlSetPosition [ _ctrl ctrlSetPosition [
(_this select 1) + 0.01 * safezoneW, _coordinateX + 0.01 * safezoneW,
(_this select 2) + 0.01 * safezoneH, _coordinateY + 0.01 * safezoneH,
2.0 / 16 * safezoneW, 2.0 / 16 * safezoneW,
0.3 / 9 * safezoneH 0.3 / 9 * safezoneH
]; ];