diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-04-17 12:50:34 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-04-17 12:50:34 -0400 |
commit | 750ebbf9aa25f0209d7f1c7186718fa07377881d (patch) | |
tree | 9e65c74808494c9832d8f01564c302e788137e5a /Archipelago | |
parent | ce831897b89974f38fd6f0583e5feac178643a14 (diff) | |
download | lingo-archipelago-750ebbf9aa25f0209d7f1c7186718fa07377881d.tar.gz lingo-archipelago-750ebbf9aa25f0209d7f1c7186718fa07377881d.tar.bz2 lingo-archipelago-750ebbf9aa25f0209d7f1c7186718fa07377881d.zip |
Prevent colorful cdp if genned before 0.4.5
Diffstat (limited to 'Archipelago')
-rw-r--r-- | Archipelago/client.gd | 16 | ||||
-rw-r--r-- | 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 | |||
95 | var _location_name_to_id = {} # LINGO only | 95 | var _location_name_to_id = {} # LINGO only |
96 | 96 | ||
97 | var _remote_version = {"major": 0, "minor": 0, "build": 0} | 97 | var _remote_version = {"major": 0, "minor": 0, "build": 0} |
98 | var _gen_version = {"major": 0, "minor": 0, "build": 0} | ||
98 | 99 | ||
99 | # TODO: caching per MW/slot, reset between connections | 100 | # TODO: caching per MW/slot, reset between connections |
100 | var _authenticated = false | 101 | var _authenticated = false |
@@ -233,6 +234,7 @@ func _on_data(): | |||
233 | if cmd == "RoomInfo": | 234 | if cmd == "RoomInfo": |
234 | _seed = message["seed_name"] | 235 | _seed = message["seed_name"] |
235 | _remote_version = message["version"] | 236 | _remote_version = message["version"] |
237 | _gen_version = message["generator_version"] | ||
236 | 238 | ||
237 | var needed_games = [] | 239 | var needed_games = [] |
238 | for game in message["datapackage_checksums"].keys(): | 240 | for game in message["datapackage_checksums"].keys(): |
@@ -779,3 +781,17 @@ func colorForItemType(flags): | |||
779 | return "#d63a22" | 781 | return "#d63a22" |
780 | else: # filler | 782 | else: # filler |
781 | return "#14de9e" | 783 | return "#14de9e" |
784 | |||
785 | |||
786 | func compareVersion(lhs, rhs): | ||
787 | if lhs["major"] == rhs["major"]: | ||
788 | if lhs["minor"] == rhs["minor"]: | ||
789 | return lhs["build"] < rhs["build"] | ||
790 | else: | ||
791 | return lhs["minor"] < rhs["minor"] | ||
792 | else: | ||
793 | return lhs["major"] < rhs["major"] | ||
794 | |||
795 | |||
796 | func wasGeneratedBeforeVersion(major, minor, build): | ||
797 | 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(): | |||
96 | 96 | ||
97 | wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map | 97 | wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map |
98 | 98 | ||
99 | # Turn THE COLORFUL into a cdp. | ||
100 | var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") | ||
101 | var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") | 99 | var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") |
102 | var colorful_cdp = cdp_auto_scene.instance() | 100 | if !apclient.wasGeneratedBeforeVersion(0, 4, 5): |
103 | colorful_cdp.name = "CountdownPanel_colorful" | 101 | # Turn THE COLORFUL into a cdp. |
104 | colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" | 102 | var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") |
105 | colorful_cdp.panels = "../../Panels/Doorways Room" | 103 | var colorful_cdp = cdp_auto_scene.instance() |
106 | colorful_cdp.translation = real_colorful.translation | 104 | colorful_cdp.name = "CountdownPanel_colorful" |
107 | colorful_cdp.rotation = real_colorful.rotation | 105 | colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" |
108 | get_node("CountdownPanels").add_child(colorful_cdp) | 106 | colorful_cdp.panels = "../../Panels/Doorways Room" |
109 | real_colorful.translation = Vector3(-51, -35, 35) # way under the map | 107 | colorful_cdp.translation = real_colorful.translation |
110 | get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() | 108 | colorful_cdp.rotation = real_colorful.rotation |
109 | get_node("CountdownPanels").add_child(colorful_cdp) | ||
110 | real_colorful.translation = Vector3(-51, -35, 35) # way under the map | ||
111 | get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() | ||
111 | 112 | ||
112 | # Set up The Master to be variable. | 113 | # Set up The Master to be variable. |
113 | var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") | 114 | var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") |