You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add custom icons to script classes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user