about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-17 13:28:15 +0100
committeroy <Tom_Adams@web.de>2011-01-17 13:28:15 +0100
commitbf6fcc20f4a9cccab0470d5848a2401bd0bfe93e (patch)
treea945e41ad55c5a0d5877e60e3eefa90e563e907a /src/game/client/components
parent40f6740742c7d967038abdd5a582d8b50712d1b2 (diff)
downloadzcatch-bf6fcc20f4a9cccab0470d5848a2401bd0bfe93e.tar.gz
zcatch-bf6fcc20f4a9cccab0470d5848a2401bd0bfe93e.zip
added an error popup on startup when the sound couldn't be initialised. Closes #425
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/menus.cpp15
-rw-r--r--src/game/client/components/menus.h1
2 files changed, 16 insertions, 0 deletions
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");
diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h
index 5e93a90a..40f6f1bd 100644
--- a/src/game/client/components/menus.h
+++ b/src/game/client/components/menus.h
@@ -97,6 +97,7 @@ class CMenus : public CComponent
 		POPUP_PURE,
 		POPUP_LANGUAGE,
 		POPUP_DELETE_DEMO,
+		POPUP_SOUNDERROR,
 		POPUP_PASSWORD,
 		POPUP_QUIT, 
 	};