You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
This commit is contained in:
@@ -260,27 +260,11 @@ void TileSetEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, C
|
||||
void TileSetEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_undo_redo_import_scene", &TileSetEditor::_undo_redo_import_scene);
|
||||
ClassDB::bind_method("_on_tileset_toolbar_button_pressed", &TileSetEditor::_on_tileset_toolbar_button_pressed);
|
||||
ClassDB::bind_method("_on_textures_added", &TileSetEditor::_on_textures_added);
|
||||
ClassDB::bind_method("_on_tileset_toolbar_confirm", &TileSetEditor::_on_tileset_toolbar_confirm);
|
||||
ClassDB::bind_method("_on_texture_list_selected", &TileSetEditor::_on_texture_list_selected);
|
||||
ClassDB::bind_method("_on_edit_mode_changed", &TileSetEditor::_on_edit_mode_changed);
|
||||
ClassDB::bind_method("_on_workspace_mode_changed", &TileSetEditor::_on_workspace_mode_changed);
|
||||
ClassDB::bind_method("_on_workspace_overlay_draw", &TileSetEditor::_on_workspace_overlay_draw);
|
||||
ClassDB::bind_method("_on_workspace_process", &TileSetEditor::_on_workspace_process);
|
||||
ClassDB::bind_method("_on_workspace_draw", &TileSetEditor::_on_workspace_draw);
|
||||
ClassDB::bind_method("_on_workspace_input", &TileSetEditor::_on_workspace_input);
|
||||
ClassDB::bind_method("_on_tool_clicked", &TileSetEditor::_on_tool_clicked);
|
||||
ClassDB::bind_method("_on_priority_changed", &TileSetEditor::_on_priority_changed);
|
||||
ClassDB::bind_method("_on_z_index_changed", &TileSetEditor::_on_z_index_changed);
|
||||
ClassDB::bind_method("_on_grid_snap_toggled", &TileSetEditor::_on_grid_snap_toggled);
|
||||
ClassDB::bind_method("_set_snap_step", &TileSetEditor::_set_snap_step);
|
||||
ClassDB::bind_method("_set_snap_off", &TileSetEditor::_set_snap_off);
|
||||
ClassDB::bind_method("_set_snap_sep", &TileSetEditor::_set_snap_sep);
|
||||
ClassDB::bind_method("_validate_current_tile_id", &TileSetEditor::_validate_current_tile_id);
|
||||
ClassDB::bind_method("_zoom_in", &TileSetEditor::_zoom_in);
|
||||
ClassDB::bind_method("_zoom_out", &TileSetEditor::_zoom_out);
|
||||
ClassDB::bind_method("_zoom_reset", &TileSetEditor::_zoom_reset);
|
||||
ClassDB::bind_method("_select_edited_shape_coord", &TileSetEditor::_select_edited_shape_coord);
|
||||
ClassDB::bind_method("_sort_tiles", &TileSetEditor::_sort_tiles);
|
||||
|
||||
@@ -358,19 +342,19 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
left_container->add_child(texture_list);
|
||||
texture_list->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
texture_list->set_custom_minimum_size(Size2(200, 0));
|
||||
texture_list->connect_compat("item_selected", this, "_on_texture_list_selected");
|
||||
texture_list->connect("item_selected", callable_mp(this, &TileSetEditor::_on_texture_list_selected));
|
||||
texture_list->set_drag_forwarding(this);
|
||||
|
||||
HBoxContainer *tileset_toolbar_container = memnew(HBoxContainer);
|
||||
left_container->add_child(tileset_toolbar_container);
|
||||
|
||||
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE] = memnew(ToolButton);
|
||||
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->connect_compat("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_ADD_TEXTURE));
|
||||
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tileset_toolbar_button_pressed), varray(TOOL_TILESET_ADD_TEXTURE));
|
||||
tileset_toolbar_container->add_child(tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]);
|
||||
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->set_tooltip(TTR("Add Texture(s) to TileSet."));
|
||||
|
||||
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE] = memnew(ToolButton);
|
||||
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->connect_compat("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_REMOVE_TEXTURE));
|
||||
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tileset_toolbar_button_pressed), varray(TOOL_TILESET_REMOVE_TEXTURE));
|
||||
tileset_toolbar_container->add_child(tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]);
|
||||
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->set_tooltip(TTR("Remove selected Texture from TileSet."));
|
||||
|
||||
@@ -383,7 +367,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
tileset_toolbar_tools->get_popup()->add_item(TTR("Create from Scene"), TOOL_TILESET_CREATE_SCENE);
|
||||
tileset_toolbar_tools->get_popup()->add_item(TTR("Merge from Scene"), TOOL_TILESET_MERGE_SCENE);
|
||||
|
||||
tileset_toolbar_tools->get_popup()->connect_compat("id_pressed", this, "_on_tileset_toolbar_button_pressed");
|
||||
tileset_toolbar_tools->get_popup()->connect("id_pressed", callable_mp(this, &TileSetEditor::_on_tileset_toolbar_button_pressed));
|
||||
tileset_toolbar_container->add_child(tileset_toolbar_tools);
|
||||
|
||||
//---------------
|
||||
@@ -416,7 +400,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
tool_workspacemode[i]->set_text(workspace_label[i]);
|
||||
tool_workspacemode[i]->set_toggle_mode(true);
|
||||
tool_workspacemode[i]->set_button_group(g);
|
||||
tool_workspacemode[i]->connect_compat("pressed", this, "_on_workspace_mode_changed", varray(i));
|
||||
tool_workspacemode[i]->connect("pressed", callable_mp(this, &TileSetEditor::_on_workspace_mode_changed), varray(i));
|
||||
tool_hb->add_child(tool_workspacemode[i]);
|
||||
}
|
||||
|
||||
@@ -429,14 +413,14 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
tool_hb->add_child(tools[SELECT_NEXT]);
|
||||
tool_hb->move_child(tools[SELECT_NEXT], WORKSPACE_CREATE_SINGLE);
|
||||
tools[SELECT_NEXT]->set_shortcut(ED_SHORTCUT("tileset_editor/next_shape", TTR("Next Coordinate"), KEY_PAGEDOWN));
|
||||
tools[SELECT_NEXT]->connect_compat("pressed", this, "_on_tool_clicked", varray(SELECT_NEXT));
|
||||
tools[SELECT_NEXT]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SELECT_NEXT));
|
||||
tools[SELECT_NEXT]->set_tooltip(TTR("Select the next shape, subtile, or Tile."));
|
||||
tools[SELECT_PREVIOUS] = memnew(ToolButton);
|
||||
tool_hb->add_child(tools[SELECT_PREVIOUS]);
|
||||
tool_hb->move_child(tools[SELECT_PREVIOUS], WORKSPACE_CREATE_SINGLE);
|
||||
tools[SELECT_PREVIOUS]->set_shortcut(ED_SHORTCUT("tileset_editor/previous_shape", TTR("Previous Coordinate"), KEY_PAGEUP));
|
||||
tools[SELECT_PREVIOUS]->set_tooltip(TTR("Select the previous shape, subtile, or Tile."));
|
||||
tools[SELECT_PREVIOUS]->connect_compat("pressed", this, "_on_tool_clicked", varray(SELECT_PREVIOUS));
|
||||
tools[SELECT_PREVIOUS]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SELECT_PREVIOUS));
|
||||
|
||||
VSeparator *separator_shape_selection = memnew(VSeparator);
|
||||
tool_hb->add_child(separator_shape_selection);
|
||||
@@ -466,7 +450,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
tool_editmode[i]->set_text(label[i]);
|
||||
tool_editmode[i]->set_toggle_mode(true);
|
||||
tool_editmode[i]->set_button_group(g);
|
||||
tool_editmode[i]->connect_compat("pressed", this, "_on_edit_mode_changed", varray(i));
|
||||
tool_editmode[i]->connect("pressed", callable_mp(this, &TileSetEditor::_on_edit_mode_changed), varray(i));
|
||||
tool_hb->add_child(tool_editmode[i]);
|
||||
}
|
||||
tool_editmode[EDITMODE_COLLISION]->set_pressed(true);
|
||||
@@ -493,21 +477,21 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
tools[TOOL_SELECT]->set_toggle_mode(true);
|
||||
tools[TOOL_SELECT]->set_button_group(tg);
|
||||
tools[TOOL_SELECT]->set_pressed(true);
|
||||
tools[TOOL_SELECT]->connect_compat("pressed", this, "_on_tool_clicked", varray(TOOL_SELECT));
|
||||
tools[TOOL_SELECT]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(TOOL_SELECT));
|
||||
|
||||
separator_bitmask = memnew(VSeparator);
|
||||
toolbar->add_child(separator_bitmask);
|
||||
tools[BITMASK_COPY] = memnew(ToolButton);
|
||||
tools[BITMASK_COPY]->set_tooltip(TTR("Copy bitmask."));
|
||||
tools[BITMASK_COPY]->connect_compat("pressed", this, "_on_tool_clicked", varray(BITMASK_COPY));
|
||||
tools[BITMASK_COPY]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(BITMASK_COPY));
|
||||
toolbar->add_child(tools[BITMASK_COPY]);
|
||||
tools[BITMASK_PASTE] = memnew(ToolButton);
|
||||
tools[BITMASK_PASTE]->set_tooltip(TTR("Paste bitmask."));
|
||||
tools[BITMASK_PASTE]->connect_compat("pressed", this, "_on_tool_clicked", varray(BITMASK_PASTE));
|
||||
tools[BITMASK_PASTE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(BITMASK_PASTE));
|
||||
toolbar->add_child(tools[BITMASK_PASTE]);
|
||||
tools[BITMASK_CLEAR] = memnew(ToolButton);
|
||||
tools[BITMASK_CLEAR]->set_tooltip(TTR("Erase bitmask."));
|
||||
tools[BITMASK_CLEAR]->connect_compat("pressed", this, "_on_tool_clicked", varray(BITMASK_CLEAR));
|
||||
tools[BITMASK_CLEAR]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(BITMASK_CLEAR));
|
||||
toolbar->add_child(tools[BITMASK_CLEAR]);
|
||||
|
||||
tools[SHAPE_NEW_RECTANGLE] = memnew(ToolButton);
|
||||
@@ -525,13 +509,13 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
separator_shape_toggle = memnew(VSeparator);
|
||||
toolbar->add_child(separator_shape_toggle);
|
||||
tools[SHAPE_TOGGLE_TYPE] = memnew(ToolButton);
|
||||
tools[SHAPE_TOGGLE_TYPE]->connect_compat("pressed", this, "_on_tool_clicked", varray(SHAPE_TOGGLE_TYPE));
|
||||
tools[SHAPE_TOGGLE_TYPE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SHAPE_TOGGLE_TYPE));
|
||||
toolbar->add_child(tools[SHAPE_TOGGLE_TYPE]);
|
||||
|
||||
separator_delete = memnew(VSeparator);
|
||||
toolbar->add_child(separator_delete);
|
||||
tools[SHAPE_DELETE] = memnew(ToolButton);
|
||||
tools[SHAPE_DELETE]->connect_compat("pressed", this, "_on_tool_clicked", varray(SHAPE_DELETE));
|
||||
tools[SHAPE_DELETE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SHAPE_DELETE));
|
||||
toolbar->add_child(tools[SHAPE_DELETE]);
|
||||
|
||||
spin_priority = memnew(SpinBox);
|
||||
@@ -539,7 +523,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
spin_priority->set_max(255);
|
||||
spin_priority->set_step(1);
|
||||
spin_priority->set_custom_minimum_size(Size2(100, 0));
|
||||
spin_priority->connect_compat("value_changed", this, "_on_priority_changed");
|
||||
spin_priority->connect("value_changed", callable_mp(this, &TileSetEditor::_on_priority_changed));
|
||||
spin_priority->hide();
|
||||
toolbar->add_child(spin_priority);
|
||||
|
||||
@@ -548,7 +532,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
spin_z_index->set_max(VS::CANVAS_ITEM_Z_MAX);
|
||||
spin_z_index->set_step(1);
|
||||
spin_z_index->set_custom_minimum_size(Size2(100, 0));
|
||||
spin_z_index->connect_compat("value_changed", this, "_on_z_index_changed");
|
||||
spin_z_index->connect("value_changed", callable_mp(this, &TileSetEditor::_on_z_index_changed));
|
||||
spin_z_index->hide();
|
||||
toolbar->add_child(spin_z_index);
|
||||
|
||||
@@ -562,7 +546,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
tools[TOOL_GRID_SNAP] = memnew(ToolButton);
|
||||
tools[TOOL_GRID_SNAP]->set_toggle_mode(true);
|
||||
tools[TOOL_GRID_SNAP]->set_tooltip(TTR("Enable snap and show grid (configurable via the Inspector)."));
|
||||
tools[TOOL_GRID_SNAP]->connect_compat("toggled", this, "_on_grid_snap_toggled");
|
||||
tools[TOOL_GRID_SNAP]->connect("toggled", callable_mp(this, &TileSetEditor::_on_grid_snap_toggled));
|
||||
toolbar->add_child(tools[TOOL_GRID_SNAP]);
|
||||
|
||||
Control *separator = memnew(Control);
|
||||
@@ -570,15 +554,15 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
toolbar->add_child(separator);
|
||||
|
||||
tools[ZOOM_OUT] = memnew(ToolButton);
|
||||
tools[ZOOM_OUT]->connect_compat("pressed", this, "_zoom_out");
|
||||
tools[ZOOM_OUT]->connect("pressed", callable_mp(this, &TileSetEditor::_zoom_out));
|
||||
toolbar->add_child(tools[ZOOM_OUT]);
|
||||
tools[ZOOM_OUT]->set_tooltip(TTR("Zoom Out"));
|
||||
tools[ZOOM_1] = memnew(ToolButton);
|
||||
tools[ZOOM_1]->connect_compat("pressed", this, "_zoom_reset");
|
||||
tools[ZOOM_1]->connect("pressed", callable_mp(this, &TileSetEditor::_zoom_reset));
|
||||
toolbar->add_child(tools[ZOOM_1]);
|
||||
tools[ZOOM_1]->set_tooltip(TTR("Zoom Reset"));
|
||||
tools[ZOOM_IN] = memnew(ToolButton);
|
||||
tools[ZOOM_IN]->connect_compat("pressed", this, "_zoom_in");
|
||||
tools[ZOOM_IN]->connect("pressed", callable_mp(this, &TileSetEditor::_zoom_in));
|
||||
toolbar->add_child(tools[ZOOM_IN]);
|
||||
tools[ZOOM_IN]->set_tooltip(TTR("Zoom In"));
|
||||
|
||||
@@ -607,13 +591,13 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
scroll->add_child(workspace_container);
|
||||
|
||||
workspace_overlay = memnew(Control);
|
||||
workspace_overlay->connect_compat("draw", this, "_on_workspace_overlay_draw");
|
||||
workspace_overlay->connect("draw", callable_mp(this, &TileSetEditor::_on_workspace_overlay_draw));
|
||||
workspace_container->add_child(workspace_overlay);
|
||||
|
||||
workspace = memnew(Control);
|
||||
workspace->set_focus_mode(FOCUS_ALL);
|
||||
workspace->connect_compat("draw", this, "_on_workspace_draw");
|
||||
workspace->connect_compat("gui_input", this, "_on_workspace_input");
|
||||
workspace->connect("draw", callable_mp(this, &TileSetEditor::_on_workspace_draw));
|
||||
workspace->connect("gui_input", callable_mp(this, &TileSetEditor::_on_workspace_input));
|
||||
workspace->set_draw_behind_parent(true);
|
||||
workspace_overlay->add_child(workspace);
|
||||
|
||||
@@ -626,7 +610,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
//---------------
|
||||
cd = memnew(ConfirmationDialog);
|
||||
add_child(cd);
|
||||
cd->connect_compat("confirmed", this, "_on_tileset_toolbar_confirm");
|
||||
cd->connect("confirmed", callable_mp(this, &TileSetEditor::_on_tileset_toolbar_confirm));
|
||||
|
||||
//---------------
|
||||
err_dialog = memnew(AcceptDialog);
|
||||
@@ -645,7 +629,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
|
||||
texture_dialog->add_filter("*." + E->get() + " ; " + E->get().to_upper());
|
||||
}
|
||||
add_child(texture_dialog);
|
||||
texture_dialog->connect_compat("files_selected", this, "_on_textures_added");
|
||||
texture_dialog->connect("files_selected", callable_mp(this, &TileSetEditor::_on_textures_added));
|
||||
|
||||
//---------------
|
||||
helper = memnew(TilesetEditorContext(this));
|
||||
|
||||
Reference in New Issue
Block a user