diff options
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r-- | editor/plugins/tiles/atlas_merging_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/atlas_merging_dialog.h | 6 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.h | 2 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_data_editors.cpp | 13 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_data_editors.h | 14 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 11 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.h | 17 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_proxies_manager_dialog.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_proxies_manager_dialog.h | 5 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.h | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.h | 3 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_scenes_collection_source_editor.h | 9 |
16 files changed, 77 insertions, 25 deletions
diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp index 677c9759c2..0f8c8c616c 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.cpp +++ b/editor/plugins/tiles/atlas_merging_dialog.cpp @@ -30,6 +30,8 @@ #include "atlas_merging_dialog.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_node.h" #include "editor/editor_scale.h" #include "scene/gui/control.h" @@ -251,6 +253,8 @@ void AtlasMergingDialog::update_tile_set(Ref<TileSet> p_tile_set) { } AtlasMergingDialog::AtlasMergingDialog() { + undo_redo = EditorNode::get_singleton()->get_undo_redo(); + // Atlas merging window. set_title(TTR("Atlas Merging")); set_hide_on_ok(false); diff --git a/editor/plugins/tiles/atlas_merging_dialog.h b/editor/plugins/tiles/atlas_merging_dialog.h index 2ae94cf44a..6fc1a3b7e0 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.h +++ b/editor/plugins/tiles/atlas_merging_dialog.h @@ -31,7 +31,6 @@ #ifndef ATLAS_MERGING_DIALOG_H #define ATLAS_MERGING_DIALOG_H -#include "editor/editor_node.h" #include "editor/editor_properties.h" #include "scene/gui/dialogs.h" @@ -39,6 +38,9 @@ #include "scene/gui/texture_rect.h" #include "scene/resources/tile_set.h" +class EditorNode; +class EditorFileDialog; + class AtlasMergingDialog : public ConfirmationDialog { GDCLASS(AtlasMergingDialog, ConfirmationDialog); @@ -49,7 +51,7 @@ private: LocalVector<Map<Vector2i, Vector2i>> merged_mapping; Ref<TileSet> tile_set; - UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); + UndoRedo *undo_redo; // Settings. int next_line_after_column = 30; diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 35496795e0..44e4faa091 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -36,7 +36,6 @@ #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/panel.h" -#include "scene/gui/texture_rect.h" #include "scene/gui/view_panner.h" #include "editor/editor_scale.h" diff --git a/editor/plugins/tiles/tile_atlas_view.h b/editor/plugins/tiles/tile_atlas_view.h index 37ef7d6a2a..caf3ef9e4b 100644 --- a/editor/plugins/tiles/tile_atlas_view.h +++ b/editor/plugins/tiles/tile_atlas_view.h @@ -37,8 +37,6 @@ #include "scene/gui/center_container.h" #include "scene/gui/label.h" #include "scene/gui/margin_container.h" -#include "scene/gui/scroll_container.h" -#include "scene/gui/texture_rect.h" #include "scene/resources/tile_set.h" class ViewPanner; diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index ae921871c3..a4d2dfc9d9 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -35,6 +35,7 @@ #include "core/math/geometry_2d.h" #include "core/os/keyboard.h" +#include "editor/editor_node.h" #include "editor/editor_properties.h" #include "editor/editor_scale.h" @@ -743,6 +744,8 @@ void GenericTilePolygonEditor::_bind_methods() { } GenericTilePolygonEditor::GenericTilePolygonEditor() { + editor_undo_redo = EditorNode::get_undo_redo(); + toolbar = memnew(HBoxContainer); add_child(toolbar); @@ -1168,6 +1171,8 @@ void TileDataDefaultEditor::_notification(int p_what) { } TileDataDefaultEditor::TileDataDefaultEditor() { + undo_redo = EditorNode::get_undo_redo(); + label = memnew(Label); label->set_text(TTR("Painting:")); add_child(label); @@ -1319,6 +1324,8 @@ void TileDataOcclusionShapeEditor::_notification(int p_what) { } TileDataOcclusionShapeEditor::TileDataOcclusionShapeEditor() { + undo_redo = EditorNode::get_undo_redo(); + polygon_editor = memnew(GenericTilePolygonEditor); add_child(polygon_editor); } @@ -1516,6 +1523,8 @@ void TileDataCollisionEditor::_notification(int p_what) { } TileDataCollisionEditor::TileDataCollisionEditor() { + undo_redo = EditorNode::get_undo_redo(); + polygon_editor = memnew(GenericTilePolygonEditor); polygon_editor->set_multiple_polygon_mode(true); polygon_editor->connect("polygons_changed", callable_mp(this, &TileDataCollisionEditor::_polygons_changed)); @@ -2487,6 +2496,8 @@ void TileDataTerrainsEditor::_notification(int p_what) { } TileDataTerrainsEditor::TileDataTerrainsEditor() { + undo_redo = EditorNode::get_undo_redo(); + label = memnew(Label); label->set_text("Painting:"); add_child(label); @@ -2591,6 +2602,8 @@ void TileDataNavigationEditor::_notification(int p_what) { } TileDataNavigationEditor::TileDataNavigationEditor() { + undo_redo = EditorNode::get_undo_redo(); + polygon_editor = memnew(GenericTilePolygonEditor); polygon_editor->set_multiple_polygon_mode(true); add_child(polygon_editor); diff --git a/editor/plugins/tiles/tile_data_editors.h b/editor/plugins/tiles/tile_data_editors.h index e4551d3302..99724760a7 100644 --- a/editor/plugins/tiles/tile_data_editors.h +++ b/editor/plugins/tiles/tile_data_editors.h @@ -33,9 +33,7 @@ #include "tile_atlas_view.h" -#include "editor/editor_node.h" #include "editor/editor_properties.h" - #include "scene/2d/tile_map.h" #include "scene/gui/box_container.h" #include "scene/gui/control.h" @@ -95,7 +93,7 @@ private: bool multiple_polygon_mode = false; bool use_undo_redo = true; - UndoRedo *editor_undo_redo = EditorNode::get_undo_redo(); + UndoRedo *editor_undo_redo; // UI int hovered_polygon_index = -1; @@ -216,7 +214,7 @@ private: protected: DummyObject *dummy_object = memnew(DummyObject); - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; StringName type; String property; @@ -281,7 +279,7 @@ private: virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; virtual void _tile_set_changed() override; @@ -316,7 +314,7 @@ class TileDataCollisionEditor : public TileDataDefaultEditor { virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; virtual void _tile_set_changed() override; @@ -368,7 +366,7 @@ protected: void _notification(int p_what); - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; public: virtual Control *get_toolbar() override { return toolbar; }; @@ -401,7 +399,7 @@ private: virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; virtual void _tile_set_changed() override; diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 6e3724ead9..5e316bc7f0 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -32,6 +32,7 @@ #include "tiles_editor_plugin.h" +#include "editor/editor_node.h" #include "editor/editor_resource_preview.h" #include "editor/editor_scale.h" #include "editor/plugins/canvas_item_editor_plugin.h" @@ -1978,7 +1979,11 @@ void TileMapEditorTilesPlugin::_bind_methods() { } TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { - CanvasItemEditor::get_singleton()->get_viewport_control()->connect("mouse_exited", callable_mp(this, &TileMapEditorTilesPlugin::_mouse_exited_viewport)); + undo_redo = EditorNode::get_undo_redo(); + + CanvasItemEditor::get_singleton() + ->get_viewport_control() + ->connect("mouse_exited", callable_mp(this, &TileMapEditorTilesPlugin::_mouse_exited_viewport)); // --- Shortcuts --- ED_SHORTCUT("tiles_editor/cut", TTR("Cut"), KeyModifierMask::CMD | Key::X); @@ -3242,6 +3247,8 @@ void TileMapEditorTerrainsPlugin::edit(ObjectID p_tile_map_id, int p_tile_map_la } TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() { + undo_redo = EditorNode::get_undo_redo(); + main_vbox_container = memnew(VBoxContainer); main_vbox_container->connect("tree_entered", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme)); main_vbox_container->connect("theme_changed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme)); @@ -3945,6 +3952,8 @@ void TileMapEditor::edit(TileMap *p_tile_map) { } TileMapEditor::TileMapEditor() { + undo_redo = EditorNode::get_undo_redo(); + set_process_internal(true); // Shortcuts. diff --git a/editor/plugins/tiles/tile_map_editor.h b/editor/plugins/tiles/tile_map_editor.h index 6fa0d01612..49e8cacac8 100644 --- a/editor/plugins/tiles/tile_map_editor.h +++ b/editor/plugins/tiles/tile_map_editor.h @@ -35,10 +35,19 @@ #include "core/os/thread.h" #include "core/typedefs.h" -#include "editor/editor_node.h" #include "scene/2d/tile_map.h" #include "scene/gui/box_container.h" +#include "scene/gui/check_box.h" +#include "scene/gui/item_list.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/separator.h" +#include "scene/gui/spin_box.h" +#include "scene/gui/split_container.h" #include "scene/gui/tab_bar.h" +#include "scene/gui/tree.h" + +class EditorNode; +class UndoRedo; class TileMapEditorPlugin : public Object { public: @@ -61,7 +70,7 @@ class TileMapEditorTilesPlugin : public TileMapEditorPlugin { GDCLASS(TileMapEditorTilesPlugin, TileMapEditorPlugin); private: - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; ObjectID tile_map_id; int tile_map_layer = -1; virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) override; @@ -212,7 +221,7 @@ class TileMapEditorTerrainsPlugin : public TileMapEditorPlugin { GDCLASS(TileMapEditorTerrainsPlugin, TileMapEditorPlugin); private: - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; ObjectID tile_map_id; int tile_map_layer = -1; virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) override; @@ -298,7 +307,7 @@ class TileMapEditor : public VBoxContainer { GDCLASS(TileMapEditor, VBoxContainer); private: - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; bool tileset_changed_needs_update = false; ObjectID tile_map_id; int tile_map_layer = -1; diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp index ad44da8dc9..62f3bd6356 100644 --- a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp +++ b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp @@ -30,6 +30,7 @@ #include "tile_proxies_manager_dialog.h" +#include "editor/editor_node.h" #include "editor/editor_scale.h" void TileProxiesManagerDialog::_right_clicked(int p_item, Vector2 p_local_mouse_pos, Object *p_item_list) { @@ -312,6 +313,8 @@ void TileProxiesManagerDialog::update_tile_set(Ref<TileSet> p_tile_set) { } TileProxiesManagerDialog::TileProxiesManagerDialog() { + undo_redo = EditorNode::get_singleton()->get_undo_redo(); + // Tile proxy management window. set_title(TTR("Tile Proxies Management")); set_process_unhandled_key_input(true); diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.h b/editor/plugins/tiles/tile_proxies_manager_dialog.h index b235d44982..4c8741c660 100644 --- a/editor/plugins/tiles/tile_proxies_manager_dialog.h +++ b/editor/plugins/tiles/tile_proxies_manager_dialog.h @@ -31,13 +31,14 @@ #ifndef TILE_PROXIES_MANAGER_DIALOG_H #define TILE_PROXIES_MANAGER_DIALOG_H -#include "editor/editor_node.h" #include "editor/editor_properties.h" #include "scene/2d/tile_map.h" #include "scene/gui/dialogs.h" #include "scene/gui/item_list.h" +class EditorNode; + class TileProxiesManagerDialog : public ConfirmationDialog { GDCLASS(TileProxiesManagerDialog, ConfirmationDialog); @@ -45,7 +46,7 @@ private: int commited_actions_count = 0; Ref<TileSet> tile_set; - UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); + UndoRedo *undo_redo; TileMapCell from; TileMapCell to; diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 1bd1cd0219..9a16e3d682 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -36,6 +36,7 @@ #include "editor/editor_scale.h" #include "editor/progress_dialog.h" +#include "editor/editor_node.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/control.h" @@ -2311,6 +2312,8 @@ void TileSetAtlasSourceEditor::_bind_methods() { } TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { + undo_redo = EditorNode::get_undo_redo(); + set_process_unhandled_key_input(true); set_process_internal(true); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.h b/editor/plugins/tiles/tile_set_atlas_source_editor.h index 51771c59ba..f0c8367d57 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.h +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.h @@ -34,10 +34,10 @@ #include "tile_atlas_view.h" #include "tile_data_editors.h" -#include "editor/editor_node.h" #include "scene/gui/split_container.h" #include "scene/resources/tile_set.h" +class EditorNode; class TileSet; class TileSetAtlasSourceEditor : public HBoxContainer { @@ -115,7 +115,7 @@ private: TileSetAtlasSource *tile_set_atlas_source = nullptr; int tile_set_atlas_source_id = TileSet::INVALID_SOURCE; - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; bool tile_set_changed_needs_update = false; diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index ab355d4658..9ca50497af 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -33,6 +33,7 @@ #include "tile_data_editors.h" #include "tiles_editor_plugin.h" +#include "editor/editor_node.h" #include "editor/editor_scale.h" #include "scene/gui/box_container.h" @@ -657,6 +658,8 @@ void TileSetEditor::edit(Ref<TileSet> p_tile_set) { TileSetEditor::TileSetEditor() { singleton = this; + undo_redo = EditorNode::get_undo_redo(); + set_process_internal(true); // TabBar. diff --git a/editor/plugins/tiles/tile_set_editor.h b/editor/plugins/tiles/tile_set_editor.h index a21c951c42..b79b37cf2e 100644 --- a/editor/plugins/tiles/tile_set_editor.h +++ b/editor/plugins/tiles/tile_set_editor.h @@ -33,6 +33,7 @@ #include "atlas_merging_dialog.h" #include "scene/gui/box_container.h" +#include "scene/gui/tab_bar.h" #include "scene/resources/tile_set.h" #include "tile_proxies_manager_dialog.h" #include "tile_set_atlas_source_editor.h" @@ -57,7 +58,7 @@ private: TileSetAtlasSourceEditor *tile_set_atlas_source_editor; TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor; - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; void _drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index 240c017b84..acb6ffc77b 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -30,6 +30,8 @@ #include "tile_set_scenes_collection_source_editor.h" +#include "editor/editor_file_system.h" +#include "editor/editor_node.h" #include "editor/editor_resource_preview.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" @@ -452,6 +454,8 @@ void TileSetScenesCollectionSourceEditor::_bind_methods() { } TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { + undo_redo = EditorNode::get_undo_redo(); + // -- Right side -- HSplitContainer *split_container_right_side = memnew(HSplitContainer); split_container_right_side->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h index 5b48ea4762..bc4e975c8d 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h @@ -31,10 +31,15 @@ #ifndef TILE_SET_SCENES_COLLECTION_SOURCE_EDITOR_H #define TILE_SET_SCENES_COLLECTION_SOURCE_EDITOR_H -#include "editor/editor_node.h" +#include "editor/editor_inspector.h" #include "scene/gui/box_container.h" +#include "scene/gui/button.h" +#include "scene/gui/item_list.h" #include "scene/resources/tile_set.h" +class EditorNode; +class UndoRedo; + class TileSetScenesCollectionSourceEditor : public HBoxContainer { GDCLASS(TileSetScenesCollectionSourceEditor, HBoxContainer); @@ -93,7 +98,7 @@ private: TileSetScenesCollectionSource *tile_set_scenes_collection_source = nullptr; int tile_set_source_id = -1; - UndoRedo *undo_redo = EditorNode::get_undo_redo(); + UndoRedo *undo_redo; bool tile_set_scenes_collection_source_changed_needs_update = false; |