diff options
| author | Juan Linietsky | 2015-01-03 16:52:37 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-01-03 16:52:37 -0300 |
| commit | fbdd925d9be1c4c96d05089d7d5a58cd938b002c (patch) | |
| tree | 9f4eb2ae7c61450dffb4a86bb5e82cf66e23d496 /tools/editor/property_editor.cpp | |
| parent | eb1f978b1c1693018e9a6d353ca914f8e6586b4e (diff) | |
| download | godot-fbdd925d9be1c4c96d05089d7d5a58cd938b002c.tar.gz godot-fbdd925d9be1c4c96d05089d7d5a58cd938b002c.tar.zst godot-fbdd925d9be1c4c96d05089d7d5a58cd938b002c.zip | |
-Work in progress visual shader editor *DOES NOT WORK YET*
Diffstat (limited to '')
| -rw-r--r-- | tools/editor/property_editor.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 777694481..195d3c01a 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -142,7 +142,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { } String orig_type = res_orig->get_type(); - print_line("orig type: "+orig_type); + Object *inst = ObjectTypeDB::instance( orig_type ); Ref<Resource> res = Ref<Resource>( inst->cast_to<Resource>() ); @@ -187,6 +187,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { ERR_FAIL_COND( inheritors_array.empty() ); + String intype=inheritors_array[p_which-TYPE_BASE_ID]; Object *obj = ObjectTypeDB::instance(intype); @@ -603,6 +604,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty if (hint_text!="") { + int idx=0; for(int i=0;i<hint_text.get_slice_count(",");i++) { @@ -620,19 +622,19 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty E=E->next(); } - int idx=0; for(Set<String>::Element *E=valid_inheritors.front();E;E=E->next()) { String t = E->get(); if (!ObjectTypeDB::can_instance(t)) continue; inheritors_array.push_back(t); + int id = TYPE_BASE_ID+idx; if (has_icon(t,"EditorIcons")) { - menu->add_icon_item(get_icon(t,"EditorIcons"),"New "+t,TYPE_BASE_ID+idx); + menu->add_icon_item(get_icon(t,"EditorIcons"),"New "+t,id); } else { - menu->add_item("New "+t,TYPE_BASE_ID+idx); + menu->add_item("New "+t,id); } idx++; @@ -970,9 +972,11 @@ void CustomPropertyEditor::_action_pressed(int p_which) { if (p_which==0) { + ERR_FAIL_COND( inheritors_array.empty() ); String intype=inheritors_array[0]; + if (hint==PROPERTY_HINT_RESOURCE_TYPE) { |
