From 44e7b3c844fe2d2e54c118648e30c2c5a693203c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 5 Jan 2024 08:14:25 -0500 Subject: Copy panel proxying from AP --- randomizer/extradata.gd | 95 +++++++++++++++++++++++++++++++++++++++++++ randomizer/load.gd | 20 +++++++++ randomizer/settings_screen.gd | 5 +++ 3 files changed, 120 insertions(+) create mode 100644 randomizer/extradata.gd diff --git a/randomizer/extradata.gd b/randomizer/extradata.gd new file mode 100644 index 0000000..89c41d2 --- /dev/null +++ b/randomizer/extradata.gd @@ -0,0 +1,95 @@ +extends Node + +var proxies = { + "Synonym Room/Panel_compose_write": ["Synonym Room/Panel_record_write"], + "Synonym Room/Panel_duplicate_same": ["Synonym Room/Panel_identical_same"], + "Synonym Room/Panel_giggle_laugh": ["Synonym Room/Panel_chuckle_laugh"], + "Synonym Room/Panel_plunge_fall": ["Synonym Room/Panel_autumn_fall"], + "Heteronym Room/Panel_mine_mine": ["Heteronym Room/Panel_mine_mine_2"], + "Heteronym Room/Panel_mobile_mobile": ["Heteronym Room/Panel_mobile_mobile_2"], + "Heteronym Room/Panel_sow_so": ["Heteronym Room/Panel_sow_sow"], + "Heteronym Room/Panel_desert_dessert": ["Heteronym Room/Panel_desert_desert"], + "Heteronym Room/Panel_two_too": ["Heteronym Room/Panel_two_to"], + "Heteronym Room/Panel_not_naught": ["Heteronym Room/Panel_not_knot"], + "Truncate Room/Panel_needle_eye": ["Truncate Room/Panel_face_eye"], + "Truncate Room/Panel_undead_dead": ["Truncate Room/Panel_deadline_dead"], + "Truncate Room/Panel_landmass_mass": ["Truncate Room/Panel_massacred_mass"], + "Truncate Room/Panel_mouth_teeth": ["Truncate Room/Panel_saw_teeth"], + "Blue Room/Panel_mouth_face": ["Blue Room/Panel_eye_face"], + "Blue Room/Panel_ice_eyesight": ["Blue Room/Panel_height_eyesight"], + "Blue Room/Panel_just_readjust": ["Blue Room/Panel_read_readjust"], + "Blue Room/Panel_continent_planet": ["Blue Room/Panel_ocean_planet"], + "Sun Room/Panel_warred_drawer": ["Sun Room/Panel_redraw_drawer"], + "Sun Room/Panel_stone_notes": ["Sun Room/Panel_onset_notes"], + "Sun Room/Panel_tsar_star": ["Sun Room/Panel_arts_star"], + "Sun Room/Panel_dare_read": ["Sun Room/Panel_dear_read"], + "Shuffle Room/Panel_amen_mean": ["Shuffle Room/Panel_name_mean"], + "Look Room/Panel_blue_hi": ["Look Room/Panel_blue_hi2"], + "Rhyme Room/Panel_move_love": ["Rhyme Room/Panel_stove_love"], + "Rhyme Room/Panel_sweat_great": ["Rhyme Room/Panel_beat_great"], + "Rhyme Room/Panel_knight_write": ["Rhyme Room/Panel_byte_write"], + "Rhyme Room/Panel_chair_bear": ["Rhyme Room/Panel_cost_most"], + "Double Room/Panel_ascend_rhyme": ["Double Room/Panel_ascend_syn"], + "Double Room/Panel_double_rhyme": ["Double Room/Panel_double_syn"], + "Double Room/Panel_blocked_rhyme": ["Double Room/Panel_blocked_syn"], + "Double Room/Panel_rise_rhyme": ["Double Room/Panel_rise_syn"], + "Double Room/Panel_crystal_rhyme": ["Double Room/Panel_crystal_syn"], + "Double Room/Panel_creative_rhyme": ["Double Room/Panel_creative_syn"], + "Double Room/Panel_child_rhyme": ["Double Room/Panel_child_syn"], + "Double Room/Panel_hidden_rhyme": ["Double Room/Panel_hidden_syn"], + "Double Room/Panel_word_rhyme": ["Double Room/Panel_word_whole"], + "Double Room/Panel_silent_rhyme": ["Double Room/Panel_silent_syn"], + "Double Room/Panel_bones_rhyme": ["Double Room/Panel_bones_syn"], + "Double Room/Panel_sentence_rhyme": ["Double Room/Panel_sentence_whole"], + "Double Room/Panel_dream_rhyme": ["Double Room/Panel_dream_syn"], + "Double Room/Panel_mystery_rhyme": ["Double Room/Panel_mystery_syn"], + "Double Room/Panel_jump_rhyme": ["Double Room/Panel_jump_syn"], + "Double Room/Panel_fall_rhyme": ["Double Room/Panel_fall_syn"], + "Double Room/Panel_return_rhyme": ["Double Room/Panel_return_ant"], + "Double Room/Panel_descend_rhyme": ["Double Room/Panel_descend_ant"], + "Hallway Room/Panel_castle_1": + ["Hallway Room/Panel_castle_2", "Hallway Room/Panel_castle_3", "Hallway Room/Panel_castle_4"], + "Hallway Room/Panel_counterclockwise_1": + [ + "Hallway Room/Panel_counterclockwise_2", + "Hallway Room/Panel_counterclockwise_3", + "Hallway Room/Panel_counterclockwise_4" + ], + "Hallway Room/Panel_transformation_1": + [ + "Hallway Room/Panel_transformation_2", + "Hallway Room/Panel_transformation_3", + "Hallway Room/Panel_transformation_4" + ], + "Smiley Room/Panel_soundgram_1": ["Smiley Room/Panel_anagram_9_1"], + "Hangry Room/Panel_red_mid_5": ["Hangry Room/Panel_red_bot_5"], + "Hangry Room/Panel_red_mid_4": ["Hangry Room/Panel_red_bot_4"], + "Ceiling Room/Panel_blue_top_1": ["Ceiling Room/Panel_red_bot_1"], + "Ceiling Room/Panel_red_mid_2": ["Ceiling Room/Panel_blue_bot_2"], + "Ceiling Room/Panel_red_bot_3": ["Ceiling Room/Panel_blue_mid_3"], + "Ceiling Room/Panel_red_top_4": ["Ceiling Room/Panel_blue_mid_4"], + "Ceiling Room/Panel_blue_bot_5": ["Ceiling Room/Panel_yellow_top_5"], + "Ceiling Room/Panel_yellow_mid_6": ["Ceiling Room/Panel_blue_top_6"], + "Ceiling Room/Panel_blue_mid_7": ["Ceiling Room/Panel_yellow_bot_7"], + "Ceiling Room/Panel_black_bot_8": ["Ceiling Room/Panel_yellow_mid_8"], + "Ceiling Room/Panel_black_top_9": ["Ceiling Room/Panel_yellow_bot_9"], + "Ceiling Room/Panel_yellow_top_10": ["Ceiling Room/Panel_black_bot_10"], + "Ceiling Room/Panel_black_top_11": ["Ceiling Room/Panel_yellow_mid_11"], + "Ceiling Room/Panel_black_top_12": ["Ceiling Room/Panel_red_bot_12"], + "Ceiling Room/Panel_black_bot_13": ["Ceiling Room/Panel_red_top_13"], + "Ceiling Room/Panel_black_mid_14": ["Ceiling Room/Panel_red_bot_14"], + "Ceiling Room/Panel_black_top_15": ["Ceiling Room/Panel_red_mid_15"], + "Chemistry Room/Panel_blue_bot_3": + ["Chemistry Room/Panel_blue_bot_2", "Chemistry Room/Panel_blue_bot_4"], + "Chemistry Room/Panel_blue_bot_6": ["Chemistry Room/Panel_blue_bot_5"], + "Chemistry Room/Panel_blue_top_1": ["Chemistry Room/Panel_blue_top_2"], + "Chemistry Room/Panel_biology_4": ["Chemistry Room/Panel_biology_8"], + "Chemistry Room/Panel_physics_8": ["Chemistry Room/Panel_physics_5"], + "Chemistry Room/Panel_physics_7": ["Chemistry Room/Panel_physics_4"], + "Chemistry Room/Panel_physics_6": ["Chemistry Room/Panel_physics_3"], + "Chemistry Room/Panel_physics_2": ["Chemistry Room/Panel_physics_1"], + "Chemistry Room/Panel_physics_9": ["Chemistry Room/Panel_biology_10"], + "Challenge Room/Panel_bread_mold": ["Challenge Room/Panel_strawberries_mold"], + "Open Areas/Panel_rise_horizon": ["Open Areas/Panel_son_horizon"], + "Open Areas/Panel_son_sunrise": ["Open Areas/Panel_rise_sunrise"] +} diff --git a/randomizer/load.gd b/randomizer/load.gd index 7f08814..c14332c 100644 --- a/randomizer/load.gd +++ b/randomizer/load.gd @@ -104,6 +104,26 @@ func _load(): "../../../Panels/Countdown Panels/Panel_1234567890_wanderlust" ] + # Make stack/double puzzles into proxies. + var proxyscript = load("res://scripts/panelProxy.gd") + + var extradata_proxies = randomizer.get_node("Extradata").proxies + for truepanel in extradata_proxies: + var proxies = extradata_proxies[truepanel] + for proxypanel in proxies: + var proxynode = panels_parent.get_node(proxypanel) + var oldparent = proxynode.get_parent() + oldparent.remove_child(proxynode) + var oldtext = proxynode.text + var oldanswer = proxynode.answer + proxynode.set_script(proxyscript) + proxynode.text = oldtext + proxynode.answer = oldanswer + proxynode.proxied_panels = ["../../%s" % truepanel] + proxynode.exact_proxy = true + proxynode.request_ready() + oldparent.add_child(proxynode) + # Proceed with the rest of the load. global._print("Hooked Load End") ._load() diff --git a/randomizer/settings_screen.gd b/randomizer/settings_screen.gd index 708b4ef..842b046 100644 --- a/randomizer/settings_screen.gd +++ b/randomizer/settings_screen.gd @@ -20,6 +20,11 @@ func _ready(): generated_puzzles_instance.name = "GeneratedPuzzles" randomizer_instance.add_child(generated_puzzles_instance) + var extradata = ResourceLoader.load("user://maps/randomizer/extradata.gd") + var extradata_instance = extradata.new() + extradata_instance.name = "Extradata" + randomizer_instance.add_child(extradata_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")) -- cgit 1.4.1