Artillery - Add Rangetable Keybind, Fix remembering last charge (#9818)

This commit is contained in:
Fabio Schick 2024-03-03 23:43:31 +01:00 committed by GitHub
parent 64538f2ad0
commit 22deb3af79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 3 deletions

View File

@ -22,10 +22,10 @@ private _ctrlElevationHigh = _dialog displayCtrl IDC_BUTTON_ELEV_HIGH;
private _ctrlElevationLow = _dialog displayCtrl IDC_BUTTON_ELEV_LOW; private _ctrlElevationLow = _dialog displayCtrl IDC_BUTTON_ELEV_LOW;
GVAR(lastElevationMode) = param [0, GVAR(lastElevationMode)]; // update if passed a new value GVAR(lastElevationMode) = param [0, GVAR(lastElevationMode)]; // update if passed a new value
GVAR(lastCharge) = lbCurSel _ctrlChargeList; GVAR(lastTablePage) = lbCurSel _ctrlChargeList;
// get data for currently selected mag/mode combo: // get data for currently selected mag/mode combo:
(GVAR(magModeData) select GVAR(lastCharge)) params [["_muzzleVelocity", -1], ["_airFriction", 0]]; (GVAR(magModeData) select GVAR(lastTablePage)) params [["_muzzleVelocity", -1], ["_airFriction", 0]];
private _elevMin = _dialog getVariable [QGVAR(elevMin), 0]; private _elevMin = _dialog getVariable [QGVAR(elevMin), 0];
private _elevMax = _dialog getVariable [QGVAR(elevMax), 0]; private _elevMax = _dialog getVariable [QGVAR(elevMax), 0];
_ctrlElevationHigh ctrlSetTextColor ([[0.25,0.25,0.25,1],[1,1,1,1]] select GVAR(lastElevationMode)); _ctrlElevationHigh ctrlSetTextColor ([[0.25,0.25,0.25,1],[1,1,1,1]] select GVAR(lastElevationMode));

View File

@ -1,10 +1,11 @@
class cfgMagazines { class CfgMagazines {
class 8Rnd_82mm_Mo_shells; class 8Rnd_82mm_Mo_shells;
class ACE_1Rnd_82mm_Mo_HE: 8Rnd_82mm_Mo_shells { class ACE_1Rnd_82mm_Mo_HE: 8Rnd_82mm_Mo_shells {
count = 1; count = 1;
scope = 2; scope = 2;
scopeCurator = 2; scopeCurator = 2;
EGVAR(arsenal,hide) = -1; EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_displayName); displayName = CSTRING(magazine_HE_displayName);
displayNameShort = ""; displayNameShort = "";
@ -19,6 +20,7 @@ class cfgMagazines {
scope = 2; scope = 2;
scopeCurator = 2; scopeCurator = 2;
EGVAR(arsenal,hide) = -1; EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_Smoke_displayName); displayName = CSTRING(magazine_Smoke_displayName);
displayNameShort = ""; displayNameShort = "";
@ -33,6 +35,7 @@ class cfgMagazines {
scope = 2; scope = 2;
scopeCurator = 2; scopeCurator = 2;
EGVAR(arsenal,hide) = -1; EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_Illum_displayName); displayName = CSTRING(magazine_Illum_displayName);
displayNameShort = ""; displayNameShort = "";
@ -47,6 +50,7 @@ class cfgMagazines {
scope = 2; scope = 2;
scopeCurator = 2; scopeCurator = 2;
EGVAR(arsenal,hide) = -1; EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_Guided_displayName); displayName = CSTRING(magazine_HE_Guided_displayName);
displayNameShort = ""; displayNameShort = "";
@ -61,6 +65,7 @@ class cfgMagazines {
scope = 2; scope = 2;
scopeCurator = 2; scopeCurator = 2;
EGVAR(arsenal,hide) = -1; EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_LaserGuided_displayName); displayName = CSTRING(magazine_HE_LaserGuided_displayName);
displayNameShort = ""; displayNameShort = "";

View File

@ -7,5 +7,6 @@ PREP_RECOMPILE_START;
PREP_RECOMPILE_END; PREP_RECOMPILE_END;
#include "initSettings.inc.sqf" #include "initSettings.inc.sqf"
#include "initKeybinds.inc.sqf"
ADDON = true; ADDON = true;

View File

@ -0,0 +1,15 @@
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
["ACE3 Equipment", QGVAR(rangetable_action), LLSTRING(rangetable_action), {
if (
!([ACE_player, "ACE_RangeTable_82mm"] call EFUNC(common,hasItem)) ||
!([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))
) exitWith {false};
// Close previously opened dialogs
closeDialog 0;
// Statement
[] call FUNC(rangeTableOpen);
true
}] call CBA_fnc_addKeybind; // Unbound