diff options
-rw-r--r-- | core/io/translation_loader_po.cpp | 2 | ||||
-rw-r--r-- | doc/base/classes.xml | 18 | ||||
-rw-r--r-- | scene/3d/quad.cpp | 4 | ||||
-rw-r--r-- | scene/3d/quad.h | 1 | ||||
-rw-r--r-- | scene/gui/popup_menu.cpp | 36 | ||||
-rw-r--r-- | scene/gui/popup_menu.h | 3 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 6 | ||||
-rw-r--r-- | tools/editor/editor_run.cpp | 16 |
9 files changed, 67 insertions, 21 deletions
diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index a22c57b941..9b73785567 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -33,8 +33,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const String &p_path) { - String l = f->get_line(); - enum Status { STATUS_NONE, diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 07e2f719f9..234ef04be5 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -30931,6 +30931,13 @@ Clear the popup menu, in effect removing all items. </description> </method> + <method name="is_hide_on_item_selection"> + <return type="bool"> + </return> + <description> + Returns a boolean that indicates whether or not the PopupMenu will hide on item selection. + </description> + </method> <method name="get_item_ID" qualifiers="const"> <return type="int"> </return> @@ -31050,6 +31057,13 @@ Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one. </description> </method> + <method name="set_hide_on_item_selection"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Sets whether or not the PopupMenu will hide on item selection. + </description> + </method> <method name="set_item_ID"> <argument index="0" name="idx" type="int"> </argument> @@ -33518,7 +33532,7 @@ <return type="Array"> </return> <description> - Return a list of the bodies colliding with this one. + Return a list of the bodies colliding with this one. By default, number of max contacts reported is at 0 , see [method set_max_contacts_reported] to increase it. </description> </method> <method name="get_friction" qualifiers="const"> @@ -33879,7 +33893,7 @@ <return type="Array"> </return> <description> - Return a list of the bodies colliding with this one. + Return a list of the bodies colliding with this one. By default, number of max contacts reported is at 0 , see [method set_max_contacts_reported] to increase it. You must also enable contact monitor, see [method set_contact_monitor] </description> </method> <method name="get_continuous_collision_detection_mode" qualifiers="const"> diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index 1a7eeef180..adba4516a6 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -230,3 +230,7 @@ Quad::Quad() { configured=false; } + +Quad::~Quad() { + VisualServer::get_singleton()->free(mesh); +} diff --git a/scene/3d/quad.h b/scene/3d/quad.h index be55b0d1c9..4b419db3b8 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -71,6 +71,7 @@ public: virtual AABB get_aabb() const; Quad(); + ~Quad(); }; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 2fbb093e8e..bba29e7c54 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -899,11 +899,24 @@ void PopupMenu::activate_item(int p_item) { Node *next = get_parent(); PopupMenu *pop = next->cast_to<PopupMenu>(); while (pop) { - pop->hide(); - next = next->get_parent(); - pop = next->cast_to<PopupMenu>(); + // We close all parents that are chained together, + // with hide_on_item_selection enabled + if(hide_on_item_selection && pop->is_hide_on_item_selection()) { + pop->hide(); + next = next->get_parent(); + pop = next->cast_to<PopupMenu>(); + } + else { + // Break out of loop when the next parent has + // hide_on_item_selection disabled + break; + } + } + // Hides popup by default; unless otherwise specified + // by using set_hide_on_item_selection + if (hide_on_item_selection) { + hide(); } - hide(); } @@ -1019,6 +1032,16 @@ void PopupMenu::_set_items(const Array& p_items){ } +// Hide on item selection determines whether or not the popup will close after item selection +void PopupMenu::set_hide_on_item_selection(bool p_enabled) { + + hide_on_item_selection=p_enabled; +} + +bool PopupMenu::is_hide_on_item_selection() { + + return hide_on_item_selection; +} String PopupMenu::get_tooltip(const Point2& p_pos) const { @@ -1107,9 +1130,13 @@ void PopupMenu::_bind_methods() { ObjectTypeDB::bind_method(_MD("_set_items"),&PopupMenu::_set_items); ObjectTypeDB::bind_method(_MD("_get_items"),&PopupMenu::_get_items); + ObjectTypeDB::bind_method(_MD("set_hide_on_item_selection","enable"),&PopupMenu::set_hide_on_item_selection); + ObjectTypeDB::bind_method(_MD("is_hide_on_item_selection"),&PopupMenu::is_hide_on_item_selection); + ObjectTypeDB::bind_method(_MD("_submenu_timeout"),&PopupMenu::_submenu_timeout); ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL, "hide_on_item_selection" ), _SCS("set_hide_on_item_selection"), _SCS("is_hide_on_item_selection") ); ADD_SIGNAL( MethodInfo("item_pressed", PropertyInfo( Variant::INT,"ID") ) ); @@ -1128,6 +1155,7 @@ PopupMenu::PopupMenu() { set_focus_mode(FOCUS_ALL); set_as_toplevel(true); + set_hide_on_item_selection(true); submenu_timer = memnew( Timer ); submenu_timer->set_wait_time(0.3); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index b3e8cd2713..56ab8ad9dc 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -74,6 +74,7 @@ class PopupMenu : public Popup { void _submenu_timeout(); bool invalidated_click; + bool hide_on_item_selection; Vector2 moved; Array _get_items() const; @@ -153,6 +154,8 @@ public: void clear_autohide_areas(); void set_invalidate_click_until_motion(); + void set_hide_on_item_selection(bool p_enabled); + bool is_hide_on_item_selection(); PopupMenu(); ~PopupMenu(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index c585fff2a6..46d4144a85 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3783,7 +3783,7 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc if (col > 0 && _is_text_char(p_search[col-1])) { col = -1; - } else if (_is_text_char(p_search[col+p_key.length()])) { + } else if ((col + p_key.length()) < p_search.length() && _is_text_char(p_search[col+p_key.length()])) { col = -1; } } diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 5a3deb7b9d..b125b622aa 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1848,7 +1848,6 @@ void EditorNode::_run(bool p_current,const String& p_custom) { run_filename=scene->get_filename(); } else { - args=run_settings_dialog->get_custom_arguments(); current_filename=scene->get_filename(); } @@ -1926,6 +1925,8 @@ void EditorNode::_run(bool p_current,const String& p_custom) { List<String> breakpoints; editor_data.get_editor_breakpoints(&breakpoints); + + args = Globals::get_singleton()->get("editor/main_run_args"); Error error = editor_run.run(run_filename,args,breakpoints,current_filename); @@ -5458,7 +5459,7 @@ EditorNode::EditorNode() { editor_import_export->load_config(); - GLOBAL_DEF("editor/main_run_args","$exec -path $path -scene $scene $main_scene"); + GLOBAL_DEF("editor/main_run_args","$scene"); ObjectTypeDB::set_type_enabled("CollisionShape",true); ObjectTypeDB::set_type_enabled("CollisionShape2D",true); @@ -5957,6 +5958,7 @@ EditorNode::EditorNode() { debug_button->set_tooltip(TTR("Debug options")); p=debug_button->get_popup(); + p->set_hide_on_item_selection(false); p->add_check_item(TTR("Deploy with Remote Debug"),RUN_DEPLOY_REMOTE_DEBUG); p->set_item_tooltip(p->get_item_count()-1,TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged.")); p->add_check_item(TTR("Small Deploy with Network FS"),RUN_FILE_SERVER); diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp index 5fbb4ae2a0..7628841707 100644 --- a/tools/editor/editor_run.cpp +++ b/tools/editor/editor_run.cpp @@ -55,15 +55,6 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back("-epid"); args.push_back(String::num(OS::get_singleton()->get_process_ID())); - if (p_custom_args!="") { - - Vector<String> cargs=p_custom_args.split(" ",false); - for(int i=0;i<cargs.size();i++) { - - args.push_back(cargs[i].replace("%20"," ").replace("$scene",p_edited_scene.replace(" ","%20"))); - } - } - if (debug_collisions) { args.push_back("-debugcol"); } @@ -150,7 +141,12 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back(bpoints); } - args.push_back(p_scene); + if (p_custom_args!="") { + Vector<String> cargs=p_custom_args.split(" ",false); + for(int i=0;i<cargs.size();i++) { + args.push_back(cargs[i].replace("$scene",p_scene).replace(" ","%20")); + } + } String exec = OS::get_singleton()->get_executable_path(); |