Could not reslove script:"res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconEditorInspector.gd"

Godot Version

4.2.1

Question

i keep on getting this error:Could not resolve script "res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconEditorInspector.gd"., i am using the controller icon addon.
here is the script:

@tool
extends EditorPlugin

var inspector_plugin : EditorInspectorPlugin

func _enter_tree():
	inspector_plugin = preload("res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconEditorInspector.gd").new()
	inspector_plugin.editor_interface = get_editor_interface()

	add_autoload_singleton("ControllerIcons", "res://addons/controller_icons-master/addons/controller_icons/ControllerIcons.gd")
	add_inspector_plugin(inspector_plugin)

func _exit_tree():
	remove_inspector_plugin(inspector_plugin)
	remove_autoload_singleton("ControllerIcons")

here the script for"res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconEditorInspector.gd

extends EditorInspectorPlugin

var path_selector := preload("res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconPathEditorProperty.gd")

var editor_interface : EditorInterface

class ControllerIcons_TexturePreview:
	var n_root: MarginContainer
	var n_background: TextureRect
	var n_texture: TextureRect
	
	var background: Texture2D

	var texture: Texture2D:
		set(_texture):
			texture = _texture
			n_texture.texture = texture
	
	func _init(editor_interface: EditorInterface):
		n_root = MarginContainer.new()

		# UPGRADE: In Godot 4.2, there's no need to have an instance to
		# EditorInterface, since it's now a static call:
		# background = EditorInterface.get_base_control().get_theme_icon("Checkerboard", "EditorIcons")
		background = editor_interface.get_base_control().get_theme_icon("Checkerboard", "EditorIcons")
		n_background = TextureRect.new()
		n_background.stretch_mode = TextureRect.STRETCH_TILE
		n_background.texture = background
		n_background.texture_repeat = CanvasItem.TEXTURE_REPEAT_ENABLED
		n_background.custom_minimum_size = Vector2(0, 256)
		n_root.add_child(n_background)
		
		n_texture = TextureRect.new()
		n_texture.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS
		n_texture.set_anchors_preset(Control.PRESET_FULL_RECT)
		n_texture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
		n_texture.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
		n_root.add_child(n_texture)
	
	func get_root():
		return n_root

var preview: ControllerIcons_TexturePreview

func _can_handle(object: Object) -> bool:
	return object is ControllerIconTexture

func _parse_begin(object: Object) -> void:
	preview = ControllerIcons_TexturePreview.new(editor_interface)
	add_custom_control(preview.get_root())
	
	var icon := object as ControllerIconTexture
	if icon:
		preview.texture = icon

func _parse_property(object: Object, type, name: String, hint_type: PropertyHint, hint_string: String, usage_flags: int, wide: bool) -> bool:
	if name == "path":
		var path_selector_instance = path_selector.new(editor_interface)
		add_property_editor(name, path_selector_instance)
		return true
	return false

here the script for res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconPathEditorProperty.gd

@tool
extends EditorProperty

var selector : ConfirmationDialog
var line_edit : LineEdit

func _init(editor_interface: EditorInterface):
	add_child(build_tree(editor_interface))

func build_tree(editor_interface: EditorInterface):
	selector = preload("res://addons/controller_icons-master/addons/controller_icons/objects/ControllerIconPathSelectorPopup.tscn").instantiate()
	selector.editor_interface = editor_interface
	selector.visible = false
	selector.path_selected.connect(
		func(path: String):
			if not path.is_empty():
				emit_changed(get_edited_property(), path)
	)

	var root := HBoxContainer.new()

	line_edit = LineEdit.new()
	line_edit.size_flags_horizontal = Control.SIZE_EXPAND_FILL
	line_edit.text_changed.connect(func(text):
		emit_changed(get_edited_property(), text)
	)

	var button := Button.new()
	# UPGRADE: In Godot 4.2, there's no need to have an instance to
	# EditorInterface, since it's now a static call:
	# button.icon = EditorInterface.get_base_control().get_theme_icon("ListSelect", "EditorIcons")
	button.icon = editor_interface.get_base_control().get_theme_icon("ListSelect", "EditorIcons")
	button.tooltip_text = "Select an icon path"
	button.pressed.connect(func():
		selector.populate()
		selector.popup_centered()
	)

	root.add_child(line_edit)
	root.add_child(button)
	root.add_child(selector)
	return root

func _update_property():
	var new_text = get_edited_object()[get_edited_property()]
	if line_edit.text != new_text:
		line_edit.text = new_text

i don’t know how to fix this error can anyone help?

nvm it fixed it self.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.