summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authormarynate <mary.w.nate@gmail.com>2014-06-15 10:10:45 +0800
committermarynate <mary.w.nate@gmail.com>2014-06-15 10:11:58 +0800
commit2b6106541c47f77b5778ec71fda74540cbc31149 (patch)
treef9a4d739ae9672fb6098e238d77c6e53b24b0f44 /tools/editor
parent64e83bfd1404ea593f0c79b478d196a3fcde42a8 (diff)
Fixed #185 Setting a new Texture for a Sprite node does not update preview
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/property_editor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 2197902933..4ac2ff0594 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -1828,6 +1828,13 @@ 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>");
+ 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 && hint_text == "Texture") {
+ p_item->set_icon(1,NULL);
+ }
+
} else {
RES res = obj->get( p_name ).operator RefPtr();
if (res->is_type("Texture")) {