diff options
-rw-r--r-- | doc/base/classes.xml | 4 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 2 | ||||
-rw-r--r-- | scene/resources/animation.cpp | 2 | ||||
-rw-r--r-- | tools/editor/io_plugins/editor_font_import_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/multi_node_edit.cpp | 26 | ||||
-rw-r--r-- | tools/editor/multi_node_edit.h | 1 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 3 |
7 files changed, 31 insertions, 9 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 070046d100..b773d85b02 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -804,10 +804,10 @@ Backspace Key </constant> <constant name="KEY_RETURN" value="16777221"> - Return Key + Return Key (On Main Keyboard) </constant> <constant name="KEY_ENTER" value="16777222"> - Enter Key + Enter Key (On Numpad) </constant> <constant name="KEY_INSERT" value="16777223"> Insert Key diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 0ff6931dcd..dd4fa992ac 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -572,7 +572,7 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd,float p_delta,flo } else { - if (next_pos<0 or next_pos>len) { + if (next_pos<0 || next_pos>len) { if (!backwards) next_pos=0; else if (backwards) diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index b6fc3eb419..8f61c7b957 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1235,7 +1235,7 @@ T Animation::_interpolate( const Vector< TKey<T> >& p_keys, float p_time, Inter float c=0; // prepare for all cases of interpolation - if (loop and loop_interpolation) { + if (loop && loop_interpolation) { // loop if (idx>=0) { diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index a6de849e44..caa838cfd1 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -533,7 +533,7 @@ class EditorFontImportDialog : public ConfirmationDialog { } if (dest->get_line_edit()->get_text().extension().to_lower() != "fnt") { - error_dialog->set_text("Invalid file extension. \nPlease use .fnt"); + error_dialog->set_text(TTR("Invalid file extension. \nPlease use .fnt")); error_dialog->popup_centered(Size2(200,100)); return; } diff --git a/tools/editor/multi_node_edit.cpp b/tools/editor/multi_node_edit.cpp index fcf6e295de..4d27b8e349 100644 --- a/tools/editor/multi_node_edit.cpp +++ b/tools/editor/multi_node_edit.cpp @@ -35,9 +35,15 @@ bool MultiNodeEdit::_set(const StringName& p_name, const Variant& p_value){ if (!es) return false; + String name = p_name; + + if (name=="scripts/script") { // script/script set is intercepted at object level (check Variant Object::get() ) ,so use a different name + name="script/script"; + } + UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("MultiNode Set")+" "+String(p_name)); + ur->create_action(TTR("MultiNode Set")+" "+String(name)); for (const List<NodePath>::Element *E=nodes.front();E;E=E->next()) { if (!es->has_node(E->get())) @@ -47,10 +53,13 @@ bool MultiNodeEdit::_set(const StringName& p_name, const Variant& p_value){ if (!n) continue; - ur->add_do_property(n,p_name,p_value); - ur->add_undo_property(n,p_name,n->get(p_name)); + ur->add_do_property(n,name,p_value); + ur->add_undo_property(n,name,n->get(name)); + } + ur->add_do_method(EditorNode::get_singleton()->get_property_editor(),"refresh"); + ur->add_undo_method(EditorNode::get_singleton()->get_property_editor(),"refresh"); ur->commit_action(); return true; @@ -62,6 +71,11 @@ bool MultiNodeEdit::_get(const StringName& p_name,Variant &r_ret) const { if (!es) return false; + String name=p_name; + if (name=="scripts/script") { // script/script set is intercepted at object level (check Variant Object::get() ) ,so use a different name + name="script/script"; + } + for (const List<NodePath>::Element *E=nodes.front();E;E=E->next()) { if (!es->has_node(E->get())) @@ -72,7 +86,7 @@ bool MultiNodeEdit::_get(const StringName& p_name,Variant &r_ret) const { continue; bool found; - r_ret=n->get(p_name,&found); + r_ret=n->get(name,&found); if (found) return true; @@ -107,6 +121,8 @@ void MultiNodeEdit::_get_property_list( List<PropertyInfo> *p_list) const{ for(List<PropertyInfo>::Element *F=plist.front();F;F=F->next()) { + if (F->get().name=="script/script") + continue; //added later manually, since this is intercepted before being set (check Variant Object::get() ) if (!usage.has(F->get().name)) { PLData pld; pld.uses=0; @@ -128,6 +144,8 @@ void MultiNodeEdit::_get_property_list( List<PropertyInfo> *p_list) const{ } } + p_list->push_back(PropertyInfo(Variant::OBJECT,"scripts/script",PROPERTY_HINT_RESOURCE_TYPE,"Script")); + } diff --git a/tools/editor/multi_node_edit.h b/tools/editor/multi_node_edit.h index 6c59765227..fd50dc5bf4 100644 --- a/tools/editor/multi_node_edit.h +++ b/tools/editor/multi_node_edit.h @@ -41,6 +41,7 @@ class MultiNodeEdit : public Reference { PropertyInfo info; }; + protected: bool _set(const StringName& p_name, const Variant& p_value); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 763734f035..246785932d 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -2142,6 +2142,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p if (obj->get( p_name ).get_type() == Variant::NIL || obj->get( p_name ).operator RefPtr().is_null()) { p_item->set_text(1,"<null>"); + p_item->set_icon(1,Ref<Texture>()); Dictionary d = p_item->get_metadata(0); int hint=d.has("hint")?d["hint"].operator int():-1; @@ -3349,6 +3350,7 @@ void PropertyEditor::update_tree() { if (obj->get( p.name ).get_type() == Variant::NIL || obj->get( p.name ).operator RefPtr().is_null()) { item->set_text(1,"<null>"); + item->set_icon(1,Ref<Texture>()); } else { RES res = obj->get( p.name ).operator RefPtr(); @@ -3934,6 +3936,7 @@ void PropertyEditor::_bind_methods() { ObjectTypeDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed); ObjectTypeDB::bind_method( "update_tree",&PropertyEditor::update_tree); ObjectTypeDB::bind_method( "_resource_preview_done",&PropertyEditor::_resource_preview_done); + ObjectTypeDB::bind_method( "refresh",&PropertyEditor::refresh); ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw); ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw); |