diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/editor/animation_editor.cpp | 83 | ||||
| -rw-r--r-- | tools/editor/animation_editor.h | 4 | ||||
| -rw-r--r-- | tools/editor/editor_file_system.cpp | 2 | ||||
| -rw-r--r-- | tools/editor/editor_node.cpp | 3 | ||||
| -rw-r--r-- | tools/editor/icons/icon_reload_small.png | bin | 0 -> 447 bytes | |||
| -rw-r--r-- | tools/editor/plugins/animation_player_editor_plugin.cpp | 9 | ||||
| -rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 19 | ||||
| -rw-r--r-- | tools/editor/plugins/script_editor_plugin.h | 2 | ||||
| -rw-r--r-- | tools/editor/project_export.cpp | 19 | ||||
| -rw-r--r-- | tools/editor/project_export.h | 2 | ||||
| -rw-r--r-- | tools/editor/project_settings.cpp | 54 | ||||
| -rw-r--r-- | tools/editor/property_editor.cpp | 45 | ||||
| -rw-r--r-- | tools/editor/scene_tree_editor.cpp | 5 |
13 files changed, 185 insertions, 62 deletions
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index cdce910665..dfb09e38fc 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -35,6 +35,7 @@ #include "scene/gui/separator.h" #include "editor_node.h" #include "tools/editor/plugins/animation_player_editor_plugin.h" +#include "scene/main/viewport.h" /* Missing to fix: *Set @@ -256,6 +257,28 @@ public: //PopupDialog *ke_dialog; + void _fix_node_path(Variant &value) { + + + NodePath np=value; + + if (np==NodePath()) + return; + + Node* root = EditorNode::get_singleton()->get_tree()->get_root(); + + Node* np_node = root->get_node(np); + ERR_FAIL_COND(!np_node); + + Node* edited_node = root->get_node(base); + ERR_FAIL_COND(!edited_node); + + + + value = edited_node->get_path_to(np_node); + } + + void _update_obj(const Ref<Animation> &p_anim) { if (setting) return; @@ -356,10 +379,18 @@ public: case Animation::TYPE_VALUE: { if (name=="value") { + + Variant value = p_value; + + if (value.get_type()==Variant::NODE_PATH) { + + _fix_node_path(value); + } + setting=true; undo_redo->create_action("Anim Change Value",true); Variant prev = animation->track_get_key_value(track,key); - undo_redo->add_do_method(animation.ptr(),"track_set_key_value",track,key,p_value); + undo_redo->add_do_method(animation.ptr(),"track_set_key_value",track,key,value); undo_redo->add_undo_method(animation.ptr(),"track_set_key_value",track,key,prev); undo_redo->add_do_method(this,"_update_obj",animation); undo_redo->add_undo_method(this,"_update_obj",animation); @@ -420,7 +451,14 @@ public: } if (what=="value") { - args[idx]=p_value; + + Variant value=p_value; + if (value.get_type()==Variant::NODE_PATH) { + + _fix_node_path(value); + } + + args[idx]=value; d_new["args"]=args; mergeable=true; } @@ -441,7 +479,7 @@ public: } break; } - return false; + return false; @@ -616,6 +654,7 @@ public: float key_ofs; PropertyInfo hint; + NodePath base; void notify_change() { @@ -1630,8 +1669,9 @@ void AnimationKeyEditor::_select_at_anim(const Ref<Animation>& p_anim,int p_trac } -PropertyInfo AnimationKeyEditor::_find_hint_for_track(int p_idx) { +PropertyInfo AnimationKeyEditor::_find_hint_for_track(int p_idx,NodePath& r_base_path) { + r_base_path=NodePath(); ERR_FAIL_COND_V(!animation.is_valid(),PropertyInfo()); ERR_FAIL_INDEX_V(p_idx,animation->get_track_count(),PropertyInfo()); @@ -1640,9 +1680,6 @@ PropertyInfo AnimationKeyEditor::_find_hint_for_track(int p_idx) { NodePath path = animation->track_get_path(p_idx); - String property = path.get_property(); - if (property=="") - return PropertyInfo(); if (!root->has_node_and_resource(path)) return PropertyInfo(); @@ -1650,6 +1687,15 @@ PropertyInfo AnimationKeyEditor::_find_hint_for_track(int p_idx) { RES res; Node *node = root->get_node_and_resource(path,res); + + if (node) { + r_base_path=node->get_path(); + } + + String property = path.get_property(); + if (property=="") + return PropertyInfo(); + List<PropertyInfo> pinfo; if (res.is_valid()) res->get_property_list(&pinfo); @@ -1729,7 +1775,7 @@ bool AnimationKeyEditor::_edit_if_single_selection() { key_edit->animation=animation; key_edit->track=idx; key_edit->key_ofs=animation->track_get_key_time(idx,key); - key_edit->hint=_find_hint_for_track(idx); + key_edit->hint=_find_hint_for_track(idx,key_edit->base); key_edit->notify_change(); curve_edit->set_transition(animation->track_get_key_transition(idx,key)); @@ -2187,7 +2233,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { newval=d; } else if (tt==Animation::TYPE_VALUE) { - PropertyInfo inf = _find_hint_for_track(idx); + NodePath np; + PropertyInfo inf = _find_hint_for_track(idx,np); if (inf.type!=Variant::NIL) { Variant::CallError err; @@ -2975,6 +3022,7 @@ void AnimationKeyEditor::_clear_selection() { key_edit->track=0; key_edit->key_ofs=0; key_edit->hint=PropertyInfo(); + key_edit->base=NodePath(); key_edit->notify_change(); } @@ -3022,9 +3070,14 @@ Node *AnimationKeyEditor::get_root() const { -void AnimationKeyEditor::set_keying(bool p_enabled) { +void AnimationKeyEditor::update_keying() { - keying=p_enabled; + bool keying_enabled=is_visible() && animation.is_valid(); + + if (keying_enabled==keying) + return; + + keying=keying_enabled; _update_menu(); emit_signal("keying_changed"); @@ -3032,7 +3085,7 @@ void AnimationKeyEditor::set_keying(bool p_enabled) { bool AnimationKeyEditor::has_keying() const { - return is_visible() && animation.is_valid(); + return keying; } void AnimationKeyEditor::_query_insert(const InsertData& p_id) { @@ -3264,9 +3317,10 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id,int p_last_track) { { //shitty hack + NodePath np; animation->add_track(p_id.type); animation->track_set_path(animation->get_track_count()-1,p_id.path); - PropertyInfo h = _find_hint_for_track(animation->get_track_count()-1); + PropertyInfo h = _find_hint_for_track(animation->get_track_count()-1,np); animation->remove_track(animation->get_track_count()-1); //hack @@ -3640,6 +3694,9 @@ void AnimationKeyEditor::_add_call_track(const NodePath& p_base) { NodePath path = root->get_path_to(from); + //print_line("root: "+String(root->get_path())); + //print_line("path: "+String(path)); + undo_redo->create_action("Anim Add Call Track"); undo_redo->add_do_method(animation.ptr(),"add_track",Animation::TYPE_METHOD); undo_redo->add_do_method(animation.ptr(),"track_set_path",animation->get_track_count(),path); diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h index c8a539179e..cd22dc3106 100644 --- a/tools/editor/animation_editor.h +++ b/tools/editor/animation_editor.h @@ -302,7 +302,7 @@ class AnimationKeyEditor : public VBoxContainer { void _select_at_anim(const Ref<Animation>& p_anim,int p_track,float p_pos); void _curve_transition_changed(float p_what); - PropertyInfo _find_hint_for_track(int p_idx); + PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path); void _create_value_item(int p_type); void _pane_drag(const Point2& p_delta); @@ -324,7 +324,7 @@ public: Ref<Animation> get_current_animation() const; void set_root(Node *p_root); Node *get_root() const; - void set_keying(bool p_enabled); + void update_keying(); bool has_keying() const; void cleanup(); diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index c7c1a48e34..ad59efc46f 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -1166,8 +1166,10 @@ EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) { void EditorFileSystem::_resource_saved(const String& p_path){ + //print_line("resource saved: "+p_path); EditorFileSystem::get_singleton()->update_file(p_path); + } String EditorFileSystem::_find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const { diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 79f5e66401..1abcb8f604 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2214,7 +2214,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { case FILE_EXPORT_PROJECT: { - project_export_settings->popup_centered_ratio(); + project_export_settings->popup_export(); /* String target = export_db->get_current_platform(); Ref<EditorExporter> exporter = export_db->get_exporter(target); @@ -3661,6 +3661,7 @@ void EditorNode::update_keying() { property_editor->set_keying(valid); + AnimationPlayerEditor::singleton->get_key_editor()->update_keying(); } diff --git a/tools/editor/icons/icon_reload_small.png b/tools/editor/icons/icon_reload_small.png Binary files differnew file mode 100644 index 0000000000..957cdfcf4f --- /dev/null +++ b/tools/editor/icons/icon_reload_small.png diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 43b4276d45..32afd86970 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -128,16 +128,9 @@ void AnimationPlayerEditor::_notification(int p_what) { anim_editor_load->set_hover_texture( get_icon("AnimGetHl","EditorIcons")); anim_editor_store->set_hover_texture( get_icon("AnimSetHl","EditorIcons")); */ - } - - if (p_what==NOTIFICATION_READY) { get_tree()->connect("node_removed",this,"_node_removed"); } - - if (p_what==NOTIFICATION_DRAW) { - - } } void AnimationPlayerEditor::_autoplay_pressed() { @@ -1305,7 +1298,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { frame = memnew( SpinBox ); hb->add_child(frame); - frame->set_custom_minimum_size(Size2(80,0)); + frame->set_custom_minimum_size(Size2(60,0)); frame->set_stretch_ratio(2); frame->set_tooltip("Animation position (in seconds)."); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 34d7e89760..5b1dd37a61 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -935,6 +935,9 @@ void ScriptEditor::_menu_option(int p_option) { if (!_test_script_times_on_disk()) return; + save_all_scripts(); + +#if 0 for(int i=0;i<tab_container->get_child_count();i++) { ScriptTextEditor *ste = tab_container->get_child(i)->cast_to<ScriptTextEditor>(); @@ -951,7 +954,7 @@ void ScriptEditor::_menu_option(int p_option) { editor->save_resource( script ); } - +#endif } break; case SEARCH_HELP: { @@ -1694,7 +1697,7 @@ void ScriptEditor::ensure_select_current() { Ref<Script> script = ste->get_edited_script(); - if (!grab_focus_block && is_inside_tree()) + if (!grab_focus_block && is_visible()) ste->get_text_edit()->grab_focus(); edit_menu->show(); @@ -1938,9 +1941,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script) { } } -void ScriptEditor::save_external_data() { - - apply_scripts(); +void ScriptEditor::save_all_scripts() { for(int i=0;i<tab_container->get_child_count();i++) { @@ -1949,9 +1950,13 @@ void ScriptEditor::save_external_data() { if (!ste) continue; + if (ste->get_text_edit()->get_version()==ste->get_text_edit()->get_saved_version()) + continue; + Ref<Script> script = ste->get_edited_script(); if (script->get_path()!="" && script->get_path().find("local://")==-1 &&script->get_path().find("::")==-1) { //external script, save it + ste->apply_code(); editor->save_resource(script); //ResourceSaver::save(script->get_path(),script); } @@ -2063,7 +2068,7 @@ void ScriptEditor::_editor_settings_changed() { void ScriptEditor::_autosave_scripts() { print_line("autosaving"); - save_external_data(); + save_all_scripts(); } void ScriptEditor::_tree_changed() { @@ -2628,7 +2633,7 @@ void ScriptEditorPlugin::clear() { void ScriptEditorPlugin::save_external_data() { - script_editor->save_external_data(); + script_editor->save_all_scripts(); } void ScriptEditorPlugin::apply_changes() { diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h index c52da41a43..5664b26580 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/tools/editor/plugins/script_editor_plugin.h @@ -295,7 +295,7 @@ public: void swap_lines(TextEdit *tx, int line1, int line2); - void save_external_data(); + void save_all_scripts(); void set_window_layout(Ref<ConfigFile> p_layout); void get_window_layout(Ref<ConfigFile> p_layout); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 7690d31e7b..164443d001 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -122,6 +122,15 @@ void ProjectExportDialog::_tree_changed() { } +void ProjectExportDialog::popup_export() { + popup_centered_ratio(); + if (pending_update_tree) { + _update_tree(); + _update_group_tree(); + pending_update_tree=false; + } +} + void ProjectExportDialog::_update_tree() { @@ -168,6 +177,11 @@ void ProjectExportDialog::_scan_finished() { print_line("**********SCAN DONEEE********"); print_line("**********SCAN DONEEE********");*/ + if (!is_visible()) { + pending_update_tree=true; + return; + } + _update_tree(); _update_group_tree(); } @@ -1446,7 +1460,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { ei="EditorIcons"; ot="Object"; - + pending_update_tree=true; } @@ -1480,6 +1494,8 @@ void ProjectExport::popup_export() { popup_centered(Size2(300,100)); + + } Error ProjectExport::export_project(const String& p_preset) { @@ -1880,5 +1896,6 @@ ProjectExport::ProjectExport(EditorData* p_data) { error = memnew( AcceptDialog ); add_child(error); + } diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h index 5a42a58e58..b9e49489e3 100644 --- a/tools/editor/project_export.h +++ b/tools/editor/project_export.h @@ -70,6 +70,7 @@ private: TabContainer *sections; bool updating_tree; + bool pending_update_tree; AcceptDialog *error; ConfirmationDialog *confirm; @@ -203,6 +204,7 @@ public: Error export_platform(const String& p_platform, const String& p_path, bool p_debug,const String& p_password,bool p_quit_after=false); + void popup_export(); ProjectExportDialog(EditorNode *p_editor); ~ProjectExportDialog(); }; diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 6c5e18ec9a..873e397010 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -38,18 +38,18 @@ ProjectSettings *ProjectSettings::singleton=NULL; static const char* _button_names[JOY_BUTTON_MAX]={ -"PS X, XBox A, NDS B", -"PS Circle, XBox B, NDS A", -"PS Square, XBox X, NDS Y", -"PS Triangle, XBox Y, NDS X", -"L, L1, Wii C", +"PS X, XBox A, Nintendo B", +"PS Circle, XBox B, Nintendo A", +"PS Square, XBox X, Nintendo Y", +"PS Triangle, XBox Y, Nintendo X", +"L, L1", "R, R1", -"L2, Wii Z", +"L2", "R2", "L3", "R3", -"Select, Wii -", -"Start, Wii +", +"Select, Nintendo -", +"Start, Nintendo +", "D-Pad Up", "D-Pad Down", "D-Pad Left", @@ -299,10 +299,22 @@ void ProjectSettings::_add_item(int p_item){ device_id->set_val(0); device_index_label->set_text("Joy Button Axis:"); device_index->clear(); - for(int i=0;i<24;i++) { + for(int i=0;i<JOY_AXIS_MAX*2;i++) { + String desc; - device_index->add_item("Axis "+itos(i/2)+" "+(i&1?"+":"-")); + int ax=i/2; + if (ax==0 || ax==1) + desc=" (Left Stick)"; + else if (ax==2 || ax==3) + desc=" (Right Stick)"; + else if (ax==6) + desc=" (L2)"; + else if (ax==7) + desc=" (R2)"; + + + device_index->add_item("Axis "+itos(i/2)+" "+(i&1?"+":"-")+desc); } device_input->popup_centered(Size2(350,95)); @@ -315,7 +327,7 @@ void ProjectSettings::_add_item(int p_item){ for(int i=0;i<JOY_BUTTON_MAX;i++) { - device_index->add_item(String(_button_names[i])); + device_index->add_item(itos(i)+": "+String(_button_names[i])); } device_input->popup_centered(Size2(350,95)); @@ -474,7 +486,7 @@ void ProjectSettings::_update_actions() { case InputEvent::JOYSTICK_BUTTON: { String str = "Device "+itos(ie.device)+", Button "+itos(ie.joy_button.button_index); - if (ie.joy_button.button_index>=0 && ie.joy_button.button_index<14) + if (ie.joy_button.button_index>=0 && ie.joy_button.button_index<JOY_BUTTON_MAX) str+=String()+" ("+_button_names[ie.joy_button.button_index]+")."; else str+="."; @@ -499,7 +511,18 @@ void ProjectSettings::_update_actions() { } break; case InputEvent::JOYSTICK_MOTION: { - String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+" "+(ie.joy_motion.axis_value<0?"-.":"+."); + String desc; + int ax = ie.joy_motion.axis; + + if (ax==0 || ax==1) + desc=" (Left Stick)."; + else if (ax==2 || ax==3) + desc=" (Right Stick)."; + else if (ax==6) + desc=" (L2)."; + else if (ax==7) + desc=" (R2)."; + String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+" "+(ie.joy_motion.axis_value<0?"-":"+")+desc; action->set_text(0,str); action->set_icon(0,get_icon("JoyAxis","EditorIcons")); } break; @@ -823,6 +846,7 @@ void ProjectSettings::_autoload_edited() { String base="autoload/"+ti->get_text(0); String path = Globals::get_singleton()->get(base); + int order = Globals::get_singleton()->get_order(base); if (path.begins_with("*")) path=path.substr(1,path.length()); @@ -833,6 +857,8 @@ void ProjectSettings::_autoload_edited() { undo_redo->create_action("Toggle Autoload GlobalVar"); undo_redo->add_do_property(Globals::get_singleton(),base,path); undo_redo->add_undo_property(Globals::get_singleton(),base,Globals::get_singleton()->get(base)); + undo_redo->add_do_method(Globals::get_singleton(),"set_order",base,order); // keep order, as config order matters for these + undo_redo->add_undo_method(Globals::get_singleton(),"set_order",base,order); undo_redo->add_do_method(this,"_update_autoload"); undo_redo->add_undo_method(this,"_update_autoload"); undo_redo->add_do_method(this,"_settings_changed"); @@ -924,10 +950,12 @@ void ProjectSettings::_autoload_delete(Object *p_item,int p_column, int p_button if (p_button==0) { //delete + int order = Globals::get_singleton()->get_order(name); undo_redo->create_action("Remove Autoload"); undo_redo->add_do_property(Globals::get_singleton(),name,Variant()); undo_redo->add_undo_property(Globals::get_singleton(),name,Globals::get_singleton()->get(name)); undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",name,true); + undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,order); undo_redo->add_do_method(this,"_update_autoload"); undo_redo->add_undo_method(this,"_update_autoload"); undo_redo->add_do_method(this,"_settings_changed"); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 4b1b93ea6e..efc821b874 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -714,7 +714,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty RES r = v; if (r.is_valid() && r->get_path().is_resource_file() && r->get_import_metadata().is_valid()) { menu->add_separator(); - menu->add_icon_item(get_icon("Reload","EditorIcons"),"Re-Import",OBJ_MENU_REIMPORT); + menu->add_icon_item(get_icon("ReloadSmall","EditorIcons"),"Re-Import",OBJ_MENU_REIMPORT); } /*if (r.is_valid() && r->get_path().is_resource_file()) { menu->set_item_tooltip(1,r->get_path()); @@ -2127,11 +2127,13 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { bool has_reload=false; int found=-1; + bool is_disabled=false; for(int i=0;i<item->get_button_count(1);i++) { if (item->get_button_id(1,i)==3) { found=i; + is_disabled=item->is_button_disabled(1,i); break; } } @@ -2149,7 +2151,7 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { bool changed = _is_property_different(v,vorig,usage); - if ((found!=-1)!=changed) { + //if ((found!=-1 && !is_disabled)!=changed) { if (changed) { @@ -2158,11 +2160,9 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { } - } - - } - + //} + } } @@ -2176,10 +2176,20 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { } } + //print_line("found: "+itos(found)+" has reload: "+itos(has_reload)+" is_disabled "+itos(is_disabled)); if (found!=-1 && !has_reload) { - item->erase_button(1,found); + + if (!is_disabled) { + item->erase_button(1,found); + if (item->get_cell_mode(1)==TreeItem::CELL_MODE_RANGE && item->get_text(1)==String()) { + item->add_button(1,get_icon("ReloadEmpty","EditorIcons"),3,true); + } + } } else if (found==-1 && has_reload) { - item->add_button(1,get_icon("Reload","EditorIcons"),3); + item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3); + } else if (found!=-1 && has_reload && is_disabled) { + item->erase_button(1,found); + item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3); } } @@ -2348,7 +2358,7 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) { if (!has_reload && found!=-1) { p_item->erase_button(1,found); } else if (has_reload && found==-1) { - p_item->add_button(1,get_icon("Reload","EditorIcons"),3); + p_item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3); } #endif Dictionary d=p_item->get_metadata(0); @@ -3092,7 +3102,9 @@ void PropertyEditor::update_tree() { } bool has_reload=false; - if (_might_be_in_instance()) { + + bool mbi = _might_be_in_instance(); + if (mbi) { Variant vorig; Dictionary d=item->get_metadata(0); @@ -3103,7 +3115,7 @@ void PropertyEditor::update_tree() { if (_is_property_different(v,vorig,usage)) { //print_line("FOR "+String(p.name)+" RELOAD WITH: "+String(v)+"("+Variant::get_type_name(v.get_type())+")=="+String(vorig)+"("+Variant::get_type_name(vorig.get_type())+")"); - item->add_button(1,get_icon("Reload","EditorIcons"),3); + item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3); has_reload=true; } } @@ -3115,11 +3127,16 @@ void PropertyEditor::update_tree() { Variant orig_value; if (scr->get_property_default_value(p.name,orig_value)) { if (orig_value!=obj->get(p.name)) { - item->add_button(1,get_icon("Reload","EditorIcons"),3); + item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3); + has_reload=true; } } } + if (mbi && !has_reload && item->get_cell_mode(1)==TreeItem::CELL_MODE_RANGE && item->get_text(1)==String()) { + item->add_button(1,get_icon("ReloadEmpty","EditorIcons"),3,true); + } + } @@ -3701,9 +3718,7 @@ PropertyEditor::PropertyEditor() { capitalize_paths=true; autoclear=false; - tree->set_column_title(0,"Property"); - tree->set_column_title(1,"Value"); - tree->set_column_titles_visible(true); + tree->set_column_titles_visible(false); keying=false; read_only=false; diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index 0260457c81..ba5cc7568b 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -658,6 +658,9 @@ void SceneTreeEditor::_renamed() { new_name=n->get_name(); } + if (new_name==n->get_name()) + return; + if (!undo_redo) { n->set_name( new_name ); which->set_metadata(0,n->get_path()); @@ -844,7 +847,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open add_child( tree ); tree->connect("cell_selected", this,"_selected_changed"); - tree->connect("item_edited", this,"_renamed"); + tree->connect("item_edited", this,"_renamed",varray(),CONNECT_DEFERRED); tree->connect("multi_selected",this,"_cell_multi_selected"); tree->connect("button_pressed",this,"_cell_button_pressed"); // tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true); |