Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/artillerytables/functions/fnc_rangeTableUpdate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ private _ctrlElevationHigh = _dialog displayCtrl IDC_BUTTON_ELEV_HIGH;
private _ctrlElevationLow = _dialog displayCtrl IDC_BUTTON_ELEV_LOW;

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:
(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 _elevMax = _dialog getVariable [QGVAR(elevMax), 0];
_ctrlElevationHigh ctrlSetTextColor ([[0.25,0.25,0.25,1],[1,1,1,1]] select GVAR(lastElevationMode));
Expand Down
7 changes: 6 additions & 1 deletion addons/mk6mortar/CfgMagazines.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
class cfgMagazines {
class CfgMagazines {
class 8Rnd_82mm_Mo_shells;
class ACE_1Rnd_82mm_Mo_HE: 8Rnd_82mm_Mo_shells {
count = 1;
scope = 2;
scopeCurator = 2;
EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_displayName);
displayNameShort = "";
Expand All @@ -19,6 +20,7 @@ class cfgMagazines {
scope = 2;
scopeCurator = 2;
EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_Smoke_displayName);
displayNameShort = "";
Expand All @@ -33,6 +35,7 @@ class cfgMagazines {
scope = 2;
scopeCurator = 2;
EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_Illum_displayName);
displayNameShort = "";
Expand All @@ -47,6 +50,7 @@ class cfgMagazines {
scope = 2;
scopeCurator = 2;
EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_Guided_displayName);
displayNameShort = "";
Expand All @@ -61,6 +65,7 @@ class cfgMagazines {
scope = 2;
scopeCurator = 2;
EGVAR(arsenal,hide) = -1;
type = 256;
author = ECSTRING(common,ACETeam);
displayName = CSTRING(magazine_HE_LaserGuided_displayName);
displayNameShort = "";
Expand Down
1 change: 1 addition & 0 deletions addons/mk6mortar/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ PREP_RECOMPILE_START;
PREP_RECOMPILE_END;

#include "initSettings.inc.sqf"
#include "initKeybinds.inc.sqf"

ADDON = true;
15 changes: 15 additions & 0 deletions addons/mk6mortar/initKeybinds.inc.sqf
Original file line number Diff line number Diff line change
@@ -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