mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 08:53:35 +00:00
Make script type distinguishable by icon
This commit is contained in:
parent
28174d531b
commit
f524ddebd5
5 changed files with 34 additions and 2 deletions
|
@ -396,8 +396,17 @@ String ScriptTextEditor::get_name() {
|
|||
}
|
||||
|
||||
Ref<Texture2D> ScriptTextEditor::get_theme_icon() {
|
||||
if (get_parent_control() && get_parent_control()->has_theme_icon(script->get_class(), "EditorIcons")) {
|
||||
return get_parent_control()->get_theme_icon(script->get_class(), "EditorIcons");
|
||||
if (get_parent_control()) {
|
||||
String icon_name = script->get_class();
|
||||
if (script->is_built_in()) {
|
||||
icon_name += "Internal";
|
||||
}
|
||||
|
||||
if (get_parent_control()->has_theme_icon(icon_name, "EditorIcons")) {
|
||||
return get_parent_control()->get_theme_icon(icon_name, "EditorIcons");
|
||||
} else if (get_parent_control()->has_theme_icon(script->get_class(), "EditorIcons")) {
|
||||
return get_parent_control()->get_theme_icon(script->get_class(), "EditorIcons");
|
||||
}
|
||||
}
|
||||
|
||||
return Ref<Texture2D>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue