diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp new file mode 100644 index 0000000000..cc66efa2e9 --- /dev/null +++ b/addons/interaction/Menu_Config.hpp @@ -0,0 +1,632 @@ + +#define HSPACE 0.5-2.0/16/2 +#define VSPACE 0.5-0.3/9/2 + +class RscStructuredText; +class AGM_Interaction_Button_Base { + tooltip = ""; + //action = "AGM_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = AGM_Interaction_Buttons select AGM_Interaction_SelectedButton;AGM_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; + + 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; + + 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}; +}; + +#define ICON_BORDER 0.05 + +// Old command rose +class AGM_Interaction_Dialog { + idd = 1713999; + enableSimulation = 1; + movingEnable = 0; + onLoad = "_dlgInteractionDialog = _this select 0; for '_a' from 10 to 19 do {(_dlgInteractionDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['AGM_Interaction_Dialog', _dlgInteractionDialog];"; + objects[] = {}; + class controls { + class Interaction_BackgroundMain: AGM_Interaction_Button_Base { + type = 0; + style = 2; + idc = 2; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY"; + w = "1.8 / 16 * safezoneW"; + h = "0.55 / 9 * safezoneH"; + }; + + class Interaction_ButtonMain: AGM_Interaction_Button_Base { + action = "-1 call AGM_Interaction_fnc_onClick;"; + style = 2; + tooltip = ""; + text = "Interaction Menu"; + idc = 3; + sizeEx = "0.6 / 40 / (getResolution select 5)"; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + x = "(0.5-1.8/16/2 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.55/9/2 + 0 * 0.04) * safezoneH + safezoneY"; + w = "1.8 / 16 * safezoneW"; + h = "0.55 / 9 * safezoneH"; + }; + + class Interaction_Background0: AGM_Interaction_Button_Base { + type = 0; + style = 2; + idc = 40; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background1: Interaction_Background0 { + idc = 41; + x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background2: Interaction_Background0 { + idc = 42; + x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background3: Interaction_Background0 { + idc = 43; + x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background4: Interaction_Background0 { + idc = 44; + x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background5: Interaction_Background0 { + idc = 45; + x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background6: Interaction_Background0 { + idc = 46; + x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background7: Interaction_Background0 { + idc = 47; + x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background8: Interaction_Background0 { + idc = 48; + x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Background9: Interaction_Background0 { + idc = 49; + x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + + class Interaction_Icon0: AGM_Interaction_Button_Base { + tooltip = ""; + text = ""; + idc = 20; + type = 0; + style = 48; + colorBackground[] = {0,0,0,0}; + x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 - 2.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon1: Interaction_Icon0 { + idc = 21; + x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon2: Interaction_Icon0 { + idc = 22; + x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon3: Interaction_Icon0 { + idc = 23; + x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.25 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon4: Interaction_Icon0 { + idc = 24; + x = (0.5-(2.0-ICON_BORDER)/16/2 + 1.0 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon5 : Interaction_Icon0 { + idc = 25; + x = (0.5-(2.0-ICON_BORDER)/16/2 + 0 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 + 2.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon6: Interaction_Icon0 { + idc = 26; + x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 + 1.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon7: Interaction_Icon0 { + idc = 27; + x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 + 0.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon8: Interaction_Icon0 { + idc = 28; + x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.25 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 - 0.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + class Interaction_Icon9: Interaction_Icon0 { + idc = 29; + x = (0.5-(2.0-ICON_BORDER)/16/2 - 1.0 * 0.1) * safezoneW + safezoneX; + y = (0.5-(0.3-ICON_BORDER)/9/2 - 1.5 * 0.04) * safezoneH + safezoneY; + w = (0.3-ICON_BORDER) / 16 * safezoneW; + h = (0.3-ICON_BORDER) / 9 * safezoneH; + }; + + class Interaction_Shortcut0: AGM_Interaction_Button_Base { + tooltip = ""; + text = ""; + idc = 30; + style = 2; + colorBackground[] = {0,0,0,0}; + x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut1: Interaction_Shortcut0 { + idc = 31; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut2: Interaction_Shortcut0 { + idc = 32; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut3: Interaction_Shortcut0 { + idc = 33; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 + 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut4: Interaction_Shortcut0 { + idc = 34; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 + 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut5 : Interaction_Shortcut0 { + idc = 35; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut6: Interaction_Shortcut0 { + idc = 36; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut7: Interaction_Shortcut0 { + idc = 37; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut8: Interaction_Shortcut0 { + idc = 38; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 - 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Shortcut9: Interaction_Shortcut0 { + idc = 39; + type = 0; + x = "(0.5+2.0/16/2-0.3/16 - 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; + w = "0.3 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + + class Interaction_Button0: AGM_Interaction_Button_Base { + action = "0 call AGM_Interaction_fnc_onClick;"; + style = 2; + tooltip = ""; + text = ""; + idc = 10; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 2.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button1: Interaction_Button0 { + action = "1 call AGM_Interaction_fnc_onClick;"; + idc = 11; + x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button2: Interaction_Button0 { + action = "2 call AGM_Interaction_fnc_onClick;"; + idc = 12; + x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button3: Interaction_Button0 { + action = "3 call AGM_Interaction_fnc_onClick;"; + idc = 13; + x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button4: Interaction_Button0 { + action = "4 call AGM_Interaction_fnc_onClick;"; + idc = 14; + x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button5: Interaction_Button0 { + action = "5 call AGM_Interaction_fnc_onClick;"; + idc = 15; + x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button6: Interaction_Button0 { + action = "6 call AGM_Interaction_fnc_onClick;"; + idc = 16; + x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button7: Interaction_Button0 { + action = "7 call AGM_Interaction_fnc_onClick;"; + idc = 17; + x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button8: Interaction_Button0 { + action = "8 call AGM_Interaction_fnc_onClick;"; + idc = 18; + x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + class Interaction_Button9: Interaction_Button0 { + action = "9 call AGM_Interaction_fnc_onClick;"; + idc = 19; + x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; + y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; + w = "2.0 / 16 * safezoneW"; + h = "0.3 / 9 * safezoneH"; + }; + }; +}; + +class RscListbox; +class IGUIBack; +class RscText; +#define X_OFFSET 0.2 + +class RscAGM_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 AGM_Interaction_fnc_onSelectMenuDblClick"; + idc = 8866; + x = X_OFFSET + 0.005; + w = 0.59; + h = 0.54; + y = 0.06; + }; + + class cancelBtnBackground: AGM_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: AGM_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: AGM_Interaction_Button_Base { + idc = 8855; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + style = 2; + text = $STR_AGM_Interaction_Back; //$STR_AGM_Interaction_CancelSelection; + action = "call AGM_Interaction_fnc_hideMenu;"; //'Default' call AGM_Interaction_fnc_openMenu; 'Default' call AGM_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: AGM_Interaction_Button_Base { + idc = 8860; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + style = 2; + text = $STR_AGM_Interaction_MakeSelection; + action = "call AGM_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_H (0.04) + +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; +}; +class RscInteractionHelperIcon: RscInteractionIcon { + 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; +}; +class RscTitles { + class AGM_FlowMenu { + idd = 9920; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0.5; + fadeOut=0.5; + duration = 10e10; + onLoad = "uiNamespace setVariable ['AGM_Flow_Display', _this select 0];"; + + class controls { + class RearIcon: RscInteractionIcon{ + idc = 999; + text = "AGM_interaction\UI\CenterIcon_ca.paa"; + x = 17.9 * GUI_GRID_W; + y = 10 * GUI_GRID_H; + w = 3.7 * GUI_GRID_H; + h = 5.75 * GUI_GRID_H; + }; + class TopIcon: RscInteractionIcon{ + idc = 1200; + h = 1 * GUI_GRID_H; + y = 9 * GUI_GRID_H; + }; + class FirstIcon: RscInteractionIcon{ + idc = 1201; + y = 10.25 * GUI_GRID_H; + h = 1.5 * GUI_GRID_H; + }; + class SelectedItemIcon: RscInteractionIcon{ + idc = 1202; + y = 12 * GUI_GRID_H; + }; + class ThirdIcon: RscInteractionIcon{ + idc = 1203; + y = 14.25 * GUI_GRID_H; + h = 1.5 * GUI_GRID_H; + }; + class BottomIcon: TopIcon{ + idc = 1204; + y = 16 * GUI_GRID_H; + }; + class ItemName: RscText{ + idc = 1000; + style = 0x01; + x = 5.25 * GUI_GRID_W; + y = 12.15 * GUI_GRID_H; + w = 13 * GUI_GRID_W; + h = 1.5 * GUI_GRID_H; + colorBackground[] = {0.3, 0.3, 0.3, 0.8}; + }; + class BackIcon: RscInteractionIcon{ + idc = 1210; + text = "AGM_interaction\UI\backArrow_ca.paa"; + x = 18.25 * GUI_GRID_W; + y = 12.69 * GUI_GRID_H; + w = 0.5 * GUI_GRID_W; + h = 0.5 * GUI_GRID_H; + }; + class ItemDetails: RscStructuredText{ + idc = 1100; + style = 0x0c; + x = 23.5 * GUI_GRID_W; + y = 11 * GUI_GRID_H; + w = 13 * GUI_GRID_W; + h = 3.9 * GUI_GRID_H; + colorBackground[] = {0, 0, 0, 0.4}; + }; + }; + }; + class AGM_InteractionHelper { + idd = 9930; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0.5; + fadeOut=0.5; + duration = 10e10; + onLoad = "uiNamespace setVariable ['AGM_Helper_Display', _this select 0];"; + + class controls { + class SelectIcon: RscInteractionHelperIcon{ + idc = 1200; + text = "AGM_interaction\UI\mouse_left_ca.paa"; + y = 17.5 * GUI_GRID_H; + }; + class SelectText: RscInteractionText{ + idc = 1000; + y = 17 * GUI_GRID_H; + text = $STR_AGM_Interaction_MakeSelection; + }; + class GoBackIcon: RscInteractionHelperIcon{ + idc = 1201; + text = "AGM_interaction\UI\mouse_right_ca.paa"; + y = 19.5 * GUI_GRID_H; + }; + class GoBackText: RscInteractionText{ + idc = 1001; + y = 19 * GUI_GRID_H; + text = $STR_AGM_Interaction_Back; + }; + class ScrollIcon: RscInteractionHelperIcon{ + idc = 1202; + text = "AGM_interaction\UI\mouse_scroll_ca.paa"; + y = 18.5 * GUI_GRID_H; + }; + class ScrollText: RscInteractionText{ + idc = 1002; + y = 18 * GUI_GRID_H; + text = $STR_AGM_Interaction_ScrollHint; + }; + }; + }; +}; diff --git a/addons/interaction/UI/CenterIcon_ca.paa b/addons/interaction/UI/CenterIcon_ca.paa new file mode 100644 index 0000000000..86deb5df7c Binary files /dev/null and b/addons/interaction/UI/CenterIcon_ca.paa differ diff --git a/addons/interaction/UI/IconInteraction_ca.paa b/addons/interaction/UI/IconInteraction_ca.paa new file mode 100644 index 0000000000..000c4bc9c6 Binary files /dev/null and b/addons/interaction/UI/IconInteraction_ca.paa differ diff --git a/addons/interaction/UI/backArrow_ca.paa b/addons/interaction/UI/backArrow_ca.paa new file mode 100644 index 0000000000..627cb64f17 Binary files /dev/null and b/addons/interaction/UI/backArrow_ca.paa differ diff --git a/addons/interaction/UI/command_rose_ca.paa b/addons/interaction/UI/command_rose_ca.paa new file mode 100644 index 0000000000..3dd8b58768 Binary files /dev/null and b/addons/interaction/UI/command_rose_ca.paa differ diff --git a/addons/interaction/UI/dot_ca.paa b/addons/interaction/UI/dot_ca.paa new file mode 100644 index 0000000000..7988dfe11d Binary files /dev/null and b/addons/interaction/UI/dot_ca.paa differ diff --git a/addons/interaction/UI/gestures_ca.paa b/addons/interaction/UI/gestures_ca.paa new file mode 100644 index 0000000000..b237d73edf Binary files /dev/null and b/addons/interaction/UI/gestures_ca.paa differ diff --git a/addons/interaction/UI/mouse_left_ca.paa b/addons/interaction/UI/mouse_left_ca.paa new file mode 100644 index 0000000000..1cbc49397e Binary files /dev/null and b/addons/interaction/UI/mouse_left_ca.paa differ diff --git a/addons/interaction/UI/mouse_right_ca.paa b/addons/interaction/UI/mouse_right_ca.paa new file mode 100644 index 0000000000..3c2a352b22 Binary files /dev/null and b/addons/interaction/UI/mouse_right_ca.paa differ diff --git a/addons/interaction/UI/mouse_scroll_ca.paa b/addons/interaction/UI/mouse_scroll_ca.paa new file mode 100644 index 0000000000..662d11b0d8 Binary files /dev/null and b/addons/interaction/UI/mouse_scroll_ca.paa differ diff --git a/addons/interaction/UI/team/team_blue_ca.paa b/addons/interaction/UI/team/team_blue_ca.paa new file mode 100644 index 0000000000..ef64818d12 Binary files /dev/null and b/addons/interaction/UI/team/team_blue_ca.paa differ diff --git a/addons/interaction/UI/team/team_green_ca.paa b/addons/interaction/UI/team/team_green_ca.paa new file mode 100644 index 0000000000..7f8c2218c1 Binary files /dev/null and b/addons/interaction/UI/team/team_green_ca.paa differ diff --git a/addons/interaction/UI/team/team_management_ca.paa b/addons/interaction/UI/team/team_management_ca.paa new file mode 100644 index 0000000000..aa5f1c79b5 Binary files /dev/null and b/addons/interaction/UI/team/team_management_ca.paa differ diff --git a/addons/interaction/UI/team/team_red_ca.paa b/addons/interaction/UI/team/team_red_ca.paa new file mode 100644 index 0000000000..2cf3de18dd Binary files /dev/null and b/addons/interaction/UI/team/team_red_ca.paa differ diff --git a/addons/interaction/UI/team/team_white_ca.paa b/addons/interaction/UI/team/team_white_ca.paa new file mode 100644 index 0000000000..cbb02bf7b4 Binary files /dev/null and b/addons/interaction/UI/team/team_white_ca.paa differ diff --git a/addons/interaction/UI/team/team_yellow_ca.paa b/addons/interaction/UI/team/team_yellow_ca.paa new file mode 100644 index 0000000000..b69405c8e8 Binary files /dev/null and b/addons/interaction/UI/team/team_yellow_ca.paa differ diff --git a/addons/interaction/clientInit.sqf b/addons/interaction/clientInit.sqf new file mode 100644 index 0000000000..02762d42b6 --- /dev/null +++ b/addons/interaction/clientInit.sqf @@ -0,0 +1,12 @@ +// by commy2 and CAA-Picard + +if (!hasInterface) exitWith {}; + +AGM_Interaction_isOpeningDoor = false; +AGM_Dancing = false; + +// restore global fire teams for JIP +{ + _team = _x getVariable ["AGM_assignedFireTeam", ""]; + if (_team != "") then {_x assignTeam _team}; +} forEach allUnits; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp new file mode 100644 index 0000000000..961d644a0b --- /dev/null +++ b/addons/interaction/config.cpp @@ -0,0 +1,664 @@ +class CfgPatches { + class AGM_Interaction { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.60; + requiredAddons[] = {AGM_Core}; + version = "0.95"; + versionStr = "0.95"; + versionAr[] = {0,95,0}; + author[] = {"commy2", "KoffeinFlummi", "CAA-Picard", "bux578"}; + authorUrl = "https://github.com/commy2/"; + }; +}; + +class CfgFunctions { + class AGM_Interaction { + class AGM_Interaction { + file = "\AGM_interaction\functions"; + class addInteraction; + class addInteractionSelf; + class AddSelectableItem; + class addToTooltip; + class applyButtons; + class canInteractWith; + class canLockDoor; + class canTapShoulder; + class getActions2; + class GetActions; + class getDoor; + class getDoorAnimations; + class getDown; + class getSelectedButton; + class hideMenu; + class hideMouseHint; + class initialiseInteraction; + class isInRange; + class joinTeam; + class lockDoor; + class menuKeyInput; + class moduleInteraction; + class moveDown; + class onButtonDown; + class onButtonDownSelf; + class onButtonUp; + class onClick; + class onSelectMenuDblClick; + class openDoor; + class openMenu; + class openMenuSelectUI; + class openMenuSelf; + class openSelectMenu; + class openSubMenu; + class openSubMenuSelf; + class prepareSelectMenu; + class push; + class removeInteraction; + class removeInteractionSelf; + class removeTag; + class sendAway; + class showMenu; + class showMouseHint; + class sortOptionsByPriority; + class tapShoulder; + class updateTooltipPosition; + + // backwards compatibility, remove in some patches + class getCaptivityStatus; + class setCaptivityStatus; + }; + }; +}; + +class Extended_PostInit_EventHandlers { + class AGM_Interaction { + clientInit = "call compile preprocessFileLineNumbers '\AGM_Interaction\clientInit.sqf'"; + }; +}; + +class Extended_GetIn_EventHandlers { + class All { + class AGM_AutoCloseMenu { + clientGetIn = "if (_this select 2 == AGM_player && {!isNull (findDisplay 1713999)}) then {(findDisplay 1713999) closeDisplay 1}"; + }; + }; +}; + +class Extended_GetOut_EventHandlers { + class All { + class AGM_AutoCloseMenu { + clientGetOut = "if (_this select 2 == AGM_player && {!isNull (findDisplay 1713999)}) then {(findDisplay 1713999) closeDisplay 1}"; + }; + }; +}; + +class AGM_Core_Default_Keys { + class openInteractionMenuNew { + displayName = "$STR_AGM_Interaction_InteractionMenu"; + condition = "true"; + statement = "call AGM_Interaction_fnc_onButtonDown"; + conditionUp = "!isNull (findDisplay 1713999) && {profileNamespace getVariable ['AGM_Interaction_AutoCloseMenu', false]}"; + statementUp = "if (AGM_Interaction_MenuType mod 2 == 0) then {call AGM_Interaction_fnc_onButtonUp};"; + exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting", "AGM_Interaction_isNotSwimming"}; + key = 219; + shift = 0; + control = 0; + alt = 0; + }; + class openInteractionMenuSelfNew { + displayName = "$STR_AGM_Interaction_InteractionMenuSelf"; + condition = "true"; + statement = "call AGM_Interaction_fnc_onButtonDownSelf"; + conditionUp = "!isNull (findDisplay 1713999) && {profileNamespace getVariable ['AGM_Interaction_AutoCloseMenu', false]}"; + statementUp = "if (AGM_Interaction_MenuType mod 2 == 1) then {call AGM_Interaction_fnc_onButtonUp};"; + exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting", "AGM_Interaction_isNotSwimming", "AGM_Core_notOnMap"}; + key = 219; + shift = 0; + control = 1; + alt = 0; + }; + class openDoor { + displayName = "$STR_AGM_Interaction_OpenDoor"; + condition = "!AGM_Interaction_isOpeningDoor && {[2] call AGM_Interaction_fnc_getDoor select 1 != ''}"; + statement = "call AGM_Interaction_fnc_openDoor"; + conditionUp = "AGM_Interaction_isOpeningDoor"; + statementUp = "AGM_Interaction_isOpeningDoor = false"; + key = 57; + shift = 0; + control = 1; + alt = 0; + }; + // disabled for now + /*class lockDoor { + displayName = "$STR_AGM_Interaction_LockDoor"; + condition = "[true] call AGM_Interaction_fnc_canLockDoor && {!AGM_Interaction_isOpeningDoor}"; + statement = "[true] call AGM_Interaction_fnc_lockDoor"; + key = 57; + shift = 0; + control = 0; + alt = 1; + }; + class unlockDoor { + displayName = "$STR_AGM_Interaction_UnlockDoor"; + condition = "[false] call AGM_Interaction_fnc_canLockDoor"; + statement = "[false] call AGM_Interaction_fnc_lockDoor"; + key = 57; + shift = 0; + control = 1; + alt = 1; + };*/ + class tapShoulder { + displayName = "$STR_AGM_Interaction_TapShoulder"; + condition = "[_player, cursorTarget] call AGM_Interaction_fnc_canTapShoulder"; + statement = "[_player, cursorTarget] call AGM_Interaction_fnc_tapShoulder"; + key = 20; + shift = 1; + control = 0; + alt = 0; + }; + class modifierKey { + displayName = "$STR_AGM_Interaction_ModifierKey"; + condition = ""; + statement = "AGM_Modifier = 1;"; + conditionUp = ""; + statementUp = "AGM_Modifier = 0;"; + exceptions[] = {"AGM_Drag_isNotDragging"}; + key = 29; + shift = 0; + control = 0; + alt = 0; + }; +}; + +class AGM_Core_Options { + class Interaction_FlowMenu { + displayName = "$STR_AGM_Interaction_FlowMenu"; + default = 0; + }; + class Interaction_AutoCloseMenu { + displayName = "$STR_AGM_Interaction_AutoCloseMenu"; + default = 0; + }; + class Interaction_AutoCenterCursor { + displayName = "$STR_AGM_Interaction_AutoCenterCursor"; + default = 1; + }; +}; + +class AGM_Parameters { + AGM_Modifier = 0; +}; +class AGM_Parameters_Boolean { + AGM_Interaction_EnableTeamManagement = 1; +}; + +class AGM_Core_canInteractConditions { + class AGM_Interaction_isNotEscorting { + condition = "!(_player getVariable ['AGM_isEscorting', false])"; + }; + class AGM_Interaction_isNotCaptive { + condition = "!(_player getVariable ['AGM_isCaptive', false])"; + }; + class AGM_Interaction_isNotSurrendering { + condition = "!(_player getVariable ['AGM_isSurrender', false])"; + }; + class AGM_Interaction_isNotSwimming { + condition = "!underwater _player"; + }; +}; + +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ +}; + +class CfgVehicles { + + class Module_F; + class AGM_ModuleInteraction: Module_F { + author = "$STR_AGM_Core_AGMTeam"; + category = "AGM"; + displayName = "Interaction System"; + function = "AGM_Interaction_fnc_moduleInteraction"; + scope = 2; + isGlobal = 1; + icon = "\AGM_Interaction\UI\IconInteraction_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 AGM_Actions { + class AGM_TeamManagement { + displayName = "$STR_AGM_Interaction_TeamManagement"; + distance = 4; + condition = "alive _target && {!isPlayer _target} && {_target in units group _player} && {AGM_Interaction_EnableTeamManagement}"; + statement = ""; + showDisabled = 0; + priority = 3.2; + icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; + subMenu[] = {"AGM_TeamManagement", 0}; + hotkey = "M"; + enableInside = 1; + + class AGM_JoinTeamRed { + displayName = "$STR_AGM_Interaction_JoinTeamRed"; + distance = 4; + condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; + statement = "[_target, 'RED'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + icon = "\AGM_Interaction\UI\team\team_red_ca.paa"; + priority = 2.4; + hotkey = "R"; + enableInside = 1; + }; + class AGM_JoinTeamGreen { + displayName = "$STR_AGM_Interaction_JoinTeamGreen"; + distance = 4; + condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; + statement = "[_target, 'GREEN'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + icon = "\AGM_Interaction\UI\team\team_green_ca.paa"; + priority = 2.3; + hotkey = "G"; + enableInside = 1; + }; + class AGM_JoinTeamBlue { + displayName = "$STR_AGM_Interaction_JoinTeamBlue"; + distance = 4; + condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; + statement = "[_target, 'BLUE'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + icon = "\AGM_Interaction\UI\team\team_blue_ca.paa"; + priority = 2.2; + hotkey = "B"; + enableInside = 1; + }; + class AGM_JoinTeamYellow { + displayName = "$STR_AGM_Interaction_JoinTeamYellow"; + distance = 4; + condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; + statement = "[_target, 'YELLOW'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + icon = "\AGM_Interaction\UI\team\team_yellow_ca.paa"; + priority = 2.1; + hotkey = "Y"; + enableInside = 1; + }; + + class AGM_LeaveTeam { + displayName = "$STR_AGM_Interaction_LeaveTeam"; + distance = 4; + condition = "alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'}"; + statement = "[_target, 'MAIN'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + icon = "\AGM_Interaction\UI\team\team_white_ca.paa"; + priority = 2.5; + hotkey = "N"; + enableInside = 1; + }; + }; + + class AGM_TapShoulder { + displayName = "$STR_AGM_Interaction_TapShoulder"; + distance = 4; + condition = "[_player, _target] call AGM_Interaction_fnc_canTapShoulder"; + statement = "[_player, _target] call AGM_Interaction_fnc_tapShoulder"; + showDisabled = 1; + priority = 2.8; + hotkey = "Q"; + enableInside = 1; + }; + class AGM_JoinGroup { + displayName = "$STR_AGM_Interaction_JoinGroup"; + distance = 4; + condition = "side group _player == side group _target && {group _player != group _target}"; + statement = "[_player] joinSilent group _target;"; + showDisabled = 0; + priority = 2.6; + icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; + hotkey = "J"; + enableInside = 1; + }; + + class AGM_GetDown { + displayName = "$STR_AGM_Interaction_GetDown"; + distance = 4; + condition = "[_target] call AGM_Interaction_fnc_canInteractWith"; + statement = "[_target] call AGM_Interaction_fnc_getDown"; + showDisabled = 0; + priority = 2.2; + }; + class AGM_SendAway { + displayName = "$STR_AGM_Interaction_SendAway"; + distance = 4; + condition = "[_target] call AGM_Interaction_fnc_canInteractWith"; + statement = "[_target] call AGM_Interaction_fnc_sendAway"; + showDisabled = 0; + priority = 2.0; + }; + class AGM_Pardon { + displayName = "$STR_AGM_Interaction_Pardon"; + distance = 4; + condition = "rating _target < -2000 && {alive _target} && {side group _player == side group _target}"; + statement = "[_target, '{_this addRating -rating _this}', _target] call AGM_Core_fnc_execRemoteFnc"; + showDisabled = 0; + priority = 2.5; + enableInside = 1; + }; + }; + + class AGM_SelfActions { + class AGM_TeamManagement { + displayName = "$STR_AGM_Interaction_TeamManagement"; + condition = "AGM_Interaction_EnableTeamManagement"; + statement = ""; + showDisabled = 1; + priority = 3.2; + icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; + subMenu[] = {"AGM_TeamManagement", 1}; + enableInside = 1; + hotkey = "M"; + + class AGM_JoinTeamRed { + displayName = "$STR_AGM_Interaction_JoinTeamRed"; + condition = "true"; + statement = "[_player, 'RED'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + priority = 2.4; + icon = "\AGM_Interaction\UI\team\team_red_ca.paa"; + enableInside = 1; + hotkey = "R"; + }; + class AGM_JoinTeamGreen { + displayName = "$STR_AGM_Interaction_JoinTeamGreen"; + condition = "true"; + statement = "[_player, 'GREEN'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + priority = 2.3; + icon = "\AGM_Interaction\UI\team\team_green_ca.paa"; + enableInside = 1; + hotkey = "G"; + }; + class AGM_JoinTeamBlue { + displayName = "$STR_AGM_Interaction_JoinTeamBlue"; + condition = "true"; + statement = "[_player, 'BLUE'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + priority = 2.2; + icon = "\AGM_Interaction\UI\team\team_blue_ca.paa"; + enableInside = 1; + hotkey = "B"; + }; + class AGM_JoinTeamYellow { + displayName = "$STR_AGM_Interaction_JoinTeamYellow"; + condition = "true"; + statement = "[_player, 'YELLOW'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + priority = 2.1; + icon = "\AGM_Interaction\UI\team\team_yellow_ca.paa"; + enableInside = 1; + hotkey = "Y"; + }; + + class AGM_LeaveTeam { + displayName = "$STR_AGM_Interaction_LeaveTeam"; + condition = "assignedTeam _player != 'MAIN'"; + statement = "[_player, 'MAIN'] call AGM_Interaction_fnc_joinTeam"; + showDisabled = 1; + priority = 2.5; + icon = "\AGM_Interaction\UI\team\team_white_ca.paa"; + enableInside = 1; + hotkey = "N"; + }; + + class AGM_BecomeLeader { + displayName = "$STR_AGM_Interaction_BecomeLeader"; + condition = "count (units group _player) > 1 && {leader group _player != _player}"; + statement = "_newGroup = createGroup side group _player; (units group _player) joinSilent _newGroup; _newGroup selectLeader _player;"; + showDisabled = 1; + priority = 1.0; + icon = "\AGM_Interaction\UI\team\team_white_ca.paa"; + enableInside = 1; + hotkey = "L"; + }; + class AGM_LeaveGroup { + displayName = "$STR_AGM_Interaction_LeaveGroup"; + condition = "count (units group _player) > 1"; + statement = "_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;"; + showDisabled = 1; + priority = 1.2; + icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; + enableInside = 1; + hotkey = "M"; + }; + }; + + /* DANCE ANIMATION DOESN'T WORK :( + class AGM_Dance { + displayName = "$STR_AGM_Interaction_Dance"; + condition = "isClass (configFile >> 'CfgPatches' >> 'AGM_Movement') and !AGM_Dancing"; + statement = "AGM_Dancing = true; [-2, {_this switchMove 'TestDance';}, player] call CBA_fnc_globalExecute;"; + showDisabled = 0; + priority = -1.2; + }; + class AGM_StopDancing { + displayName = "$STR_AGM_Interaction_StopDancing"; + condition = "AGM_Dancing"; + statement = "AGM_Dancing = false; [-2, {_this switchMove '';}, player] call CBA_fnc_globalExecute;"; + showDisabled = 0; + priority = -1.2; + }; + */ + + class AGM_Gestures { + displayName = "$STR_AGM_Interaction_Gestures"; + condition = "canStand _target"; + statement = ""; + showDisabled = 1; + priority = 3.5; + subMenu[] = {"AGM_Gestures", 1}; + icon = "AGM_Interaction\UI\gestures_ca.paa"; + hotkey = "G"; + + /*class AGM_Gesture_Advance { + displayName = "$STR_AGM_Interaction_Gestures_Attack"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureAttack';"; + showDisabled = 1; + priority = 2.0; + };*/ + class AGM_Gesture_Advance { + displayName = "$STR_AGM_Interaction_Gestures_Advance"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureAdvance';"; + showDisabled = 1; + priority = 1.9; + hotkey = "1"; + }; + class AGM_Gesture_Go { + displayName = "$STR_AGM_Interaction_Gestures_Go"; + condition = "canStand _target"; + statement = "_target playActionNow (['gestureGo', 'gestureGoB'] select (floor random 2));"; + showDisabled = 1; + priority = 1.8; + hotkey = "2"; + }; + class AGM_Gesture_Follow { + displayName = "$STR_AGM_Interaction_Gestures_Follow"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureFollow';"; + showDisabled = 1; + priority = 1.7; + hotkey = "3"; + }; + /*class AGM_Gesture_Point { + displayName = "$STR_AGM_Interaction_Gestures_Point"; + condition = "canStand _target"; + statement = "_target playActionNow 'gesturePoint';"; + showDisabled = 1; + priority = 1.6; + };*/ + class AGM_Gesture_Up { + displayName = "$STR_AGM_Interaction_Gestures_Up"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureUp';"; + showDisabled = 1; + priority = 1.5; + hotkey = "4"; + }; + class AGM_Gesture_Cover { + displayName = "$STR_AGM_Interaction_Gestures_Cover"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureCover';"; + showDisabled = 1; + priority = 1.4; + hotkey = "5"; + }; + class AGM_Gesture_CeaseFire { + displayName = "$STR_AGM_Interaction_Gestures_Cease_Fire"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureCeaseFire';"; + showDisabled = 1; + priority = 1.3; + hotkey = "6"; + }; + class AGM_Gesture_Freeze { + displayName = "$STR_AGM_Interaction_Gestures_Freeze"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureFreeze';"; + showDisabled = 1; + priority = 1.2; + hotkey = "7"; + }; + class AGM_Gesture_Yes { + displayName = "$STR_AGM_Interaction_Gestures_Yes"; + condition = "canStand _target"; + statement = "_target playActionNow (['gestureYes', 'gestureNod'] select (floor random 2));"; + showDisabled = 1; + priority = 1.1; + hotkey = "8"; + }; + class AGM_Gesture_No { + displayName = "$STR_AGM_Interaction_Gestures_No"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureNo';"; + showDisabled = 1; + priority = 1.0; + hotkey = "9"; + }; + class AGM_Gesture_Hi { + displayName = "$STR_AGM_Interaction_Gestures_Hi"; + condition = "canStand _target"; + statement = "_target playActionNow (['gestureHi', 'gestureHiB', 'gestureHiC'] select (floor random 3));"; + showDisabled = 1; + priority = 0.9; + hotkey = "0"; + }; + }; + + class AGM_Equipment { + displayName = "$STR_AGM_Interaction_Equipment"; + condition = "true"; + statement = ""; + showDisabled = 1; + priority = 4.5; + icon = ""; // @todo + subMenu[] = {"AGM_Equipment", 1}; + enableInside = 1; + hotkey = "E"; + + class AGM_Dummy { + displayName = ""; + condition = "false"; + statement = ""; + showDisabled = 1; + priority = -99; + icon = "AGM_Core\UI\blank_CO.paa"; + enableInside = 1; + }; + }; + }; + }; + + class LandVehicle; + class Car: LandVehicle { + class AGM_Actions {}; + class AGM_SelfActions {}; + }; + class Tank: LandVehicle { + class AGM_Actions {}; + class AGM_SelfActions {}; + }; + + class Air; + class Helicopter: Air { + class AGM_Actions {}; + class AGM_SelfActions {}; + }; + class Plane: Air { + class AGM_Actions {}; + class AGM_SelfActions {}; + }; + + class Ship; + class Ship_F: Ship { + class AGM_Actions { + class AGM_Push { + displayName = "$STR_AGM_Interaction_Push"; + distance = 4; + condition = "getMass _target < 1000 and alive _target"; + statement = "[_target, [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]] call AGM_Interaction_fnc_push;"; + showDisabled = 0; + priority = -1; + }; + }; + class AGM_SelfActions {}; + }; + + class StaticWeapon: LandVehicle { + class AGM_Actions {}; + class AGM_SelfActions {}; + }; + + class StaticMortar; + class Mortar_01_base_F: StaticMortar { + class AGM_Actions {}; + class AGM_SelfActions {}; + }; + + class Box_NATO_Support_F; + class AGM_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(AGM_CableTie,24) + }; + }; +}; + +class CfgWeapons { + class AGM_ItemCore; + class InventoryItem_Base_F; + + class AGM_CableTie: AGM_ItemCore { + displayName = "$STR_AGM_Interaction_CableTie_Name"; + descriptionShort = "$STR_AGM_Interaction_CableTie_Description"; + model = "\AGM_Interaction\agm_cabletie.p3d"; + picture = "\AGM_Interaction\UI\agm_cabletie_x_ca.paa"; + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + }; + }; +}; + +#include diff --git a/addons/interaction/functions/fn_AddSelectableItem.sqf b/addons/interaction/functions/fn_AddSelectableItem.sqf new file mode 100644 index 0000000000..f6fccae709 --- /dev/null +++ b/addons/interaction/functions/fn_AddSelectableItem.sqf @@ -0,0 +1,40 @@ +/* + Name: AGM_Interaction_fnc_AddSelectableItem + + 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: +*/ +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 = "AGM_Interaction\UI\dot_ca.paa"; +}; + +if ((profileNamespace getVariable ["AGM_Interaction_FlowMenu", false])) then { + //[_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey] + _container pushBack [_displayName, nil, {true},0,[], _picture, "", {true}, [], 4, "", _data]; +}else{ + _index = lbAdd [_container, _displayName]; + lbSetData [_container, _index, str _data]; + lbSetPicture [_container, _index, _picture]; +}; + +_container diff --git a/addons/interaction/functions/fn_GetActions.sqf b/addons/interaction/functions/fn_GetActions.sqf new file mode 100644 index 0000000000..6e7b067150 --- /dev/null +++ b/addons/interaction/functions/fn_GetActions.sqf @@ -0,0 +1,154 @@ +/* + Name: AGM_Interaction_fnc_GetActions + + Author: + commy2 + Garth de Wet (LH) + + Description: + + Parameters: + 0: OBJECT - target + 1: ARRAY - Parents of the target object + 2: ARRAY - Actions + 3: ARRAY - Patches + 4: CONFIG - Parent config (ConfigFile >> "CfgVehicles"/MissionConfigFile >> "CfgVehicles") + 5: BOOL - Is mission config file? + 6: STRING - Classname ("AGM_Actions"/"AGM_SelfActions") + 7: STRING - Sub-class + + Returns: + Nothing + + Example: + [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "AGM_Actions"] call AGM_Interaction_fnc_GetActions; + + [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "AGM_SelfActions"] call AGM_Interaction_fnc_GetActions; +*/ +#define DEFAULT_ICON "\AGM_Interaction\UI\dot_ca.paa" +private ["_target", "_parents", "_actions", "_patches", "_baseConfig", "_actionType", "_i","_index", "_missionConfig", "_stdConfig"]; +_target = _this select 0; +_parents = _this select 1; +_actions = _this select 2; +_patches = _this select 3; +_baseConfig = _this select 4; +_missionConfig = _this select 5; +_actionType = _this select 6; +_subClass = _this select 7; + +_stdConfig = (configFile >> "CfgVehicles" >> typeOf _target >> _actionType); +if (_subClass != "") then { + _stdConfig = _stdConfig >> _subClass; +}; + +_count = count _parents; +for "_i" from 0 to (_count - 1) do { + _config = _baseConfig >> _parents select _i >> _actionType; + if (_subClass != "") then { + _config = _config >> _subClass; + }; + + _count = count _config; + if (_count > 0) then { + for "_index" from 0 to (_count - 1) do { + private ["_action", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority", "_tooltip", "_hotkey", + "_subMenu", "_conditionShow", "_exceptions", "_icon", "_actionToCache", "_cacheActions", "_cache", "_indexCache", "_configName"]; + _action = if (_missionConfig) then {_config select _index} else {_stdConfig >> configName (_config select _index)}; + _cache = missionNamespace getVariable ["AGM_Interaction_MenuCache", [[], [], []]]; + + if (count _action > 0) then { + _configName = configName _action; + + _cacheConfigs = _cache select 0; + _cacheActions = _cache select 1; + _cacheIndices = _cache select 2; + + _indexCache = _cacheConfigs find _action; + if (_indexCache == -1) then { + _displayName = getText (_action >> "displayName"); + _distance = getNumber (_action >> "distance"); + _priority = getNumber (_action >> "priority"); + _subMenu = getArray (_action >> "subMenu"); + _tooltip = getText (_action >> "tooltip"); + _hotkey = getText (_action >> "hotkey"); + _enableInside = getNumber (_action >> "enableInside"); + + // Condition + _condition = getText (_action >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _condition = _condition + format [" && {%1 call AGM_Core_canInteract} && {[AGM_player, AGM_Interaction_Target] call AGM_Core_fnc_canInteractWith}", getArray (_action >> "exceptions")]; + if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; + + _condition = compile _condition; + + // Condition to show the action + _conditionShow = getText (_action >> "conditionShow"); + _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call _conditionShow; + }; + + // Exceptions to the general conditions that have to be true + _exceptions = getArray (_action >> "exceptions"); + + // statement + _statement = getText (_action >> "statement"); + _statement = compile _statement; + + if (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]) then { + _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { + compile format ["call AGM_Interaction_fnc_hideMenu;if(%2 == 1)then{['%1'] call AGM_Interaction_fnc_openSubMenuSelf;}else{['%1'] call AGM_Interaction_fnc_openSubMenu;};", _subMenu select 0, _subMenu select 1]; + } else { + compile ("call AGM_Interaction_fnc_hideMenu;" + getText (_action >> "statement")); + }; + }; + + // icon + _icon = getText (_action >> "Icon"); + if (_icon == "") then { + _icon = DEFAULT_ICON; + }; + + _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; + + if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call _condition}} && {_distance == 0 || {[_object, _distance] call AGM_Interaction_fnc_isInRange}}) then { + _actions pushBack _actionToCache; + _patches pushBack _configName; + }; + + _indexCache = _cacheActions find _actionToCache; + if (_indexCache == -1) then { + _indexCache = count _cacheActions; + _cacheActions pushBack _actionToCache; + }; + + _cacheConfigs pushBack _action; + _cacheIndices pushBack _indexCache; + + _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; + ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call AGM_Debug_fnc_log; + } else { + ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call AGM_Debug_fnc_log; + + _cachedAction = _cacheActions select (_cacheIndices select _indexCache); + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call (_cachedAction select 7); + }; + + if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call (_cachedAction select 2)}} && {[_object, (_cachedAction select 9)] call AGM_Interaction_fnc_isInRange || {(_cachedAction select 9) == 0}}) then { + _actions pushBack _cachedAction; + _patches pushBack _configName; + }; + }; + }; + + AGM_Interaction_MenuCache = _cache; + }; + }; +}; +[_actions, _patches] diff --git a/addons/interaction/functions/fn_MoveDown.sqf b/addons/interaction/functions/fn_MoveDown.sqf new file mode 100644 index 0000000000..7a5662ed9b --- /dev/null +++ b/addons/interaction/functions/fn_MoveDown.sqf @@ -0,0 +1,66 @@ +/* + Name: AGM_Interaction_fnc_MoveDown + + 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 AGM_Interaction_fnc_MoveDown; + -1 call AGM_Interaction_fnc_MoveDown; +*/ +#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) +if (isNil "AGM_Interaction_MainButton") exitWith{}; +if (isNil "AGM_Interaction_Buttons") exitWith{}; +_count = (count AGM_Interaction_Buttons)- 1; +AGM_Interaction_SelectedButton = CLAMP(AGM_Interaction_SelectedButton + _this, 0, _count); + +_target = AGM_Interaction_Target; +_player = AGM_player; +_vehicle = vehicle _player; + +disableSerialization; +_dlgInteractionDialog = uiNamespace getVariable "AGM_Flow_Display"; +_top = AGM_Interaction_SelectedButton - 2; +_i = 0; +while {_i <= 4} do { + _index =_i + _top; + _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); + if (_index >= 0 && {_index <= _count}) then { + _action = AGM_Interaction_Buttons select _index; + _ctrl ctrlShow true; + _ctrl ctrlSetText (_action select 5); + _color = [1,1,1,1]; + if !([_target, _player] call (_action select 2)) then { + _color = [0.3,0.3,0.3,0.8]; + }; + if (_i == 0 || _i == 4) then { + _color set [3, 0.5]; + }; + if (_i == 1 || _i == 3) then { + _color set [3, 0.75]; + }; + _ctrl ctrlSetTextColor _color; + }else{ + _ctrl ctrlShow false; + }; + _i = _i + 1; +}; + +_ctrl = _dlgInteractionDialog displayCtrl 1000; +_ctrl ctrlSetText ((AGM_Interaction_Buttons select AGM_Interaction_SelectedButton) select 0); +_ctrl = _dlgInteractionDialog displayCtrl 1100; +_current = (AGM_Interaction_Buttons select AGM_Interaction_SelectedButton); +_infoText = ""; +if !([_target, _player] call (_current select 2)) then { + _infoText = "Unavailable"; +}; +_ctrl ctrlSetText _infoText; +_ctrl ctrlShow (_infoText != ""); diff --git a/addons/interaction/functions/fn_addInteraction.sqf b/addons/interaction/functions/fn_addInteraction.sqf new file mode 100644 index 0000000000..72c3ccb182 --- /dev/null +++ b/addons/interaction/functions/fn_addInteraction.sqf @@ -0,0 +1,55 @@ +/* + * Author: commy2 + * + * Add an AGM action to an object. Note: This function is global. + * + * Argument: + * 0: Object the action should be assigned to (Object) + * 1: Name of the action shown in the menu (String) + * 2: Distance the player can be away from the object (Number) + * 3: Condition (Code or String) + * 4: Statement (Code or String) + * 5: Show the action even if the conditon is not met (Bool or Number) + * 6: Priority (Number, optional default: 0) + * + * Return value: + * ID of the action (used to remove it later). + */ + +private ["_object", "_displayName", "_distance", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_object = _this select 0; +_displayName = _this select 1; +_distance = _this select 2; +_condition = _this select 3; +_statement = _this select 4; +_showDisabled = _this select 5; +_priority = _this select 6; + +if (typeName _condition == "STRING") then { + _condition = compile _condition; +}; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +if (typeName _showDisabled == "SCALAR") then { + _showDisabled = _showDisabled > 0; +}; + +if (isNil "_priority") then { + _priority = 0; +}; + +_actionsVar = _object getVariable ["AGM_Interactions", [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack [_displayName, _distance, _condition, _statement, _showDisabled, _priority]; + +_object setVariable ["AGM_Interactions", [_id, _actionIDs, _actions], true]; +_id diff --git a/addons/interaction/functions/fn_addInteractionSelf.sqf b/addons/interaction/functions/fn_addInteractionSelf.sqf new file mode 100644 index 0000000000..bccaf40528 --- /dev/null +++ b/addons/interaction/functions/fn_addInteractionSelf.sqf @@ -0,0 +1,55 @@ +/* + * Author: commy2 + * + * Add an AGM self action to the player. Execute this on the local machine of the player. + * + * Argument: + * 0: Name of the action shown in the menu (String) + * 1: Condition (Code or String) + * 2: Statement (Code or String) + * 3: Show the action even if the conditon is not met (Bool or Number) + * 4: Priority (Number, optional default: 0) + * + * Return value: + * ID of the action (used to remove it later). + */ + + + +private ["_displayName", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; + + +_displayName = _this select 0; + +_condition = _this select 1; +_statement = _this select 2; +_showDisabled = _this select 3; +_priority = _this select 4; + +if (typeName _condition == "STRING") then { + _condition = compile _condition; +}; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +if (typeName _showDisabled == "SCALAR") then { + _showDisabled = _showDisabled > 0; +}; + +if (isNil "_priority") then { + _priority = 0; +}; + +_actionsVar = AGM_player getVariable ["AGM_InteractionsSelf", [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack [_displayName, _condition, _statement, _showDisabled, _priority]; + +AGM_player setVariable ["AGM_InteractionsSelf", [_id, _actionIDs, _actions], false]; +_id diff --git a/addons/interaction/functions/fn_addToTooltip.sqf b/addons/interaction/functions/fn_addToTooltip.sqf new file mode 100644 index 0000000000..b54b7c5716 --- /dev/null +++ b/addons/interaction/functions/fn_addToTooltip.sqf @@ -0,0 +1,3 @@ +// by commy2 + +AGM_Interaction_CurrentTooltip pushBack (_this select 0); diff --git a/addons/interaction/functions/fn_applyButtons.sqf b/addons/interaction/functions/fn_applyButtons.sqf new file mode 100644 index 0000000000..8bc732f946 --- /dev/null +++ b/addons/interaction/functions/fn_applyButtons.sqf @@ -0,0 +1,51 @@ +// by commy2 + +private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; + +_object = AGM_Interaction_Target; +_actions = AGM_Interaction_Buttons; + + +disableSerialization; +_dlgInteractionDialog = uiNamespace getVariable "AGM_Interaction_Dialog"; + +/* +for "_a" from 0 to (_count - 1) do { + _action = AGM_Interaction_Buttons select _a; + + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); + _ctrlInteractionDialog ctrlShow true; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); +}; +*/ + +_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; + +AGM_Interaction_MainButton = "(findDisplay 1713999) closeDisplay 1;"; + +if (_object isKindOf "Man") then { + _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["AGM_Name", "Unknown"]}); +} else { + _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); +}; + +for "_index" from 0 to 9 do { + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); + _ctrlInteractionDialog ctrlShow true; + + _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); + + if (_index < _count) then { + _action = AGM_Interaction_Buttons select _index; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); + + _ctrlInteractionDialogIcon ctrlSetText (_action select 5); + } else { + _ctrlInteractionDialog ctrlSetText ""; + _ctrlInteractionDialog ctrlEnable false; + + _ctrlInteractionDialogIcon ctrlSetText ""; + }; +}; diff --git a/addons/interaction/functions/fn_canInteractWith.sqf b/addons/interaction/functions/fn_canInteractWith.sqf new file mode 100644 index 0000000000..8766ff096e --- /dev/null +++ b/addons/interaction/functions/fn_canInteractWith.sqf @@ -0,0 +1,12 @@ +// by commy2 + +private ["_unit", "_isCivilian"]; + +_unit = _this select 0; +_isCivilian = _this select 1; + +if (isNil "_isCivilian") then {_isCivilian = true}; + +alive _unit +&& [side _unit != side AGM_player, side group _unit == civilian] select _isCivilian +//&& {count (weapons _unit) == 0} diff --git a/addons/interaction/functions/fn_canLockDoor.sqf b/addons/interaction/functions/fn_canLockDoor.sqf new file mode 100644 index 0000000000..8591bc3c78 --- /dev/null +++ b/addons/interaction/functions/fn_canLockDoor.sqf @@ -0,0 +1,16 @@ +// by commy2 + +private ["_mode", "_info", "_house", "_door", "_id"]; + +_mode = _this select 0; //lock: true, unlock: false + +_info = [2] call AGM_Interaction_fnc_getDoor; + +_house = _info select 0; +_door = _info select 1; +_id = _info select 2; + +!isNull _house +&& {_door == "door"} +&& {!_mode || {_house animationPhase format ["door_%1_rot", _id] <= 0}} +&& {(_house getVariable [format ["BIS_Disabled_Door_%1", _id], 0] != 1) isEqualTo _mode} diff --git a/addons/interaction/functions/fn_canTapShoulder.sqf b/addons/interaction/functions/fn_canTapShoulder.sqf new file mode 100644 index 0000000000..0966b53c37 --- /dev/null +++ b/addons/interaction/functions/fn_canTapShoulder.sqf @@ -0,0 +1,11 @@ +// by commy2 + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +_target isKindOf "CAManBase" && +{alive _target} && +{_unit distance _target < 4} && +{!(_target getVariable ["AGM_isUnconscious", false])} diff --git a/addons/interaction/functions/fn_getActions2.sqf b/addons/interaction/functions/fn_getActions2.sqf new file mode 100644 index 0000000000..2ede8ea968 --- /dev/null +++ b/addons/interaction/functions/fn_getActions2.sqf @@ -0,0 +1,120 @@ +// commy2 + +private ["_object", "_config", "_type", "_actions", "_configs"]; + +_object = _this select 0; +_config = _this select 1; // configFile, missionConfigFile +_type = _this select 2; // "AGM_CfgInteractions", "AGM_CfgInteractionsSelf" +_actions = _this select 3; // []; + +_configs = "_object isKindOf configName _x" configClasses (_config >> _type); + +// cache +private ["_cache", "_cacheConfigs", "_cacheActions", "_cacheIndices"]; + +_cache = uiNamespace getVariable ["AGM_Interaction_MenuCache", [[], [], []]]; +_cacheConfigs = _cache select 0; +_cacheActions = _cache select 1; +_cacheIndices = _cache select 2; + +// get interactions +{ + private "_configActions"; + + _configActions = "true" configClasses (_config >> _type >> configName _x); + { + private ["_action", "_configName", "_indexCache"]; + + _action = _x; + _configName = configName _action; + + _indexCache = _cacheConfigs find _action; + if (_indexCache == -1) then { + private ["_displayName", "_distance", "_priority", "_subMenu", "_tooltip", "_hotkey", "_enableInside", "_condition", "_conditionShow", "_showDisabled", "_exceptions", "_statement", "_icon"]; + + _displayName = getText (_action >> "displayName"); + _distance = getNumber (_action >> "distance"); + _priority = getNumber (_action >> "priority"); + _subMenu = getArray (_action >> "subMenu"); + _tooltip = getText (_action >> "tooltip"); + _hotkey = getText (_action >> "hotkey"); + _enableInside = getNumber (_action >> "enableInside"); + + // Condition + _condition = getText (_action >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _condition = _condition + format [" && {%1 call AGM_Core_canInteract} && {[AGM_player, AGM_Interaction_Target] call AGM_Core_fnc_canInteractWith}", getArray (_action >> "exceptions")]; + if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; + + _condition = compile _condition; + + // Condition to show the action + _conditionShow = getText (_action >> "conditionShow"); + _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call _conditionShow; + }; + + // Exceptions to the general conditions that have to be true + _exceptions = getArray (_action >> "exceptions"); + + // statement + _statement = getText (_action >> "statement"); + _statement = compile _statement; + + if (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]) then { + _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { + compile format ["call AGM_Interaction_fnc_hideMenu;if(%2 == 1)then{['%1'] call AGM_Interaction_fnc_openSubMenuSelf;}else{['%1'] call AGM_Interaction_fnc_openSubMenu;};", _subMenu select 0, _subMenu select 1]; + } else { + compile ("call AGM_Interaction_fnc_hideMenu;" + getText (_action >> "statement")); + }; + }; + + // icon + _icon = getText (_action >> "Icon"); + if (_icon == "") then { + _icon = DEFAULT_ICON; + }; + + private "_actionToCache"; + _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; + + if ((_showDisabled || {[_object, _player] call _condition}) && {_distance == 0 || {[_object, _distance] call AGM_Interaction_fnc_isInRange}}) then { + _actions pushBack _actionToCache; + }; + + _indexCache = _cacheActions find _actionToCache; + if (_indexCache == -1) then { + _indexCache = count _cacheActions; + _cacheActions pushBack _actionToCache; + }; + + _cacheConfigs pushBack _action; + _cacheIndices pushBack _indexCache; + + _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; + ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call AGM_Debug_fnc_log; + } else { + ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call AGM_Debug_fnc_log; + + private ["_cachedAction", "_showDisabled"]; + _cachedAction = _cacheActions select (_cacheIndices select _indexCache); + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call (_cachedAction select 7); + }; + + if ((_showDisabled || {[_object, _player] call (_cachedAction select 2)}) && {[_object, (_cachedAction select 9)] call AGM_Interaction_fnc_isInRange || {(_cachedAction select 9) == 0}}) then { + _actions pushBack _cachedAction; + }; + }; + } forEach _configActions; //Actions of this CfgVehicles class +} forEach _configs; //CfgVehicles class + +uiNamespace setVariable ["AGM_Interaction_MenuCache", _cache]; + +_actions diff --git a/addons/interaction/functions/fn_getCaptivityStatus.sqf b/addons/interaction/functions/fn_getCaptivityStatus.sqf new file mode 100644 index 0000000000..43538e882b --- /dev/null +++ b/addons/interaction/functions/fn_getCaptivityStatus.sqf @@ -0,0 +1,3 @@ +// by commy2 + +_this call AGM_Core_fnc_getCaptivityStatus; diff --git a/addons/interaction/functions/fn_getDoor.sqf b/addons/interaction/functions/fn_getDoor.sqf new file mode 100644 index 0000000000..19e5277873 --- /dev/null +++ b/addons/interaction/functions/fn_getDoor.sqf @@ -0,0 +1,31 @@ +// by commy2 + +private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; + +_distance = _this select 0; + +_position0 = positionCameraToWorld [0, 0, 0]; +_position1 = positionCameraToWorld [0, 0, _distance]; + +_intersections = lineIntersectsWith [ATLToASL _position0, ATLToASL _position1, objNull, objNull, true]; + +_count = count _intersections; +if (_count == 0) exitWith {[objNull, ""]}; + +_house = _intersections select (_count - 1); + +// shithouse is bugged +if (typeOf _house == "") exitWith {[objNull, ""]}; + +_intersections = [_house, "GEOM"] intersect [_position0, _position1]; + +_door = _intersections select 0 select 0; +if (isNil "_door") exitWith {[_house, ""]}; +[_house, _door] + +/* +_house = cursorTarget; +_actions = "true" configClasses (configFile >> "CfgVehicles" >> typeOf _house >> "UserActions"); +_actions = [_actions, {getText (_x >> "statement")}] call AGM_Core_fnc_map; +_actions +*/ diff --git a/addons/interaction/functions/fn_getDoorAnimations.sqf b/addons/interaction/functions/fn_getDoorAnimations.sqf new file mode 100644 index 0000000000..67e6788754 --- /dev/null +++ b/addons/interaction/functions/fn_getDoorAnimations.sqf @@ -0,0 +1,106 @@ +// by commy2 + +private ["_house", "_door", "_animations", "_lockedVariable"]; + +_house = _this select 0; +_door = _this select 1; + +_index = [ + "door_1", + "door_2", + "door_3", + "door_4", + "door_5", + "door_6", + "door_7", + "door_8", + "door_9", + "door_10", + "door_11", + "door_12", + "door_13", + "Door_14", + "door_15", + "door_16", + "door_17", + "door_18", + "door_19", + "door_20", + "door_21", + "door_22", + + "hatch_1", + "hatch_2", + "hatch_3", + "hatch_4", + "hatch_5", + "hatch_6" +] find toLower _door; + +if (_index == -1) exitWith {[[],""]}; + +_animations = [ + ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], + ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], + ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], + ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], + ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], + ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], + ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], + ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], + ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], + ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], + ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], + ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], + ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], + ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], + ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], + ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], + ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], + ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], + ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], + ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], + ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], + ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], + + ["Hatch_1_rot"], + ["Hatch_2_rot"], + ["Hatch_3_rot"], + ["Hatch_4_rot"], + ["Hatch_5_rot"], + ["Hatch_6_rot"] +] select _index; + +_lockedVariable = [ + ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], + ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], + ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], + ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], + ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], + ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], + ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], + ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], + ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], + ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], + ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], + ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], + ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], + ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], + ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], + ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], + ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], + ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], + ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], + ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], + ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], + ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], + + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""] +] select _index; + +[_animations, _lockedVariable] diff --git a/addons/interaction/functions/fn_getDown.sqf b/addons/interaction/functions/fn_getDown.sqf new file mode 100644 index 0000000000..73bae1c883 --- /dev/null +++ b/addons/interaction/functions/fn_getDown.sqf @@ -0,0 +1,33 @@ +/* + * Author: KoffeinFlummi + * + * Forces a civilian to the ground. (chance of failure). + * + * Arguments: + * 0: Unit to be sent away (Object) + * + * Return value: + * none + */ + +#define RADIUS 10 + +private ["_unit", "_chance", "_x"]; + +_unit = _this select 0; + +AGM_player playActionNow "GestureGo"; // put something else here. + +if (count (weapons AGM_player) > 0) then { + _chance = 0.8; +} else { + _chance = 0.5; +}; + +{ + if (count (weapons _unit) == 0 and random 1 < _chance) then { + [-2, { + _this setUnitPos "DOWN"; + }, _x] call CBA_fnc_globalExecute; + }; +} foreach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fn_getSelectedButton.sqf b/addons/interaction/functions/fn_getSelectedButton.sqf new file mode 100644 index 0000000000..3813811703 --- /dev/null +++ b/addons/interaction/functions/fn_getSelectedButton.sqf @@ -0,0 +1,23 @@ +// by commy2 + +#define MIN_DISTANCE 0.0065 + +private ["_position", "_distance", "_angle"]; + +_position = uiNamespace getVariable ['AGM_Interaction_CursorPosition', [0.5, 0.5, 0]]; + +_position = [((_position select 1) - 0.5) / safezoneH, ((_position select 2) - 0.5) / safezoneW, 0]; + +_distance = [0, 0, 0] vectorDistanceSqr _position; + +// is in center +if (_distance < MIN_DISTANCE) exitWith {-1}; + +_angle = (_position select 0) atan2 (_position select 1); + +// rotate circle +_angle = 180 - _angle + 360 / 10 / 2; +if (_angle < 0) then {_angle = _angle + 360}; + +_angle = floor (_angle / 360 * 10); +if (_angle == 10) then {0} else {_angle} diff --git a/addons/interaction/functions/fn_hideMenu.sqf b/addons/interaction/functions/fn_hideMenu.sqf new file mode 100644 index 0000000000..24e867b5b5 --- /dev/null +++ b/addons/interaction/functions/fn_hideMenu.sqf @@ -0,0 +1,22 @@ +/* + Name: AGM_Interaction_fnc_hideMenu + + Author: Garth de Wet (LH) + + Description: + Closes the Interaction menu + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call AGM_Interaction_fnc_hideMenu; +*/ +closeDialog 0; +(findDisplay 1713999) closeDisplay 1; +(uiNameSpace getVariable "AGM_Flow_Display") closeDisplay 0; +AGM_Interaction_MainButton = nil; +call AGM_Interaction_fnc_hideMouseHint; \ No newline at end of file diff --git a/addons/interaction/functions/fn_hideMouseHint.sqf b/addons/interaction/functions/fn_hideMouseHint.sqf new file mode 100644 index 0000000000..f8f9b75b35 --- /dev/null +++ b/addons/interaction/functions/fn_hideMouseHint.sqf @@ -0,0 +1,22 @@ +/* + Name: AGM_Interaction_fnc_hideMouseHint + + 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 AGM_Interaction_fnc_hideMouseHint; +*/ +if (isNull (uiNamespace getVariable ["AGM_Helper_Display", objNull])) exitWith{}; + +("AGM_InteractionHelper" call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; +showHUD true; \ No newline at end of file diff --git a/addons/interaction/functions/fn_initialiseInteraction.sqf b/addons/interaction/functions/fn_initialiseInteraction.sqf new file mode 100644 index 0000000000..556e3d0bd6 --- /dev/null +++ b/addons/interaction/functions/fn_initialiseInteraction.sqf @@ -0,0 +1,167 @@ +/* + Name: AGM_Interaction_fnc_initialiseInteraction + + Author: + commy2 + Garth de Wet (LH) + + Description: + Initialises the interaction click handlers. + + Parameters: + 0 : CODE - code to call when right clicking/center button + 1 : BOOLEAN - Submenu + 2 : BOOLEAN - Flow Menu + 3 : BOOLEAN - Self interaction + 4 : OBJECT - Target + + Returns: + Nothing + + Example: + [{"Default" call AGM_Interaction_fnc_openMenu;}, true, (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]), AGM_Interaction_Target] call AGM_Interaction_fnc_initialiseInteraction; +*/ +private ["_subMenu", "_selfMenu", "_target"]; +AGM_Interaction_MainButton = _this select 0; +_subMenu = _this select 1; +_selfMenu = _this select 3; +_target = _this select 4; + +_player = AGM_player; +_vehicle = vehicle _player; +//_object = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); + +if !([_target, 5] call AGM_Interaction_fnc_isInRange) exitWith {}; + +AGM_Interaction_Shortcuts = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; + +// Flow menu +if (_this select 2) then { + ("AGM_FlowMenu" call BIS_fnc_rscLayer) cutRsc ["AGM_FlowMenu", "PLAIN",0.5, false]; + AGM_Interaction_SelectedButton = 0; + (findDisplay 1713999) closeDisplay 1; + if (_player getVariable ["AGM_AcceptAction", -1] == -1) then { + [{if(isNil {AGM_Interaction_MainButton} || {!(profileNamespace getVariable ['AGM_Interaction_FlowMenu', false])})exitWith{false};(-(_this select 0) / 1.2) call AGM_Interaction_fnc_MoveDown;true}] call AGM_Core_fnc_addScrollWheelEventHandler; + + _player setVariable ["AGM_AcceptAction", [_player, "DefaultAction", {(!isNil {AGM_Interaction_MainButton}) && {(profileNamespace getVariable ['AGM_Interaction_FlowMenu', false])}}, {_action = AGM_Interaction_Buttons select AGM_Interaction_SelectedButton;_target = AGM_Interaction_Target;_player = AGM_player;_vehicle = vehicle _player;if ([_target, _player] call (_action select 2)) then {call AGM_Interaction_fnc_hideMenu;if(count _action == 12) then{(_action select 11) call (_action select 1);}else{[_target, _player] call (_action select 1);};};}] call AGM_core_fnc_addActionEventHandler]; + _player setVariable ["AGM_AcceptAction", [_player, "menuBack", {(!isNil {AGM_Interaction_MainButton}) && {(profileNamespace getVariable ['AGM_Interaction_FlowMenu', false])}}, {call AGM_Interaction_MainButton;}] call AGM_core_fnc_addActionEventHandler]; + }; + 0 call AGM_Interaction_fnc_moveDown; + [localize "STR_AGM_Interaction_MakeSelection", if (_subMenu)then{localize "STR_AGM_Interaction_Back"}else{""}, localize "STR_AGM_Interaction_ScrollHint"] call AGM_Interaction_fnc_showMouseHint; + ((uiNamespace getVariable "AGM_Flow_Display") displayCtrl (1210)) ctrlShow _subMenu; +}else{ // Rose + if (!isNull(uiNamespace getVariable "AGM_Flow_Display")) then { + (uiNameSpace getVariable "AGM_Flow_Display") closeDisplay 0; + call AGM_Interaction_fnc_hideMouseHint; + }; + if (!_subMenu || {isNull (findDisplay 1713999)}) then { + (findDisplay 1713999) closeDisplay 1; + + (findDisplay 46) createDisplay "AGM_Interaction_Dialog"; + // Add eventhandlers + (findDisplay 1713999) displayAddEventHandler ["KeyDown", "_this call AGM_Core_onKeyDown"]; + (findDisplay 1713999) displayAddEventHandler ["KeyUp", "_this call AGM_Core_onKeyUp"]; + + (findDisplay 1713999) displayAddEventHandler ["KeyDown", "_this call AGM_Interaction_fnc_menuKeyInput"]; + }; + disableSerialization; + _dlgInteractionDialog = uiNamespace getVariable "AGM_Interaction_Dialog"; + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; + if (profileNamespace getVariable ["AGM_Interaction_AutoCenterCursor", true]) then {setMousePosition [0.5, 0.5]}; + if !(_subMenu) then { + _ctrlInteractionDialog ctrlSetText ([_target] call AGM_Core_fnc_getName); + } else { + _ctrlInteractionDialog ctrlSetText localize "STR_AGM_Interaction_Back"; + }; + + _buttons = AGM_Interaction_Buttons; + _count = count _buttons; + + for "_i" from 0 to 9 do { + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _i); + _ctrlInteractionDialog ctrlShow true; + + _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _i); + _ctrlInteractionDialogShortcut = _dlgInteractionDialog displayCtrl (30 + _i); + //_ctrlInteractionDialogBackground = _dlgInteractionDialog displayCtrl (40 + _i); + if (_i < _count) then { + _action = _buttons select _i; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable ([_target, _player] call (_action select 2)); + _ctrlInteractionDialog ctrlSetTooltip (_action select 6); + + _ctrlInteractionDialogIcon ctrlSetText (_action select 5); + _ctrlInteractionDialogShortcut ctrlSetText (_action select 10); + //_ctrlInteractionDialogBackground ctrlShow true; + + AGM_Interaction_Shortcuts set [_i, [_action select 10] call AGM_Core_fnc_letterToCode]; + } else { + _ctrlInteractionDialog ctrlSetText ""; + _ctrlInteractionDialog ctrlEnable false; + _ctrlInteractionDialog ctrlSetTooltip ""; + + _ctrlInteractionDialogIcon ctrlSetText ""; + _ctrlInteractionDialogShortcut ctrlSetText ""; + //_ctrlInteractionDialogBackground ctrlShow false; + }; + }; + + // Update Buttons + terminate (missionNamespace getVariable ["AGM_Interaction_updateMenuHandle", scriptNull]); + + AGM_Interaction_updateMenuHandle = 0 spawn { + disableSerialization; + _dlgMenu = uiNamespace getVariable ["AGM_Interaction_Dialog", displayNull]; + _ctrlTooltip = _dlgMenu displayCtrl 40; + + _player = AGM_player; + _vehicle = vehicle _player; + _target = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); + + waitUntil { + if !([_target, 5] call AGM_Interaction_fnc_isInRange) exitWith { + (findDisplay 1713999) closeDisplay 1 + }; + + AGM_Interaction_Tooltips = [[], [], [], [], [], [], [], [], [], []]; + { + _ctrlText = _dlgMenu displayCtrl (10 + _forEachIndex); + _ctrlIcon = _dlgMenu displayCtrl (20 + _forEachIndex); + + _condition = _x select 2; + _conditionShow = _x select 7; + _distance = _x select 9; + + AGM_Interaction_CurrentTooltip = []; + + _enable = (_distance == 0 || {[_target, _distance] call AGM_Interaction_fnc_isInRange}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}; + if (isNil "_enable") then {_enable = false}; + + AGM_Interaction_Tooltips set [_forEachIndex, AGM_Interaction_CurrentTooltip]; + + // apply conditional tooltips + /*if (_forEachIndex == call AGM_Interaction_fnc_getSelectedButton) then { + _tooltip = _x select 6; + + _showTooltip = _tooltip != ""; + + _tooltip = text _tooltip; + + { + _showTooltip = true; + _tooltip = composeText [_tooltip, lineBreak, _x]; + } forEach (AGM_Interaction_Tooltips select _forEachIndex); + + _ctrlTooltip ctrlSetStructuredText _tooltip; + _ctrlTooltip ctrlShow _showTooltip; + };*/ + + _ctrlText ctrlEnable _enable; + _ctrlIcon ctrlEnable _enable; + } forEach AGM_Interaction_Buttons; + + sleep 0.5; + isNull (findDisplay 1713999) + }; + }; +}; diff --git a/addons/interaction/functions/fn_isInRange.sqf b/addons/interaction/functions/fn_isInRange.sqf new file mode 100644 index 0000000000..bb82f7af95 --- /dev/null +++ b/addons/interaction/functions/fn_isInRange.sqf @@ -0,0 +1,49 @@ +/* + * Author: commy2 + * + * Check if the vehicle is in range of the player. + * + * Argument: + * 0: Vehicke (Object) + * 1: Distance in meters (Number) + * + * Return value: + * (Bool) + */ + +private ["_vehicle", "_distance", "_player"]; + +_vehicle = _this select 0; +_distance = _this select 1; + +_player = AGM_player; + +if (_vehicle isKindOf "Man") exitWith {_player distance _vehicle < _distance}; + +private ["_position0", "_position1"];//, "_direction"]; + +_position0 = getPosASL _player; +_position1 = getPosASL _vehicle; + +/* +_direction = _position1 vectorDiff _position0; +_direction = _direction vectorMultiply (_distance / (vectorMagnitude _direction)); + +_position0 = eyePos _player; +_position1 = _position0 vectorAdd _direction; + +_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance} +*/ + +_position0 = ATLToASL positionCameraToWorld [0, 0, 0]; +_position0 set [2, (_position0 select 2) - (getTerrainHeightASL _position0 min 0)]; + +_position1 = ATLToASL positionCameraToWorld [0, 0, _distance]; +_position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)]; + +if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then { + true +} else { + ["Not in Range"] call AGM_Interaction_fnc_addToTooltip; + false +} diff --git a/addons/interaction/functions/fn_joinTeam.sqf b/addons/interaction/functions/fn_joinTeam.sqf new file mode 100644 index 0000000000..c6db297c49 --- /dev/null +++ b/addons/interaction/functions/fn_joinTeam.sqf @@ -0,0 +1,20 @@ +// by commy2 + +private ["_unit", "_team", "_message"]; + +_unit = _this select 0; +_team = _this select 1; + +_unit setVariable ["AGM_assignedFireTeam", _team, true]; +[_unit, format ["{_this assignTeam '%1'}", _team]] call AGM_Core_fnc_execRemoteFnc; + +if (_unit == AGM_player) then { + _message = if (_team == "MAIN") then { + localize "STR_AGM_Interaction_LeftTeam"; + } else { + _team = localize format ["STR_AGM_Interaction_Team%1", _team]; + format [localize "STR_AGM_Interaction_JoinedTeam", _team]; + }; + + [_message] call AGM_Core_fnc_displayTextStructured; +}; diff --git a/addons/interaction/functions/fn_lockDoor.sqf b/addons/interaction/functions/fn_lockDoor.sqf new file mode 100644 index 0000000000..edc317bfac --- /dev/null +++ b/addons/interaction/functions/fn_lockDoor.sqf @@ -0,0 +1,27 @@ +// by commy2 + +private ["_mode", "_info", "_house", "_door", "_id", "_phase"]; + +_mode = _this select 0; //lock: true, unlock: false + +_info = [2] call AGM_Interaction_fnc_getDoor; + +_house = _info select 0; +_door = _info select 1; +_id = _info select 2; + +if (isNull _house) exitWith {}; + +/* +_phase = [1, 0] select _mode; + +_house animate [format ["%1_%2_rot", _door, _id], _phase]; +_house animate [format ["%1_Handle_%2_rot_1", _door, _id], _phase]; +_house animate [format ["%1_Handle_%2_rot_2", _door, _id], _phase]; +*/ + +_house setVariable [format ["BIS_Disabled_%1_%2", _door, _id], [0, 1] select _mode]; + +playSound "AGM_Sound_Click"; + +[localize (["STR_AGM_Interaction_UnlockedDoor", "STR_AGM_Interaction_LockedDoor"] select _mode)] call AGM_Core_fnc_displayTextStructured; diff --git a/addons/interaction/functions/fn_menuKeyInput.sqf b/addons/interaction/functions/fn_menuKeyInput.sqf new file mode 100644 index 0000000000..786add7670 --- /dev/null +++ b/addons/interaction/functions/fn_menuKeyInput.sqf @@ -0,0 +1,16 @@ +// by commy2 + +private "_key"; + +_key = _this select 1; + +if (_key in [28, 57, 156, 200, 208, 203, 205, 201, 209]) exitWith {true}; + +_index = AGM_Interaction_Shortcuts find _key; + +if (_index != -1 && {ctrlEnabled (findDisplay 1713999 displayCtrl (_index + 10))}) exitWith { + _index call AGM_Interaction_fnc_onClick; + true +}; + +false diff --git a/addons/interaction/functions/fn_moduleInteraction.sqf b/addons/interaction/functions/fn_moduleInteraction.sqf new file mode 100644 index 0000000000..60f15e1215 --- /dev/null +++ b/addons/interaction/functions/fn_moduleInteraction.sqf @@ -0,0 +1,20 @@ +/* + * Author: bux578 + * + * Initializes the Interaction module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, "AGM_Interaction_EnableTeamManagement", "EnableTeamManagement"] call AGM_Core_fnc_readBooleanParameterFromModule; + +diag_log text "[AGM]: Interaction Module Initialized."; diff --git a/addons/interaction/functions/fn_onButtonDown.sqf b/addons/interaction/functions/fn_onButtonDown.sqf new file mode 100644 index 0000000000..91a20d9fc7 --- /dev/null +++ b/addons/interaction/functions/fn_onButtonDown.sqf @@ -0,0 +1,14 @@ +// by commy2 + +if (dialog) exitWith { + closeDialog 0; +}; + +if (isNull (findDisplay 1713999)) then { + if (AGM_player == vehicle AGM_player) then {"" call AGM_Interaction_fnc_openMenu} else {[AGM_player, vehicle AGM_player] call AGM_Interaction_fnc_openMenuSelectUI}; + setMousePosition [0.5, 0.5]; +} else { + (findDisplay 1713999) closeDisplay 1; +}; + +[_player, "interactionMenuOpened", [_player, AGM_Interaction_Target, 0]] call AGM_Core_fnc_callCustomEventHandlers; diff --git a/addons/interaction/functions/fn_onButtonDownSelf.sqf b/addons/interaction/functions/fn_onButtonDownSelf.sqf new file mode 100644 index 0000000000..90aa4b4aca --- /dev/null +++ b/addons/interaction/functions/fn_onButtonDownSelf.sqf @@ -0,0 +1,14 @@ +// by commy2 + +if (dialog) exitWith { + closeDialog 0; +}; + +if (isNull (findDisplay 1713999)) then { + "" call AGM_Interaction_fnc_openMenuSelf; + setMousePosition [0.5, 0.5]; +} else { + (findDisplay 1713999) closeDisplay 1; +}; + +[_player, "interactionMenuOpened", [_player, AGM_Interaction_Target, 1]] call AGM_Core_fnc_callCustomEventHandlers; diff --git a/addons/interaction/functions/fn_onButtonUp.sqf b/addons/interaction/functions/fn_onButtonUp.sqf new file mode 100644 index 0000000000..0466eee0dc --- /dev/null +++ b/addons/interaction/functions/fn_onButtonUp.sqf @@ -0,0 +1,44 @@ +// by commy2 + +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; + +_player = AGM_player; +_vehicle = vehicle _player; +_target = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); + +_count = count AGM_Interaction_Buttons; +_index = call AGM_Interaction_fnc_getSelectedButton; + +_action = if (_index != -1 && {_index < _count}) then { + AGM_Interaction_Buttons select _index +} else { + ["", {}, {false}, 0, [], "", "", {false}, [], 0] +}; + +(findDisplay 1713999) closeDisplay 1; +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 || {[AGM_Interaction_Target, _distance] call AGM_Interaction_fnc_isInRange}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { + [_target, _player] call _statement; +}; diff --git a/addons/interaction/functions/fn_onClick.sqf b/addons/interaction/functions/fn_onClick.sqf new file mode 100644 index 0000000000..6fb9a353fc --- /dev/null +++ b/addons/interaction/functions/fn_onClick.sqf @@ -0,0 +1,44 @@ +// by commy2 + +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; + +_player = AGM_player; +_vehicle = vehicle _player; +_target = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); + +_count = count AGM_Interaction_Buttons; +_index = _this; //call AGM_Interaction_fnc_getSelectedButton; + +_action = if (_index != -1 && {_index < _count}) then { + AGM_Interaction_Buttons select _index +} else { + ["", {}, {false}, 0, [], "", "", {false}, [], 0] +}; + +_subMenu = _action select 4; + +// back +if (_index == -1) exitWith { + call AGM_Interaction_MainButton; +}; + +if (count _subMenu < 2) then { + (findDisplay 1713999) closeDisplay 1; + 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 || {[AGM_Interaction_Target, _distance] call AGM_Interaction_fnc_isInRange}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { + [_target, _player] call _statement; + }; +} else { + if (_subMenu select 1 < 1) then { + [_subMenu select 0] call AGM_Interaction_fnc_openSubMenu; + } else { + [_subMenu select 0] call AGM_Interaction_fnc_openSubMenuSelf; + }; +}; diff --git a/addons/interaction/functions/fn_onSelectMenuDblClick.sqf b/addons/interaction/functions/fn_onSelectMenuDblClick.sqf new file mode 100644 index 0000000000..db7f326bd2 --- /dev/null +++ b/addons/interaction/functions/fn_onSelectMenuDblClick.sqf @@ -0,0 +1,3 @@ +// by CorruptedHeart, commy2 + +call compile (lbData [8866, lbCurSel 8866]) call AGM_Interaction_SelectAccept; diff --git a/addons/interaction/functions/fn_openDoor.sqf b/addons/interaction/functions/fn_openDoor.sqf new file mode 100644 index 0000000000..98f21fe690 --- /dev/null +++ b/addons/interaction/functions/fn_openDoor.sqf @@ -0,0 +1,56 @@ +// by commy2 + +private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; + +_info = [2] call AGM_Interaction_fnc_getDoor; + +_house = _info select 0; +_door = _info select 1; + +if (isNull _house) exitWith {}; + +_animations = [_house, _door] call AGM_Interaction_fnc_getDoorAnimations; + +_lockedVariable = _animations select 1; +_animations = _animations select 0; + +if (count _animations == 0) exitWith {}; + +if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { + _lockedVariable set [0, _house]; + _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; +}; + +AGM_Interaction_isOpeningDoor = true; +playSound "AGM_Sound_Click"; + +[_house, _animations] spawn { + _house = _this select 0; + _animations = _this select 1; + + _phase = _house animationPhase (_animations select 0); + _position = getPosASL AGM_player; + + _time = time + 0.2; + _usedMouseWheel = false; + waitUntil { + if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { + _usedMouseWheel = true; + }; + + _phase = _phase + (inputAction "PrevAction" / 12) min 1; + _phase = _phase - (inputAction "NextAction" / 12) max 0; + + {_house animate [_x, _phase]} forEach _animations; + + !AGM_Interaction_isOpeningDoor || {getPosASL AGM_player distance _position > 1} + }; + + if (!_usedMouseWheel && {time < _time}) then { + _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + + {_house animate [_x, _phase]} forEach _animations; + }; + + AGM_Interaction_isOpeningDoor = false; +}; diff --git a/addons/interaction/functions/fn_openMenu.sqf b/addons/interaction/functions/fn_openMenu.sqf new file mode 100644 index 0000000000..02fe1ba1ab --- /dev/null +++ b/addons/interaction/functions/fn_openMenu.sqf @@ -0,0 +1,6 @@ +// by commy2 + +private "_target"; +_target = [cursorTarget, AGM_Interaction_Target] select (_this == "Default"); + +[0, _target, ""] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_openMenuSelectUI.sqf b/addons/interaction/functions/fn_openMenuSelectUI.sqf new file mode 100644 index 0000000000..dbac9e2f75 --- /dev/null +++ b/addons/interaction/functions/fn_openMenuSelectUI.sqf @@ -0,0 +1,43 @@ +// by commy2 + +private ["_unit", "_vehicle", "_cargo"]; + +_unit = _this select 0; +_vehicle = _this select 1; + +// allow interaction with all cargo slots and all ffv slots +_cargo = [_vehicle, ["cargo", "ffv"], true] call AGM_Core_fnc_getVehicleCrew; + +// you can only interact if you are in cargo or ffv yourself. exit otherwise +if !(_unit in _cargo) exitWith {}; + +AGM_InteractionMenu_Crew = _cargo; + +// prepare: add header and "OK" button to select menu +private "_actions"; +_actions = [localize "STR_AGM_Interaction_InteractionMenu", localize "STR_AGM_Interaction_Interact"] call AGM_Interaction_fnc_prepareSelectMenu; + +// prepare: add all cargo units as options to select menu +{ + if (_x != _unit) then { + _actions = [ + _actions, + [_x] call AGM_Core_fnc_getName, + "\AGM_Interaction\UI\dot_ca.paa", + _forEachIndex + ] call AGM_Interaction_fnc_AddSelectableItem; + }; +} forEach _cargo; + +// open select menu +[ + _actions, + { + call AGM_Interaction_fnc_hideMenu; + [0, AGM_InteractionMenu_Crew select _this, ""] spawn AGM_Interaction_fnc_showMenu; + AGM_InteractionMenu_Crew = nil; + }, + { + call AGM_Interaction_fnc_hideMenu; + } +] call AGM_Interaction_fnc_openSelectMenu; diff --git a/addons/interaction/functions/fn_openMenuSelf.sqf b/addons/interaction/functions/fn_openMenuSelf.sqf new file mode 100644 index 0000000000..e6056eb1ef --- /dev/null +++ b/addons/interaction/functions/fn_openMenuSelf.sqf @@ -0,0 +1,3 @@ +// by commy2 + +[1, AGM_player, ""] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_openSelectMenu.sqf b/addons/interaction/functions/fn_openSelectMenu.sqf new file mode 100644 index 0000000000..069d1dbc8a --- /dev/null +++ b/addons/interaction/functions/fn_openSelectMenu.sqf @@ -0,0 +1,43 @@ +/* + Name: AGM_Interaction_fnc_openSelectMenu + + 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: +*/ +if (!(profileNamespace getVariable ["AGM_Interaction_FlowMenu", false])) then { + AGM_Interaction_SelectAccept = _this select 1; + AGM_Interaction_SelectCancel = _this select 2; + buttonSetAction [8855, "call AGM_Interaction_SelectCancel;"]; // cancel + buttonSetAction [8860, "(call compile (lbData [8866, lbCurSel 8866])) call AGM_Interaction_SelectAccept;"]; // accept + lbSetCurSel [8866, 0]; +}else{ + _customActions = _this select 0; + _count = count _customActions; + if (_count == 0) exitWith {}; + _customActions call AGM_Interaction_fnc_sortOptionsByPriority; + for "_i" from 0 to _count -1 do { + _action = _customActions select _i; + _action set [1, (_this select 1)]; + }; + AGM_Interaction_Buttons = _customActions; + [(_this select 2), true, true, false, AGM_player] call AGM_Interaction_fnc_initialiseInteraction; +}; diff --git a/addons/interaction/functions/fn_openSubMenu.sqf b/addons/interaction/functions/fn_openSubMenu.sqf new file mode 100644 index 0000000000..7898d9e181 --- /dev/null +++ b/addons/interaction/functions/fn_openSubMenu.sqf @@ -0,0 +1,3 @@ +// by commy2 + +[2, AGM_Interaction_Target, _this select 0] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_openSubMenuSelf.sqf b/addons/interaction/functions/fn_openSubMenuSelf.sqf new file mode 100644 index 0000000000..966684c84f --- /dev/null +++ b/addons/interaction/functions/fn_openSubMenuSelf.sqf @@ -0,0 +1,3 @@ +// by commy2 + +[3, AGM_player, _this select 0] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_prepareSelectMenu.sqf b/addons/interaction/functions/fn_prepareSelectMenu.sqf new file mode 100644 index 0000000000..bb84eaca12 --- /dev/null +++ b/addons/interaction/functions/fn_prepareSelectMenu.sqf @@ -0,0 +1,35 @@ +/* + Name: AGM_Interaction_fnc_prepareSelectMenu + + 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 AGM_Interaction_fnc_prepareSelectMenu; +*/ +private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; +closeDialog 0; +if (!(profileNamespace getVariable ["AGM_Interaction_FlowMenu", false])) exitWith { + _header = _this select 0; + _buttonText = _this select 1; + if (isNil "_buttonText" or {_buttonText == ""}) then { + _buttonText = localize "STR_AGM_Interaction_MakeSelection"; + }; + createDialog "RscAGM_SelectAnItem"; + ctrlSetText [8860, _buttonText]; + ctrlSetText [8870, _header]; + + lbClear 8866; + + 8866 +}; +[] diff --git a/addons/interaction/functions/fn_push.sqf b/addons/interaction/functions/fn_push.sqf new file mode 100644 index 0000000000..d4ce290d1e --- /dev/null +++ b/addons/interaction/functions/fn_push.sqf @@ -0,0 +1,21 @@ +/* + * Author: KoffeinFlummi + * + * Pushes a boat away from the player. + * + * Arguments: + * 0: Boat (object) + * 1: Velocity (vectorlike array) + * + * Return Value: + * None + */ + +_boat = _this select 0; +_velocity = _this select 1; + +if !(local _boat) exitWith { + [_this, "AGM_Interaction_fnc_push", _boat] call AGM_Core_fnc_execRemoteFnc; +}; + +_boat setVelocity _velocity; diff --git a/addons/interaction/functions/fn_removeInteraction.sqf b/addons/interaction/functions/fn_removeInteraction.sqf new file mode 100644 index 0000000000..b633ce0bc8 --- /dev/null +++ b/addons/interaction/functions/fn_removeInteraction.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * + * Remove an AGM action from an object. Note: This function is global. + * + * Argument: + * 0: Object (Object) + * 1: ID of the action (Number) + * + * Return value: + * None. + */ + +private ["_object", "_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; + +_object = _this select 0; +_id = _this select 1; + +_actionsVar = _object getVariable ["AGM_Interactions", [-1, [], []]]; + +_currentID = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []]; +_actions = _actions - [[]]; + +_object setVariable ["AGM_Interactions", [_currentID, _actionIDs, _actions], true]; diff --git a/addons/interaction/functions/fn_removeInteractionSelf.sqf b/addons/interaction/functions/fn_removeInteractionSelf.sqf new file mode 100644 index 0000000000..140c6f0502 --- /dev/null +++ b/addons/interaction/functions/fn_removeInteractionSelf.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * + * Remove an AGM self action from the player. + * + * Argument: + * 0: ID of the action (Number) + * + * Return value: + * None. + */ + + +private ["_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; + + +_id = _this select 0; + +_actionsVar = AGM_player getVariable ["AGM_InteractionsSelf", [-1, [], []]]; + +_currentID = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []]; +_actions = _actions - [[]]; + +AGM_player setVariable ["AGM_InteractionsSelf", [_currentID, _actionIDs, _actions], false]; diff --git a/addons/interaction/functions/fn_removeTag.sqf b/addons/interaction/functions/fn_removeTag.sqf new file mode 100644 index 0000000000..9d37367f1c --- /dev/null +++ b/addons/interaction/functions/fn_removeTag.sqf @@ -0,0 +1,19 @@ +// by commy2 + +0 spawn { + waitUntil {player getVariable ["AGM_Name", ""] != ""}; + + _name = player getVariable ["AGM_Name", ""]; + _name = toArray _name; + + _index = _name find (toArray "]" select 0); + + if (_index != -1) then { + for "_index" from 0 to _index do { + _name set [_index, -1]; + }; + _name = _name - [-1]; + _name = toString _name; + player setVariable ["AGM_Name", _name, true]; + }; +}; diff --git a/addons/interaction/functions/fn_sendAway.sqf b/addons/interaction/functions/fn_sendAway.sqf new file mode 100644 index 0000000000..a4434bbd12 --- /dev/null +++ b/addons/interaction/functions/fn_sendAway.sqf @@ -0,0 +1,35 @@ +/* + * Author: KoffeinFlummi + * + * Sends a civilian crowd away (chance of failure). + * + * Arguments: + * 0: Unit to be sent away (Object) + * + * Return value: + * none +*/ + +#define DISTANCE 50 +#define RADIUS 10 + +private ["_unit", "_chance", "_x"]; + +_unit = _this select 0; + +AGM_player playActionNow "GestureGo"; + +if (count weapons AGM_player > 0) then { + _chance = 0.8; +} else { + _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, AGM_player]] call CBA_fnc_globalExecute; + }; +} foreach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fn_setCaptivityStatus.sqf b/addons/interaction/functions/fn_setCaptivityStatus.sqf new file mode 100644 index 0000000000..1055780cac --- /dev/null +++ b/addons/interaction/functions/fn_setCaptivityStatus.sqf @@ -0,0 +1,3 @@ +// by commy2 + +_this call AGM_Core_fnc_setCaptivityStatus; diff --git a/addons/interaction/functions/fn_showMenu.sqf b/addons/interaction/functions/fn_showMenu.sqf new file mode 100644 index 0000000000..291ab27331 --- /dev/null +++ b/addons/interaction/functions/fn_showMenu.sqf @@ -0,0 +1,118 @@ +/* + Name: AGM_Interaction_fnc_showMenu + + Author: + commy2 + Garth de Wet (LH) + aeroson + + Description: + + Parameters: + 0: NUMBER - Menu type (0 - interaction, 1 - self-interaction, 2 - sub-interaction, 3 - sub-self-interaction) + 1: OBJECT - Target object + 2: STRING - Sub-Menu ClassName + + Returns: + Nothing + + Example: + [0, AGM_Interaction_Target] call AGM_Interaction_fnc_showMenu; + [1, player] call AGM_Interaction_fnc_showMenu; + [2, AGM_Interaction_Target, "AGM_Explosives"] call AGM_Interaction_fnc_showMenu; + [3, player, "AGM_Explosives"] call AGM_Interaction_fnc_showMenu; +*/ +private ["_player", "_vehicle", "_mainButtonAction", "_object", "_index", "_actions", "_result", "_menuType"]; +#define DEFAULT_ICON "\AGM_Interaction\UI\dot_ca.paa" +#define DEFAULT_DISTANCE 4 // seems to be 4 +_player = AGM_player; +_vehicle = vehicle _player; + +AGM_Interaction_MenuType = _this select 0; // 0 Interaction, 1 Self Interaction + +_mainButtonAction = [ + {call AGM_Interaction_fnc_hideMenu}, + {call AGM_Interaction_fnc_hideMenu}, + {"Default" call AGM_Interaction_fnc_openMenu}, + {"Default" call AGM_Interaction_fnc_openMenuSelf} +] select AGM_Interaction_MenuType; + +_menuType = AGM_Interaction_MenuType % 2; +uiNamespace setVariable ["AGM_Interaction_CursorPosition", [controlNull, 0.5, 0.5, -1]]; + +AGM_Interaction_Target = _this select 1; +_object = AGM_Interaction_Target; + +if (_menuType == 0 && {(isNull (_object) || {!([_object, 4] call AGM_Interaction_fnc_isInRange)})}) exitWith {};//call ([AGM_Interaction_fnc_onButtonDown, AGM_Interaction_fnc_onButtonDownSelf] select _menuType)}; +if !([_player, _object] call AGM_Core_fnc_canInteractWith) exitWith {}; + +// add actions or self actions of AGM_Interaction_Target +_parents = [configFile >> "CfgVehicles" >> typeOf _object, true] call BIS_fnc_returnParents; +_result = [_object, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions; +_actions = ([_object, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions) select 0; + +// add self actions of vehicle _player +if (_menuType == 1 && {_player != _vehicle}) then { + _parents = [configFile >> "CfgVehicles" >> typeOf _vehicle, true] call BIS_fnc_returnParents; + _result = [_vehicle, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions; + _actions = _actions + (([_vehicle, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions) select 0); +}; + +// custom defined actions, stored in variable instead of cfg like above +if (AGM_Interaction_MenuType < 2) then { + + private ["_customActions", "_customAction", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority"]; + + // add interactions or self interactions of AGM_Interaction_Target + _customActions = (_object getVariable [["AGM_Interactions", "AGM_InteractionsSelf"] select _menuType, [-1, [], []]]) select 2; + + // add self interactions of vehicle _player + if (_menuType == 1 && {_player != _vehicle}) then { + _customActions = _customActions + ((_vehicle getVariable [["AGM_Interactions", "AGM_InteractionsSelf"] select _menuType, [-1, [], []]]) select 2); + }; + + if(_menuType==0) then { + + private ["_distance"]; + + for "_index" from 0 to (count _customActions - 1) do { + + _customAction = _customActions select _index; + _displayName = _customAction select 0; + _distance = _customAction select 1; + _condition = _customAction select 2; + _statement = _customAction select 3; + _showDisabled = _customAction select 4; + _priority = _customAction select 5; + + if ((_showDisabled || {[_object, _player] call _condition}) && {[_object, _distance] call AGM_Interaction_fnc_isInRange || {_distance == 0}}) then { + _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], _distance, ""]; + }; + }; + + } else { // self interactions do not have distance + + for "_index" from 0 to (count _customActions - 1) do { + + _customAction = _customActions select _index; + _displayName = _customAction select 0; + _condition = _customAction select 1; + _statement = _customAction select 2; + _showDisabled = _customAction select 3; + _priority = _customAction select 4; + + if (_showDisabled || {[_object, _player] call _condition}) then { + _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], DEFAULT_DISTANCE, ""]; + }; + }; + + }; + + +}; + +if (count _actions == 0) exitWith {};//call ([AGM_Interaction_fnc_onButtonDown, AGM_Interaction_fnc_onButtonDownSelf] select _menuType)}; + +_actions call AGM_Interaction_fnc_sortOptionsByPriority; +AGM_Interaction_Buttons = _actions; +[_mainButtonAction, (_this select 2) != "", (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]), _menuType == 1, _object] call AGM_Interaction_fnc_initialiseInteraction; diff --git a/addons/interaction/functions/fn_showMouseHint.sqf b/addons/interaction/functions/fn_showMouseHint.sqf new file mode 100644 index 0000000000..a856e9d9c6 --- /dev/null +++ b/addons/interaction/functions/fn_showMouseHint.sqf @@ -0,0 +1,54 @@ +/* + Name: AGM_Interaction_fnc_showMouseHint + + 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 AGM_Interaction_fnc_showMouseHint; +*/ +#define GUI_GRID_W (0.025) +#define GUI_GRID_H (0.04) +private ["_leftClick", "_rightClick", "_scroll"]; +_leftClick = _this select 0; +_rightClick = _this select 1; +_scroll = ""; +if (count _this > 2) then { + _scroll = _this select 2; +}; + +("AGM_InteractionHelper" call BIS_fnc_rscLayer) cutRsc ["AGM_InteractionHelper", "PLAIN",0.5, false]; +disableSerialization; +_display = uiNamespace getVariable ["AGM_Helper_Display", objNull]; +if (isNull _display) exitWith{}; + +(_display displayCtrl 1000) ctrlSetText _leftClick; +(_display displayCtrl 1001) ctrlSetText _rightClick; + +(_display displayCtrl 1000) ctrlShow (_leftClick != ""); +(_display displayCtrl 1200) ctrlShow (_leftClick != ""); +(_display displayCtrl 1001) ctrlShow (_rightClick != ""); +(_display displayCtrl 1201) ctrlShow (_rightClick != ""); + +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) ctrlCommit 0; + (_display displayCtrl 1201) ctrlCommit 0; +}; +(_display displayCtrl 1002) ctrlSetText _scroll; +showHUD false; \ No newline at end of file diff --git a/addons/interaction/functions/fn_sortOptionsByPriority.sqf b/addons/interaction/functions/fn_sortOptionsByPriority.sqf new file mode 100644 index 0000000000..dd94cadfe4 --- /dev/null +++ b/addons/interaction/functions/fn_sortOptionsByPriority.sqf @@ -0,0 +1,20 @@ +// by commy2 + +private ["_actions", "_count", "_index", "_actionN", "_actionM"]; + +_actions = _this; +_count = count _actions; +_index = 0; + +while {_index < _count - 1} do { + _actionN = + _actions select _index; + _actionM = + _actions select (_index + 1); + + if (_actionN select 3 < _actionM select 3) then { + _actions set [_index, _actionM]; + _actions set [_index + 1, _actionN]; + _index = 0; + } else { + _index = _index + 1; + }; +}; diff --git a/addons/interaction/functions/fn_tapShoulder.sqf b/addons/interaction/functions/fn_tapShoulder.sqf new file mode 100644 index 0000000000..8d6340143f --- /dev/null +++ b/addons/interaction/functions/fn_tapShoulder.sqf @@ -0,0 +1,20 @@ +// by commy2 + +private ["_unit", "_message"]; + +_tapper = _this select 0; +_target = _this select 1; + +if (_target != AGM_player) exitWith { + addCamShake [4, 0.5, 5]; + if !(local _target) then { + [[_tapper, _target], "AGM_Interaction_fnc_tapShoulder", _target] call AGM_Core_fnc_execRemoteFnc; + }; +}; + +addCamShake [4, 0.5, 5]; + +//_message = format ["%1 tapped you on your shoulder.", [_unit] call AGM_Core_fnc_getName]; +_message = localize "STR_AGM_Interaction_YouWereTapped"; + +[_message] call AGM_Core_fnc_displayTextStructured; diff --git a/addons/interaction/functions/fn_updateTooltipPosition.sqf b/addons/interaction/functions/fn_updateTooltipPosition.sqf new file mode 100644 index 0000000000..3df14635e0 --- /dev/null +++ b/addons/interaction/functions/fn_updateTooltipPosition.sqf @@ -0,0 +1,12 @@ +// by commy2 + +disableSerialization; +_ctrl = ctrlParent (_this select 0) displayCtrl 40; + +_ctrl ctrlSetPosition [ + (_this select 1) + 0.01 * safezoneW, + (_this select 2) + 0.01 * safezoneH, + 2.0 / 16 * safezoneW, + 0.3 / 9 * safezoneH +]; +_ctrl ctrlCommit 0; diff --git a/addons/interaction/rsc/button1.paa b/addons/interaction/rsc/button1.paa new file mode 100644 index 0000000000..51d3a373a1 Binary files /dev/null and b/addons/interaction/rsc/button1.paa differ diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml new file mode 100644 index 0000000000..47670ccf75 --- /dev/null +++ b/addons/interaction/stringtable.xml @@ -0,0 +1,652 @@ + + + + + + Interaction Menu + Interaktionsmenü + Menú de interacción + Menu interakcji + Menu interakce + Menu d'interaction + Меню взаимодействия + Interakció + Menu de Interação + Menù Interattivo + + + Interaction Menu (Self) + Interaktionsmenü (Selbst) + Menú de interacción (Propia) + Menu interakcji (na siebie) + Menu interakce (vlastní) + Menu d'interaction (Perso) + Меню взаимодействия (с собой) + Interakció (saját) + Menu de Interação (Individual) + Menù Interattivo (Individuale) + + + Open / Close Door + Tür öffnen / schließen + Abrir / Cerrar puerta + Otwórz / Zamknij drzwi + Otevřít / Zavřít dveře + Ouvrir / Fermer Portes + Открыть / Закрыть двери + Ajtó nyitás / zárás + Abrir / Fechar Porta + Apri / Chiudi la porta + + + Lock Door + Tür sperren + Bloquear puerta + Verrouiller Porte + Blocca la porta + Заблокировать дверь + Trancar Porta + Ajtó bezárása + Zablokuj drzwi + Zamknout dveře + + + Unlock Door + Tür entsperren + Desbloquear puerta + Déverrouiller Porte + Sblocca la porta + Разблокировать дверь + Destrancar Porta + Zár kinyitása + Odblokuj drzwi + Odemknout dveře + + + Locked Door + Tür gesperrt + Puerta bloqueada + Porte Verrouillée + Porta bloccata + Дверь заблокирована + Porta Trancada + Zárt ajtó + Zablokowano drzwi + Zamčené dveře + + + Unlocked Door + Tür entsperrt + Puerta desbloqueada + Porte Déverrouillée + Porta sbloccata + Дверь разблокирована + Porta Destrancada + Nyitott ajtó + Odblokowano drzwi + Odemčené dveře + + + Join group + Gruppe beitreten + Unirse al grupo + Dołącz do grupy + Přidat se do skupiny + Rejoindre Groupe + Вступить в группу + Csatlakozás + Unir-se ao grupo + Unisciti alla squadra + + + Leave Group + Gruppe verlassen + Dejar grupo + Opuść grupę + Odejít ze skupiny + Quitter Groupe + Выйти из группы + Csoport elhagyása + Deixar grupo + Lascia la squadra + + + Become Leader + Grp.-führung übern. + Asumir el liderazgo + Przejmij dowodzenie + Stát se velitelem + Devenir Leader + Стать лидером + Vezetés átvétele + Tornar-se Líder + Prendi il comando + + + DANCE! + TANZEN! + BAILAR! + TAŃCZ! + TANČIT! + Danse! + ТАНЦЕВАТЬ! + TÁNC! + DANCE! + Balla! + + + Stop Dancing + Tanzen abbrechen + Dejar de bailar + Przestań tańczyć + Přestat tancovat + Arrêter de danser + Прекратить танцевать + Tánc abbahagyása + Parar de dançar + Smetti di ballare + + + << Back + << Zurück + << Atrás + << Wstecz + << Zpět + << Retour + << Назад + << Vissza + << Voltar + << Indietro + + + Gestures >> + Gesten >> + Gestos >> + Gesty >> + Gesta >> + Signaux >> + Жесты >> + Kézjelek >> + Gestos >> + Segnali gestuali >> + + + Attack + Angreifen + Atacar + Do ataku + Zaútočit + Attaquer + Атаковать + Támadás + Atacar + Attaccare + + + Advance + Vordringen + Avanzar + Naprzód + Postoupit + Avancer + Продвигаться + Előre + Avançar + Avanzare + + + Go + Los + Adelante + Szybko + Jít + Aller + Идти + Mozgás + Mover-se + Muoversi + + + Follow + Folgen + Seguirme + Za mną + Následovat + Suivre + Следовать + Utánam + Seguir + Seguire + + + Point + Zeigen + Señalar + Wskazać + Ukázat + Pointer + Точка + Mutat + Apontar + Puntare a + + + Up + Aufstehen + Arriba + Do góry + Vztyk + Debout + Вверх + Fel + Acima + Alzarsi + + + Cover + Deckung + Cubrirse + Do osłony + Krýt se + A couvert + Укрыться + Fedezékbe + Proteger-se + Copertura + + + Cease Fire + Feuer einstellen + Alto el fuego + Wstrzymać ogień + Zastavit palbu + Halte au feu + Прекратить огонь + Tüzet szüntess + Cessar Fogo + Cessare il Fuoco + + + Freeze + Keine Bewegung + Alto + Stać + Stát + Halte + Замереть + Állj + Alto + Fermi + + + Hi + Hallo + Hola + Witaj + Ahoj + Salut + Привет + Szeva + Olá + Ciao + + + Yes + Ja + Si + Tak + Ano + Oui + Да + Igen + Sim + Si + + + No + Nein + No + Nie + Ne + Non + Нет + Nem + Não + No + + + Put weapon on back + Waffe wegstecken + Arma a la espalda + Umieść broń na plecach + Dát zbraň na záda + Arme à la bretelle + Повесить оружие на спину + Fegyvert hátra + Colocar arma nas costas + Metti l'arma in spalla + + + Tap Shoulder + Auf Schulter klopfen + Tocar el hombro + Klepnij w ramię + Poklepat na rameno + Taper sur l'épaule + Похлопать по плечу + Vállveregetés + Tocar ombro + Dai un colpetto + + + You were tapped on the shoulder. + Dir wurde auf die Schulter geklopft + Te tocaron el hombro. + On te tape sur l'épaule. + Zostałeś klepnięty po ramieniu + Vállonveregettek + Někdo tě poklepal na rameno. + Вас похлопали по плечу + Você foi tocado no ombro. + Ti è stato dato un colpetto sulla spalla + + + Cancel + Abbrechen + Cancelar + Anuluj + Annuler + Zrušit + Annulla + Отменить + Cancelar + Mégse + + + Select + Wählen + Seleccionar + Wybierz + Sélectionner + Zvolit + Seleziona + Выбрать + Selecionar + Kiválaszt + + + Go Away! + Geh Weg! + Aléjate! + Odejdź! + Jděte pryč! + Allez-vous-en! + Уходите отсюда! + Tűnés! + Vá Embora! + Via di qui! + + + Get Down! + Auf Den Boden! + Al suelo! + Padnij! + K zemi! + A terre! + A földre! + Ложись! + Abaixe-se! + A Terra! + + + Team Management >> + Team Management >> + Gestión de equipo >> + Gestion d'équipe >> + Zarządzanie oddziałem >> + Správa týmu >> + Управление группой >> + Gerenciamento de Equipe >> + Organizzazione Squadra >> + Csapat kezelés >> + + + Red + Rot + Rojo + Rouge + Czerwony + Červený + Красный + Vermelha + Rosso + Piros + + + Green + Grün + Verde + Vert + Zielony + Zelený + Зеленый + Verde + Verde + Zöld + + + Blue + Blau + Azul + Bleu + Niebieski + Modrý + Синий + Azul + Blu + Kék + + + Yellow + Gelb + Amarillo + Jaune + Żółty + Žlutý + Желтый + Amarela + Giallo + Sárga + + + Join Team Red + Team Rot beitreten + Unirse al equipo rojo + Rejoindre Rouge + Dołącz do drużyny czerwonej + Připojit do Červeného Týmu + Присоединиться к красной группе + Unir-se à Equipe Vermelha + Entra nella Squadra Rossa + Csatlakozás a piros csapathoz + + + Join Team Green + Team Grün beitreten + Unirse al equipo verde + Rejoindre Verte + Dołącz do drużyny zielonej + Připojit do Zeleného Týmu + Присоединиться к зеленой группе + Unir-se à Equipe Verde + Entra nella Squadra Verde + Csatlakozás a zöld csapathoz + + + Join Team Blue + Team Blau beitreten + Unirse al equipo azul + Rejoindre Bleue + Dołącz do drużyny niebieskiej + Připojit do Modrého Týmu + Присоединиться к синей группе + Unir-se à Equipe Azul + Entra nella Squadra Blu + Csatlakozás a kék csapathoz + + + Join Team Yellow + Team Gelb beitreten + Unirse al equipo amarillo + Rejoindre Jaune + Dołącz do drużyny żółtej + Připojit do Žlutého Týmu + Присоединиться к желтой группе + Unir-se à Equipe Amarela + Entra nella Squadra Gialla + Csatlakozás a sárga csapathoz + + + You joined Team %1 + Du bist Team %1 beigetreten + Te has unido al equipo %1 + Tu as rejoint l'équipe %1 + Dołączyłeś do drużyny %1 + Připojil ses do Týmu %1 + Вы присоединились к группе %1 + Você uniu-se à Equipe %1 + Sei entrato nella Squadra %1 + Csatlakoztál a %1 csapathoz + + + Leave Team + Team verlassen + Dejar equipo + Quitter l'équipe + Opuść drużynę + Opustit tým + Покинуть группу + Deixar Equipe + Lascia la Squadra + Csapat elhagyása + + + You left the Team + Du hast das Team verlassen + Has dejado el equipo + Tu as quitté l'équipe + Opuściłeś drużynę + Opustil si tým + Вы покинули группу + Você deixou a Equipe + Hai lasciato la squadra + Elhagytad a csapatot + + + Pardon + Begnadigen + Perdonar + Przebacz + Pardon + Pardon + Извините + Perdão + Perdona + Megbocsátás + + + Flow Menu + Mausradmenü + Flow Menu + Menú desplegable + Menu Déroulant + Flow Menu + Выпадающее меню + Flow Menu + Menù a Scorrimento + Legördülő menü + + + Scroll + Scrollen + Przewiń + Défilement + Desplazar + Пролистать + Rolar + Scorri + Görgetés + Otáčení + + + Modifier Key + Modifikator + Modyfikator + Modifier la touche + Tecla modificadora + клавиша-модификатор + Tecla Modificadora + Modifica Tasto + Módosító billentyű + Modifikátor + + + Not in Range + Außer Reichweite + Hors de portée. + Fuera de rango + Слишком далеко + Fora do Alcançe + Hatótávolságon kívül + Poza zasięgiem + Mimo dosah + + + Close Menu on Key Release + Menü nach Loslassen schließen + Zamknij menu automatycznie + Fermer le menu en relâchant la touche + Cerrar menú al soltar la tecla + Menü bezárása a billentyű elengedésekor + Закрывать меню при отжатии клавиши + Menu interakce (Na držení) + + + Auto Center Cursor + Mauszeiger automatisch zentrieren + Auto-centrar cursor + Automatycznie centruj kursor + Vycentrování kurzoru + Egér auto-centrírozása + Автоцентрирование курсора + + + Equipment >> + Ausrüstung >> + Equipamiento >> + Équipment >> + Ekwipunek >> + Vybavení >> + Felszerelés >> + Снаряжение >> + + + Push + Schieben + Empujar + Pousser + Pchnij + Odstrčit + Tolás + Толкать + + + Interact + Interagiere + Interakce + Взаимодействовать + Interakcja + Interactuar + + +