Skip to content

Commit

Permalink
Signals: Fix invalid connections to missing callbacks
Browse files Browse the repository at this point in the history
These bugs existed since those lines were added, so I assume that
their intended use is no longer relevant.
  • Loading branch information
akien-mga committed Feb 23, 2020
1 parent 220c8e8 commit 15e6a82
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 49 deletions.
3 changes: 1 addition & 2 deletions editor/groups_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/*************************************************************************/

#include "groups_editor.h"

#include "editor/scene_tree_editor.h"
#include "editor_node.h"
#include "editor_scale.h"
Expand Down Expand Up @@ -468,7 +469,6 @@ GroupDialog::GroupDialog() {
nodes_to_add->set_select_mode(Tree::SELECT_MULTI);
nodes_to_add->set_v_size_flags(SIZE_EXPAND_FILL);
nodes_to_add->add_constant_override("draw_guides", 1);
nodes_to_add->connect_compat("item_selected", this, "_nodes_to_add_selected");

HBoxContainer *add_filter_hbc = memnew(HBoxContainer);
add_filter_hbc->add_constant_override("separate", 0);
Expand Down Expand Up @@ -515,7 +515,6 @@ GroupDialog::GroupDialog() {
nodes_to_remove->set_hide_folding(true);
nodes_to_remove->set_select_mode(Tree::SELECT_MULTI);
nodes_to_remove->add_constant_override("draw_guides", 1);
nodes_to_remove->connect_compat("item_selected", this, "_node_to_remove_selected");

HBoxContainer *remove_filter_hbc = memnew(HBoxContainer);
remove_filter_hbc->add_constant_override("separate", 0);
Expand Down
13 changes: 3 additions & 10 deletions editor/plugins/animation_player_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
#include "editor/animation_track_editor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"

// For onion skinning.
#include "editor/plugins/canvas_item_editor_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
#include "editor/plugins/spatial_editor_plugin.h" // For onion skinning.
#include "scene/main/viewport.h"
#include "servers/visual_server.h"

Expand Down Expand Up @@ -375,8 +373,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource> &p_resou
Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);

if (err != OK) {
accept->set_text(TTR("Error saving resource!"));
accept->popup_centered_minsize();
EditorNode::get_singleton()->show_warning(TTR("Error saving resource!"));
return;
}

Expand Down Expand Up @@ -1628,10 +1625,6 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
scale->set_tooltip(TTR("Scale animation playback globally for the node."));
scale->hide();

accept = memnew(AcceptDialog);
add_child(accept);
accept->connect_compat("confirmed", this, "_menu_confirm_current");

delete_dialog = memnew(ConfirmationDialog);
add_child(delete_dialog);
delete_dialog->connect_compat("confirmed", this, "_animation_remove_confirmed");
Expand Down
1 change: 0 additions & 1 deletion editor/plugins/animation_player_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class AnimationPlayerEditor : public VBoxContainer {
float timeline_position;

EditorFileDialog *file;
AcceptDialog *accept;
ConfirmationDialog *delete_dialog;
int current_option;

Expand Down
7 changes: 0 additions & 7 deletions editor/plugins/cpu_particles_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ void CPUParticlesEditor::_menu_option(int p_option) {

switch (p_option) {

case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: {

emission_file_dialog->popup_centered_ratio();

} break;

case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {

emission_tree_dialog->popup_centered_ratio();
Expand Down Expand Up @@ -112,7 +106,6 @@ CPUParticlesEditor::CPUParticlesEditor() {
particles_editor_hb->hide();

options->set_text(TTR("CPUParticles"));
options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART);
Expand Down
1 change: 0 additions & 1 deletion editor/plugins/cpu_particles_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class CPUParticlesEditor : public ParticlesEditorBase {
enum Menu {

MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE,
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
MENU_OPTION_RESTART

Expand Down
26 changes: 0 additions & 26 deletions editor/plugins/particles_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,9 @@ ParticlesEditorBase::ParticlesEditorBase() {
emission_dialog->get_ok()->set_text(TTR("Create"));
emission_dialog->connect_compat("confirmed", this, "_generate_emission_points");

emission_file_dialog = memnew(EditorFileDialog);
add_child(emission_file_dialog);
emission_file_dialog->connect_compat("file_selected", this, "_resource_seleted");
emission_tree_dialog = memnew(SceneTreeDialog);
add_child(emission_tree_dialog);
emission_tree_dialog->connect_compat("selected", this, "_node_selected");

List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("Mesh", &extensions);

emission_file_dialog->clear_filters();
for (int i = 0; i < extensions.size(); i++) {

emission_file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper());
}

emission_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
}

void ParticlesEditor::_node_removed(Node *p_node) {
Expand Down Expand Up @@ -279,17 +265,6 @@ void ParticlesEditor::_menu_option(int p_option) {
generate_seconds->set_value(trunc(gen_time) + 1.0);
generate_aabb->popup_centered_minsize();
} break;
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: {

Ref<ParticlesMaterial> material = node->get_process_material();
if (material.is_null()) {
EditorNode::get_singleton()->show_warning(TTR("A processor material of type 'ParticlesMaterial' is required."));
return;
}
emission_file_dialog->popup_centered_ratio();

} break;

case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {
Ref<ParticlesMaterial> material = node->get_process_material();
if (material.is_null()) {
Expand Down Expand Up @@ -467,7 +442,6 @@ ParticlesEditor::ParticlesEditor() {
options->set_text(TTR("Particles"));
options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES);
Expand Down
2 changes: 0 additions & 2 deletions editor/plugins/particles_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ParticlesEditorBase : public Control {
MenuButton *options;
HBoxContainer *particles_editor_hb;

EditorFileDialog *emission_file_dialog;
SceneTreeDialog *emission_tree_dialog;

ConfirmationDialog *emission_dialog;
Expand Down Expand Up @@ -77,7 +76,6 @@ class ParticlesEditor : public ParticlesEditorBase {

MENU_OPTION_GENERATE_AABB,
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE,
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
MENU_OPTION_CONVERT_TO_CPU_PARTICLES,
MENU_OPTION_RESTART,
Expand Down

0 comments on commit 15e6a82

Please sign in to comment.