From 15f0dd00a39f6d3abcb81ff1cd338c84c9c3ebce Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 27 May 2023 12:04:27 -0400 Subject: Painting names are loaded from the game now This makes us update-resistant because we automatically get access to new paintings, and also it prevents issues where the names in the mod do not line up with the game's names, which have caused crashes in at least one MW. --- Archipelago/load.gd | 32 +++++++- Archipelago/paintingdata.gd | 189 -------------------------------------------- 2 files changed, 28 insertions(+), 193 deletions(-) delete mode 100644 Archipelago/paintingdata.gd (limited to 'Archipelago') diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 6860de7..72bbd15 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -1,5 +1,21 @@ extends "res://scripts/load.gd" +const EXCLUDED_PAINTINGS = [ + "ascension.tscn", + "ascension_ne.tscn", + "ascension_nw.tscn", + "ascension_se.tscn", + "ascension_sw.tscn", + "frame.tscn", + "scenery_0.tscn", + "scenery_1.tscn", + "scenery_2.tscn", + "scenery_3.tscn", + "scenery_4.tscn", + "scenery_5.tscn", + "pilgrim.tscn" +] + func _load(): global._print("Hooked Load Start") @@ -195,13 +211,21 @@ func _load(): # Randomize the paintings, if necessary. if apclient._painting_shuffle: - var pd_script = ResourceLoader.load("user://maps/Archipelago/paintingdata.gd") - var pd = pd_script.new() + var paintings_dir = Directory.new() + var all_paintings = [] + if paintings_dir.open("res://nodes/paintings") == OK: + paintings_dir.list_dir_begin() + var file_name = paintings_dir.get_next() + while file_name != "": + if file_name.ends_with(".tscn") and not EXCLUDED_PAINTINGS.has(file_name): + all_paintings.append(file_name.trim_suffix(".tscn")) + file_name = paintings_dir.get_next() + paintings_dir.list_dir_end() + + var pd = Node.new() pd.set_name("AP_Paintings") self.add_child(pd) - var all_paintings = pd.kALL_PAINTINGS - var classes = {} for painting in apclient._paintings_mapping.values(): if not classes.has(painting): diff --git a/Archipelago/paintingdata.gd b/Archipelago/paintingdata.gd deleted file mode 100644 index f82063d..0000000 --- a/Archipelago/paintingdata.gd +++ /dev/null @@ -1,189 +0,0 @@ -extends Node - -const kALL_PAINTINGS = [ - "arrows", - "beach", - "bg_1_stonks", - "bg_alison", - "bg_aquatechture", - "bg_automata", - "bg_barbell", - "bg_basketball", - "bg_bass", - "bg_bee", - "bg_bg1", - "bg_bg2", - "bg_bg3", - "bg_bg4", - "bg_bg5", - "bg_bg6", - "bg_bg7", - "bg_bg8", - "bg_bookshelf", - "bg_boxer", - "bg_box_black", - "bg_box_blue", - "bg_box_green", - "bg_box_orange", - "bg_box_purple", - "bg_box_red", - "bg_box_white", - "bg_bread", - "bg_breakfast", - "bg_breakout", - "bg_bright_square", - "bg_bush", - "bg_candle", - "bg_cannoe", - "bg_cannon", - "bg_car", - "bg_cat", - "bg_champion", - "bg_cheese", - "bg_chomp", - "bg_colin", - "bg_colorcentric", - "bg_cooking", - "bg_cow", - "bg_david", - "bg_distant_planet", - "bg_dragon_scale", - "bg_duck", - "bg_egg", - "bg_emt", - "bg_enigma", - "bg_farmer", - "bg_feeling_still", - "bg_fish2", - "bg_fish", - "bg_flowbot", - "bg_fourth", - "bg_fractured", - "bg_frog", - "bg_gene", - "bg_good_morning_sun", - "bg_good_night_moon", - "bg_grave", - "bg_great_wave", - "bg_grooves", - "bg_growth", - "bg_halloween_2", - "bg_hammering", - "bg_hazard", - "bg_hilbert", - "bg_interconnection", - "bg_in_the_weeds", - "bg_jhon", - "bg_knight", - "bg_knight_night", - "bg_laboratory", - "bg_life", - "bg_lingo", - "bg_long_nose", - "bg_magic_trick", - "bg_manifold_tree", - "bg_margret", - "bg_marshmallow", - "bg_mona_lisa", - "bg_moonbound", - "bg_mountain", - "bg_nose", - "bg_notnerb", - "bg_pear", - "bg_pearson", - "bg_pencils", - "bg_penguin", - "bg_planet_eclipse", - "bg_planet_gas_giant", - "bg_planet_ringed", - "bg_quarterly_review", - "bg_rabbit", - "bg_reacher", - "bg_roboworker", - "bg_sandcastle", - "bg_sax", - "bg_scorpion", - "bg_sheryl", - "bg_skew_tree", - "bg_snow_day", - "bg_spare", - "bg_sport_shirt", - "bg_squares", - "bg_stained_glass", - "bg_stakeout", - "bg_starry_night", - "bg_sub", - "bg_sushi", - "bg_taco", - "bg_talking", - "bg_teris", - "bg_timmy", - "bg_tomato", - "bg_trumpet", - "bg_two_tall", - "bg_watermelon", - "bg_waves", - "bg_wrench", - "blueman", - "boxes", - "catlike", - "cherry", - "clock", - "colors", - "crep", - "crown", - "egg", - "eight", - "electrons", - "emmy", - "ether", - "eyes", - "eyesyellow", - "flower", - "fruitbowl", - "garden", - "gardenexploded", - "hatkirby", - "hatman", - "hi", - "hi_solved", - "icy", - "ig_note", - "ig_rose", - "kiwi", - "knot", - "map", - "maze", - "mittens", - "ninjonicx", - "ninjonicx_square", - "noka", - "ntwiles", - "owl", - "panda", - "pattern_gold", - "pattern_gray", - "pattern_icely", - "pattern_purple", - "pattern_solar", - "pencil", - "rainbow", - "redman", - "rever", - "rm_tower", - "rubrica", - "samswine", - "smile", - "smile_red", - "snowman", - "symmetry", - "symmetry_2", - "taiji", - "tree", - "tst_box_black_lav", - "tst_box_magenta", - "tst_box_mint", - "undalevein", - "yinyang", - "zombie" -] -- cgit 1.4.1