Skip to content

Commit

Permalink
Add support for Like a Dragon: Ishin!
Browse files Browse the repository at this point in the history
Closes #55
  • Loading branch information
Z1ni committed Jan 22, 2024
1 parent 4a2199a commit 4712f0b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Legend: ✅ Confirmed working, ❔ Unconfirmed, - Not available in the store
| High on Life |||
| Just Cause 4 |||
| Lies of P || - |
| Like a Dragon: Ishin! || - |
| Octopath Traveller |||
| Palworld |||
| Persona 5 Royal || - |
Expand Down
6 changes: 6 additions & 0 deletions games.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
"name": "Palworld",
"package": "PocketpairInc.Palworld_ad4psfrxyesvt",
"handler": "palworld"
},
// Like a Dragon: Ishin!
{
"name": "Like a Dragon: Ishin!",
"package": "SEGAofAmericaInc.ProjectMacan_s751p9cej88mt",
"handler": "like-a-dragon-ishin"
}
]
}
27 changes: 26 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,27 @@ def get_save_paths(
fpath = container["files"][0]["path"]
save_meta.append((fname, fpath))

elif handler_name == "like-a-dragon-ishin":
for container in containers:
path = PurePath(container["name"])
if path.name == "datasav":
fpath = path.with_name("data.sav")
elif path.name == "datasys":
fpath = path.with_name("data.sys")
else:
continue

for file in container["files"]:
if file["name"].lower() == "data":
save_meta.append((str(fpath), file["path"]))
elif file["name"].lower() == "icon":
save_meta.append(
(
str(fpath.with_name(f"{fpath.parent.name}_icon.png")),
file["path"],
)
)

else:
raise Exception('Unsupported XGP app "%s"' % store_pkg_name)

Expand Down Expand Up @@ -443,7 +464,11 @@ def main():

# Create a ZIP file
formatted_game_name = (
name.replace(" ", "_").replace(":", "_").replace("'", "").lower()
name.replace(" ", "_")
.replace(":", "_")
.replace("'", "")
.replace("!", "")
.lower()
)
timestamp = datetime.now().strftime("%Y-%m-%d_%H_%M_%S")
zip_name = "{}_{}_{}.zip".format(
Expand Down

0 comments on commit 4712f0b

Please sign in to comment.