Skip to content

Commit 665c0c1

Browse files
committed
Hide the window when the UI is hidden
1 parent 446a0e9 commit 665c0c1

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

ChatNotif/NotifWindow.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "Esy.ChatNotif.Callback";
77
NotifWindow = class(Turbine.UI.Window); -- Inherit from Turbine.UI.Window
88

99
function NotifWindow:Constructor()
10-
-- Turbin Window fields
10+
-- Turbine Window fields
1111
Turbine.UI.Window.Constructor(self);
1212
local WINDOW_WIDTH = 500;
1313
local WINDOW_HEIGHT = 500;
@@ -18,6 +18,20 @@ function NotifWindow:Constructor()
1818
self:SetLock(SETTINGS.POSITION_LOCKED);
1919
self:SetVisible(true);
2020

21+
22+
23+
-- Hide the window when the UI is hidden
24+
self:SetWantsKeyEvents(true);
25+
self.KeyDown = function(sender, args)
26+
if (args.Action == Turbine.UI.Lotro.Action.Escape) then
27+
self:SetVisible(true);
28+
elseif (args.Action == 268435635) then
29+
self:SetVisible(not self:IsVisible());
30+
end
31+
end
32+
33+
34+
2135
-- Ability to move the window when unlocked
2236
local mousePositionBefore = nil;
2337
local windowPositionBefore = nil;

0 commit comments

Comments
 (0)