summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
authorWill Nations <willnationsdev@gmail.com>2018-07-28 22:36:43 -0500
committerWill Nations <willnationsdev@gmail.com>2018-08-14 14:18:05 -0500
commit6d9cc032e71ccc768064bf908623b0954d01181c (patch)
tree1765ce220fa8329ebd7a48e611ab6db3f7655367 /modules/gdscript/gdscript.cpp
parentb4f579b5ba8df8b8972c79a10b6d9c8b0719829f (diff)
downloadredot-engine-6d9cc032e71ccc768064bf908623b0954d01181c.tar.gz
Add custom icons to script classes.
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r--modules/gdscript/gdscript.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 42ec05e6ce..8cf7121630 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1811,7 +1811,7 @@ bool GDScriptLanguage::handles_global_class_type(const String &p_type) const {
return p_type == "GDScript";
}
-String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type) const {
+String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const {
PoolVector<uint8_t> sourcef;
Error err;
@@ -1876,6 +1876,12 @@ String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_b
}
}
}
+ if (r_icon_path) {
+ if (c->icon_path.is_abs_path())
+ *r_icon_path = c->icon_path;
+ else if (c->icon_path.is_rel_path())
+ *r_icon_path = p_path.get_base_dir().plus_file(c->icon_path).simplify_path();
+ }
return c->name;
}