Merge pull request #580 from marynate/PR-fix-particles-editor-menu
Particles editor menu not display in proper position
This commit is contained in:
commit
02a694ff48
@ -29,6 +29,7 @@
|
|||||||
#include "particles_editor_plugin.h"
|
#include "particles_editor_plugin.h"
|
||||||
#include "io/resource_loader.h"
|
#include "io/resource_loader.h"
|
||||||
#include "servers/visual/particle_system_sw.h"
|
#include "servers/visual/particle_system_sw.h"
|
||||||
|
#include "tools/editor/plugins/spatial_editor_plugin.h"
|
||||||
|
|
||||||
|
|
||||||
void ParticlesEditor::_node_removed(Node *p_node) {
|
void ParticlesEditor::_node_removed(Node *p_node) {
|
||||||
@ -340,9 +341,11 @@ void ParticlesEditor::_bind_methods() {
|
|||||||
|
|
||||||
ParticlesEditor::ParticlesEditor() {
|
ParticlesEditor::ParticlesEditor() {
|
||||||
|
|
||||||
|
particles_editor_hb = memnew ( HBoxContainer );
|
||||||
|
SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
|
||||||
options = memnew( MenuButton );
|
options = memnew( MenuButton );
|
||||||
add_child(options);
|
particles_editor_hb->add_child(options);
|
||||||
options->set_area_as_parent_rect();
|
particles_editor_hb->hide();
|
||||||
|
|
||||||
options->set_text("Particles");
|
options->set_text("Particles");
|
||||||
options->get_popup()->add_item("Generate AABB",MENU_OPTION_GENERATE_AABB);
|
options->get_popup()->add_item("Generate AABB",MENU_OPTION_GENERATE_AABB);
|
||||||
@ -429,8 +432,9 @@ void ParticlesEditorPlugin::make_visible(bool p_visible) {
|
|||||||
|
|
||||||
if (p_visible) {
|
if (p_visible) {
|
||||||
particles_editor->show();
|
particles_editor->show();
|
||||||
|
particles_editor->particles_editor_hb->show();
|
||||||
} else {
|
} else {
|
||||||
|
particles_editor->particles_editor_hb->hide();
|
||||||
particles_editor->hide();
|
particles_editor->hide();
|
||||||
particles_editor->edit(NULL);
|
particles_editor->edit(NULL);
|
||||||
}
|
}
|
||||||
@ -443,14 +447,6 @@ ParticlesEditorPlugin::ParticlesEditorPlugin(EditorNode *p_node) {
|
|||||||
particles_editor = memnew( ParticlesEditor );
|
particles_editor = memnew( ParticlesEditor );
|
||||||
editor->get_viewport()->add_child(particles_editor);
|
editor->get_viewport()->add_child(particles_editor);
|
||||||
|
|
||||||
// particles_editor->set_anchor(MARGIN_LEFT,Control::ANCHOR_END);
|
|
||||||
// particles_editor->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END);
|
|
||||||
particles_editor->set_margin(MARGIN_LEFT,253);
|
|
||||||
particles_editor->set_margin(MARGIN_RIGHT,280);
|
|
||||||
particles_editor->set_margin(MARGIN_TOP,0);
|
|
||||||
particles_editor->set_margin(MARGIN_BOTTOM,10);
|
|
||||||
|
|
||||||
|
|
||||||
particles_editor->hide();
|
particles_editor->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,8 @@ class ParticlesEditor : public Control {
|
|||||||
OBJ_TYPE(ParticlesEditor, Control );
|
OBJ_TYPE(ParticlesEditor, Control );
|
||||||
|
|
||||||
Panel *panel;
|
Panel *panel;
|
||||||
MenuButton * options;
|
MenuButton *options;
|
||||||
|
HBoxContainer *particles_editor_hb;
|
||||||
Particles *node;
|
Particles *node;
|
||||||
|
|
||||||
|
|
||||||
@ -78,6 +79,8 @@ class ParticlesEditor : public Control {
|
|||||||
|
|
||||||
void _populate();
|
void _populate();
|
||||||
|
|
||||||
|
friend class ParticlesEditorPlugin;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void _notification(int p_notification);
|
void _notification(int p_notification);
|
||||||
|
Loading…
Reference in New Issue
Block a user