mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Disables multiple openings of the kestrel & atrag. Allows the overlay toggle, but disables the opening of multiple ones. Used onUnload handlers. Supports both limiting interact and keybinds. Fixes #1086
This commit is contained in:
parent
00c28dd146
commit
6b5d95906d
@ -142,6 +142,7 @@ class ATragMX_Display {
|
||||
name="ATragMX_Display";
|
||||
idd=-1;
|
||||
onLoad="uiNamespace setVariable ['ATragMX_Display', (_this select 0)]";
|
||||
onUnload=QUOTE(_this call FUNC(on_close_dialog));
|
||||
movingEnable=1;
|
||||
controlsBackground[]={};
|
||||
objects[]={};
|
||||
|
@ -68,5 +68,6 @@ PREP(update_target_data);
|
||||
PREP(update_target_selection);
|
||||
PREP(update_unit_selection);
|
||||
PREP(update_zero_range);
|
||||
PREP(on_close_dialog);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
//if (dialog) exitWith { false };
|
||||
if(GVAR(active)) exitWith { false };
|
||||
if (underwater ACE_player) exitWith { false };
|
||||
if (!("ACE_ATragMX" in (uniformItems ACE_player)) && !("ACE_ATragMX" in (vestItems ACE_player))) exitWith { false };
|
||||
|
||||
@ -47,4 +48,6 @@ GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer);
|
||||
lbAdd [6000, _x select 0];
|
||||
} forEach GVAR(gunList);
|
||||
|
||||
GVAR(active) = true;
|
||||
|
||||
true
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(active) = false;
|
||||
|
||||
GVAR(workingMemory) = +(GVAR(gunList) select 0);
|
||||
|
||||
GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"];
|
||||
|
4
addons/atragmx/functions/fnc_on_close_dialog.sqf
Normal file
4
addons/atragmx/functions/fnc_on_close_dialog.sqf
Normal file
@ -0,0 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['ATragMX_Display', nil];
|
||||
GVAR(active) = false;
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
if(GVAR(active)) exitWith {};
|
||||
// Statement
|
||||
[] call FUNC(create_dialog);
|
||||
false
|
||||
|
@ -54,6 +54,7 @@ class Kestrel4500_Display
|
||||
name="Kestrel4500_Display";
|
||||
idd=-1;
|
||||
onLoad="uiNamespace setVariable ['Kestrel4500_Display', (_this select 0)]";
|
||||
onUnload=QUOTE(_this call FUNC(onCloseDialog));
|
||||
movingEnable=1;
|
||||
controlsBackground[]={};
|
||||
objects[]={};
|
||||
@ -217,6 +218,7 @@ class RscTitles
|
||||
{
|
||||
idd=-1;
|
||||
onLoad="with uiNameSpace do { RscKestrel4500 = _this select 0 };";
|
||||
onUnload=(_this call FUNC(onCloseDisplay));
|
||||
movingEnable=0;
|
||||
duration=60;
|
||||
fadeIn="false";
|
||||
|
@ -22,4 +22,4 @@ GVAR(MeasuredWindSpeed) = 0;
|
||||
GVAR(ImpellerState) = 0;
|
||||
|
||||
GVAR(Kestrel4500) = false;
|
||||
GVAR(Overlay) = false;
|
||||
GVAR(Overlay) = false;
|
@ -13,4 +13,7 @@ PREP(measureWindSpeed);
|
||||
PREP(updateDisplay);
|
||||
PREP(updateImpellerState);
|
||||
|
||||
PREP(onCloseDialog);
|
||||
PREP(onCloseDisplay);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
//if (dialog) exitWith { false };
|
||||
if (underwater ACE_player) exitWith { false };
|
||||
if(GVAR(Kestrel4500)) exitWith { false };
|
||||
if (!("ACE_Kestrel4500" in (uniformItems ACE_player)) && !("ACE_Kestrel4500" in (vestItems ACE_player))) exitWith { false };
|
||||
|
||||
GVAR(Overlay) = false;
|
||||
|
4
addons/kestrel4500/functions/fnc_onCloseDialog.sqf
Normal file
4
addons/kestrel4500/functions/fnc_onCloseDialog.sqf
Normal file
@ -0,0 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['Kestrel4500_Display', nil];
|
||||
GVAR(Kestrel4500) = false;
|
4
addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
Normal file
4
addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
Normal file
@ -0,0 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['RscKestrel4500', nil];
|
||||
GVAR(Overlay) = false;
|
@ -2,7 +2,8 @@
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
if(GVAR(Kestrel4500)) exitWith { false };
|
||||
|
||||
// Statement
|
||||
[] call FUNC(createKestrelDialog);
|
||||
false
|
||||
@ -14,7 +15,7 @@
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
|
||||
// Statement
|
||||
[] call FUNC(displayKestrel);
|
||||
false
|
||||
|
Loading…
Reference in New Issue
Block a user