Fix more binding issues.

This commit is contained in:
Relintai 2021-12-12 19:20:14 +01:00
parent efbe5e0be0
commit 5867bf41b0
8 changed files with 11 additions and 8 deletions

View File

@ -3926,7 +3926,7 @@ void RTileSetAtlasSource::_get_property_list(List<PropertyInfo> *p_list) const {
for (List<PropertyInfo>::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;

View File

@ -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");

View File

@ -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);
}

View File

@ -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<InputEvent> &p_event);

View File

@ -993,6 +993,9 @@ Map<Vector2i, RTileMapCell> RTileMapEditorTilesPlugin::_draw_line(Vector2 p_star
Ref<RTileMapPattern> pattern = p_erase ? erase_pattern : selection_pattern;
Map<Vector2i, RTileMapCell> 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);

View File

@ -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);

View File

@ -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();
}

View File

@ -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<InputEvent> &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);