diff options
| author | oy <Tom_Adams@web.de> | 2011-03-22 00:31:42 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-03-22 00:31:42 +0100 |
| commit | eaef2ce48a36a786dc60248dcc5e746865570b2d (patch) | |
| tree | 0e82b7f702afbfe6a62172a881709b944afb563d /src/game/client/components/menus.cpp | |
| parent | 588a411666de052fd237f9aaa857278ade420b51 (diff) | |
| download | zcatch-eaef2ce48a36a786dc60248dcc5e746865570b2d.tar.gz zcatch-eaef2ce48a36a786dc60248dcc5e746865570b2d.zip | |
added notification for unsaved map data and a confirmation for overwriting an existing map in the editor. Closes #115
Diffstat (limited to 'src/game/client/components/menus.cpp')
| -rw-r--r-- | src/game/client/components/menus.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
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 <engine/editor.h> #include <engine/graphics.h> -#include <engine/textrender.h> -#include <engine/serverbrowser.h> #include <engine/keys.h> +#include <engine/serverbrowser.h> #include <engine/storage.h> +#include <engine/textrender.h> #include <engine/shared/config.h> #include <game/version.h> @@ -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); |