Use repr and add explanation

it's weird to define a variable then openly mutate it (mutate the list values, that is)
I wonder if it could have unforeseen consequences
There may be when sharing saves : achievements unlocked in the system the save is created may get silently unlocked on the system the save gets loaded...
This commit is contained in:
Gouvernathor 2023-11-18 02:14:28 +01:00
parent f8251f921b
commit 7d4aa5f8fd

View File

@ -1,4 +1,5 @@
define achievements_dict = { define achievements_dict = {
# id : (categoryname, title, description, unlocked, icon, secret)
"unlockher": ["Characters", "Granger Danger", "Awarded for unlocking Hermione Granger.", False, "interface/icons/head/hermione.webp", False], "unlockher": ["Characters", "Granger Danger", "Awarded for unlocking Hermione Granger.", False, "interface/icons/head/hermione.webp", False],
"unlockcho": ["Characters", "Chang Dynasty", "Awarded for unlocking Cho Chang.", False, "interface/icons/head/cho.webp", False], "unlockcho": ["Characters", "Chang Dynasty", "Awarded for unlocking Cho Chang.", False, "interface/icons/head/cho.webp", False],
"unlocklun": ["Characters", "Looney Tunes", "Awarded for unlocking Luna Lovegood.", False, "interface/icons/head/luna.webp", False], "unlocklun": ["Characters", "Looney Tunes", "Awarded for unlocking Luna Lovegood.", False, "interface/icons/head/luna.webp", False],
@ -25,8 +26,8 @@ define achievements_dict = {
"flashback": ["Cardgame", "Flashback", "Awarded for retelling what actually happened...", False, "interface/icons/cards.webp", True], "flashback": ["Cardgame", "Flashback", "Awarded for retelling what actually happened...", False, "interface/icons/cards.webp", True],
"start": ["General", "Welcome to Hogwarts!", "Awarded for finishing the intro.", False, "interface/icon.webp", False], "start": ["General", "Welcome to Hogwarts!", "Awarded for finishing the intro.", False, "interface/icon.webp", False],
"export": ["General", "Sharing is caring", "Awarded for exporting an outfit through the wardrobe menu.", False, "interface/wardrobe/icons/load.webp", False], "export": ["General", "Sharing is caring", "Awarded for exporting an outfit through the wardrobe menu.", False, "interface/wardrobe/icons/load.webp", False],
"Credits": ["General", "New game, who this?", "Awarded for checking out the Credits Menu.", False, "interface/icons/silver_scroll.webp", False], "Credits": ["General", "New game, who this?", "Awarded for checking out the Credits Menu.", False, "interface/icons/silver_scroll.webp", False],
"Cardwin": ["Cardgame", "Time to duel", "Awarded for winning your first Card game duel.", False, "interface/icons/cards.webp", False], "Cardwin": ["Cardgame", "Time to duel", "Awarded for winning your first Card game duel.", False, "interface/icons/cards.webp", False],
"puzzle": ["General", "Down the hatch!", "Awarded for wasting a bottle of unbelievably rare phoenix tears by drinking it.", False, "interface/icons/item_potion.webp", True], "puzzle": ["General", "Down the hatch!", "Awarded for wasting a bottle of unbelievably rare phoenix tears by drinking it.", False, "interface/icons/item_potion.webp", True],
"ending": ["General", "Bittersweet Farewell", "Awarded for reaching the original ending.", False, "interface/icons/silver.webp", True], "ending": ["General", "Bittersweet Farewell", "Awarded for reaching the original ending.", False, "interface/icons/silver.webp", True],
#1.37 HG achievements #1.37 HG achievements
@ -55,7 +56,7 @@ init python:
"""Check if icons are loadable at init""" """Check if icons are loadable at init"""
for i in self.achievements.values(): for i in self.achievements.values():
if not renpy.loadable(i[4]): if not renpy.loadable(i[4]):
raise IOError("\"{}\"".format(i[4])) raise IOError(repr(i[4]))
def attempt_repair(self): def attempt_repair(self):
"""Achievements are kept in a persistent state which is shared across versions, """Achievements are kept in a persistent state which is shared across versions,