summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp11
-rw-r--r--editor/plugins/tile_map_editor_plugin.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 7f73d7fd7c..c5c7272ed2 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -147,6 +147,15 @@ void TileMapEditor::_menu_option(int p_option) {
canvas_item_editor->update();
} break;
+ case OPTION_FIX_INVALID: {
+
+ undo_redo->create_action(TTR("Fix Invalid Tiles"));
+ undo_redo->add_undo_method(node, "set", "tile_data", node->get("tile_data"));
+ node->fix_invalid_tiles();
+ undo_redo->add_do_method(node, "set", "tile_data", node->get("tile_data"));
+ undo_redo->commit_action();
+
+ } break;
}
}
@@ -1583,6 +1592,8 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
p->add_shortcut(ED_SHORTCUT("tile_map_editor/select", TTR("Select"), KEY_MASK_CMD + KEY_B), OPTION_SELECT);
p->add_shortcut(ED_SHORTCUT("tile_map_editor/duplicate_selection", TTR("Duplicate Selection"), KEY_MASK_CMD + KEY_D), OPTION_DUPLICATE);
p->add_shortcut(ED_GET_SHORTCUT("tile_map_editor/erase_selection"), OPTION_ERASE_SELECTION);
+ p->add_separator();
+ p->add_item(TTR("Fix Invalid Tiles"), OPTION_FIX_INVALID);
p->connect("id_pressed", this, "_menu_option");
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h
index 0a937e200e..2d582d030b 100644
--- a/editor/plugins/tile_map_editor_plugin.h
+++ b/editor/plugins/tile_map_editor_plugin.h
@@ -71,6 +71,7 @@ class TileMapEditor : public VBoxContainer {
OPTION_DUPLICATE,
OPTION_ERASE_SELECTION,
OPTION_PAINTING,
+ OPTION_FIX_INVALID,
};
TileMap *node;