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";
|
name="ATragMX_Display";
|
||||||
idd=-1;
|
idd=-1;
|
||||||
onLoad="uiNamespace setVariable ['ATragMX_Display', (_this select 0)]";
|
onLoad="uiNamespace setVariable ['ATragMX_Display', (_this select 0)]";
|
||||||
|
onUnload=QUOTE(_this call FUNC(on_close_dialog));
|
||||||
movingEnable=1;
|
movingEnable=1;
|
||||||
controlsBackground[]={};
|
controlsBackground[]={};
|
||||||
objects[]={};
|
objects[]={};
|
||||||
|
@ -68,5 +68,6 @@ PREP(update_target_data);
|
|||||||
PREP(update_target_selection);
|
PREP(update_target_selection);
|
||||||
PREP(update_unit_selection);
|
PREP(update_unit_selection);
|
||||||
PREP(update_zero_range);
|
PREP(update_zero_range);
|
||||||
|
PREP(on_close_dialog);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
//if (dialog) exitWith { false };
|
//if (dialog) exitWith { false };
|
||||||
|
if(GVAR(active)) exitWith { false };
|
||||||
if (underwater ACE_player) exitWith { false };
|
if (underwater ACE_player) exitWith { false };
|
||||||
if (!("ACE_ATragMX" in (uniformItems ACE_player)) && !("ACE_ATragMX" in (vestItems 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];
|
lbAdd [6000, _x select 0];
|
||||||
} forEach GVAR(gunList);
|
} forEach GVAR(gunList);
|
||||||
|
|
||||||
|
GVAR(active) = true;
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
GVAR(active) = false;
|
||||||
|
|
||||||
GVAR(workingMemory) = +(GVAR(gunList) select 0);
|
GVAR(workingMemory) = +(GVAR(gunList) select 0);
|
||||||
|
|
||||||
GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"];
|
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
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
|
if(GVAR(active)) exitWith {};
|
||||||
// Statement
|
// Statement
|
||||||
[] call FUNC(create_dialog);
|
[] call FUNC(create_dialog);
|
||||||
false
|
false
|
||||||
|
@ -54,6 +54,7 @@ class Kestrel4500_Display
|
|||||||
name="Kestrel4500_Display";
|
name="Kestrel4500_Display";
|
||||||
idd=-1;
|
idd=-1;
|
||||||
onLoad="uiNamespace setVariable ['Kestrel4500_Display', (_this select 0)]";
|
onLoad="uiNamespace setVariable ['Kestrel4500_Display', (_this select 0)]";
|
||||||
|
onUnload=QUOTE(_this call FUNC(onCloseDialog));
|
||||||
movingEnable=1;
|
movingEnable=1;
|
||||||
controlsBackground[]={};
|
controlsBackground[]={};
|
||||||
objects[]={};
|
objects[]={};
|
||||||
@ -217,6 +218,7 @@ class RscTitles
|
|||||||
{
|
{
|
||||||
idd=-1;
|
idd=-1;
|
||||||
onLoad="with uiNameSpace do { RscKestrel4500 = _this select 0 };";
|
onLoad="with uiNameSpace do { RscKestrel4500 = _this select 0 };";
|
||||||
|
onUnload=(_this call FUNC(onCloseDisplay));
|
||||||
movingEnable=0;
|
movingEnable=0;
|
||||||
duration=60;
|
duration=60;
|
||||||
fadeIn="false";
|
fadeIn="false";
|
||||||
|
@ -13,4 +13,7 @@ PREP(measureWindSpeed);
|
|||||||
PREP(updateDisplay);
|
PREP(updateDisplay);
|
||||||
PREP(updateImpellerState);
|
PREP(updateImpellerState);
|
||||||
|
|
||||||
|
PREP(onCloseDialog);
|
||||||
|
PREP(onCloseDisplay);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
//if (dialog) exitWith { false };
|
//if (dialog) exitWith { false };
|
||||||
if (underwater ACE_player) 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 };
|
if (!("ACE_Kestrel4500" in (uniformItems ACE_player)) && !("ACE_Kestrel4500" in (vestItems ACE_player))) exitWith { false };
|
||||||
|
|
||||||
GVAR(Overlay) = 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,6 +2,7 @@
|
|||||||
{
|
{
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
|
if(GVAR(Kestrel4500)) exitWith { false };
|
||||||
|
|
||||||
// Statement
|
// Statement
|
||||||
[] call FUNC(createKestrelDialog);
|
[] call FUNC(createKestrelDialog);
|
||||||
|
Loading…
Reference in New Issue
Block a user