about summary refs log tree commit diff
path: root/src/game/editor/layer_tiles.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-07-09 01:09:06 +0200
committeroy <Tom_Adams@web.de>2011-07-09 01:09:06 +0200
commit7bc07b613f9fed3dcef26f63332ea68db1e1f381 (patch)
treed357af2b1d1db1dd6d5d62874326c739890402a4 /src/game/editor/layer_tiles.cpp
parentf44094490549a46781a7d85a137ddf748021d00f (diff)
downloadzcatch-7bc07b613f9fed3dcef26f63332ea68db1e1f381.tar.gz
zcatch-7bc07b613f9fed3dcef26f63332ea68db1e1f381.zip
added auto mapping feature by LordSkelethom
Diffstat (limited to 'src/game/editor/layer_tiles.cpp')
-rw-r--r--src/game/editor/layer_tiles.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/game/editor/layer_tiles.cpp b/src/game/editor/layer_tiles.cpp
index b792eda9..81944636 100644
--- a/src/game/editor/layer_tiles.cpp
+++ b/src/game/editor/layer_tiles.cpp
@@ -360,14 +360,32 @@ void CLayerTiles::ShowInfo()
 int CLayerTiles::RenderProperties(CUIRect *pToolBox)
 {
 	CUIRect Button;
-	pToolBox->HSplitBottom(12.0f, pToolBox, &Button);
-
+	
 	bool InGameGroup = !find_linear(m_pEditor->m_Map.m_pGameGroup->m_lLayers.all(), this).empty();
-	if(m_pEditor->m_Map.m_pGameLayer == this)
+	if(m_pEditor->m_Map.m_pGameLayer != this)
+	{
+		if(m_Image >= 0 && m_Image < m_pEditor->m_Map.m_lImages.size() && m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.IsLoaded())
+		{
+			static int s_AutoMapperButton = 0;
+			pToolBox->HSplitBottom(12.0f, pToolBox, &Button);
+			if(m_pEditor->DoButton_Editor(&s_AutoMapperButton, "Auto map", 0, &Button, 0, ""))
+				m_pEditor->PopupSelectConfigAutoMapInvoke(m_pEditor->UI()->MouseX(), m_pEditor->UI()->MouseY());
+			
+			int Result = m_pEditor->PopupSelectConfigAutoMapResult();
+			if(Result > -1)
+			{
+				m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.Proceed(this, Result);
+				return 1;
+			}
+		}
+	}
+	else
 		InGameGroup = false;
 
 	if(InGameGroup)
 	{
+		pToolBox->HSplitBottom(2.0f, pToolBox, 0);
+		pToolBox->HSplitBottom(12.0f, pToolBox, &Button);
 		static int s_ColclButton = 0;
 		if(m_pEditor->DoButton_Editor(&s_ColclButton, "Game tiles", 0, &Button, 0, "Constructs game tiles from this layer"))
 			m_pEditor->PopupSelectGametileOpInvoke(m_pEditor->UI()->MouseX(), m_pEditor->UI()->MouseY());