mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into arsenal-main-menu
This commit is contained in:
commit
8bca2ac73b
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@ -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.
|
||||
|
@ -34,6 +34,7 @@ PREP(onSelChangedRight);
|
||||
PREP(onSelChangedRightListnBox);
|
||||
PREP(open3DEN);
|
||||
PREP(openBox);
|
||||
PREP(portVALoadouts);
|
||||
PREP(removeBox);
|
||||
PREP(removeVirtualItems);
|
||||
PREP(scanConfig);
|
||||
|
43
addons/arsenal/functions/fnc_portVALoadouts.sqf
Normal file
43
addons/arsenal/functions/fnc_portVALoadouts.sqf
Normal file
@ -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];
|
@ -434,6 +434,17 @@
|
||||
<Italian>Impossibile aprire l'arsenale ACE</Italian>
|
||||
<Japanese>ACE 武器庫を開けません</Japanese>
|
||||
</Key>
|
||||
<Key ID= "STR_ACE_Arsenal_portLoadoutsText">
|
||||
<English>Import BI VA loadouts to ACE Arsenal</English>
|
||||
<French>Importe les loadouts de BI VA dans ACE Arsenal</French>
|
||||
</Key>
|
||||
<Key ID= "STR_ACE_Arsenal_portLoadoutsPlayerError">
|
||||
<English>No player unit available! Place a unit and mark it as "Player".</English>
|
||||
<French>Aucune unité joueur disponible ! Placez une unité et marquez la en tant que "joueur".</French>
|
||||
</Key>
|
||||
<Key ID= "STR_ACE_Arsenal_portLoadoutsLoadoutError">
|
||||
<English>No loadouts to import.</English>
|
||||
<French>Aucun loadout à importer.</French>
|
||||
<Key ID="STR_ACE_Arsenal_Mission">
|
||||
<English>ACE Arsenal</English>
|
||||
<German>ACE-Arsenal</German>
|
||||
|
@ -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 = 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,6 +768,7 @@ 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;
|
||||
@ -781,6 +790,7 @@ class GVAR(loadoutsDisplay) {
|
||||
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 {
|
||||
@ -798,6 +808,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 +850,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 +878,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));
|
||||
|
@ -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;";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -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);
|
||||
|
@ -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 {};
|
||||
|
||||
|
@ -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 {};
|
||||
|
@ -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
|
||||
|
@ -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 ["
|
||||
|
@ -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
|
||||
|
@ -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 };
|
||||
|
Loading…
Reference in New Issue
Block a user