diff options
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r-- | editor/plugins/tiles/atlas_merging_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_data_editors.cpp | 13 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 15 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp | 2 |
7 files changed, 28 insertions, 17 deletions
diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp index de4f3f7989..d7e08db954 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.cpp +++ b/editor/plugins/tiles/atlas_merging_dialog.cpp @@ -269,7 +269,7 @@ AtlasMergingDialog::AtlasMergingDialog() { // Atlas sources item list. atlas_merging_atlases_list = memnew(ItemList); - atlas_merging_atlases_list->set_fixed_icon_size(Size2i(60, 60) * EDSCALE); + atlas_merging_atlases_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE); atlas_merging_atlases_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); atlas_merging_atlases_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); atlas_merging_atlases_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index d9291503cb..c823487279 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -403,6 +403,9 @@ void TileAtlasView::set_atlas_source(TileSet *p_tile_set, TileSetAtlasSource *p_ // Update everything. _update_zoom_and_panning(); + base_tiles_drawing_root->set_size(_compute_base_tiles_control_size()); + alternative_tiles_drawing_root->set_size(_compute_alternative_tiles_control_size()); + // Update. base_tiles_draw->queue_redraw(); base_tiles_texture_grid->queue_redraw(); @@ -601,7 +604,6 @@ TileAtlasView::TileAtlasView() { base_tiles_drawing_root = memnew(Control); base_tiles_drawing_root->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); - base_tiles_drawing_root->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); base_tiles_drawing_root->set_texture_filter(TEXTURE_FILTER_NEAREST); base_tiles_root_control->add_child(base_tiles_drawing_root); @@ -645,7 +647,6 @@ TileAtlasView::TileAtlasView() { alternative_tiles_drawing_root = memnew(Control); alternative_tiles_drawing_root->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); - alternative_tiles_drawing_root->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); alternative_tiles_drawing_root->set_texture_filter(TEXTURE_FILTER_NEAREST); alternative_tiles_root_control->add_child(alternative_tiles_drawing_root); diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 1dce41e4c7..4d54001b94 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -40,6 +40,10 @@ #include "editor/editor_scale.h" #include "editor/editor_undo_redo_manager.h" +#ifdef DEBUG_ENABLED +#include "servers/navigation_server_3d.h" +#endif // DEBUG_ENABLED + void TileDataEditor::_tile_set_changed_plan_update() { _tile_set_changed_update_needed = true; call_deferred(SNAME("_tile_set_changed_deferred_update")); @@ -2674,7 +2678,9 @@ void TileDataNavigationEditor::_tile_set_changed() { void TileDataNavigationEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - polygon_editor->set_polygons_color(get_tree()->get_debug_navigation_color()); +#ifdef DEBUG_ENABLED + polygon_editor->set_polygons_color(NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_color()); +#endif // DEBUG_ENABLED } break; } } @@ -2701,7 +2707,10 @@ void TileDataNavigationEditor::draw_over_tile(CanvasItem *p_canvas_item, Transfo return; } - Color color = p_canvas_item->get_tree()->get_debug_navigation_color(); + Color color = Color(0.5, 1.0, 1.0, 1.0); +#ifdef DEBUG_ENABLED + color = NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_color(); +#endif // DEBUG_ENABLED if (p_selected) { Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0); diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 08f418c1f7..79230891f1 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -2020,9 +2020,9 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { ->connect("mouse_exited", callable_mp(this, &TileMapEditorTilesPlugin::_mouse_exited_viewport)); // --- Shortcuts --- - ED_SHORTCUT("tiles_editor/cut", TTR("Cut"), KeyModifierMask::CMD | Key::X); - ED_SHORTCUT("tiles_editor/copy", TTR("Copy"), KeyModifierMask::CMD | Key::C); - ED_SHORTCUT("tiles_editor/paste", TTR("Paste"), KeyModifierMask::CMD | Key::V); + ED_SHORTCUT("tiles_editor/cut", TTR("Cut"), KeyModifierMask::CMD_OR_CTRL | Key::X); + ED_SHORTCUT("tiles_editor/copy", TTR("Copy"), KeyModifierMask::CMD_OR_CTRL | Key::C); + ED_SHORTCUT("tiles_editor/paste", TTR("Paste"), KeyModifierMask::CMD_OR_CTRL | Key::V); ED_SHORTCUT("tiles_editor/cancel", TTR("Cancel"), Key::ESCAPE); ED_SHORTCUT("tiles_editor/delete", TTR("Delete"), Key::KEY_DELETE); @@ -2170,7 +2170,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { split_container_left_side->set_h_size_flags(Control::SIZE_EXPAND_FILL); split_container_left_side->set_v_size_flags(Control::SIZE_EXPAND_FILL); split_container_left_side->set_stretch_ratio(0.25); - split_container_left_side->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); + split_container_left_side->set_custom_minimum_size(Size2(70, 0) * EDSCALE); atlas_sources_split_container->add_child(split_container_left_side); HBoxContainer *sources_bottom_actions = memnew(HBoxContainer); @@ -2190,11 +2190,11 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { sources_bottom_actions->add_child(source_sort_button); sources_list = memnew(ItemList); - sources_list->set_fixed_icon_size(Size2i(60, 60) * EDSCALE); + sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE); sources_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); sources_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); sources_list->set_stretch_ratio(0.25); - sources_list->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); + sources_list->set_custom_minimum_size(Size2(70, 0) * EDSCALE); sources_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); sources_list->connect("item_selected", callable_mp(this, &TileMapEditorTilesPlugin::_update_fix_selected_and_hovered).unbind(1)); sources_list->connect("item_selected", callable_mp(this, &TileMapEditorTilesPlugin::_update_source_display).unbind(1)); @@ -3323,7 +3323,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() { terrains_tree = memnew(Tree); terrains_tree->set_h_size_flags(Control::SIZE_EXPAND_FILL); terrains_tree->set_stretch_ratio(0.25); - terrains_tree->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); + terrains_tree->set_custom_minimum_size(Size2(70, 0) * EDSCALE); terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); terrains_tree->set_hide_root(true); terrains_tree->connect("item_selected", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_tiles_list)); @@ -3677,6 +3677,7 @@ void TileMapEditor::_update_layers_selection() { tile_map_layer = -1; } tile_map->set_selected_layer(toggle_highlight_selected_layer_button->is_pressed() ? tile_map_layer : -1); + tileset_changed_needs_update = false; // Update is not needed here and actually causes problems. layers_selection_button->clear(); if (tile_map->get_layers_count() > 0) { diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 2aea020902..45b2a5eb14 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -401,7 +401,7 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_get_property_list(List<Pro if (all_alternatve_id_zero) { p_list->push_back(PropertyInfo(Variant::NIL, "Animation", PROPERTY_HINT_NONE, "animation_", PROPERTY_USAGE_GROUP)); p_list->push_back(PropertyInfo(Variant::INT, "animation_columns", PROPERTY_HINT_NONE, "")); - p_list->push_back(PropertyInfo(Variant::VECTOR2I, "animation_separation", PROPERTY_HINT_NONE, "suffix:px")); + p_list->push_back(PropertyInfo(Variant::VECTOR2I, "animation_separation", PROPERTY_HINT_NONE, "")); p_list->push_back(PropertyInfo(Variant::FLOAT, "animation_speed", PROPERTY_HINT_NONE, "")); p_list->push_back(PropertyInfo(Variant::INT, "animation_frames_count", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ARRAY, "Frames,animation_frame_")); // Not optimal, but returns value for the first tile. This is similar to what MultiNodeEdit does. @@ -2342,7 +2342,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { // Middle panel. ScrollContainer *middle_panel = memnew(ScrollContainer); middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); - middle_panel->set_custom_minimum_size(Size2i(200, 0) * EDSCALE); + middle_panel->set_custom_minimum_size(Size2(200, 0) * EDSCALE); split_container_right_side->add_child(middle_panel); VBoxContainer *middle_vbox_container = memnew(VBoxContainer); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index dca17475e0..80a8318bbb 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -690,7 +690,7 @@ TileSetEditor::TileSetEditor() { split_container_left_side->set_h_size_flags(SIZE_EXPAND_FILL); split_container_left_side->set_v_size_flags(SIZE_EXPAND_FILL); split_container_left_side->set_stretch_ratio(0.25); - split_container_left_side->set_custom_minimum_size(Size2i(70, 0) * EDSCALE); + split_container_left_side->set_custom_minimum_size(Size2(70, 0) * EDSCALE); split_container->add_child(split_container_left_side); source_sort_button = memnew(MenuButton); @@ -706,7 +706,7 @@ TileSetEditor::TileSetEditor() { p->set_item_checked(TilesEditorPlugin::SOURCE_SORT_ID, true); sources_list = memnew(ItemList); - sources_list->set_fixed_icon_size(Size2i(60, 60) * EDSCALE); + sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE); sources_list->set_h_size_flags(SIZE_EXPAND_FILL); sources_list->set_v_size_flags(SIZE_EXPAND_FILL); sources_list->connect("item_selected", callable_mp(this, &TileSetEditor::_source_selected)); 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 9a4b14616f..f7622e68ab 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -463,7 +463,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { // Middle panel. ScrollContainer *middle_panel = memnew(ScrollContainer); middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); - middle_panel->set_custom_minimum_size(Size2i(200, 0) * EDSCALE); + middle_panel->set_custom_minimum_size(Size2(200, 0) * EDSCALE); split_container_right_side->add_child(middle_panel); VBoxContainer *middle_vbox_container = memnew(VBoxContainer); |