From 750ebbf9aa25f0209d7f1c7186718fa07377881d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 17 Apr 2024 12:50:34 -0400 Subject: Prevent colorful cdp if genned before 0.4.5 --- Archipelago/client.gd | 16 ++++++++++++++++ Archipelago/load.gd | 23 ++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 489fdb9..2f66c1b 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -95,6 +95,7 @@ var _item_name_to_id = {} # LINGO only var _location_name_to_id = {} # LINGO only var _remote_version = {"major": 0, "minor": 0, "build": 0} +var _gen_version = {"major": 0, "minor": 0, "build": 0} # TODO: caching per MW/slot, reset between connections var _authenticated = false @@ -233,6 +234,7 @@ func _on_data(): if cmd == "RoomInfo": _seed = message["seed_name"] _remote_version = message["version"] + _gen_version = message["generator_version"] var needed_games = [] for game in message["datapackage_checksums"].keys(): @@ -779,3 +781,17 @@ func colorForItemType(flags): return "#d63a22" else: # filler return "#14de9e" + + +func compareVersion(lhs, rhs): + if lhs["major"] == rhs["major"]: + if lhs["minor"] == rhs["minor"]: + return lhs["build"] < rhs["build"] + else: + return lhs["minor"] < rhs["minor"] + else: + return lhs["major"] < rhs["major"] + + +func wasGeneratedBeforeVersion(major, minor, build): + return compareVersion(_gen_version, {"major": major, "minor": minor, "build": build}) diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 566ee39..27e70b7 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -96,18 +96,19 @@ func _load(): wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map - # Turn THE COLORFUL into a cdp. - var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") - var colorful_cdp = cdp_auto_scene.instance() - colorful_cdp.name = "CountdownPanel_colorful" - colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" - colorful_cdp.panels = "../../Panels/Doorways Room" - colorful_cdp.translation = real_colorful.translation - colorful_cdp.rotation = real_colorful.rotation - get_node("CountdownPanels").add_child(colorful_cdp) - real_colorful.translation = Vector3(-51, -35, 35) # way under the map - get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() + if !apclient.wasGeneratedBeforeVersion(0, 4, 5): + # Turn THE COLORFUL into a cdp. + var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") + var colorful_cdp = cdp_auto_scene.instance() + colorful_cdp.name = "CountdownPanel_colorful" + colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" + colorful_cdp.panels = "../../Panels/Doorways Room" + colorful_cdp.translation = real_colorful.translation + colorful_cdp.rotation = real_colorful.rotation + get_node("CountdownPanels").add_child(colorful_cdp) + real_colorful.translation = Vector3(-51, -35, 35) # way under the map + get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() # Set up The Master to be variable. var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") -- cgit 1.4.1