Skip to content

Conversation

@Justin99x
Copy link
Contributor

Adds functionality for all registered save options to be reverted to default when a save file is loaded, before the custom save data is loaded into the options. This fixes an issue where characters with no custom save data inherited option values from whatever character was last loaded.

Grouped and nested options have all their children set to default recursively.

For GroupedOption and NestedOption, recursively sets all children to their default values.
"""
if isinstance(save_option, ValueOption):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: if you were to edit this code again I'd prefer using a match. Fine as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to edit this part anyway since it's causing the pyright issue. Not sure why IDE and pyright CLI checks are out of sync on this, but I've got my env set up to check the latter now too.

Think I need to do:
val_opt = cast(ValueOption[Any], save_option)

Are you okay with this? I know you mentioned trying to avoid casts since there's actual overhead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah seems we have to use it now...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect this comes from build 399

Extended reportUnknownVariableType check to include cases where a value whose type is a generic class parameterized by Unknown is assigned to a variable with a declared type.

Copy link
Collaborator

@apple1417 apple1417 left a comment

Choose a reason for hiding this comment

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

Please fix the typing issues from at least the save options dir - the rest can be separate.

Please also bump the version number and update the changelog.

@apple1417 apple1417 merged commit b78a4cd into bl-sdk:master May 8, 2025
12 checks passed
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