From bf6fcc20f4a9cccab0470d5848a2401bd0bfe93e Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 17 Jan 2011 13:28:15 +0100 Subject: added an error popup on startup when the sound couldn't be initialised. Closes #425 --- src/game/client/components/menus.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/game/client/components/menus.cpp') diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index d70e0b88..cac86588 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -753,6 +753,14 @@ int CMenus::Render() // some margin around the screen Screen.Margin(10.0f, &Screen); + static bool s_SoundCheck = false; + if(!s_SoundCheck && m_Popup == POPUP_NONE) + { + if(Client()->SoundInitFailed()) + m_Popup = POPUP_SOUNDERROR; + s_SoundCheck = true; + } + if(m_Popup == POPUP_NONE) { // do tab bar @@ -840,6 +848,13 @@ int CMenus::Render() pExtraText = Localize("Are you sure that you want to delete the demo?"); ExtraAlign = -1; } + else if(m_Popup == POPUP_SOUNDERROR) + { + pTitle = Localize("Sound error"); + pExtraText = Localize("The audio device couldn't be initialised."); + pButtonText = Localize("Ok"); + ExtraAlign = -1; + } else if(m_Popup == POPUP_PASSWORD) { pTitle = Localize("Password incorrect"); -- cgit 1.4.1