Open
Conversation
Contributor
Author
|
I've added 10 tests that hopefully cover a sufficient number of setting combos to test this feature. |
wooferzfg
reviewed
Jun 9, 2024
| def enable_all_options(options: Options): | ||
| enable_all_progression_location_options(options) | ||
| # options.progression_locations | ||
| # options.excluded_locations |
Contributor
There was a problem hiding this comment.
Did you mean to leave these comments in?
Contributor
Author
There was a problem hiding this comment.
Yeah, I figured it was in the style of the test function to have all the options there, but the unmodified ones commented out. Like with randomized_gear/starting_gear.
Contributor
|
I got an error when running the Windows build: |
Owner
|
I fixed the pkg error on master, you can revert the workaround in wwrando.spec |
b8b0ea0 to
8920d90
Compare
3 tasks
8920d90 to
23bfee2
Compare
23bfee2 to
5e8e279
Compare
Also validates `excluded_locations` to ensure it only contains real locations. This change ensures consistency when `Options` is constructed directly (such as in tests).
Running the randomizer with `-noui` or creating `Options` in tests misses `__post_init__`, so move validation to `validate` which gets called by the randomizer itself. Also, dedup excluded locations during validation.
Most UI interactions call `update_settings` which will trigger a deepcopy of the item locations dict. This is an unnecessary cost for the purpose of safety, so add a parameter to `load_and_parse_item_locations` that allows it to skip the deepcopy. It's the responsibility of the caller to ensure the dict is not mutated. The default is to deepcopy and we only use `deepcopy=False` in 3 places where the dict is confirmed to not be mutated.
06259c2 to
0c2626d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR adds an "Excluded Locations" tab that lets users specify progression locations to be ignored by the randomizer.
The interface here is similar to selecting starting items from randomized items. On the "Excluded Locations" tab, the user can view all the progression locations for the settings selected from the main tab. They can use the buttons to move locations to the "Excluded Locations" side; locations on this side will be considered non-progress locations by the randomizer. Additionally, two filters are added for both progression and excluded locations, allowing the user to quickly find a location in the list. The filters do not affect the final value for either location list.
A few things to note:
I've also added zlib compression, alongside base64 encoding, for permalinks. This is optional. However, since each location adds a bit to the bitstring, it can get rather long. For the default settings and a seed name of A:
Before:
MS4xMC4wXzBjMjYyNmQAQQBJEFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAA+wLIJQAAAAAAAQBBAIAAAfter:
eJwz1DM00DOIN0g2MjMyS2FwZPAUCGAgEkgwMPxmOqEKZjMCtTYwAAA+DgbzIf any further revisions or clarifications are needed, please let me know.