-
Notifications
You must be signed in to change notification settings - Fork 85
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
save options in xml format #1704
base: master
Are you sure you want to change the base?
Conversation
renamed Options to SavedGameOptions Options are instant fields now.
I see legacy save is deleted - so this will upgrade legacy savefiles to XML and no going back? |
IMO, it's not the best idea but not so bad either. Depends on how it will be released. Upcoming game update (Dec 13, 2022) doesn't break anything in the mod (as opposed to previous patches) so theoretically user could use previous version but if I release both Test and Stable with the same version they won't have a chance to do so 😂 |
@krzychu124 @kvakvs to make it forward compatible I need to first save legacy and then save xml and then place it in the byte array. its not hard but could be a bit confusing and annoying to read. should I go ahead and do it? |
Wait for Krzychu's opinion, i think we do not need dual save format. Is that a realistic scenario when users from Epic games/where older game version is running, try and load new XML-only savegames? |
Legacy load is supported. |
Legacy save is deleted, i wonder if that is a very rare scenario when it is necessary and we can ignore it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you've tested the fix. It doesn't work for me, it's loading previous version (legacy), but after hot-reload it somehow loads the correct settings, so I have no idea what is going on. Maybe UI was build before the settings? I don't think so, since it wouldn't work before the change either.
So.. we partially need #1709 because of changes you've made in #1702, now the UI is not updated when value changes. On Hot-reload order of calls (read settings, init Settings screen) is different -> first load settings, then generate SettingsUI |
Convert to draft because I have not tested my fix. |
@krzychu124 do I have to use |
d81d704
to
92b0a59
Compare
if (!OptionsManager.Instance.LoadData(options ?? new byte[0])) { | ||
loadingSucceeded = false; | ||
if (!TMPELifecycle.IsNewGame) { | ||
if (Version <= 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a bug, or you should swap bodies because LoadData(data)
is loading XML Options (OPTIONS_ID
)
which does not exist if version is equal or lower than 3
fixes #562
saved game options are serialized as xml and then converted to byte[] data.
SavedGamePathFinderEdition
because it will it does not belong there and would make it difficult to set options as default for new games.TMPE.zip