@@ -69,13 +69,6 @@ static func get_type_string(type: Type) -> String:
6969 return String (Type .find_key (type )).capitalize ().replace (" " , "" )
7070
7171
72- ## Returns the configured color for slots of [param type].
73- static func get_color (type : Type ) -> Color :
74- if GaeaEditorSettings .CONFIGURABLE_SLOT_COLORS .has (type ):
75- return GaeaEditorSettings .get_configured_color_for_value_type (type )
76- return get_default_color (type )
77-
78-
7972## Returns the default value for [param type]. Returns [code]null[/code] if there's none.
8073static func get_default_value (type : Type ) -> Variant :
8174 match type :
@@ -157,6 +150,16 @@ static func from_old_slot_type(old_type: int) -> GaeaValue.Type:
157150 return GaeaValue .Type .NULL
158151
159152
153+ ## Returns the configured color for slots of [param type].
154+ static func get_color (type : Type ) -> Color :
155+ if Engine .is_editor_hint ():
156+ # gdlint:ignore = duplicated-load
157+ var gaea_editor_settings : GDScript = load ("uid://duu3vekk7pxwk" )
158+ if gaea_editor_settings .CONFIGURABLE_SLOT_COLORS .has (type ):
159+ return gaea_editor_settings .get_configured_color_for_value_type (type )
160+ return get_default_color (type )
161+
162+
160163## Returns the default color for slots of [param type].
161164static func get_default_color (type : Type ) -> Color :
162165 match type :
@@ -210,8 +213,8 @@ static func get_display_icon(type: Type) -> Texture2D:
210213 Type .MATERIAL :
211214 return load ("uid://b0vqox8bodse" )
212215 Type .TEXTURE :
213- var editor_interface = Engine .get_singleton ( "EditorInterface" )
214- return editor_interface .get_base_control ().get_theme_icon (& "Image" , & "EditorIcons" )
216+ if Engine .is_editor_hint ():
217+ return Engine . get_singleton ( & "EditorInterface" ) .get_base_control ().get_theme_icon (& "Image" , & "EditorIcons" )
215218 # Dictionary types
216219 Type .SAMPLE :
217220 return load ("uid://dkccxw7yq1mth" )
@@ -222,8 +225,11 @@ static func get_display_icon(type: Type) -> Texture2D:
222225
223226## Returns the configured icon for slots of [param type].
224227static func get_slot_icon (type : Type ) -> Texture2D :
225- if GaeaEditorSettings .CONFIGURABLE_SLOT_COLORS .has (type ):
226- return GaeaEditorSettings .get_configured_icon_for_value_type (type )
228+ if Engine .is_editor_hint ():
229+ # gdlint:ignore = duplicated-load
230+ var gaea_editor_settings : GDScript = load ("uid://duu3vekk7pxwk" )
231+ if gaea_editor_settings .CONFIGURABLE_SLOT_COLORS .has (type ):
232+ return gaea_editor_settings .get_configured_icon_for_value_type (type )
227233 return get_default_slot_icon (type )
228234
229235
@@ -240,7 +246,8 @@ static func get_default_slot_icon(type: Type) -> Texture2D:
240246 Type .VECTOR3I , Type .VECTOR3 :
241247 return load ("uid://dbvw3j8fnmhpu" )
242248 Type .ANY :
243- return EditorInterface .get_editor_theme ().get_icon ("NodeInfo" , "EditorIcons" )
249+ if Engine .is_editor_hint ():
250+ return Engine .get_singleton (& "EditorInterface" ).get_editor_theme ().get_icon ("NodeInfo" , "EditorIcons" )
244251 # Simple types
245252 Type .RANGE :
246253 return load ("uid://dfsmxavxasx7x" )
0 commit comments