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

Core: hot reload components from installed apworld #3480

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

beauxq
Copy link
Collaborator

@beauxq beauxq commented Jun 6, 2024

What is this fixing or adding?

I saw this comment: #3472 (review)

New buttons appear in Launcher when you install apworld.

There are probably still some things that don't work without restarting the Launcher, but this covers a lot of what players will want to do.

How was this tested?

  • prepared a new button.apworld with nothing but a new component button
  • cleaned out template yaml directory
  • cleaned out lib directory (subversion dependencies)

  • run Launcher.py
    • This window stays open for all the remaining steps here. It is never closed.
  • drag button.apworld onto Launcher window
    • see button appear
  • press button
    • see effect of button (print to console)
  • drag ff6wc.apworld onto Launcher window
  • drag subversion.apworld onto Launcher window
  • press "Generate Template Options" button
    • see yamls for all these newly installed games
  • move FF6 and Subversion yamls to Players
  • press "Generate" button
    • see output zip
  • extract patch files
  • drag FF6 patch file onto Launcher window
    • patch file is created and SNIClient opens
  • close SNIClient
  • drag Subversion patch file onto Launcher window
    • patch file is created and SNIClient opens

did not test frozen

@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 6, 2024
Launcher.py Outdated Show resolved Hide resolved
Launcher.py Outdated Show resolved Hide resolved
worlds/LauncherComponents.py Outdated Show resolved Hide resolved
Launcher.py Show resolved Hide resolved
beauxq and others added 2 commits June 6, 2024 08:34
`Launcher` widget members default to `None` so they can be defined in `build`

`Launcher._refresh_components` is not wrapped

loaded world goes into `world_sources` so we can check if it's already loaded.
(`WorldSource` can be ordered now without trying to compare `None` and `float`)
(don't load empty directories so we don't detect them as worlds)
Comment on lines +127 to +133
found_already_loaded = False
for loaded_world in worlds.world_sources:
loaded_name = pathlib.Path(loaded_world.path).stem
if module_name == loaded_name:
found_already_loaded = True
break
if found_already_loaded:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Don't you dare tell me to use for else - I'm not doing it.

Copy link
Member

Choose a reason for hiding this comment

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

if only there was a way to get rid of the temp found_already_loaded

@@ -48,7 +49,7 @@ class WorldSource:
path: str # typically relative path from this module
is_zip: bool = False
relative: bool = True # relative to regular world import folder
time_taken: Optional[float] = None
time_taken: float = -1.0
Copy link
Member

Choose a reason for hiding this comment

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

Always smuggling in some typing fixes

Copy link
Collaborator Author

@beauxq beauxq Jun 6, 2024

Choose a reason for hiding this comment

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

This is a runtime error I ran into with the changes I made.
'<' not supported between instances of 'NoneType' and 'float'
because this dataclass says that it's ordered.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(The smuggled in was typings/schema/__init__.pyi - That has nothing to do with this PR.) 😛

worlds/LauncherComponents.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.

Thanks!

@black-sliver black-sliver merged commit 6bb1cce into ArchipelagoMW:main Jun 6, 2024
17 checks passed
wu4 pushed a commit to wu4/Archipelago that referenced this pull request Jun 6, 2024
* Core: hot reload components from installed apworld

* address PR reviews

`Launcher` widget members default to `None` so they can be defined in `build`

`Launcher._refresh_components` is not wrapped

loaded world goes into `world_sources` so we can check if it's already loaded.
(`WorldSource` can be ordered now without trying to compare `None` and `float`)
(don't load empty directories so we don't detect them as worlds)

* clarify that the installation is successful
agilbert1412 pushed a commit to agilbert1412/Archipelago that referenced this pull request Jun 13, 2024
* Core: hot reload components from installed apworld

* address PR reviews

`Launcher` widget members default to `None` so they can be defined in `build`

`Launcher._refresh_components` is not wrapped

loaded world goes into `world_sources` so we can check if it's already loaded.
(`WorldSource` can be ordered now without trying to compare `None` and `float`)
(don't load empty directories so we don't detect them as worlds)

* clarify that the installation is successful
jnschurig pushed a commit to Tranquilite0/Archipelago-SoulBlazer that referenced this pull request Jun 13, 2024
* Core: hot reload components from installed apworld

* address PR reviews

`Launcher` widget members default to `None` so they can be defined in `build`

`Launcher._refresh_components` is not wrapped

loaded world goes into `world_sources` so we can check if it's already loaded.
(`WorldSource` can be ordered now without trying to compare `None` and `float`)
(don't load empty directories so we don't detect them as worlds)

* clarify that the installation is successful
sflavelle pushed a commit to sflavelle/Archipelago-tgc that referenced this pull request Jun 20, 2024
* Core: hot reload components from installed apworld

* address PR reviews

`Launcher` widget members default to `None` so they can be defined in `build`

`Launcher._refresh_components` is not wrapped

loaded world goes into `world_sources` so we can check if it's already loaded.
(`WorldSource` can be ordered now without trying to compare `None` and `float`)
(don't load empty directories so we don't detect them as worlds)

* clarify that the installation is successful
qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
* Core: hot reload components from installed apworld

* address PR reviews

`Launcher` widget members default to `None` so they can be defined in `build`

`Launcher._refresh_components` is not wrapped

loaded world goes into `world_sources` so we can check if it's already loaded.
(`WorldSource` can be ordered now without trying to compare `None` and `float`)
(don't load empty directories so we don't detect them as worlds)

* clarify that the installation is successful
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