about summary refs log tree commit diff
path: root/src/game/editor/ed_editor.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-10-09 18:38:23 +0200
committeroy <Tom_Adams@web.de>2010-10-09 18:38:23 +0200
commitb3c81e7258cabc72cf9f610da0aa6aa494dd30a9 (patch)
treeea81ac04883e905efa6eb2f2800c837fe91f79a7 /src/game/editor/ed_editor.cpp
parentab2df146410e47bc4d30d1088b383aac03766d6f (diff)
downloadzcatch-b3c81e7258cabc72cf9f610da0aa6aa494dd30a9.tar.gz
zcatch-b3c81e7258cabc72cf9f610da0aa6aa494dd30a9.zip
added the possibility to shift the tiles of a layer into any direction
Diffstat (limited to 'src/game/editor/ed_editor.cpp')
-rw-r--r--src/game/editor/ed_editor.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 270f3efd..0b84fe38 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -1668,6 +1668,41 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIds, int *
 				Change = i;
 			}
 		}
+		else if(pProps[i].m_Type == PROPTYPE_SHIFT)
+		{
+			CUIRect Left, Right, Up, Down;
+			Shifter.VSplitMid(&Left, &Up);
+			Left.VSplitRight(1.0f, &Left, 0);
+			Up.VSplitLeft(1.0f, 0, &Up);
+			Left.VSplitLeft(10.0f, &Left, &Shifter);
+			Shifter.VSplitRight(10.0f, &Shifter, &Right);
+			RenderTools()->DrawUIRect(&Shifter, vec4(1,1,1,0.5f), 0, 0.0f);
+			UI()->DoLabel(&Shifter, "X", 10.0f, 0, -1);
+			Up.VSplitLeft(10.0f, &Up, &Shifter);
+			Shifter.VSplitRight(10.0f, &Shifter, &Down);
+			RenderTools()->DrawUIRect(&Shifter, vec4(1,1,1,0.5f), 0, 0.0f);
+			UI()->DoLabel(&Shifter, "Y", 10.0f, 0, -1);
+			if(DoButton_ButtonDec(&pIds[i], "-", 0, &Left, 0, Localize("Left")))
+			{
+				*pNewVal = 1;
+				Change = i;
+			}
+			if(DoButton_ButtonInc(((char *)&pIds[i])+3, "+", 0, &Right, 0, Localize("Right")))
+			{
+				*pNewVal = 2;
+				Change = i;
+			}
+			if(DoButton_ButtonDec(((char *)&pIds[i])+1, "-", 0, &Up, 0, Localize("Up")))
+			{
+				*pNewVal = 4;
+				Change = i;
+			}
+			if(DoButton_ButtonInc(((char *)&pIds[i])+2, "+", 0, &Down, 0, Localize("Down")))
+			{
+				*pNewVal = 8;
+				Change = i;
+			}
+		}
 	}
 
 	return Change;
@@ -1779,7 +1814,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
 					m_SelectedGroup = g;
 					static int s_LayerPopupId = 0;
 					if(Result == 2)
-						UiInvokePopupMenu(&s_LayerPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 150, PopupLayer);
+						UiInvokePopupMenu(&s_LayerPopupId, 0, UI()->MouseX(), UI()->MouseY(), 120, 180, PopupLayer);
 				}
 
 				LayerCur += 14.0f;