about summary refs log tree commit diff
path: root/src/game/editor/ed_popups.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2010-07-05 20:46:32 +0200
committerMagnus Auvinen <magnus.auvinen@gmail.com>2010-07-05 20:46:32 +0200
commitd302ba921e61177da9af1f85df58fe6f47ca5e95 (patch)
tree4ac19b9caab0a7142b6dfbc05d234af152bd5407 /src/game/editor/ed_popups.cpp
parent143af11a25bc4a944c3605b9a165ffd2f1970641 (diff)
parentbd02c2043e9f76ec47ee9ac35caf23ae294b1dfa (diff)
downloadzcatch-d302ba921e61177da9af1f85df58fe6f47ca5e95.tar.gz
zcatch-d302ba921e61177da9af1f85df58fe6f47ca5e95.zip
Merge branch 'master' of github.com:matricks/teeworlds
Diffstat (limited to 'src/game/editor/ed_popups.cpp')
-rw-r--r--src/game/editor/ed_popups.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game/editor/ed_popups.cpp b/src/game/editor/ed_popups.cpp
index 5e833ba6..001a7249 100644
--- a/src/game/editor/ed_popups.cpp
+++ b/src/game/editor/ed_popups.cpp
@@ -20,6 +20,10 @@ static int g_UiNumPopups = 0;
 void CEditor::UiInvokePopupMenu(void *Id, int Flags, float x, float y, float w, float h, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect), void *pExtra)
 {
 	dbg_msg("", "invoked");
+	if(x + w > UI()->Screen()->w)
+		x -= w;
+	if(y + h > UI()->Screen()->h)
+		y -= h;
 	s_UiPopups[g_UiNumPopups].m_pId = Id;
 	s_UiPopups[g_UiNumPopups].m_IsMenu = Flags;
 	s_UiPopups[g_UiNumPopups].m_Rect.x = x;
@@ -84,6 +88,7 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View)
 		pEditor->DoButton_Editor(&s_DeleteButton, Localize("Delete group"), 0, &Button, 0, Localize("Delete group")))
 	{
 		pEditor->m_Map.DeleteGroup(pEditor->m_SelectedGroup);
+		pEditor->m_SelectedGroup = max(0, pEditor->m_SelectedGroup-1);
 		return 1;
 	}