Godot version:
master, a8787d1
OS/device including version:
Any
Issue description:
After OS/DisplayServer split, multiple editor UI elements use default bitmap font (no scaling and latin characters only), and have missing interface icons.
Elements with the wrong font:
File dialog icons are missing in the following dialogs:
Related PRs: #39123 (Tooltip font), #38917 (Some documentation fonts).
File dialog icons are missing in the following dialogs:
All file dialogs opened from "Export" All file dialogs opened from "Inspector"It seems to issue with EditorFileDialog and not EditorDialog.
Also, I am not sure if the icons for EditorFileDialog should in type "EditorIcons" or if it should be in its own type "EditorFileDialog"(like FileDialog and other stuff work).
get_icon() fails(i.e, returns default_icon) for lot of icons of type "EditorIcons" including the ones used in EditorFileDialog.
icon_map.has("EditorIcons") itself fails for only the problematic icons. It's weird that it doesn't always fail. This means that for a short time, icon_map temporarily doesn't have the key "EditorIcons". This doesn't make sense to me because I thought icon_map is not supposed to change.
I changed get_icon to:
Ref<Texture2D> Theme::get_icon(const StringName &p_name, const StringName &p_type) const {
if(icon_map.has("EditorIcons"))
print_line("A");
if (icon_map.has(p_type) && icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid()) {
return icon_map[p_type][p_name];
} else {
if(!icon_map.has("EditorIcons")) print_line("B");
print_line(p_name);
print_line(p_type);
print_line("----");
return default_icon;
}
}
Output:
...
A
A
A
A
B
FileThumbnail
EditorIcons
----
B
FileList
EditorIcons
----
B
Back
EditorIcons
----
B
Forward
EditorIcons
----
B
ArrowUp
EditorIcons
----
B
Reload
EditorIcons
----
B
Favorites
EditorIcons
----
B
GuiVisibilityVisible
EditorIcons
----
B
MoveUp
EditorIcons
----
B
MoveDown
EditorIcons
----
A
A
A
...
~Seems like the type EditorIcons is replaced by Icons at some point.~
Update:
Finally found the issue source.
EditorFileDialog uses it's ItemList's theme to get its icons (item_list->get_theme_icon("FileThumbnail", "EditorIcons")).
The problem is that ItemList uses the default_theme(which doesn't have EditorIcons type at all). EditorIcons is a type that only exists in editor_theme.
A simple way to solve it is by creating an editor_theme using create_editor_theme(get_theme()) in EditorFileDialog like how EditorNode does it. But, isn't it bad to create the whole new editor_theme instance every time an EditorFileDialog is created?
I can make a PR if this solution is fine.
I hope to fix this error as soon as possible
Estimated repair time?
Estimated repair time?
What's your budget? :)
I already asked you not to ask for fixes in short deadlines (unless you're willing to pay someone to do the work). This is the master branch, and breakage is normal. There are dozens of other more critical issues that also need to be fixed. That branch is not usable in production at all, so putting so much pressure on having proper internationalization of the in-editor class reference for something which is not usable in production seems a bit far-fetched.
If all you care about is having your own version of Godot fully localized, I'd suggest that you cherry-pick #37164 for your own use in the 3.2 branch, which won't be affected by this bug in the first place.
I just want to know how long it will take to fix it. It's not mandatory.
Well unless a contributor chooses to look into it and fix it, this will be on @reduz's shoulders as his changes created the problem. Here's currently busy with rendering work and will hopefully then move on to investigate regressions related to the DisplayServer and Window changes, so maybe within a few weeks to a month.
Icon issue seems to be because of a timing issue. The icons are not ready/populated when they are set during the EditorFileDialog's creation. This can be confirmed because https://github.com/godotengine/godot/blob/00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8/editor/editor_file_dialog.cpp#L595 has no issues. In fact, just doing _notification(NOTIFICATION_ENTER_TREE); inside this function makes all icons appear.
Most helpful comment
Well unless a contributor chooses to look into it and fix it, this will be on @reduz's shoulders as his changes created the problem. Here's currently busy with rendering work and will hopefully then move on to investigate regressions related to the DisplayServer and Window changes, so maybe within a few weeks to a month.