extends Node2D func _ready(): if not get_tree().root.has_node("Root"): return ; GallerySingleton.AddImage("Death_Poison"); var whoDied = Dialogic.get_variable("6_Death_Poison") var path = "" match whoDied: "Green": path = "res://resources/graphics/backgrounds/death_poison/AgathaPoison.webp" GallerySingleton.AddImage("Death_Poison_Green"); "Purple": path = "res://resources/graphics/backgrounds/death_poison/DanaPoison.webp" GallerySingleton.AddImage("Death_Poison_Purple"); "Black": path = "res://resources/graphics/backgrounds/death_poison/Linda Poison.webp" GallerySingleton.AddImage("Death_Poison_Black"); "none": path = "res://resources/graphics/backgrounds/death_poison/HughPoison.webp" GallerySingleton.AddImage("Death_Poison_Hugh"); $Char.texture = load(path) func InitForGallery()->Array: scale = Vector2(0.5, 0.5) var amount = 0; var only = ""; var names = ["Death_Poison_Green", "Death_Poison_Purple", "Death_Poison_Black", "Death_Poison_Hugh"]; var res = []; for i in names: var unlocked = GallerySingleton.HaveImage(i); if unlocked: match i: "Death_Poison_Green": res.push_back("ui_name_green"); "Death_Poison_Purple": res.push_back("ui_name_purple"); "Death_Poison_Black": res.push_back("ui_name_black"); "Death_Poison_Hugh": res.push_back("ui_name_mc"); amount += 1; only = i; if amount == 1: var path = ""; match only: "Death_Poison_Green": path = "res://resources/graphics/backgrounds/death_poison/AgathaPoison.webp" "Death_Poison_Purple": path = "res://resources/graphics/backgrounds/death_poison/DanaPoison.webp" "Death_Poison_Black": path = "res://resources/graphics/backgrounds/death_poison/Linda Poison.webp" "Death_Poison_Hugh": path = "res://resources/graphics/backgrounds/death_poison/HughPoison.webp" $Char.texture = load(path); return []; else : var firstCharacter = tr(res[0]); SetSettings(firstCharacter) return res; func SetSettings(setting): var path = ""; if setting == tr("ui_name_green"): path = "res://resources/graphics/backgrounds/death_poison/AgathaPoison.webp"; elif setting == tr("ui_name_purple"): path = "res://resources/graphics/backgrounds/death_poison/DanaPoison.webp"; elif setting == tr("ui_name_black"): path = "res://resources/graphics/backgrounds/death_poison/Linda Poison.webp"; else : path = "res://resources/graphics/backgrounds/death_poison/HughPoison.webp"; $Char.texture = load(path)