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

Launcher: handle apworld installation #3472

Merged
merged 7 commits into from
Jun 5, 2024
Merged

Conversation

Berserker66
Copy link
Member

@Berserker66 Berserker66 commented Jun 5, 2024

What is this fixing or adding?

Running Launcher with an APWorld will now install that APWorld. On Windows this can be triggered by double click an .apworld file.

How was this tested?

On Win10.

If this makes graphical changes, please attach screenshots.

image
image

Before:
image
After:
image

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jun 5, 2024
@Silvris
Copy link
Collaborator

Silvris commented Jun 5, 2024

It might be useful to detect if an apworld is frozen. The amount of frozen worlds released now is relatively low, but probably worth checking for.

Absolutely not worth delaying for, but I think discussions on what metadata an apworld should contain should probably restart, if nothing for the use case of "is this apworld a newer version to the one currently installed, and if so, prompt the user if they want to update instead of throwing an exception".

@Berserker66
Copy link
Member Author

This will deny frozen apworlds as they have an __init__.pyc instead of __init__.py

worlds/LauncherComponents.py Outdated Show resolved Hide resolved
worlds/LauncherComponents.py Outdated Show resolved Hide resolved
worlds/LauncherComponents.py Outdated Show resolved Hide resolved
worlds/LauncherComponents.py Outdated Show resolved Hide resolved
worlds/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@black-sliver black-sliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One sad part is that Launcher doesn't reload the worlds after installation (i.e. drag&drop it in and no new buttons appear)

if worlds.user_folder is None:
raise Exception("Custom Worlds directory appears to not be writable.")
for world_source in worlds.world_sources:
if apworld_path.samefile(world_source.resolved_path):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing - do you want to compare file content, or just make sure it doesn't try to have the same path in src and dst of copyfile? (because this doesn't compare content)

Copy link
Member Author

@Berserker66 Berserker66 Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention was preventing users from double clicking already installed apworlds and that mucking something up.

@Berserker66 Berserker66 merged commit 93cd137 into main Jun 5, 2024
28 checks passed
@Berserker66 Berserker66 deleted the launcher_apworld_installer branch June 5, 2024 23:36
wu4 pushed a commit to wu4/Archipelago that referenced this pull request Jun 6, 2024
agilbert1412 pushed a commit to agilbert1412/Archipelago that referenced this pull request Jun 13, 2024
jnschurig pushed a commit to Tranquilite0/Archipelago-SoulBlazer that referenced this pull request Jun 13, 2024
sflavelle pushed a commit to sflavelle/Archipelago-tgc that referenced this pull request Jun 20, 2024
qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants