about summary refs log tree commit diff
path: root/src/game/client/components/menus.cpp
diff options
context:
space:
mode:
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;