@@ -453,6 +453,7 @@ local function CustomChat_Open( pcalled )
453
453
CustomChat .frame :SetKeyboardInputEnabled ( true )
454
454
CustomChat .frame :OpenChat ()
455
455
456
+ CustomChat .isOpen = true
456
457
CustomChat .SetTyping ( true )
457
458
458
459
-- Make sure the gamemode and other addons know we are chatting
@@ -465,6 +466,8 @@ local function CustomChat_Close()
465
466
CustomChat .frame :CloseChat ()
466
467
CustomChat .frame :SetMouseInputEnabled ( false )
467
468
CustomChat .frame :SetKeyboardInputEnabled ( false )
469
+
470
+ CustomChat .isOpen = false
468
471
CustomChat .SetTyping ( false )
469
472
470
473
gui .EnableScreenClicker ( false )
@@ -516,18 +519,26 @@ local function CustomChat_HUDShouldDraw( name )
516
519
end
517
520
518
521
local function CustomChat_Think ()
519
- if not CustomChat .frame then return end
522
+ local frame = CustomChat .frame
523
+ if not frame then return end
520
524
521
- if not gui .IsGameUIVisible () and not CustomChat .frame :IsVisible () then
522
- CustomChat .frame :SetVisible ( true )
525
+ if gui .IsGameUIVisible () then
526
+ if frame :IsVisible () then
527
+ -- Close and completely hide the chat
528
+ -- while the pause menu is visible
529
+ chat .Close ()
530
+ frame :SetVisible ( false )
531
+ end
532
+
533
+ elseif not frame :IsVisible () then
534
+ -- Make the chat visible otherwise
535
+ frame :SetVisible ( true )
523
536
end
524
537
end
525
538
526
539
local function CustomChat_OnPauseMenuShow ()
527
- if not CustomChat .frame then return end
528
-
529
- if CustomChat .frame :IsVisible () then
530
- CustomChat .frame :SetVisible ( false )
540
+ if CustomChat .frame and CustomChat .isOpen then
541
+ chat .Close ()
531
542
532
543
return false
533
544
end
0 commit comments