extends Node func _ready(): var runtime = global.get_node("Runtime") # Some helpful logging. if Steam.isSubscribed(): global._print("Provisioning successful! Build ID: %d" % Steam.getAppBuildId()) else: global._print("Provisioning failed.") # Undo the load screen removing our cursor get_tree().get_root().set_disable_input(false) Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) # Increase the WebSocket input buffer size so that we can download large # data packages. ProjectSettings.set_setting("network/limits/websocket_client/max_in_buffer_kb", 8192) switcher.layer = 4 # Create the global AP manager, if it doesn't already exist. if not global.has_node("Archipelago"): var ap_script = runtime.load_script("manager.gd") var ap_instance = ap_script.new() ap_instance.name = "Archipelago" ap_instance.SCRIPT_client = runtime.load_script("client.gd") ap_instance.SCRIPT_keyboard = runtime.load_script("keyboard.gd") ap_instance.SCRIPT_locationListener = runtime.load_script("locationListener.gd") ap_instance.SCRIPT_minimap = runtime.load_script("minimap.gd") ap_instance.SCRIPT_victoryListener = runtime.load_script("victoryListener.gd") ap_instance.SCRIPT_websocketserver = runtime.load_script("vendor/WebSocketServer.gd") global.add_child(ap_instance) # Let's also inject any scripts we need to inject now. installScriptExtension(runtime.load_script("allowNumbers.gd")) installScriptExtension(runtime.load_script("animationListener.gd")) installScriptExtension(runtime.load_script("collectable.gd")) installScriptExtension(runtime.load_script("door.gd")) installScriptExtension(runtime.load_script("keyHolder.gd")) installScriptExtension(runtime.load_script("keyHolderChecker.gd")) installScriptExtension(runtime.load_script("keyHolderResetterListener.gd")) installScriptExtension(runtime.load_script("painting.gd")) installScriptExtension(runtime.load_script("paintingAuto.gd")) installScriptExtension(runtime.load_script("panel.gd")) installScriptExtension(runtime.load_script("pauseMenu.gd")) installScriptExtension(runtime.load_script("player.gd")) installScriptExtension(runtime.load_script("saver.gd")) installScriptExtension(runtime.load_script("teleport.gd")) installScriptExtension(runtime.load_script("teleportListener.gd")) installScriptExtension(runtime.load_script("visibilityListener.gd")) installScriptExtension(runtime.load_script("worldport.gd")) installScriptExtension(runtime.load_script("worldportListener.gd")) var proto_script = runtime.load_script("../generated/proto.gd") var gamedata_script = runtime.load_script("gamedata.gd") var gamedata_instance = gamedata_script.new(proto_script) gamedata_instance.load(runtime.read_path("../generated/data.binpb")) gamedata_instance.name = "Gamedata" global.add_child(gamedata_instance) var messages_script = runtime.load_script("messages.gd") var messages_instance = messages_script.new() messages_instance.name = "Messages" messages_instance.SCRIPT_rainbowText = runtime.load_script("rainbowText.gd") global.add_child(messages_instance) var effects_script = runtime.load_script("effects.gd") var effects_instance = effects_script.new() effects_instance.name = "Effects" global.add_child(effects_instance) var textclient_script = runtime.load_script("textclient.gd") var textclient_instance = textclient_script.new() textclient_instance.name = "Textclient" global.add_child(textclient_instance) var compass_overlay_script = runtime.load_script("compass_overlay.gd") var compass_overlay_instance = compass_overlay_script.new() compass_overlay_instance.name = "Compass" compass_overlay_instance.SCRIPT_compass = runtime.load_script("compass.gd") global.add_child(compass_overlay_instance) unlocks.data["advanced_mastery"] = "" unlocks.data["charismatic_mastery"] = "" unlocks.data["crystalline_mastery"] = "" unlocks.data["fuzzy_mastery"] = "" unlocks.data["icarus_mastery"] = "" unlocks.data["stellar_mastery"] = "" var ap = global.get_node("Archipelago") var gamedata = global.get_node("Gamedata") ap.ap_connected.connect(connectionSuccessful) ap.could_not_connect.connect(connectionUnsuccessful) ap.connect_status.connect(connectionStatus) # Populate textboxes with AP settings. get_node("../Panel/server_box").text = ap.ap_server get_node("../Panel/player_box").text = ap.ap_user get_node("../Panel/password_box").text = ap.ap_pass var history_box = get_node("../Panel/connection_history") if ap.connection_history.is_empty(): history_box.disabled = true else: history_box.disabled = false var i = 0 for details in ap.connection_history: history_box.get_popup().add_item("%s (%s)" % [details[1], details[0]], i) i += 1 history_box.get_popup().id_pressed.connect(historySelected) # Show client version. var version = gamedata.objects.get_version() get_node("../Panel/title").text = ( "ARCHIPELAGO (%d.%d.%d)" % [ver
extends Node
var apworld_reader
func _init(path):
apworld_reader = ZIPReader.new()
apworld_reader.open(path)
func _get_true_path(path):
if path.begins_with("../"):
return "lingo2/%s" % path.substr(3)
else:
return "lingo2/client/%s" % path
func load_script(path):
var true_path = _get_true_path(path)
var script = GDScript.new()
script.source_code = apworld_reader.read_file(true_path).get_string_from_utf8()
script.reload()
return script
func read_path(path):
var true_path = _get_true_path(path)
return apworld_reader.read_file(true_path)
func load_script_as_scene(path, scene_name):
var script = load_script(path)
var instance = script.new()
instance.name = scene_name
get_tree().unload_current_scene()
_load_scene.call_deferred(instance)
func _load_scene(instance):
get_tree().get_root().add_child(instance)
get_tree().current_scene = instance