Thread Tools Display Modes
12/28/14, 10:18 PM   #1
Balver
 
Balver's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 39
Hide chat in menu

I'm looking for an addon that automatically hides the chat window when I open a menu or use the bank or a crafting station.
  Reply With Quote
12/29/14, 07:35 AM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
could add this into pChat .. will have a look on it.
  Reply With Quote
01/03/15, 02:56 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,014
Maybe this helps. Taken from the gamemenu scene source code "here"

Lua Code:
  1. local wasChatMaximized
  2. local function OnShow(gameMenu)
  3.     RebuildTree(gameMenu)
  4.     wasChatMaximized = not CHAT_SYSTEM:IsMinimized()
  5.     if wasChatMaximized then
  6.         CHAT_SYSTEM:Minimize()
  7.     end
  8. end
  9. local function OnHide(gameMenu)
  10.     if wasChatMaximized and CHAT_SYSTEM:IsMinimized()then
  11.         CHAT_SYSTEM:Maximize()
  12.     end
  13.     wasChatMaximized = nil
  14. end

Too bad it is local :-( But maybe you can use this code of CHAT_SYSTEM to simply hide (Minimize) /show (Maximize) the chat.
  Reply With Quote
01/03/15, 04:05 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Baertram View Post
Maybe this helps. Taken from the gamemenu scene source code "here"

Lua Code:
  1. local wasChatMaximized
  2. local function OnShow(gameMenu)
  3.     RebuildTree(gameMenu)
  4.     wasChatMaximized = not CHAT_SYSTEM:IsMinimized()
  5.     if wasChatMaximized then
  6.         CHAT_SYSTEM:Minimize()
  7.     end
  8. end
  9. local function OnHide(gameMenu)
  10.     if wasChatMaximized and CHAT_SYSTEM:IsMinimized()then
  11.         CHAT_SYSTEM:Maximize()
  12.     end
  13.     wasChatMaximized = nil
  14. end

Too bad it is local :-( But maybe you can use this code of CHAT_SYSTEM to simply hide (Minimize) /show (Maximize) the chat.
It is local, but if you take a look how those functions are used:

xml Code:
  1. <GuiXml>
  2.     <Controls>
  3.         <TopLevelControl name="ZO_GameMenu_InGame" inherits="ZO_GameMenu_Template" hidden="true">
  4.             <OnInitialized>
  5.                 ZO_GameMenu_InGame_Initialize(self)
  6.             </OnInitialized>
  7.         </TopLevelControl>
  8.     </Controls>
  9. </GuiXml>

Lua Code:
  1. function ZO_GameMenu_InGame_Initialize(self)
  2.     local GAME_MENU_INGAME = ZO_GameMenu_Initialize(self, OnShow, OnHide)
  3.  
  4.     --some other code
  5. end

Lua Code:
  1. function ZO_GameMenu_Initialize(control, onShowFunction, onHideFunction)
  2.     local gameMenu = ZO_GameMenuManager:New(control)
  3.     control.OnShow = onShowFunction
  4.     control.OnHide = onHideFunction
  5.     control.gameMenu = gameMenu
  6.     return gameMenu
  7. end

You can see, that there is a global reference to those functions:
Code:
ZO_GameMenu_InGame:OnShow()
ZO_GameMenu_InGame:OnHide()

Last edited by Garkin : 01/03/15 at 04:08 PM.
  Reply With Quote
01/03/15, 04:29 PM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,014
Yes, I saw this before, thanks Garkin.

The OnHide function should be fine.
But the OnShow function of the "game menu ingame" in total isn't the thing needed here as it would also rebuild the game menu tree.

I think you could simply use the CHAT_SYSTEM:Maximize() and CHAT_SYSTEM:Minimize() functions here to show/hide the chat as a bank/crafting station/etc. scene gets to the state OnShown e.g.
  Reply With Quote
01/03/15, 04:37 PM   #6
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I'm already working on this. I prehook SCENE_MANAGER:SetState() and use CHAT_SYSTEM:Minimize() and :Maximize() for my part.

Just need to disable it at 1st state (when addon loads) and check if scene manager is on "hudui" or not.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Hide chat in menu


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off