about summary refs log tree commit diff
path: root/src/game/client/components/menus.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-09-05 17:53:31 +0200
committeroy <Tom_Adams@web.de>2010-09-05 17:53:31 +0200
commit5588e1ec8caff39e2a21ce6d9d7c13c5f4d603f1 (patch)
treeb9b761bc64d1c1b3bed8c424f29c0a51e2a8d430 /src/game/client/components/menus.cpp
parentfcfaa8389f968bc89fbd4afbfc70ea7c3815c7bb (diff)
downloadzcatch-5588e1ec8caff39e2a21ce6d9d7c13c5f4d603f1.tar.gz
zcatch-5588e1ec8caff39e2a21ce6d9d7c13c5f4d603f1.zip
fixed selected index when deleting a demo and added a popup to confirm the deletion
Diffstat (limited to 'src/game/client/components/menus.cpp')
-rw-r--r--src/game/client/components/menus.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index f1250914..78b6b0fc 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -88,6 +88,7 @@ CMenus::CMenus()
 	m_NeedSendinfo = false;
 	m_MenuActive = true;
 	m_UseMouseButtons = true;
+	m_DemolistDelEntry = false;
 	
 	m_EscapePressed = false;
 	m_EnterPressed = false;
@@ -846,6 +847,12 @@ int CMenus::Render()
 			pButtonText = Localize("Ok");
 			ExtraAlign = -1;
 		}
+		else if(m_Popup == POPUP_DELETE_DEMO)
+		{
+			pTitle = Localize("Delete demo");
+			pExtraText = Localize("Are you sure that you want to delete the demo?");
+			ExtraAlign = -1;
+		}
 		else if(m_Popup == POPUP_PASSWORD)
 		{
 			pTitle = Localize("Password incorrect");
@@ -939,6 +946,29 @@ int CMenus::Render()
 			static float Offset = 0.0f;
 			DoEditBox(&g_Config.m_Password, &TextBox, g_Config.m_Password, sizeof(g_Config.m_Password), 12.0f, &Offset, true);
 		}
+		else if(m_Popup == POPUP_DELETE_DEMO)
+		{
+			CUIRect Yes, No;
+			Box.HSplitBottom(20.f, &Box, &Part);
+			Box.HSplitBottom(24.f, &Box, &Part);
+			Part.VMargin(80.0f, &Part);
+			
+			Part.VSplitMid(&No, &Yes);
+			
+			Yes.VMargin(20.0f, &Yes);
+			No.VMargin(20.0f, &No);
+
+			static int s_ButtonAbort = 0;
+			if(DoButton_Menu(&s_ButtonAbort, Localize("No"), 0, &No) || m_EscapePressed)
+				m_Popup = POPUP_NONE;
+
+			static int s_ButtonTryAgain = 0;
+			if(DoButton_Menu(&s_ButtonTryAgain, Localize("Yes"), 0, &Yes) || m_EnterPressed)
+			{
+				m_Popup = POPUP_NONE;
+				m_DemolistDelEntry = true;
+			}
+		}
 		else if(m_Popup == POPUP_FIRST_LAUNCH)
 		{
 			CUIRect Label, TextBox;