Skip to content

Conversation

@Justin99x
Copy link
Contributor

Module that enables saving arbitrary json-encodable data directly to the character save file. Original issue here:
#1

The module extends mods_base.ValueOption and its subclasses by adding a set of SaveOption classes. The classes behave almost exactly like their parents, except their values are saved to the save file instead of to the mod's settings file.

Some changes to note since apple's informal code review a few weeks ago:

  • Updated mods_base submodule to latest commit that includes _to_json() and _from_json() methods for all options.
  • Added an optional on_load callback that that runs as a post hook to LoadPlayerSaveGame. This allows for applying any custom save data to the character immediately after the regular save data has been applied.
  • GroupedOption and NestedOption are handled by checking if every child is either Grouped/Nested or a Save Option. If so, it can be registered as a save option. The new _(to|from)_json() methods are used to convert the values to JSON.

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.

Looks like most of the errors, bar the one spelling, are unrelated, and just broke due to newer releases. I'll get a fix in for them soon-ish.

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 merge in/rebase on top of current master, which should fix the unrelated errors. Will merge when all checks pass.

@apple1417 apple1417 merged commit 5d15cdf into bl-sdk:master Mar 27, 2025
11 of 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