From eaef2ce48a36a786dc60248dcc5e746865570b2d Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 22 Mar 2011 00:31:42 +0100 Subject: added notification for unsaved map data and a confirmation for overwriting an existing map in the editor. Closes #115 --- src/game/client/components/menus.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/game/client/components') diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 415ff646..cd8b7760 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -9,11 +9,12 @@ #include "menus.h" #include "skins.h" +#include #include -#include -#include #include +#include #include +#include #include #include @@ -889,6 +890,7 @@ int CMenus::Render() { pTitle = Localize("Quit"); pExtraText = Localize("Are you sure that you want to quit?"); + ExtraAlign = -1; } else if(m_Popup == POPUP_FIRST_LAUNCH) { @@ -923,10 +925,17 @@ int CMenus::Render() CUIRect Yes, No; Box.HSplitBottom(20.f, &Box, &Part); Box.HSplitBottom(24.f, &Box, &Part); + + // additional info + Box.HSplitTop(10.0f, 0, &Box); + Box.VMargin(20.f/UI()->Scale(), &Box); + if(m_pClient->Editor()->HasUnsavedData()) + UI()->DoLabelScaled(&Box, Localize("There's an unsaved map in the editor, you might want to save it before you quit the game.\nQuit anyway?"), + 20.f, -1, Part.w); + + // buttons Part.VMargin(80.0f, &Part); - Part.VSplitMid(&No, &Yes); - Yes.VMargin(20.0f, &Yes); No.VMargin(20.0f, &No); -- cgit 1.4.1