extendsSpatialfunc_ready():# Undo the load screen removing our cursorget_tree().get_root().set_disable_input(false)Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)# Create the global Randomizer node, if it doesn't already exist.ifnotglobal.has_node("Randomizer"):varrandomizer_script=ResourceLoader.load("user://maps/randomizer/randomizer.gd")varrandomizer_instance=randomizer_script.new()randomizer_instance.name="Randomizer"global.add_child(randomizer_instance)randomizer_instance.SCRIPT_generator=load("user://maps/randomizer/generator.gd")vargenerated_puzzles=ResourceLoader.load("user://maps/randomizer/generated_puzzles.gd")vargenerated_puzzles_instance=generated_puzzles.new()generated_puzzles_instance.name="GeneratedPuzzles"randomizer_instance.add_child(generated_puzzles_instance)# Let's also inject any scripts we need to inject now.installScriptExtension(ResourceLoader.load("user://maps/randomizer/load.gd"))installScriptExtension(ResourceLoader.load("user://maps/randomizer/panelEnd.gd"))installScriptExtension(ResourceLoader.load("user://maps/randomizer/panelInput.gd"))installScriptExtension(ResourceLoader.load("user://maps/randomizer/panelLevelSwitch.gd"))installScriptExtension(ResourceLoader.load("user://maps/randomizer/worldTransporter.gd"))varrandomizer=global.get_node("Randomizer")randomizer.connect("finished_randomizing",self,"randomizationSuccessful")randomizer.connect("randomizer_status",self,"randomizationStatus")# Show client version.self.get_node("Panel/title").text="RANDOMIZER (%s)"%randomizer.my_version# Increase font size in text boxes.varfield_font=DynamicFont.new()field_font.font_data=load("res://fonts/CutiveMono_Regular.ttf")field_font.size=36self.get_node("Panel/seed_box").add_font_override("font",field_font)# Adapted from https://gitlab.com/Delta-V-Modding/Mods/-/blob/main/game/ModLoader.gdfuncinstallScriptExtension(childScript:Resource):# Force Godot to compile the script now.# We need to do this here to ensure that the inheritance chain is# properly set up, and multiple mods can chain-extend the same# class multiple times.# This is also needed to make Godot instantiate the extended class# when creating singletons.# The actual instance is thrown away.childScript.new()varparentScript=childScript.get_base_script()varparentScriptPath=parentScript.resource_pathglobal._print("ModLoader: Installing script extension over %s"%parentScriptPath)childScript.take_over_path(parentScriptPath)funcrandomizationStatus(message):varpopup=self.get_node("Panel/AcceptDialog")popup.window_title="Randomizing..."popup.dialog_text=messagepopup.popup_exclusive=truepopup.get_ok().visible=falsepopup.popup_centered()funcrandomizationSuccessful():varrandomizer=global.get_node("Randomizer")# Switch to LL1Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)global.map="level1"global.save_file=randomizer.getSaveFileName()var_discard=get_tree().change_scene("res://scenes/load_screen.tscn")