diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index cce9cd74f..73a35414d 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -721,6 +721,7 @@ public: m_SpeedupMaxSpeed = 0; m_SpeedupAngle = 0; m_LargeLayerWasWarned = false; + m_PreventUnusedTilesWasWarned = false; m_AllowPlaceUnusedTiles = false; } @@ -782,12 +783,14 @@ public: POPEVENT_NEW, POPEVENT_SAVE, POPEVENT_LARGELAYER, + POPEVENT_PREVENTUNUSEDTILES }; int m_PopupEventType; int m_PopupEventActivated; int m_PopupEventWasActivated; bool m_LargeLayerWasWarned; + bool m_PreventUnusedTilesWasWarned; bool m_AllowPlaceUnusedTiles; enum diff --git a/src/game/editor/layer_game.cpp b/src/game/editor/layer_game.cpp index 1116c7e55..6bab7f82d 100644 --- a/src/game/editor/layer_game.cpp +++ b/src/game/editor/layer_game.cpp @@ -46,6 +46,11 @@ void CLayerGame::SetTile(int x, int y, CTile tile) } else { CTile air = {TILE_AIR}; CLayerTiles::SetTile(x, y, air); + if(!m_pEditor->m_PreventUnusedTilesWasWarned) { + m_pEditor->m_PopupEventType = m_pEditor->POPEVENT_PREVENTUNUSEDTILES; + m_pEditor->m_PopupEventActivated = true; + m_pEditor->m_PreventUnusedTilesWasWarned = true; + } } } } diff --git a/src/game/editor/layer_tiles.cpp b/src/game/editor/layer_tiles.cpp index 98aef0617..8e09ef6f8 100644 --- a/src/game/editor/layer_tiles.cpp +++ b/src/game/editor/layer_tiles.cpp @@ -1318,6 +1318,11 @@ void CLayerFront::SetTile(int x, int y, CTile tile) } else { CTile air = {TILE_AIR}; CLayerTiles::SetTile(x, y, air); + if(!m_pEditor->m_PreventUnusedTilesWasWarned) { + m_pEditor->m_PopupEventType = m_pEditor->POPEVENT_PREVENTUNUSEDTILES; + m_pEditor->m_PopupEventActivated = true; + m_pEditor->m_PreventUnusedTilesWasWarned = true; + } } } diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 8e5b400fc..2d77028cc 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -1040,6 +1040,8 @@ int CEditor::PopupEvent(CEditor *pEditor, CUIRect View) pEditor->UI()->DoLabel(&Label, "Save map", 20.0f, 0); else if(pEditor->m_PopupEventType == POPEVENT_LARGELAYER) pEditor->UI()->DoLabel(&Label, "Large layer", 20.0f, 0); + else if(pEditor->m_PopupEventType == POPEVENT_PREVENTUNUSEDTILES) + pEditor->UI()->DoLabel(&Label, "Unused tiles disabled", 20.0f, 0); View.HSplitBottom(10.0f, &View, 0); View.HSplitBottom(20.0f, &View, &ButtonBar); @@ -1058,6 +1060,8 @@ int CEditor::PopupEvent(CEditor *pEditor, CUIRect View) pEditor->UI()->DoLabel(&Label, "The file already exists.\nDo you want to overwrite the map?", 10.0f, -1); else if(pEditor->m_PopupEventType == POPEVENT_LARGELAYER) pEditor->UI()->DoLabel(&Label, "You are trying to set the height or width of a layer to more than 1000 tiles. This is actually possible, but only rarely necessary. It may cause the editor to work slower, larger file size as well as higher memory usage for client and server.", 10.0f, -1, Label.w-10.0f); + else if(pEditor->m_PopupEventType == POPEVENT_PREVENTUNUSEDTILES) + pEditor->UI()->DoLabel(&Label, "Unused tiles can't be placed by default because they could get a use later and then destroy your map. If you are mapping for a different gametype you can activate the 'Unused' switch to be able to place every tile.", 10.0f, -1, Label.w-10.0f); // button bar ButtonBar.VSplitLeft(30.0f, 0, &ButtonBar); @@ -1081,7 +1085,7 @@ int CEditor::PopupEvent(CEditor *pEditor, CUIRect View) } ButtonBar.VSplitRight(30.0f, &ButtonBar, 0); ButtonBar.VSplitRight(110.0f, &ButtonBar, &Label); - if(pEditor->m_PopupEventType != POPEVENT_LARGELAYER) + if(pEditor->m_PopupEventType != POPEVENT_LARGELAYER && pEditor->m_PopupEventType != POPEVENT_PREVENTUNUSEDTILES) { static int s_AbortButton = 0; if(pEditor->DoButton_Editor(&s_AbortButton, "Abort", 0, &Label, 0, 0))