diff options
| author | oy <Tom_Adams@web.de> | 2010-09-12 12:43:03 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-09-12 12:43:03 +0200 |
| commit | e226b4721238c84600fe25dc4dd46cec16d1fa5d (patch) | |
| tree | ee577e0a9535d38dc434af5848ef28ef58d88b8d /src/game/client/components | |
| parent | d913af1ab2d383832a49ed6a4460523f80b8337d (diff) | |
| download | zcatch-e226b4721238c84600fe25dc4dd46cec16d1fa5d.tar.gz zcatch-e226b4721238c84600fe25dc4dd46cec16d1fa5d.zip | |
close the emote selector, chat history and the scoreboard when closing the chat, console or ingame menu. Closes #111
Diffstat (limited to 'src/game/client/components')
| -rw-r--r-- | src/game/client/components/chat.cpp | 9 | ||||
| -rw-r--r-- | src/game/client/components/chat.h | 1 | ||||
| -rw-r--r-- | src/game/client/components/console.cpp | 1 | ||||
| -rw-r--r-- | src/game/client/components/emoticon.cpp | 5 | ||||
| -rw-r--r-- | src/game/client/components/emoticon.h | 1 | ||||
| -rw-r--r-- | src/game/client/components/menus.cpp | 14 | ||||
| -rw-r--r-- | src/game/client/components/scoreboard.cpp | 5 | ||||
| -rw-r--r-- | src/game/client/components/scoreboard.h | 1 |
8 files changed, 34 insertions, 3 deletions
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 60b62188..d0b216a5 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -33,6 +33,11 @@ void CChat::OnReset() m_Show = false; } +void CChat::OnRelease() +{ + m_Show = false; +} + void CChat::OnStateChange(int NewState, int OldState) { if(OldState <= IClient::STATE_CONNECTING) @@ -84,12 +89,16 @@ bool CChat::OnInput(IInput::CEvent e) return false; if(e.m_Flags&IInput::FLAG_PRESS && e.m_Key == KEY_ESCAPE) + { m_Mode = MODE_NONE; + m_pClient->OnRelease(); + } else if(e.m_Flags&IInput::FLAG_PRESS && (e.m_Key == KEY_RETURN || e.m_Key == KEY_KP_ENTER)) { if(m_Input.GetString()[0]) Say(m_Mode == MODE_ALL ? 0 : 1, m_Input.GetString()); m_Mode = MODE_NONE; + m_pClient->OnRelease(); } else m_Input.ProcessInput(e); diff --git a/src/game/client/components/chat.h b/src/game/client/components/chat.h index 02afc902..c1867c00 100644 --- a/src/game/client/components/chat.h +++ b/src/game/client/components/chat.h @@ -56,6 +56,7 @@ public: virtual void OnConsoleInit(); virtual void OnStateChange(int NewState, int OldState); virtual void OnRender(); + virtual void OnRelease(); virtual void OnMessage(int MsgType, void *pRawMsg); virtual bool OnInput(IInput::CEvent Event); }; diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index cb8c31ce..cdf4239a 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -565,6 +565,7 @@ void CGameConsole::Toggle(int Type) { Input()->MouseModeRelative(); m_pClient->m_pMenus->UseMouseButtons(true); + m_pClient->OnRelease(); m_ConsoleState = CONSOLE_CLOSING; } } diff --git a/src/game/client/components/emoticon.cpp b/src/game/client/components/emoticon.cpp index cb54dbcd..9139c2c1 100644 --- a/src/game/client/components/emoticon.cpp +++ b/src/game/client/components/emoticon.cpp @@ -39,6 +39,11 @@ void CEmoticon::OnReset() m_SelectedEmote = -1; } +void CEmoticon::OnRelease() +{ + m_Active = false; +} + void CEmoticon::OnMessage(int MsgType, void *pRawMsg) { } diff --git a/src/game/client/components/emoticon.h b/src/game/client/components/emoticon.h index e10b57da..580c8736 100644 --- a/src/game/client/components/emoticon.h +++ b/src/game/client/components/emoticon.h @@ -22,6 +22,7 @@ public: virtual void OnReset(); virtual void OnConsoleInit(); virtual void OnRender(); + virtual void OnRelease(); virtual void OnMessage(int MsgType, void *pRawMsg); virtual bool OnMouseMove(float x, float y); diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index b1e3e3d0..05817d3a 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1015,10 +1015,18 @@ int CMenus::Render() void CMenus::SetActive(bool Active) { m_MenuActive = Active; - if(!m_MenuActive && m_NeedSendinfo) + if(!m_MenuActive) { - m_pClient->SendInfo(false); - m_NeedSendinfo = false; + if(m_NeedSendinfo) + { + m_pClient->SendInfo(false); + m_NeedSendinfo = false; + } + + if(Client()->State() == IClient::STATE_ONLINE) + { + m_pClient->OnRelease(); + } } } diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 2214c2d1..7d5530c6 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -27,6 +27,11 @@ void CScoreboard::OnReset() m_Active = false; } +void CScoreboard::OnRelease() +{ + m_Active = false; +} + void CScoreboard::OnConsoleInit() { Console()->Register("+scoreboard", "", CFGFLAG_CLIENT, ConKeyScoreboard, this, "Show scoreboard"); diff --git a/src/game/client/components/scoreboard.h b/src/game/client/components/scoreboard.h index be0292cf..871b34fd 100644 --- a/src/game/client/components/scoreboard.h +++ b/src/game/client/components/scoreboard.h @@ -18,6 +18,7 @@ public: virtual void OnReset(); virtual void OnConsoleInit(); virtual void OnRender(); + virtual void OnRelease(); bool Active(); }; |