feat: unlock in-game galleries per owned version
This commit is contained in:
1 parent
e14184435c
commit
19924e1c5a
21 files changed
+977
-395
No files matched your search
@@ -0,0 +1,22 @@
|
||||
"""Gallery support for converted games; never changes scripts or story progress."""
|
||||
from app.translation import file_json
|
||||
|
||||
|
||||
def available(manifest: dict | None) -> bool:
|
||||
if not manifest or "game.json" not in manifest.get("files", {}):
|
||||
return False
|
||||
game = file_json(manifest, "game.json")
|
||||
if game.get("engine") not in (None, "renpy") or game.get("runtime"):
|
||||
return False
|
||||
screens = game.get("screens", {})
|
||||
if game.get("build", {}).get("name") == "MIST" and "rewatchgirlselectscreen" in screens:
|
||||
return True
|
||||
|
||||
def uses_gallery(value):
|
||||
if isinstance(value, dict):
|
||||
if value.get("k") == "call" and value.get("f", {}).get("k") == "name" and value["f"].get("id") in {"Gallery", "Replay"}:
|
||||
return True
|
||||
return any(uses_gallery(item) for item in value.values())
|
||||
return isinstance(value, list) and any(uses_gallery(item) for item in value)
|
||||
|
||||
return uses_gallery(game.get("init", [])) or uses_gallery(screens) or uses_gallery(game.get("defaults", []))
|
||||
Reference in new issue
Block a user