summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2019-06-21 22:33:11 -0700
committerclayjohn <claynjohn@gmail.com>2019-06-21 22:33:11 -0700
commit64ecc8a5a3e22f92cf480f65249ac5468b9b5b89 (patch)
tree68c17bee47e22471ae186125d7bab67b9514d35f /editor
parent5a29be31b3055e218107df50bbbebdc0865026e8 (diff)
downloadredot-engine-64ecc8a5a3e22f92cf480f65249ac5468b9b5b89.tar.gz
properly set emitting when particles restart
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/cpu_particles_2d_editor_plugin.cpp6
-rw-r--r--editor/plugins/cpu_particles_2d_editor_plugin.h3
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.cpp8
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.h1
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp6
-rw-r--r--editor/plugins/particles_2d_editor_plugin.h3
-rw-r--r--editor/plugins/particles_editor_plugin.cpp7
-rw-r--r--editor/plugins/particles_editor_plugin.h1
8 files changed, 33 insertions, 2 deletions
diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp
index 1622ce17b2..7c2116f06b 100644
--- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp
@@ -75,6 +75,10 @@ void CPUParticles2DEditorPlugin::_menu_callback(int p_idx) {
emission_mask->popup_centered_minsize();
} break;
+ case MENU_RESTART: {
+
+ particles->restart();
+ }
}
}
@@ -265,6 +269,8 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) {
menu = memnew(MenuButton);
menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK);
+ menu->get_popup()->add_separator();
+ menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART);
// menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
menu->set_text(TTR("Particles"));
menu->set_switch_on_hover(true);
diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.h b/editor/plugins/cpu_particles_2d_editor_plugin.h
index f715abd87b..84bbfff095 100644
--- a/editor/plugins/cpu_particles_2d_editor_plugin.h
+++ b/editor/plugins/cpu_particles_2d_editor_plugin.h
@@ -44,7 +44,8 @@ class CPUParticles2DEditorPlugin : public EditorPlugin {
enum {
MENU_LOAD_EMISSION_MASK,
- MENU_CLEAR_EMISSION_MASK
+ MENU_CLEAR_EMISSION_MASK,
+ MENU_RESTART
};
enum EmissionMode {
diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp
index 70be9b95bb..93ffce41fa 100644
--- a/editor/plugins/cpu_particles_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_editor_plugin.cpp
@@ -62,6 +62,12 @@ void CPUParticlesEditor::_menu_option(int p_option) {
emission_tree_dialog->popup_centered_ratio();
} break;
+
+ case MENU_OPTION_RESTART: {
+
+ node->restart();
+
+ } break;
}
}
@@ -108,6 +114,8 @@ CPUParticlesEditor::CPUParticlesEditor() {
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);
options->get_popup()->connect("id_pressed", this, "_menu_option");
}
diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_editor_plugin.h
index 09b0adbe5d..674f00dc9f 100644
--- a/editor/plugins/cpu_particles_editor_plugin.h
+++ b/editor/plugins/cpu_particles_editor_plugin.h
@@ -43,6 +43,7 @@ class CPUParticlesEditor : public ParticlesEditorBase {
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE,
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
+ MENU_OPTION_RESTART
};
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index 6fabdc93c6..f75d4f03b7 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -102,6 +102,10 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) {
ur->commit_action();
} break;
+ case MENU_RESTART: {
+
+ particles->restart();
+ }
}
}
@@ -380,6 +384,8 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
// menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK);
menu->get_popup()->add_separator();
menu->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES);
+ menu->get_popup()->add_separator();
+ menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART);
menu->set_text(TTR("Particles"));
menu->set_switch_on_hover(true);
toolbar->add_child(menu);
diff --git a/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/particles_2d_editor_plugin.h
index 35b874fb25..0f092aaa4f 100644
--- a/editor/plugins/particles_2d_editor_plugin.h
+++ b/editor/plugins/particles_2d_editor_plugin.h
@@ -47,7 +47,8 @@ class Particles2DEditorPlugin : public EditorPlugin {
MENU_GENERATE_VISIBILITY_RECT,
MENU_LOAD_EMISSION_MASK,
MENU_CLEAR_EMISSION_MASK,
- MENU_OPTION_CONVERT_TO_CPU_PARTICLES
+ MENU_OPTION_CONVERT_TO_CPU_PARTICLES,
+ MENU_RESTART
};
enum EmissionMode {
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index 3f4f66a26d..887930c377 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -321,6 +321,11 @@ void ParticlesEditor::_menu_option(int p_option) {
ur->commit_action();
} break;
+ case MENU_OPTION_RESTART: {
+
+ node->restart();
+
+ } break;
}
}
@@ -471,6 +476,8 @@ ParticlesEditor::ParticlesEditor() {
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);
+ options->get_popup()->add_separator();
+ options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART);
options->get_popup()->connect("id_pressed", this, "_menu_option");
diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h
index b1c53dcf94..5d05fbd4ac 100644
--- a/editor/plugins/particles_editor_plugin.h
+++ b/editor/plugins/particles_editor_plugin.h
@@ -86,6 +86,7 @@ class ParticlesEditor : public ParticlesEditorBase {
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
MENU_OPTION_CONVERT_TO_CPU_PARTICLES,
+ MENU_OPTION_RESTART,
};