diff options
| author | Juan Linietsky | 2015-03-02 00:54:10 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-03-02 00:54:43 -0300 |
| commit | a1f715a4da71fbc2b7d6fad68624bf8b22c6da17 (patch) | |
| tree | 5cd305c8f8858504f0b5efb804b2c291b1dc5089 /tools/editor/property_editor.cpp | |
| parent | 0e732637d07d908daf64526f222e71fea402f3db (diff) | |
| download | godot-a1f715a4da71fbc2b7d6fad68624bf8b22c6da17.tar.gz godot-a1f715a4da71fbc2b7d6fad68624bf8b22c6da17.tar.zst godot-a1f715a4da71fbc2b7d6fad68624bf8b22c6da17.zip | |
support for 2D shadow casters
Added support for 2D shadow casters.
*DANGER* Shaders in CanvasItem CHANGED, if you are using shader in a
CanvasItem and pull this, you will lose them. Shaders now work through a
2D material system similar to 3D. If you don't want to lose the 2D
shader code, save the shader as a .shd, then create a material in
CanvasItem and re-assign the shader.
Diffstat (limited to 'tools/editor/property_editor.cpp')
| -rw-r--r-- | tools/editor/property_editor.cpp | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index a60068309..25c39b317 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -1857,8 +1857,33 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p } else { p_item->set_text(1,"<"+res->get_type()+">"); }; + + if (has_icon(res->get_type(),"EditorIcons")) { + + p_item->set_icon(1,get_icon(res->get_type(),"EditorIcons")); + } else { + + Dictionary d = p_item->get_metadata(0); + int hint=d.has("hint")?d["hint"].operator int():-1; + String hint_text=d.has("hint_text")?d["hint_text"]:""; + if (hint==PROPERTY_HINT_RESOURCE_TYPE) { + + if (has_icon(hint_text,"EditorIcons")) { + + p_item->set_icon(1,get_icon(hint_text,"EditorIcons")); + + } else { + p_item->set_icon(1,get_icon("Object","EditorIcons")); + + } + } + } + + + } + } break; default: {}; } @@ -2529,7 +2554,10 @@ void PropertyEditor::update_tree() { item->set_editable( 1, !read_only ); item->add_button(1,get_icon("EditResource","EditorIcons")); String type; + if (p.hint==PROPERTY_HINT_RESOURCE_TYPE) + type=p.hint_string; bool notnil=false; + if (obj->get( p.name ).get_type() == Variant::NIL || obj->get( p.name ).operator RefPtr().is_null()) { item->set_text(1,"<null>"); @@ -2553,12 +2581,18 @@ void PropertyEditor::update_tree() { }; notnil=true; + if (has_icon(res->get_type(),"EditorIcons")) { + type=res->get_type(); + } } - if (p.hint==PROPERTY_HINT_RESOURCE_TYPE) { + + if (type!=String()) { + if (type.find(",")!=-1) + type=type.get_slice(",",0); //printf("prop %s , type %s\n",p.name.ascii().get_data(),p.hint_string.ascii().get_data()); - if (has_icon(p.hint_string,"EditorIcons")) - item->set_icon( 0, get_icon(p.hint_string,"EditorIcons") ); + if (has_icon(type,"EditorIcons")) + item->set_icon( 0, get_icon(type,"EditorIcons") ); else item->set_icon( 0, get_icon("Object","EditorIcons") ); } |
