From 5867bf41b0bd3e8fcd7f1ea45377088725463566 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 12 Dec 2021 19:20:14 +0100 Subject: [PATCH] Fix more binding issues. --- rtile_set.cpp | 2 +- tile_editor/editor_zoom_widget.cpp | 2 +- tile_editor/tile_atlas_view.cpp | 2 +- tile_editor/tile_atlas_view.h | 2 +- tile_editor/tile_map_editor.cpp | 5 ++++- tile_editor/tile_proxies_manager_dialog.cpp | 2 +- tile_editor/tile_set_atlas_source_editor.cpp | 2 +- tile_editor/tile_set_atlas_source_editor.h | 2 +- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/rtile_set.cpp b/rtile_set.cpp index 903954c..4a74365 100644 --- a/rtile_set.cpp +++ b/rtile_set.cpp @@ -3926,7 +3926,7 @@ void RTileSetAtlasSource::_get_property_list(List *p_list) const { for (List::Element *E = alternative_property_list.front(); E; E = E->next()) { PropertyInfo &alternative_property_info = E->get(); - Variant default_value = ClassDB::class_get_default_property_value("TileData", alternative_property_info.name); + Variant default_value = ClassDB::class_get_default_property_value("RTileData", alternative_property_info.name); Variant value = E_alternative->value()->get(alternative_property_info.name); if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value))) { alternative_property_info.usage ^= PROPERTY_USAGE_STORAGE; diff --git a/tile_editor/editor_zoom_widget.cpp b/tile_editor/editor_zoom_widget.cpp index d0bb5bb..ba1c686 100644 --- a/tile_editor/editor_zoom_widget.cpp +++ b/tile_editor/editor_zoom_widget.cpp @@ -165,7 +165,7 @@ void EditorZoomWidget::_bind_methods() { ClassDB::bind_method(D_METHOD("_button_zoom_minus"), &EditorZoomWidget::_button_zoom_minus); ClassDB::bind_method(D_METHOD("_button_zoom_reset"), &EditorZoomWidget::_button_zoom_reset); - ClassDB::bind_method(D_METHOD("_button_zoom_reset"), &EditorZoomWidget::_button_zoom_reset); + ClassDB::bind_method(D_METHOD("_button_zoom_plus"), &EditorZoomWidget::_button_zoom_plus); ADD_PROPERTY(PropertyInfo(Variant::REAL, "zoom"), "set_zoom", "get_zoom"); diff --git a/tile_editor/tile_atlas_view.cpp b/tile_editor/tile_atlas_view.cpp index a137f23..af0d94c 100644 --- a/tile_editor/tile_atlas_view.cpp +++ b/tile_editor/tile_atlas_view.cpp @@ -174,7 +174,7 @@ void RTileAtlasView::_update_zoom_and_panning(bool p_zoom_on_mouse_pos) { center_container->set_size(center_container->get_minimum_size()); } -void RTileAtlasView::_zoom_widget_changed() { +void RTileAtlasView::_zoom_widget_changed(const float zoom) { _update_zoom_and_panning(); emit_signal(("transform_changed"), zoom_widget->get_zoom(), panning); } diff --git a/tile_editor/tile_atlas_view.h b/tile_editor/tile_atlas_view.h index 75c74ae..555ee09 100644 --- a/tile_editor/tile_atlas_view.h +++ b/tile_editor/tile_atlas_view.h @@ -63,7 +63,7 @@ private: CenterContainer *center_container; Vector2 panning; void _update_zoom_and_panning(bool p_zoom_on_mouse_pos = false); - void _zoom_widget_changed(); + void _zoom_widget_changed(const float zoom = 0); void _center_view(); virtual void gui_input(const Ref &p_event); diff --git a/tile_editor/tile_map_editor.cpp b/tile_editor/tile_map_editor.cpp index 67b6875..75d5f97 100644 --- a/tile_editor/tile_map_editor.cpp +++ b/tile_editor/tile_map_editor.cpp @@ -993,6 +993,9 @@ Map RTileMapEditorTilesPlugin::_draw_line(Vector2 p_star Ref pattern = p_erase ? erase_pattern : selection_pattern; Map output; + + ERR_FAIL_COND_V(!pattern.is_valid(), output); + if (!pattern->is_empty()) { // Paint the tiles on the tile map. if (!p_erase && random_tile_checkbox->is_pressed()) { @@ -4029,7 +4032,7 @@ RTileMapEditor::RTileMapEditor() { layers_selection_button->set_toggle_mode(true); layers_selection_button->connect("draw", this, "_layers_selection_button_draw"); layers_selection_button->connect("pressed", this, "_layers_selection_button_pressed"); - layers_selection_button->connect("hidden", layers_selection_popup, "hide"); + layers_selection_button->connect("hide", layers_selection_popup, "hide"); layers_selection_button->set_tooltip(TTR("Tile Map Layer")); layers_selection_button->add_child(layers_selection_popup); tile_map_toolbar->add_child(layers_selection_button); diff --git a/tile_editor/tile_proxies_manager_dialog.cpp b/tile_editor/tile_proxies_manager_dialog.cpp index 5fc94ee..84df9f5 100644 --- a/tile_editor/tile_proxies_manager_dialog.cpp +++ b/tile_editor/tile_proxies_manager_dialog.cpp @@ -386,7 +386,7 @@ RTileProxiesManagerDialog::RTileProxiesManagerDialog() { vbox_container->add_child(alternative_level_list); popup_menu = memnew(PopupMenu); - popup_menu->add_shortcut(ED_GET_SHORTCUT("ui_text_delete")); + //popup_menu->add_shortcut(ED_GET_SHORTCUT("ui_text_delete")); popup_menu->connect("id_pressed", this, "_menu_id_pressed"); add_child(popup_menu); diff --git a/tile_editor/tile_set_atlas_source_editor.cpp b/tile_editor/tile_set_atlas_source_editor.cpp index 09acdd1..f0e213b 100644 --- a/tile_editor/tile_set_atlas_source_editor.cpp +++ b/tile_editor/tile_set_atlas_source_editor.cpp @@ -980,7 +980,7 @@ void RTileSetAtlasSourceEditor::_tile_atlas_control_mouse_exited() { tile_atlas_view->update(); } -void RTileSetAtlasSourceEditor::_tile_atlas_view_transform_changed() { +void RTileSetAtlasSourceEditor::_tile_atlas_view_transform_changed(const float zoom, const Vector2 &scroll) { tile_atlas_control->update(); tile_atlas_control_unscaled->update(); } diff --git a/tile_editor/tile_set_atlas_source_editor.h b/tile_editor/tile_set_atlas_source_editor.h index 7b608c3..2a619f4 100644 --- a/tile_editor/tile_set_atlas_source_editor.h +++ b/tile_editor/tile_set_atlas_source_editor.h @@ -234,7 +234,7 @@ private: void _tile_atlas_control_unscaled_draw(); void _tile_atlas_control_mouse_exited(); void _tile_atlas_control_gui_input(const Ref &p_event); - void _tile_atlas_view_transform_changed(); + void _tile_atlas_view_transform_changed(const float zoom = 0, const Vector2 &scroll = Vector2()); // A control over the alternative tiles. Vector3i hovered_alternative_tile_coords = Vector3i(RTileSetSource::INVALID_ATLAS_COORDS.x, RTileSetSource::INVALID_ATLAS_COORDS.y, RTileSetSource::INVALID_TILE_ALTERNATIVE);