Reimplement Achievements interface

This commit is contained in:
LoafyLemon 2024-09-12 16:16:41 +01:00
parent 45695350c9
commit 352091267c
3 changed files with 108 additions and 308 deletions

File diff suppressed because it is too large Load Diff

View File

@ -59,6 +59,7 @@ default desk_OBJ = RoomObject(
"Do Paperwork": (Text("📝", align=(0.5, 0.5)), Jump("paperwork"), "states.paperwork_unlocked"), "Do Paperwork": (Text("📝", align=(0.5, 0.5)), Jump("paperwork"), "states.paperwork_unlocked"),
"Open Deck Builder": (Text("🃏", align=(0.5, 0.5)), Jump("deck_builder"), "states.cardgame.unlocked"), "Open Deck Builder": (Text("🃏", align=(0.5, 0.5)), Jump("deck_builder"), "states.cardgame.unlocked"),
"Open Cheats Menu": (Text("🕹️", align=(0.5, 0.5)), Jump("cheats"), "states.env.cheats"), "Open Cheats Menu": (Text("🕹️", align=(0.5, 0.5)), Jump("cheats"), "states.env.cheats"),
"Open Achievements Menu": (Text("⭐", align=(0.5, 0.5)), Jump("achievements"), "True"),
}, },
hovered=Show( hovered=Show(
"gui_tooltip", "gui_tooltip",

View File

@ -1,3 +1,12 @@
init python hide:
# keep the achievements from earlier versions
if isinstance(persistent.achievements, dict):
# id : [categoryname, title, description, unlocked, icon, secret]
for k, v in persistent.achievements.items():
if v[3]:
achievement.grant(k)
del persistent.achievements
init python: init python:
import requests import requests