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-16 18:50:05 +0200
committeroy <Tom_Adams@web.de>2010-10-16 18:50:05 +0200
commit0edad8e6407ea4768a7bfd14c7b7c27d2459b384 (patch)
treee2706ff2e12a039e0d4c1365e354aec6669f4d8f /src/game/editor/ed_editor.cpp
parent85fd27284621d335dd76ee66da7349b19004adc1 (diff)
downloadzcatch-0edad8e6407ea4768a7bfd14c7b7c27d2459b384.tar.gz
zcatch-0edad8e6407ea4768a7bfd14c7b7c27d2459b384.zip
made it possible to specify which layers/groups should be saved within the map
Diffstat (limited to 'src/game/editor/ed_editor.cpp')
-rw-r--r--src/game/editor/ed_editor.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 1cf367d4..a3ff8e48 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -42,6 +42,7 @@ CLayerGroup::CLayerGroup()
 {
 	m_pName = "";
 	m_Visible = true;
+	m_SaveToMap = true;
 	m_GameGroup = false;
 	m_OffsetX = 0;
 	m_OffsetY = 0;
@@ -1765,7 +1766,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
 				continue;
 			}
 
-			CUIRect VisibleToggle;
+			CUIRect VisibleToggle, SaveCheck;
 			if(LayerCur >= LayerStartAt)
 			{
 				LayersBox.HSplitTop(12.0f, &Slot, &LayersBox);
@@ -1773,9 +1774,14 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
 				if(DoButton_Ex(&m_Map.m_lGroups[g]->m_Visible, m_Map.m_lGroups[g]->m_Visible?"V":"H", 0, &VisibleToggle, 0, Localize("Toggle group visibility"), CUI::CORNER_L))
 					m_Map.m_lGroups[g]->m_Visible = !m_Map.m_lGroups[g]->m_Visible;
 
+				Slot.VSplitRight(12.0f, &Slot, &SaveCheck);
+				if(DoButton_Ex(&m_Map.m_lGroups[g]->m_SaveToMap, "S", m_Map.m_lGroups[g]->m_SaveToMap, &SaveCheck, 0, Localize("Enable/disable group for saving"), CUI::CORNER_R))
+					if(!m_Map.m_lGroups[g]->m_GameGroup)
+						m_Map.m_lGroups[g]->m_SaveToMap = !m_Map.m_lGroups[g]->m_SaveToMap;
+
 				str_format(aBuf, sizeof(aBuf),"#%d %s", g, m_Map.m_lGroups[g]->m_pName);
 				if(int Result = DoButton_Ex(&m_Map.m_lGroups[g], aBuf, g==m_SelectedGroup, &Slot,
-					BUTTON_CONTEXT, Localize("Select group. Right click for properties."), CUI::CORNER_R))
+					BUTTON_CONTEXT, Localize("Select group. Right click for properties."), 0))
 				{
 					m_SelectedGroup = g;
 					m_SelectedLayer = 0;
@@ -1806,9 +1812,14 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect ToolBar, CUIRect View)
 				if(DoButton_Ex(&m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible, m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible?"V":"H", 0, &VisibleToggle, 0, Localize("Toggle layer visibility"), CUI::CORNER_L))
 					m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible = !m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible;
 
+				Button.VSplitRight(12.0f, &Button, &SaveCheck);
+				if(DoButton_Ex(&m_Map.m_lGroups[g]->m_lLayers[i]->m_SaveToMap, "S", m_Map.m_lGroups[g]->m_lLayers[i]->m_SaveToMap, &SaveCheck, 0, Localize("Enable/disable layer for saving"), CUI::CORNER_R))
+					if(m_Map.m_lGroups[g]->m_lLayers[i] != m_Map.m_pGameLayer)
+						m_Map.m_lGroups[g]->m_lLayers[i]->m_SaveToMap = !m_Map.m_lGroups[g]->m_lLayers[i]->m_SaveToMap;
+
 				str_format(aBuf, sizeof(aBuf),"#%d %s ", i, m_Map.m_lGroups[g]->m_lLayers[i]->m_pTypeName);
 				if(int Result = DoButton_Ex(m_Map.m_lGroups[g]->m_lLayers[i], aBuf, g==m_SelectedGroup&&i==m_SelectedLayer, &Button,
-					BUTTON_CONTEXT, Localize("Select layer. Right click for properties."), CUI::CORNER_R))
+					BUTTON_CONTEXT, Localize("Select layer. Right click for properties."), 0))
 				{
 					m_SelectedLayer = i;
 					m_SelectedGroup = g;