mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Add custom icons to script classes.
This commit is contained in:
parent
b4f579b5ba
commit
6d9cc032e7
12 changed files with 165 additions and 38 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue