diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index a333dc08fe..b56ddb134a 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -22,4 +22,4 @@ **RPT log file:** - Add a link ([gist](https://gist.github.com) or [pastebin](http://pastebin.com)) to the client and/or server RPT file. An instruction to find your RPT files can be found [here](https://community.bistudio.com/wiki/Crash_Files#Arma_3). -- If possible at the time the bug is encountered, go to ACE Options and select "Debug To Clipboard", this will print extensive debug information to the RPT file. +- If possible at the time the bug is encountered, go to Options and select "ACE Debug To Clipboard", this will print extensive debug information to the RPT file and copy it to clipboard. diff --git a/addons/arsenal/RscDisplayMain.hpp b/addons/arsenal/RscDisplayMain.hpp new file mode 100644 index 0000000000..b20b99e31e --- /dev/null +++ b/addons/arsenal/RscDisplayMain.hpp @@ -0,0 +1,36 @@ +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + class controls { + class GroupSingleplayer: RscControlsGroupNoScrollbars { + class Controls; + }; + class GroupTutorials: GroupSingleplayer { + h = "(6 * 1.5) * (pixelH * pixelGrid * 2)"; + + class Controls: Controls { + class Bootcamp; + class VRTraining; + class Arsenal; + class GVAR(mission): Arsenal { + idc = -1; + text = CSTRING(Mission); + tooltip = CSTRING(Mission_tooltip); + y = "(3 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + onbuttonclick = QUOTE(playMission [ARR_2('','PATHTOF(missions\Arsenal.VR)')]); + animTextureNormal = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + animTextureDisabled = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + animTextureOver = QPATHTOF(data\buttonMissionMainMenuHover_ca.paa); + animTextureFocused = QPATHTOF(data\buttonMissionMainMenuHover_ca.paa); + animTexturePressed = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + animTextureDefault = QPATHTOF(data\buttonMissionMainMenu_ca.paa); + }; + class FieldManual: Bootcamp { + y = "(4 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + }; + class CommunityGuides: Bootcamp { + y = "(5 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + }; + }; + }; + }; +}; diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index 576115ad68..7596b769d8 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -14,6 +14,7 @@ PREP(clearSearchbar); PREP(fillLeftPanel); PREP(fillLoadoutsList); PREP(fillRightPanel); +PREP(handleLoadoutsSearchbar); PREP(handleMouse); PREP(handleScrollWheel); PREP(handleSearchbar); @@ -34,6 +35,7 @@ PREP(onSelChangedRight); PREP(onSelChangedRightListnBox); PREP(open3DEN); PREP(openBox); +PREP(portVALoadouts); PREP(removeBox); PREP(removeVirtualItems); PREP(scanConfig); diff --git a/addons/arsenal/XEH_postInit.sqf b/addons/arsenal/XEH_postInit.sqf index e18afc6cc0..dcc5c7c7b5 100644 --- a/addons/arsenal/XEH_postInit.sqf +++ b/addons/arsenal/XEH_postInit.sqf @@ -4,6 +4,7 @@ GVAR(EH_ID) = 0; GVAR(lastSearchTextLeft) = ""; GVAR(lastSearchTextRight) = ""; +GVAR(lastSearchTextLoadouts) = ""; [QGVAR(initBox), {_this call FUNC(initBox)}] call CBA_fnc_addEventHandler; [QGVAR(removeBox), {_this call FUNC(removeBox)}] call CBA_fnc_addEventHandler; diff --git a/addons/arsenal/config.cpp b/addons/arsenal/config.cpp index dcf101e172..0c3000ab3c 100644 --- a/addons/arsenal/config.cpp +++ b/addons/arsenal/config.cpp @@ -37,4 +37,5 @@ class Cfg3DEN { }; #include "ui\RscAttributes.hpp" -#include "CfgEventHandlers.hpp" \ No newline at end of file +#include "CfgEventHandlers.hpp" +#include "RscDisplayMain.hpp" diff --git a/addons/arsenal/data/buttonMissionMainMenuHover_ca.paa b/addons/arsenal/data/buttonMissionMainMenuHover_ca.paa new file mode 100644 index 0000000000..5592939ea8 Binary files /dev/null and b/addons/arsenal/data/buttonMissionMainMenuHover_ca.paa differ diff --git a/addons/arsenal/data/buttonMissionMainMenu_ca.paa b/addons/arsenal/data/buttonMissionMainMenu_ca.paa new file mode 100644 index 0000000000..9f84cefcdf Binary files /dev/null and b/addons/arsenal/data/buttonMissionMainMenu_ca.paa differ diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index 0f2b3ff62a..5cc25796bd 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -18,6 +18,7 @@ #define IDC_totalWeightText 801 #define IDC_message 9 #define IDC_menuBar 10 +#define IDC_menuBarClose 1001 #define IDC_infoBox 11 #define IDC_infoBackground 1101 #define IDC_infoName 1102 @@ -106,6 +107,7 @@ #define IDC_buttonShare 306 #define IDC_buttonDelete 307 #define IDC_buttonRename 308 +#define IDC_loadoutsSearchbar 309 #define IDC_buttonMyLoadoutsBackground 401 #define IDC_buttonMyLoadouts 402 #define IDC_buttonDefaultLoadoutsBackground 403 @@ -329,4 +331,4 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\ _contentPanelCtrl lnbSetPicture [[_newRow, 6], getText (configFile >> "cfgWeapons" >> ((_loadout select 4) select 0) >> "picture")];\ _contentPanelCtrl lnbSetPicture [[_newRow, 7], getText (configFile >> "cfgVehicles" >> ((_loadout select 5) select 0) >> "picture")];\ _contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (configFile >> "cfgWeapons" >> (_loadout select 6) >> "picture")];\ - _contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")]; \ No newline at end of file + _contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")]; diff --git a/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf b/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf new file mode 100644 index 0000000000..07a42c4fd5 --- /dev/null +++ b/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf @@ -0,0 +1,45 @@ +/* + * Author: Alganthe + * Handles keyboard inputs inside the searchbars text boxes. + * + * Arguments: + * 0: Loadouts display + * 1: Searchbar control + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" +#include "..\defines.hpp" + +params ["_display", "_control"]; + +private _textString = ctrlText _control; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; + +if !(GVAR(lastSearchTextLoadouts) isEqualTo "" || {(_textString find GVAR(lastSearchTextLoadouts)) == 0}) then {//don't refill if there is no need + [_display, _display displayCtrl GVAR(currentLoadoutsTab)] call FUNC(fillLoadoutsList); +}; + +GVAR(lastSearchTextLoadouts) = _textString; +if (count _textString == 0) exitWith {}; + +private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; + +private _itemsToGo = (lnbSize _contentPanelCtrl) select 0; +private _lbIndex = 0; +while {_itemsToGo > 0} do { + private _currentData = _contentPanelCtrl lnbText [_lbIndex, 1]; + private _currentClassname = _contentPanelCtrl lnbData [_lbIndex, 0]; + + if ((_currentData isEqualTo "") || {(((toUpper _currentData) find (toUpper _textString)) == -1) && {((toUpper _currentClassname) find (toUpper _textString)) == -1}}) then { + _contentPanelCtrl lnbDeleteRow _lbIndex; + } else { + _lbIndex = _lbIndex + 1; + }; + _itemsToGo = _itemsToGo - 1; +}; +_contentPanelCtrl lnbSetCurSelRow -1; diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 6b1916e694..b963974033 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -21,83 +21,41 @@ params ["", "_args"]; _args params ["_display", "_keyPressed", "_shiftState", "_ctrlState", "_altState"]; -if !((findDisplay IDD_loadouts_display) isEqualTo displayNull) exitWith {}; - GVAR(shiftState) = _shiftState; - private _return = true; +private _loadoutsDisplay = findDisplay IDD_loadouts_display; -if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then { - - switch true do { - // Close button - case (_keyPressed == DIK_ESCAPE): { - _display closeDisplay 2; - }; - // Hide button - case (_keyPressed == DIK_BACKSPACE): { - [_display] call FUNC(buttonHide); - }; - // Export button - case (_keyPressed == DIK_C && {_ctrlState}): { - [_display] call FUNC(buttonExport); - }; - // Import button - case (_keyPressed == DIK_V && {_ctrlState}): { - [_display] call FUNC(buttonImport); - }; - // Search fields - case (_keyPressed == DIK_F && {_ctrlState}): { - ctrlSetFocus (_display displayCtrl IDC_leftSearchbar); - }; - // Switch vision mode - case (_keyPressed in (actionkeys "nightvision")): { - if (isNil QGVAR(visionMode)) then { - GVAR(visionMode) = 0; +if !(_loadoutsDisplay isEqualTo displayNull) then { + if !(GVAR(loadoutsSearchbarFocus)) then { + switch true do { + // Close button + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; }; - GVAR(visionMode) = (GVAR(visionMode) + 1) % 3; - - switch GVAR(visionMode) do { - //--- Normal - case 0: { - camusenvg false; - false setCamUseTi 0; - }; - //--- NVG - case 1: { - camusenvg true; - false setCamUseTi 0; - }; - //--- TI - default { - camusenvg false; - true setCamUseTi 0; - }; + // Search field + case (_keyPressed == DIK_F && {_ctrlState}): { + ctrlSetFocus (_loadoutsDisplay displayCtrl IDC_loadoutsSearchbar); + }; + }; + } else { + switch true do { + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + case (_keyPressed == DIK_BACKSPACE): { + _return = false; + }; + case (_keyPressed == DIK_NUMPADENTER); + case (_keyPressed == DIK_RETURN): { + [_loadoutsDisplay, _loadoutsDisplay displayCtrl IDC_loadoutsSearchbar] call FUNC(handleLoadoutsSearchBar); + }; + case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { + _return = false; }; - - playsound ["RscDisplayCurator_visionMode",true]; }; }; -} else { + switch true do { - case (_keyPressed == DIK_ESCAPE): { - _display closeDisplay 2; - }; - case (_keyPressed == DIK_BACKSPACE): { - _return = false; - }; - case (_keyPressed == DIK_NUMPADENTER); - case (_keyPressed == DIK_RETURN): { - if (GVAR(leftSearchbarFocus)) then { - [_display, _display displayCtrl IDC_leftSearchbar] call FUNC(handleSearchBar); - }; - if (GVAR(rightSearchbarFocus)) then { - [_display, _display displayCtrl IDC_rightSearchbar] call FUNC(handleSearchBar); - }; - }; - case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { - _return = false; - }; case (_keyPressed == DIK_C && {_ctrlState}): { _return = false; }; @@ -110,31 +68,121 @@ if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then { case (_keyPressed == DIK_X && {_ctrlState}): { _return = false; }; - // Search fields - case (_keyPressed == DIK_F && {_ctrlState}): { - if (GVAR(rightSearchbarFocus)) then { + case (GVAR(loadoutsPanelFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}): { + _return = false; + }; + }; +} else { + + if (!GVAR(leftSearchbarFocus) && {!GVAR(rightSearchbarFocus)}) then { + + switch true do { + // Close button + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + // Hide button + case (_keyPressed == DIK_BACKSPACE): { + [_display] call FUNC(buttonHide); + }; + // Export button + case (_keyPressed == DIK_C && {_ctrlState}): { + [_display] call FUNC(buttonExport); + }; + // Import button + case (_keyPressed == DIK_V && {_ctrlState}): { + [_display] call FUNC(buttonImport); + }; + // Search fields + case (_keyPressed == DIK_F && {_ctrlState}): { ctrlSetFocus (_display displayCtrl IDC_leftSearchbar); - } else { - ctrlSetFocus (_display displayCtrl IDC_rightSearchbar); + }; + // Switch vision mode + case (_keyPressed in (actionkeys "nightvision")): { + if (isNil QGVAR(visionMode)) then { + GVAR(visionMode) = 0; + }; + GVAR(visionMode) = (GVAR(visionMode) + 1) % 3; + + switch GVAR(visionMode) do { + //--- Normal + case 0: { + camusenvg false; + false setCamUseTi 0; + }; + //--- NVG + case 1: { + camusenvg true; + false setCamUseTi 0; + }; + //--- TI + default { + camusenvg false; + true setCamUseTi 0; + }; + }; + + playsound ["RscDisplayCurator_visionMode",true]; + }; + }; + } else { + switch true do { + case (_keyPressed == DIK_ESCAPE): { + _display closeDisplay 2; + }; + case (_keyPressed == DIK_BACKSPACE): { + _return = false; + }; + case (_keyPressed == DIK_NUMPADENTER); + case (_keyPressed == DIK_RETURN): { + if (GVAR(leftSearchbarFocus)) then { + [_display, _display displayCtrl IDC_leftSearchbar] call FUNC(handleSearchBar); + }; + if (GVAR(rightSearchbarFocus)) then { + [_display, _display displayCtrl IDC_rightSearchbar] call FUNC(handleSearchBar); + }; + }; + case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { + _return = false; + }; + case (_keyPressed == DIK_C && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_V && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_A && {_ctrlState}): { + _return = false; + }; + case (_keyPressed == DIK_X && {_ctrlState}): { + _return = false; + }; + // Search fields + case (_keyPressed == DIK_F && {_ctrlState}): { + if (GVAR(rightSearchbarFocus)) then { + ctrlSetFocus (_display displayCtrl IDC_leftSearchbar); + } else { + ctrlSetFocus (_display displayCtrl IDC_rightSearchbar); + }; }; }; }; -}; -if (GVAR(leftTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { - _return = false; -}; + if (GVAR(leftTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { + _return = false; + }; -if (GVAR(rightTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { - _return = false; -}; + if (GVAR(rightTabFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { + _return = false; + }; -if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { - _return = false; -}; + if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_UP, DIK_DOWN]}) then { + _return = false; + }; -if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_LEFT, DIK_RIGHT]}) then { - [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); + if (GVAR(rightTabLnBFocus) && {_keyPressed in [DIK_LEFT, DIK_RIGHT]}) then { + [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); + }; }; _return diff --git a/addons/arsenal/functions/fnc_onLoadoutsClose.sqf b/addons/arsenal/functions/fnc_onLoadoutsClose.sqf index 8318b4d409..777af3aed1 100644 --- a/addons/arsenal/functions/fnc_onLoadoutsClose.sqf +++ b/addons/arsenal/functions/fnc_onLoadoutsClose.sqf @@ -20,6 +20,8 @@ private _mouseBlockCtrl = _arsenalDisplay displayCtrl IDC_mouseBlock; GVAR(cameraPosition) = GVAR(previousCameraPos); GVAR(previousCameraPos) = nil; +GVAR(loadoutsSearchbarFocus) = nil; +GVAR(loadoutsPanelFocus) = nil; _mouseBlockCtrl ctrlEnable false; _mouseBlockCtrl ctrlCommit 0; diff --git a/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf b/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf index 6d6dd4bb76..ec025b0bc1 100644 --- a/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf +++ b/addons/arsenal/functions/fnc_onLoadoutsOpen.sqf @@ -27,6 +27,8 @@ _mouseBlockCtrl ctrlCommit 0; [_arsenalDisplay] call FUNC(buttonHide); GVAR(currentLoadoutsTab) = -1; +GVAR(loadoutsSearchbarFocus) = false; +GVAR(loadoutsPanelFocus) = false; GVAR(previousCameraPos) = GVAR(cameraPosition); GVAR(cameraPosition) = [5,0,20,[-0.85,0,0.85]]; diff --git a/addons/arsenal/functions/fnc_portVALoadouts.sqf b/addons/arsenal/functions/fnc_portVALoadouts.sqf new file mode 100644 index 0000000000..7ad141819d --- /dev/null +++ b/addons/arsenal/functions/fnc_portVALoadouts.sqf @@ -0,0 +1,43 @@ +/* + * Author: alganthe + * Port VA loadouts to ACE Arsenal. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: Yes +*/ +#include "script_component.hpp" + +private _VALoadouts = +(profilenamespace getvariable ["bis_fnc_saveInventory_data",[]]); +private _aceLoadouts = +(profileNamespace getVariable [QGVAR(saved_loadouts),[]]); + +if (isNull player) exitWith { + [localize LSTRING(portLoadoutsPlayerError)] call BIS_fnc_error; +}; + +if (_VALoadouts isEqualTo []) exitWith { + [localize LSTRING(portLoadoutsLoadoutError)] call BIS_fnc_error; +}; + +for "_i" from 0 to (count _VALoadouts - 1) step 2 do { + _name = _VALoadouts select _i; + _inventory = _VALoadouts select (_i + 1); + + private _sameNameLoadoutsList = _aceLoadouts select {_x select 0 == _name}; + [player, [profilenamespace, _name]] call bis_fnc_loadinventory; + + private _loadout = getUnitLoadout player; + + if (count _sameNameLoadoutsList > 0) then { + _aceLoadouts set [_aceLoadouts find (_sameNameLoadoutsList select 0), [_name, _loadout]]; + + } else { + _aceLoadouts pushBack [_name, _loadout]; + }; +}; + +profileNamespace setVariable [QGVAR(saved_loadouts), _aceLoadouts]; diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf index c74a368e1a..28f90b9ae6 100644 --- a/addons/arsenal/functions/fnc_scanConfig.sqf +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -125,7 +125,7 @@ private _magazineGroups = [[],[]] call CBA_fnc_hashCreate; (_cargo select 17) pushBackUnique _className; }; }; -} foreach configProperties [_configCfgWeapons, "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; +} foreach configProperties [_configCfgWeapons, "isClass _x && {(if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')}) == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true]; { private _className = configName _x; diff --git a/addons/arsenal/missions/Arsenal.VR/CfgEventHandlers.hpp b/addons/arsenal/missions/Arsenal.VR/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0f36260026 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call compile preprocessFileLineNumbers 'XEH_preInit.sqf'); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call compile preprocessFileLineNumbers 'XEH_postInit.sqf'); + }; +}; diff --git a/addons/arsenal/missions/Arsenal.VR/XEH_postInit.sqf b/addons/arsenal/missions/Arsenal.VR/XEH_postInit.sqf new file mode 100644 index 0000000000..e9fde7c172 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/XEH_postInit.sqf @@ -0,0 +1,113 @@ +#include "script_component.hpp" +#include "\z\ace\addons\arsenal\defines.hpp" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" + +enableSaving [false, false]; +cba_diagnostic_projectileMaxLines = 10; + +[QGVAR(displayOpened), { + private _player = player; + + // player pose + [{ + switch (true) do { + case (primaryWeapon _this != ""): { + _this switchMove "amovpercmstpslowwrfldnon"; + }; + case (handgunWeapon _this != ""): { + _this switchMove "amovpercmstpslowwpstdnon"; + }; + default { + _this switchMove "amovpercmstpsnonwnondnon"; + }; + }; + }, _player] call CBA_fnc_execNextFrame; + + // hide everything except the player + { + _x enableSimulation false; + _x hideObject true; + } forEach (allMissionObjects "" - [_player]); + + _player call CBA_fnc_removeUnitTrackProjectiles; + _player setFatigue 0; + + // Esc to close mission + { + private _display = findDisplay IDD_ace_arsenal; + + _display displayAddEventHandler ["KeyDown", { + params ["_display", "_key", "_shift"]; + + if (_key isEqualTo DIK_ESCAPE && {!_shift}) then { + [_display] spawn { + disableSerialization; + params ["_display"]; + + private _return = [ + localize "str_sure", + localize "str_a3_rscdisplaymain_buttonexit", + true, false, + _display, false, true + ] call BIS_fnc_GUImessage; + + if (_return) then { + profileNamespace setVariable [QGVAR(missionLastLoadout), getUnitLoadout player]; + _display closeDisplay 2; + findDisplay 46 closeDisplay 0; + }; + }; + true + }; + }]; + + private _buttonClose = _display displayCtrl IDC_menuBarClose; + _buttonClose ctrlSetText localize "str_a3_rscdisplayarsenal_buttonok"; + } call CBA_fnc_execNextFrame; +}] call CBA_fnc_addEventHandler; + +[QGVAR(displayClosed), { + private _player = player; + + // unhide everthing + { + _x enableSimulation true; + _x hideObject false; + } forEach allMissionObjects ""; + + // update VR unit gear + { + private _unit = _x; + + removeVest _unit; + _unit addVest vest _player; + + removeBackpack _unit; + _unit addBackpack backpack _player; + + removeHeadgear _unit; + _unit addHeadgear headgear _player; + + removeGoggles _unit; + _unit addGoggles goggles _player; + + removeAllWeapons _unit; + _unit addWeapon primaryWeapon _player; + { + _unit addPrimaryWeaponItem _x; + } forEach primaryWeaponItems _player; + + _unit addWeapon secondaryWeapon _player; + + { + _unit addSecondaryWeaponItem _x; + } forEach secondaryWeaponItems _player; + + _unit addWeapon handgunWeapon _player; + { + _unit addHandgunItem _x; + } forEach handgunItems _player; + } forEach (entities [["B_Soldier_VR_F", "O_Soldier_VR_F", "I_Soldier_VR_F"], [], true]); + + _player call CBA_fnc_addUnitTrackProjectiles; +}] call CBA_fnc_addEventHandler; diff --git a/addons/arsenal/missions/Arsenal.VR/XEH_preInit.sqf b/addons/arsenal/missions/Arsenal.VR/XEH_preInit.sqf new file mode 100644 index 0000000000..329d5fd1a5 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/XEH_preInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +PREP(onPause); +PREP(createTarget); diff --git a/addons/arsenal/missions/Arsenal.VR/description.ext b/addons/arsenal/missions/Arsenal.VR/description.ext new file mode 100644 index 0000000000..b548cb933e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/description.ext @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +dev = "commy2"; +author = ECSTRING(common,ACETeam); + +onLoadName = CSTRING(Mission); +overviewText = CSTRING(Mission_overview); +overviewPicture = "logo_ca.paa"; + +briefing = 0; +debriefing = 0; +enableDebugConsoleSP = 1; + +doneKeys[] = {"BIS_Arsenal.Map_VR_done"}; +onPauseScript[] = {QFUNC(onPause)}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf b/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf new file mode 100644 index 0000000000..7ff1ea58e6 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf @@ -0,0 +1,66 @@ +#include "script_component.hpp" + +params ["_type", "_position", ["_group", grpNull], "_varName"]; +private _player = player; + +if (isNull _group) then { + _group = creategroup east; +}; + +private _target = _group createUnit [_type, [10,10,0], [], 0, "NONE"]; + +if (isNil "_varName") then { + _varName = _target call BIS_fnc_netId; +}; + +_target setPos _position; +_target setDir (_position getDir _player); +_target doWatch position _player; +_target addRating -10e10; +_target setUnitPos "UP"; +_target setBehaviour "CARELESS"; +_target setCombatMode "BLUE"; +_target setSpeedMode "LIMITED"; +_target disableAI "TARGET"; +_target disableAI "AUTOTARGET"; +_target allowFleeing 0; +_target setSpeaker "BASE"; + +[{ + params ["_target", "_time"]; + + if (speaker _target == "BASE") exitWith {time > _time}; + _target setSpeaker "BASE"; + false +}, {}, [_target, time + 1]] call CBA_fnc_waitUntilAndExecute; + +_player reveal [_target, 4]; + +_target addVest vest _player; +_target addBackpack backpack _player; +_target addHeadgear headgear _player; +_target addGoggles goggles _player; +_target addWeapon primaryWeapon _player; +_target addWeapon secondaryWeapon _player; +_target addWeapon handgunWeapon _player; + +_target setVehicleVarName _varName; +missionNamespace setvariable [_varName, _target]; + +_target switchMove "amovpercmstpslowwrfldnon"; +_target setVariable ["origin", _position]; + +_target addEventHandler ["killed", { + params ["_target"]; + private _position = _target getVariable ["origin", position _target]; + private _varName = vehicleVarName _target; + + [_target, true] spawn BIS_fnc_VREffectKilled; + + [{isNull (_this select 0)}, { + (_this select 1) call FUNC(createTarget); + }, [_target, [typeOf _target, _position, group _target, _varName]]] call CBA_fnc_waitUntilAndExecute; +}]; + +_target call BIS_fnc_VRHitpart; +_target diff --git a/addons/arsenal/missions/Arsenal.VR/fnc_onPause.sqf b/addons/arsenal/missions/Arsenal.VR/fnc_onPause.sqf new file mode 100644 index 0000000000..25e49405bf --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fnc_onPause.sqf @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +params ["_display"]; + +private _ctrlButtonAbort = _display displayCtrl 104; +_ctrlButtonAbort ctrlSetText localize LSTRING(Mission); +_ctrlButtonAbort ctrlSetTooltip localize LSTRING(ReturnToArsenal); + +_ctrlButtonAbort ctrlSetEventHandler ["ButtonClick", { + params ["_control"]; + ctrlParent _control closeDisplay 2; + {[player, player, true] call FUNC(openBox)} call CBA_fnc_execNextFrame; + true +} call EFUNC(common,codeToString)]; + +true diff --git a/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf new file mode 100644 index 0000000000..111202d04e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf @@ -0,0 +1,175 @@ +#include "script_component.hpp" + +params ["_unit"]; + +private _loadout = profileNamespace getVariable QGVAR(missionLastLoadout); + +if (!isNil "_loadout") then { + _unit setUnitLoadout _loadout; +}; + +_unit allowDamage false; + +//--- Static targets in various distance +{ + private _position = _unit getRelPos [_x, _forEachIndex]; + ["O_Soldier_VR_F", _position] call FUNC(createTarget); +} forEach [10, 20, 30, 40, 50, 100, 500, 1000, 2000]; + +//--- Target line +private _position = _unit getRelPos [20, -90]; + +for "_i" from 0 to 5 do { + private _position = _position vectorAdd [0, -3 + _i, 0]; + ["O_Soldier_VR_F", _position] call FUNC(createTarget); +}; + +//--- Target cluster +_position = _unit getRelPos [20, 90]; + +for "_i" from 0 to 8 do { + private _index = floor (_i / 3); + private _position = _position vectorAdd [_index * 1.5, 1.5 + (_i % 3), 0]; + + private _target = ["O_Soldier_VR_F", _position] call FUNC(createTarget); + + _target switchMove (["aidlpercmstpslowwrfldnon", "aidlpknlmstpslowwrfldnon_ai", "aidlppnemstpsraswrfldnon_ai"] select _index); + _target setUnitPos (["UP", "MIDDLE", "DOWN"] select _index); +}; + +//--- Target patrol +private _group = createGroup east; + +{ + private _position = _unit getRelPos [10, _x]; + private _waypoint = _group addWaypoint [_position, 0]; + + if (_forEachIndex == 4) then { + _waypoint setWaypointType "CYCLE"; + }; +} forEach [0, 90, 180, 270, 0]; + +_position = _unit getRelPos [10, 180]; + +for "_i" from 0 to 1 do { + private _target = ["O_Soldier_VR_F", _position] call FUNC(createTarget); + + [_target] join _group; + _target stop false; + _target enableAI "MOVE"; + _target setSpeedMode "LIMITED"; +}; + +//--- Armored vehicles +private _vehicles = []; + +private _step = 15; +_position = [position _unit select 0,(position _unit select 1) + 30,0]; + +{ + private _row = _forEachIndex; + private _rowCount = (count _x - 1) * 0.5; + + { + private _position = _position vectorAdd [(-_rowCount + _forEachIndex) * _step, _row * _step, 0]; + + private _vehicle = createVehicle [_x, _position, [], 0, "NONE"]; + _vehicle setPos _position; + _vehicle setDir 180; + _vehicle setVelocity [0,0,-1]; + _vehicle call BIS_fnc_VRHitpart; + + private _marker = _vehicle call BIS_fnc_boundingBoxMarker; + _marker setMarkerColor "ColorOrange"; + _vehicles pushBack _vehicle; + } forEach _x; +} forEach [[ + "Land_VR_Target_MRAP_01_F", + "Land_VR_Target_APC_Wheeled_01_F", + "Land_VR_Target_MBT_01_cannon_F" +], [ + "Land_VR_Target_MRAP_01_F", + "Land_VR_Target_APC_Wheeled_01_F", + "Land_VR_Target_MBT_01_cannon_F" +]]; + +_vehicles spawn { + waituntil { + private _allDisabled = true; + + { + _hitAlive = _x getVariable ["bis_fnc_VRHitParts_hitalive", []]; + _allDisabled = _allDisabled && ({!_x} count _hitAlive >= 2); + sleep 0.1; + } forEach _this; + + _allDisabled + }; + + setStatValue ["MarkMassVirtualDestruction", 1]; +}; + +//--- Cover objects +private _coverObjects = [ + "Land_VR_CoverObject_01_kneel_F", + "Land_VR_CoverObject_01_kneelHigh_F", + "Land_VR_CoverObject_01_kneelLow_F", + "Land_VR_CoverObject_01_stand_F", + "Land_VR_CoverObject_01_standHigh_F" +]; + +for "_i" from 5 to 11 do { + private _direction = 180 + _i * 45; + private _position = _unit getRelPos [(abs sin _direction + abs cos _direction) * 3, _direction]; + private _block = createVehicle [_coverObjects select (_i % count _coverObjects), _position, [], 0, "NONE"]; + _block setPos _position; +}; + +//--- Starting point +private _square = createVehicle ["VR_Area_01_square_1x1_grey_F", position _unit, [], 0, "NONE"]; +_square setPosASL getPosASL _unit; + +private _marker = createMarker [QGVAR(start), getPosWorld _unit]; +_marker setMarkerType "mil_start"; + +//--- Open Arsenal +[_unit, true, false] call FUNC(initBox); + +[{!isNull findDisplay 46}, { + [_this, _this, true] call FUNC(openBox); +}, _unit] call CBA_fnc_waitUntilAndExecute; + +//--- Salute +_unit addEventHandler ["AnimChanged", { + params ["_unit", "_anim"]; + _anim = _anim splitString "_"; + + if ("salute" in _anim) then { + { + _x playAction "salute"; + } forEach ((_unit nearObjects ["CAManBase", 10]) - [_unit]); + }; +}]; + +["#(argb,8,8,3)color(0,0,0,1)", false, nil, 0.1, [0,0.5]] spawn BIS_fnc_textTiles; + +//--- Target markers +private _markers = []; + +{ + private _marker = createMarker [vehicleVarName _x, position _x]; + _marker setMarkerType "mil_dot"; + _marker setMarkerColor "ColorOrange"; + + _markers pushBack _marker; +} forEach (allMissionObjects "CAManBase" - [_unit]); + +_markers spawn { + while {true} do { + { + private _target = missionNamespace getVariable _x; + _x setMarkerPos position _target; + } forEach _this; + sleep 0.1; + }; +}; diff --git a/addons/arsenal/missions/Arsenal.VR/logo_ca.paa b/addons/arsenal/missions/Arsenal.VR/logo_ca.paa new file mode 100644 index 0000000000..0ad1e2dd0f Binary files /dev/null and b/addons/arsenal/missions/Arsenal.VR/logo_ca.paa differ diff --git a/addons/arsenal/missions/Arsenal.VR/mission.sqm b/addons/arsenal/missions/Arsenal.VR/mission.sqm new file mode 100644 index 0000000000..c43d901f6e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/mission.sqm @@ -0,0 +1,163 @@ +version=12; +class Mission +{ + addOns[]= + { + "A3_Map_VR", + "A3_Characters_F_BLUFOR", + "a3_characters_f_beta", + "a3_characters_f" + }; + addOnsAuto[]= + { + "A3_Characters_F_BLUFOR", + "a3_characters_f", + "A3_Map_VR" + }; + randomSeed=5486937; + class Intel + { + briefingName="@STR_A3_Arsenal"; + startWeather=0; + startWind=0.099999994; + startWaves=0.099999994; + forecastWeather=0; + forecastWind=0.099999994; + forecastWaves=0.099999994; + forecastLightnings=0.099999994; + year=2035; + month=2; + day=24; + hour=12; + minute=0; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; + class Groups + { + items=1; + class Item0 + { + side="CIV"; + class Vehicles + { + items=1; + class Item0 + { + position[]={4256,5,4192}; + azimut=180; + id=0; + side="CIV"; + vehicle="C_man_1"; + player="PLAYER COMMANDER"; + leader=1; + skill=0.60000002; + }; + }; + }; + }; + class Sensors + { + items=1; + class Item0 + { + position[]={4271.2827,5,4170.251}; + a=0; + b=0; + interruptable=1; + age="UNKNOWN"; + expCond="cheat1"; + expActiv="endmission ""end1"""; + class Effects + { + }; + }; + }; +}; +class Intro +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=12455686; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; +class OutroWin +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=9312504; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; +class OutroLoose +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=15192082; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; diff --git a/addons/arsenal/missions/Arsenal.VR/script_component.hpp b/addons/arsenal/missions/Arsenal.VR/script_component.hpp new file mode 100644 index 0000000000..83467c1293 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/script_component.hpp @@ -0,0 +1,3 @@ +#include "\z\ace\addons\arsenal\script_component.hpp" + +#define PREP(var) FUNC(var) = compileFinal preprocessFileLineNumbers format ["fnc_%1.sqf", QUOTE(var)] diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 0c28240b9b..21452fed7a 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -394,6 +394,7 @@ ACE Arsenal ACE Arsenal + ACE-Arsenal ACE Arsenał ACE 武器庫 Arsenale ACE @@ -429,9 +430,37 @@ Unable to open ACE arsenal Impossible d'ouvrir ACE arsenal - Kann ACE Arsenal nicht anzeigen + Kann ACE-Arsenal nicht anzeigen Impossibile aprire l'arsenale ACE ACE 武器庫を開けません + + Import BI VA loadouts to ACE Arsenal + Importe les loadouts de BI VA dans ACE Arsenal + + + No player unit available! Place a unit and mark it as "Player". + Aucune unité joueur disponible ! Placez une unité et marquez la en tant que "joueur". + + + No loadouts to import. + Aucun loadout à importer. + + + ACE Arsenal + ACE-Arsenal + + + Return to ACE Arsenal. + Zurück zum ACE-Arsenal. + + + Use ACE Arsenal to try out different weapons and equipment. + Verwende ACE-Arsenal und sieh dir verschiedene Waffen und Ausrüstung an und probiere sie aus. + + + Try weapons and equipment and create your own loadouts. + Probiere verschiedene Waffen und Ausrüstung aus und stelle dir eigene Ausrüstungsprofile zusammen. + diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp index b1faccfd70..33564b7010 100644 --- a/addons/arsenal/ui/RscAttributes.hpp +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -130,7 +130,7 @@ class GVAR(display) { text = ECSTRING(common,Weight); x = 0; y = 0; - w = QUOTE(40 * GRID_W); + w = QUOTE(30 * GRID_W); h = QUOTE(8 * GRID_H); sizeEx = QUOTE(7 * GRID_H); }; @@ -138,9 +138,9 @@ class GVAR(display) { idc = IDC_totalWeightText; style = ST_RIGHT; text = ""; - x = QUOTE(40 * GRID_W); + x = QUOTE(30 * GRID_W); y = 0; - w = QUOTE(40 * GRID_W); + w = QUOTE(50 * GRID_W); h = QUOTE(8 * GRID_H); sizeEx = QUOTE(7 * GRID_H); }; @@ -159,51 +159,58 @@ class GVAR(display) { h = QUOTE(10 * GRID_H); sizeEx = QUOTE(5 * GRID_H); }; + + #define WIDTH_TOTAL (safezoneW - 2 * (93 * GRID_W)) + #define WIDTH_GAP (WIDTH_TOTAL / 100) + #define WIDTH_SINGLE ((WIDTH_TOTAL - 6 * WIDTH_GAP) / 5) + class menuBar: RscControlsGroupNoScrollbars { idc = IDC_menuBar; - x = QUOTE((safezoneX + safezoneW * 0.50) - (105 * GRID_W)); + x = QUOTE(0.5 - WIDTH_TOTAL / 2); y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); - w = QUOTE(210 * GRID_W); + w = QUOTE(WIDTH_TOTAL); h = QUOTE(7 * GRID_H); class controls { class buttonHide: ctrlButton { idc = -1; colorBackground[] = {0,0,0,0.8}; - x = QUOTE(0 * GRID_W); + x = QUOTE(1 * WIDTH_GAP + 0 * WIDTH_SINGLE); y = QUOTE(0); - w = QUOTE(40 * GRID_W); + w = QUOTE(WIDTH_SINGLE); h = QUOTE(7 * GRID_H); text = CSTRING(buttonHideText); + sizeEx = QUOTE(5 * GRID_H); shortcuts[] = {"0x0E"}; tooltip = CSTRING(buttonHideTooltip); onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonHide)); }; class buttonLoadouts: buttonHide { idc = -1; - x = QUOTE(42.5 * GRID_W); + x = QUOTE(2 * WIDTH_GAP + 1 * WIDTH_SINGLE); text = CSTRING(buttonLoadoutsText); onButtonClick = QUOTE(createDialog QQGVAR(loadoutsDisplay)); }; class buttonExport: buttonHide { idc = -1; - x = QUOTE(85 * GRID_W); + x = QUOTE(3 * WIDTH_GAP + 2 * WIDTH_SINGLE); text = CSTRING(buttonExportText); onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonExport)); }; class buttonImport: buttonHide { idc = -1; - x = QUOTE(127.5 * GRID_W); + x = QUOTE(4 * WIDTH_GAP + 3 * WIDTH_SINGLE); text = CSTRING(buttonImportText); onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonImport)); }; class buttonClose: ctrlButtonClose { - idc = -1; + idc = IDC_menuBarClose; colorBackground[] = {0,0,0,0.8}; - x = QUOTE(170 * GRID_W); + x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE); y = QUOTE(0); - w = QUOTE(40 * GRID_W); + w = QUOTE(WIDTH_SINGLE); h = QUOTE(7 * GRID_H); text = CSTRING(buttonCloseText); + sizeEx = QUOTE(5 * GRID_H); shortcuts[]= {"0x01"}; onButtonClick = QUOTE(ctrlparent (_this select 0) closeDisplay 2); }; @@ -330,6 +337,7 @@ class GVAR(display) { w = QUOTE(80 * GRID_W); h = QUOTE(6 * GRID_H); onLBSelChanged = QUOTE(_this call FUNC(sortPanel)); + sizeEx = QUOTE(5 * GRID_H); class Items { class Alphabet { text="$STR_a3_rscdisplayarsenal_sort_alphabet"; @@ -760,12 +768,15 @@ class GVAR(loadoutsDisplay) { y = QUOTE(0); w = QUOTE(160 * GRID_W); h = QUOTE(5 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); }; class contentPanel: RscListnBox { idc = IDC_contentPanel; columns[]={0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90}; drawSideArrows=0; disableOverflow=1; + onSetFocus = QUOTE(GVAR(loadoutsPanelFocus) = true); + onKillFocus = QUOTE(GVAR(loadoutsPanelFocus) = false); onLBSelChanged = QUOTE([ARR_3(ctrlParent (_this select 0), _this select 0, _this select 1)] call FUNC(onSelChangedLoadouts)); onLBDblClick = QUOTE([ARR_2(ctrlparent (_this select 0), (ctrlParent (_this select 0)) displayCtrl IDC_buttonLoad)] call FUNC(buttonLoadoutsLoad)); x = QUOTE(0); @@ -777,17 +788,38 @@ class GVAR(loadoutsDisplay) { class textTitle: RscText { idc= -1; text="$STR_DISP_GAME_NAME"; - x = QUOTE(1 * GRID_W); + x = QUOTE(0 * GRID_W); y = QUOTE(safezoneH - (51 * GRID_H)); w = QUOTE(15 * GRID_W); h = QUOTE(5 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); colorBackground[]={0,0,0,0.2}; }; class textEditBox: ctrlEdit { idc= IDC_textEditBox; - x = QUOTE(16 * GRID_W); + x = QUOTE(15 * GRID_W); y = QUOTE(safezoneH - (51 * GRID_H)); - w = QUOTE(80 * GRID_W); + w = QUOTE(65 * GRID_W); + h = QUOTE(5 * GRID_H); + }; + class loadoutsSearchbar: ctrlEdit { + idc = IDC_loadoutsSearchbar; + onSetFocus = QUOTE(GVAR(loadoutsSearchbarFocus) = true); + onKillFocus = QUOTE(GVAR(loadoutsSearchbarFocus) = false); + onMouseButtonClick = QUOTE([ARR_3(ctrlParent (_this select 0), _this select 0, _this select 1)] call FUNC(clearSearchbar)); + x = QUOTE(83 * GRID_W); + y = QUOTE(safezoneH - (51 * GRID_H)); + w = QUOTE(72 * GRID_W); + h = QUOTE(5 * GRID_H); + }; + class loadoutsSearchbarButton: ctrlButtonPicture { + idc = -1; + text = "\a3\Ui_f\data\GUI\RscCommon\RscButtonSearch\search_start_ca.paa"; + colorBackground[]={0,0,0,0.5}; + onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), ctrlparent (_this select 0) displayCtrl IDC_loadoutsSearchbar)] call FUNC(handleLoadoutsSearchbar)); + x = QUOTE(155 * GRID_W); + y = QUOTE(safezoneH - (51 * GRID_H)); + w = QUOTE(5 * GRID_W); h = QUOTE(5 * GRID_H); }; class buttonSave: ctrlButton { @@ -798,6 +830,7 @@ class GVAR(loadoutsDisplay) { h = QUOTE(10 * GRID_H); text= CSTRING(buttonSaveText); tooltip= CSTRING(buttonSaveTooltip); + sizeEx = QUOTE(5 * GRID_H); onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsSave)); colorBackground[] = {0,0,0,0.8}; }; @@ -839,7 +872,7 @@ class GVAR(loadoutsDisplay) { y = QUOTE(safezoneH + safezoneY - 9 * GRID_H); w = QUOTE(30 * GRID_W); h = QUOTE(7 * GRID_H); - sizeEx = QUOTE(4 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); text= CSTRING(buttonCloseText); shortcuts[]= {"0x01"}; tooltip= ""; @@ -867,7 +900,7 @@ class GVAR(loadoutsDisplay) { y = QUOTE(0 * GRID_H); w = QUOTE(52 * GRID_W); h = QUOTE(7 * GRID_H); - sizeEx = QUOTE(4 * GRID_H); + sizeEx = QUOTE(5 * GRID_H); text= CSTRING(tabMyLoadoutsText); tooltip= CSTRING(tabMyLoadoutsTooltip); onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(loadoutsChangeTab)); diff --git a/addons/arsenal/ui/RscCommon.hpp b/addons/arsenal/ui/RscCommon.hpp index 2a88204d7b..5db52bf704 100644 --- a/addons/arsenal/ui/RscCommon.hpp +++ b/addons/arsenal/ui/RscCommon.hpp @@ -275,4 +275,18 @@ class Display3DEN { }; }; }; + class Controls { + class MenuStrip: ctrlMenuStrip { + class Items { + class Tools { + items[] += {"ACE_arsenal_portVALoadouts"}; + }; + class ACE_arsenal_portVALoadouts { + text = CSTRING(portLoadoutsText); + picture = "\z\ace\logo_ace3_ca.paa"; + action = "call ace_arsenal_fnc_portVALoadouts;"; + }; + }; + }; + }; }; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index beca3d3246..88da983be9 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -27,15 +27,18 @@ private _config = (_this select 3) select (count (_this select 3) - 1); private _requiredItems = getArray(_config >> "requires"); private _hasRequired = true; private _detonators = [_unit] call FUNC(getDetonators); + { if !(_x in _detonators) exitWith{ _hasRequired = false; }; } count _requiredItems; +private _code = ""; private _codeSet = false; + while {!_codeSet} do { - private _code = str(round (random 9999)); + _code = str(round (random 9999)); _count = 4 - count (toArray _code); while {_count > 0} do { _code = "0" + _code; @@ -43,9 +46,11 @@ while {!_codeSet} do { }; _codeSet = (count ([_code] call FUNC(getSpeedDialExplosive))) == 0; }; + if (isNil QGVAR(CellphoneIEDs)) then { GVAR(CellphoneIEDs) = []; }; + private _count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")]; _count = _count + 1; publicVariable QGVAR(CellphoneIEDs); diff --git a/addons/explosives/functions/fnc_onIncapacitated.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf index 6f9a9f498a..7e2cb249cc 100644 --- a/addons/explosives/functions/fnc_onIncapacitated.sqf +++ b/addons/explosives/functions/fnc_onIncapacitated.sqf @@ -19,6 +19,11 @@ params ["_unit"]; TRACE_1("params",_unit); +if (_unit == ace_player) then { + // close cellphone if open + closeDialog 0; +}; + // Exit if no item: if (({_x == "ACE_DeadManSwitch"} count (items _unit)) == 0) exitWith {}; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index dcc1759648..65b9327d5a 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -13,10 +13,9 @@ * * Public: No */ - -//fnc_doSpall.sqf #include "script_component.hpp" -// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; + +#define WEIGHTED_SIZE [QGVAR(spall_small), 4, QGVAR(spall_medium), 3, QGVAR(spall_large), 2, QGVAR(spall_huge), 1] params ["_hitData", "_hitPartDataIndex"]; private _initialData = GVAR(spallHPData) select (_hitData select 0); @@ -51,6 +50,7 @@ if (alive _round) then { }; }; if (_exit) exitWith {}; + private _unitDir = vectorNormalized _velocity; private _pos = _hpData select 3; private _spallPos = []; @@ -88,14 +88,6 @@ if (_explosive > 0) then { _spallPolar set [0, _fragPower * 0.66]; }; -private _fragTypes = [ - QGVAR(spall_small), QGVAR(spall_small), QGVAR(spall_small), - QGVAR(spall_small),QGVAR(spall_medium),QGVAR(spall_medium),QGVAR(spall_medium), - QGVAR(spall_medium), QGVAR(spall_large), QGVAR(spall_large), QGVAR(spall_huge), - QGVAR(spall_huge) - -]; - // diag_log text format ["SPALL POWER: %1", _spallPolar select 0]; private _spread = 15 + (random 25); private _spallCount = 5 + (random 10); @@ -110,8 +102,7 @@ for "_i" from 1 to _spallCount do { _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragType = round (random ((count _fragTypes) - 1)); - private _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; @@ -133,8 +124,7 @@ for "_i" from 1 to _spallCount do { _vel = (_vel - (_vel * 0.25)) + (random (_vel * 0.5)); private _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - private _fragType = round (random ((count _fragTypes) - 1)); - private _fragment = (_fragTypes select _fragType) createVehicleLocal [0, 0, 10000]; + private _fragment = (selectRandomWeighted WEIGHTED_SIZE) createVehicleLocal [0, 0, 10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index b1e29a79ca..a9d13cde08 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -54,6 +54,7 @@ if (_shouldAdd) then { private _localShooter = if (isNil "_gunner") then {local _unit} else {local _gunner}; TRACE_4("",_localShooter,_unit,_ammo,_projectile); if (!_localShooter) exitWith {}; + if (_weapon == "Put") exitWith {}; // Ignore explosives placed without ace_explosives // Skip if less than 0.5 second from last shot if ((CBA_missionTime - (_unit getVariable [QGVAR(lastTrack), -1])) < 0.5) exitWith {}; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index bde72c6476..d745734ca1 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -269,7 +269,7 @@ Add the `ACE_EarPlugs` item to all units that have loud weapons. Can disable if using custom loadouts. - Fügt die "ACE_EarPlugs" zu allen Einheiten mit lauten Waffen hinzu. Wird deaktiviert wenn eine eigene Inventarkonfiguration vorgenommen wurde. + Fügt die "ACE_EarPlugs" zu allen Einheiten mit lauten Waffen hinzu. Wird deaktiviert wenn eigene Ausrüstungsprofile verwendet werden. Dodaje `ACE_EarPlugs` - stopery - do wszystkich jednostek, które posiadają głośną broń. Można wyłaczyć w przypadku korzystania z niestandardowych loadoutów. Добавляет предмет `ACE_EarPlugs` всем юнитам, которые имеют громкое оружие. Можно отключить при ручной настройке снаряжения. Adicionar o item `ACE_EarPlugs` a todas as unidades que tenham armas barulhentas. Pode ser desabilitado com carregamentos customizados. diff --git a/addons/optionsmenu/README.md b/addons/optionsmenu/README.md index f8d8c54d09..e274229053 100644 --- a/addons/optionsmenu/README.md +++ b/addons/optionsmenu/README.md @@ -1,7 +1,8 @@ ace_optionsmenu =============== -Adds the options menu used by other components. +Previously held the options menu. +Now just handles version display on main menu and debug/headbug on options menu. ## Maintainers diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index fcaca6a9de..a502934f50 100644 --- a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -55,15 +55,16 @@ if (isNull ace_player) then {"null"} else {animationState ace_player}]; _text = format [" -------ACE Settings------"]; +------ACE's CBA Settings------"]; [_text] call _outputText; - +private _aceSettings = cba_settings_allSettings select {((_x select [0,4]) == "ace_") || {(_x select [0,5]) == "acex_"}}; +_aceSettings sort true; { - _var = missionNamespace getVariable [(_x select 0), "ERROR: Not Defined"]; - _text = format ["%1 - %2", (_x select 0), _var]; + _var = missionNamespace getVariable [_x, "ERROR: Not Defined"]; + _text = format ["%1 - %2", _x, _var]; [_text] call _outputText; -} forEach EGVAR(common,settings); +} forEach _aceSettings; _text = format [" diff --git a/addons/optionsmenu/script_component.hpp b/addons/optionsmenu/script_component.hpp index c13e915702..7ae6409e6c 100644 --- a/addons/optionsmenu/script_component.hpp +++ b/addons/optionsmenu/script_component.hpp @@ -20,10 +20,3 @@ #define IDC_MAIN_INFO 80090 #define IDC_MAIN_INFO_CURRENT_VERSION_INFO 80091 #define IDC_MAIN_INFO_NEWEST_VERSION_INFO 80092 - -#define MENU_TAB_OPTIONS 0 -#define MENU_TAB_COLORS 1 - -#define MENU_TAB_SERVER_OPTIONS 10 -#define MENU_TAB_SERVER_COLORS 11 -#define MENU_TAB_SERVER_VALUES 12 diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index f670fc1720..8c48ee654b 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -18,6 +18,7 @@ #include "script_component.hpp" params ["_unit", "_turretAndDirection", "_majorStep"]; +TRACE_3("adjustScope",_unit,_turretAndDirection,_majorStep); if (!(_unit isKindOf "Man")) exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; @@ -26,14 +27,16 @@ if (!GVAR(enabled)) exitWith {false}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; +TRACE_2("",GVAR(canAdjustElevation),GVAR(canAdjustWindage)); if (!(GVAR(canAdjustElevation) select _weaponIndex) && (_turretAndDirection in [ELEVATION_UP, ELEVATION_DOWN])) exitWith {false}; -if (!(GVAR(canAdjustWindage) select _weaponIndex) && (_turretAndDirection in [WINDAGE_UP, WINDAGE_DOWN])) exitWith {false}; +if (!(GVAR(canAdjustWindage) select _weaponIndex) && (_turretAndDirection in [WINDAGE_LEFT, WINDAGE_RIGHT])) exitWith {false}; private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; private _zeroing = _adjustment select _weaponIndex; _zeroing params ["_elevation", "_windage", "_zero"]; (GVAR(scopeAdjust) select _weaponIndex) params ["_maxVertical", "_verticalIncrement", "_maxHorizontal", "_horizontalIncrement"]; +TRACE_4("",_maxVertical,_verticalIncrement,_maxHorizontal,_horizontalIncrement); switch (_turretAndDirection) do { case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement }; diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp index 6daa59a752..359b96135b 100644 --- a/addons/spectator/config.cpp +++ b/addons/spectator/config.cpp @@ -21,7 +21,7 @@ class CfgPatches { class CfgRespawnTemplates { class ADDON { - displayName = CSTRING(Module_DisplayName); + displayName = CSTRING(Settings_DisplayName); onPlayerKilled = QFUNC(respawnTemplate); onPlayerRespawn = QFUNC(respawnTemplate); respawnTypes[] = {1,2,3,4,5}; diff --git a/docs/wiki/frameworkx/fortify-framework.md b/docs/wiki/frameworkx/fortify-framework.md index eaf30f628f..fe49cc1eb3 100644 --- a/docs/wiki/frameworkx/fortify-framework.md +++ b/docs/wiki/frameworkx/fortify-framework.md @@ -48,7 +48,7 @@ To add a preset via code you use the function `call acex_fortify_fnc_registerObj * None * * Example: -* [west, 5000, [["Sandbag", 5], ["Bunker", 50]]] call acex_fortify_fnc_registerObjects +* [west, 5000, [["Land_BagFence_Long_F", 5], ["Land_BagBunker_Small_F", 50]]] call acex_fortify_fnc_registerObjects ``` Adding it through `description.ext` you use: diff --git a/extras/assets/icons/Icons_MainMenu/buttonMissionMainMenuHover_ca.psd b/extras/assets/icons/Icons_MainMenu/buttonMissionMainMenuHover_ca.psd new file mode 100644 index 0000000000..daf66f1378 Binary files /dev/null and b/extras/assets/icons/Icons_MainMenu/buttonMissionMainMenuHover_ca.psd differ diff --git a/extras/assets/icons/Icons_MainMenu/buttonMissionMainMenu_ca.psd b/extras/assets/icons/Icons_MainMenu/buttonMissionMainMenu_ca.psd new file mode 100644 index 0000000000..0ca6d87d23 Binary files /dev/null and b/extras/assets/icons/Icons_MainMenu/buttonMissionMainMenu_ca.psd differ diff --git a/extras/assets/icons/Icons_MainMenu/logo_ca.psd b/extras/assets/icons/Icons_MainMenu/logo_ca.psd new file mode 100644 index 0000000000..7962077714 Binary files /dev/null and b/extras/assets/icons/Icons_MainMenu/logo_ca.psd differ