Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
527ab830
Unverified
Commit
527ab830
authored
Jun 24, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 24, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39793 from Xrayez/class-icon-opt
Optimize class icon loading
parents
9ad5e9e4
4a86e2bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
editor_node.cpp
editor/editor_node.cpp
+4
-9
No files found.
editor/editor_node.cpp
View file @
527ab830
...
...
@@ -3642,17 +3642,12 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p
}
if
(
ScriptServer
::
is_global_class
(
p_class
))
{
String
icon_path
=
EditorNode
::
get_editor_data
().
script_class_get_icon_path
(
p_class
);
Ref
<
ImageTexture
>
icon
=
_load_custom_class_icon
(
icon_path
);
if
(
icon
.
is_valid
())
{
return
icon
;
}
Ref
<
Script
>
script
=
ResourceLoader
::
load
(
ScriptServer
::
get_global_class_path
(
p_class
),
"Script"
);
Ref
<
ImageTexture
>
icon
;
Ref
<
Script
>
script
=
EditorNode
::
get_editor_data
().
script_class_load_script
(
p_class
);
while
(
script
.
is_valid
())
{
String
current_icon_path
;
script
->
get_language
()
->
get_global_class_name
(
script
->
get_path
(),
nullptr
,
&
current_icon_path
);
String
Name
name
=
EditorNode
::
get_editor_data
().
script_class_get_name
(
script
->
get_path
())
;
String
current_icon_path
=
EditorNode
::
get_editor_data
().
script_class_get_icon_path
(
name
);
icon
=
_load_custom_class_icon
(
current_icon_path
);
if
(
icon
.
is_valid
())
{
return
icon
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment