Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portable Mode #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

FluentCoding
Copy link

@FluentCoding FluentCoding commented Oct 9, 2020

This pull request gives you the possibility to distribute the resulting configuration file with the replays by making the paths relative.
When the user saves a combo json somewhere, a folder called "replays" gets created in the folder of the combo json where a copy of every replay gets saved where a highlight has been found. It also forces the user to save the combo json into an empty folder for a cleaner structure (and for the zip feature).

This PR is directly related to this PR for Ishiikura for relative paths (to the json) support: project-slippi/Ishiiruka#202.

TODO:

  • Add ZIP functionality by asking the user at the end if he wants to compress the folder

image

@vinceau
Copy link
Owner

vinceau commented Oct 10, 2020

Thanks for the PR! A reminder that this PR will not be merged until project-slippi/Ishiiruka#202 first gets merged and is distributed with the Slippi Desktop App.

In regards to the changes, this isn't exactly how I envisioned this feature to behave. I wouldn't want the portablization of the combos.json + slp file zip compression to happen in the File Processor. I would rather that step to happen in the Playback Queue.

The Playback Queue should have two new buttons: Load Zip, and Save Zip.

Save Zip will open a "Save as" prompt, and once a path to a zip has been specified, it'll take the current items in the playback queue, copy them into the zip, and generate a combos.json with relative paths. I envision the zip file structure to look something like:

combos.zip
├── combos.json
└── slp
    ├── Game_1234.slp
    └── Game_5678.slp

Load Zip will open the "Open file" dialog prompt, and once a zip has been specified, unzip the items into a temp folder, and populate the playback queue with those files.

@FluentCoding
Copy link
Author

FluentCoding commented Oct 10, 2020

Hm, your idea seems to be cleaner. I'll do it in the next days and try to accomplish it!

@vinceau
Copy link
Owner

vinceau commented Oct 10, 2020

On second thought, I'm not sure having a Load Zip button is a good idea. If people end up loading the same zip (which could have many many files) several times it would unpack the same SLP files in the temp folder multiple times. I think it'd be better if a user with a zip file manually extracts the zip, and then uses the built-in Load JSON button to load the combos.json file.

@FluentCoding
Copy link
Author

On second thought, I'm not sure having a Load Zip button is a good idea. If people end up loading the same zip (which could have many many files) several times it would unpack the same SLP files in the temp folder multiple times. I think it'd be better if a user with a zip file manually extracts the zip, and then uses the built-in Load JSON button to load the combos.json file.

So only Save Zip? I mean, I could also do the loading in the memory and free it afterwards, I don't see the problem (if this works with NodeJS).

@FluentCoding
Copy link
Author

Btw it's actually possible with this package: https://www.npmjs.com/package/adm-zip

@FluentCoding
Copy link
Author

Or nvm, slippi ishiikura doesn't support it so forget it lol. Yh, we shouldn't do Load Zip then ig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants