convert preload to load for addons kh_slider & kh_window load when godot start [also generate an error an disable plugin]

This commit is contained in:
AleaJactaEst 2021-09-23 22:23:01 +02:00
parent a6b6bb36c7
commit 2c5138eb74
3 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ func get_plus_texture():
func _ready(): func _ready():
self.add_child( preload( "res://addons/kh_slider/kh_h_slider.tscn" ).instance() ) self.add_child( load( "res://addons/kh_slider/kh_h_slider.tscn" ).instance() )
$kh_h_slider/minus.connect( "pressed", self, "_on_minus_pressed" ) $kh_h_slider/minus.connect( "pressed", self, "_on_minus_pressed" )
$kh_h_slider/value.connect( "changed", self, "_on_value_changed" ) $kh_h_slider/value.connect( "changed", self, "_on_value_changed" )

View file

@ -2,7 +2,7 @@ tool
extends EditorPlugin extends EditorPlugin
func _enter_tree(): func _enter_tree():
add_custom_type("KhHSlider", "HBoxContainer", preload("kh_h_slider.gd"), preload("kh_h_slider.png")) add_custom_type("KhHSlider", "HBoxContainer", load("kh_h_slider.gd"), load("kh_h_slider.png"))
func _exit_tree(): func _exit_tree():
remove_custom_type("KhHSlider") remove_custom_type("KhHSlider")

View file

@ -4,7 +4,7 @@ extends EditorPlugin
func _enter_tree(): func _enter_tree():
# Initialization of the plugin goes here # Initialization of the plugin goes here
# Add the new type with a name, a parent type, a script and an icon # Add the new type with a name, a parent type, a script and an icon
add_custom_type("kh_window", "MarginContainer", preload("res://addons/kh_window/kh_window.gd"), preload("res://addons/kh_window/icon.png")) add_custom_type("kh_window", "MarginContainer", load("res://addons/kh_window/kh_window.gd"), load("res://addons/kh_window/icon.png"))
func _exit_tree(): func _exit_tree():
# Clean-up of the plugin goes here # Clean-up of the plugin goes here