Merge pull request #4057 from TheHX/particles-plugin
Fix file dialog, of Particles2D plugin, showing "Error" icons
This commit is contained in:
commit
9e97e9f39d
|
@ -26,10 +26,11 @@
|
|||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#include "particles_2d_editor_plugin.h"
|
||||
#include "canvas_item_editor_plugin.h"
|
||||
#include "io/image_loader.h"
|
||||
|
||||
#include "scene/gui/separator.h"
|
||||
|
||||
void Particles2DEditorPlugin::edit(Object *p_object) {
|
||||
|
||||
|
@ -49,12 +50,10 @@ void Particles2DEditorPlugin::make_visible(bool p_visible) {
|
|||
|
||||
if (p_visible) {
|
||||
|
||||
sep->show();
|
||||
menu->show();
|
||||
toolbar->show();
|
||||
} else {
|
||||
|
||||
menu->hide();
|
||||
sep->hide();
|
||||
toolbar->hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -164,35 +163,36 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) {
|
|||
particles=NULL;
|
||||
editor=p_node;
|
||||
undo_redo=editor->get_undo_redo();
|
||||
sep = memnew( VSeparator );
|
||||
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(sep);
|
||||
sep->hide();
|
||||
|
||||
toolbar = memnew( HBoxContainer );
|
||||
add_control_to_container(CONTAINER_CANVAS_EDITOR_MENU, toolbar);
|
||||
toolbar->hide();
|
||||
|
||||
toolbar->add_child( memnew( VSeparator ) );
|
||||
|
||||
menu = memnew( MenuButton );
|
||||
menu->get_popup()->add_item("Load Emission Mask",MENU_LOAD_EMISSION_MASK);
|
||||
menu->get_popup()->add_item("Clear Emission Mask",MENU_CLEAR_EMISSION_MASK);
|
||||
menu->set_text("Particles");
|
||||
toolbar->add_child(menu);
|
||||
|
||||
file = memnew(EditorFileDialog);
|
||||
add_child(file);
|
||||
file = memnew( EditorFileDialog );
|
||||
List<String> ext;
|
||||
ImageLoader::get_recognized_extensions(&ext);
|
||||
for(List<String>::Element *E=ext.front();E;E=E->next()) {
|
||||
file->add_filter("*."+E->get()+"; "+E->get().to_upper());
|
||||
}
|
||||
file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
|
||||
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(menu);
|
||||
toolbar->add_child(file);
|
||||
|
||||
epoints = memnew( SpinBox );
|
||||
epoints->set_min(1);
|
||||
epoints->set_max(8192);
|
||||
epoints->set_step(1);
|
||||
epoints->set_val(512);
|
||||
file->get_vbox()->add_margin_child("Generated Point Count:",epoints);
|
||||
menu->hide();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Particles2DEditorPlugin::~Particles2DEditorPlugin()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "tools/editor/editor_node.h"
|
||||
#include "scene/2d/collision_polygon_2d.h"
|
||||
|
||||
#include "scene/gui/separator.h"
|
||||
#include "scene/gui/box_container.h"
|
||||
#include "scene/gui/file_dialog.h"
|
||||
#include "scene/2d/particles_2d.h"
|
||||
|
||||
|
@ -47,14 +47,14 @@ class Particles2DEditorPlugin : public EditorPlugin {
|
|||
MENU_CLEAR_EMISSION_MASK
|
||||
};
|
||||
|
||||
Particles2D *particles;
|
||||
|
||||
EditorFileDialog *file;
|
||||
EditorNode *editor;
|
||||
|
||||
HBoxContainer *toolbar;
|
||||
MenuButton *menu;
|
||||
|
||||
VSeparator *sep;
|
||||
Particles2D *particles;
|
||||
SpinBox *epoints;
|
||||
|
||||
UndoRedo *undo_redo;
|
||||
|
|
Loading…
Reference in New Issue