-
Notifications
You must be signed in to change notification settings - Fork 286
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
Use duality serializer for editoruserdata #865
Use duality serializer for editoruserdata #865
Conversation
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 good overall 👍 Some change requests, see inline comments.
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.
Done with most of my own change requests and also restored the old settings behavior / wired up editor internals to the new settings container class.
There's one more refactoring I'd like to explore: Due to the non-trivial nature of saving editor data which is composed of the main container, all the plugin data objects and a serialized dock panel blob, I'd like to re-introduce the SaveUserData
/ LoadUserData
method pair, and add a similar one for AppData
, while at the same time having the public properties return the instance directly. This would remove the need to always write .Instance
as well. The advantage of having a shared interface for settings containers to allow unified saving still remains, it's just used internally.
I'll experiment with this locally to see if the result is a net improvement or not, will report back.
Okay, so I played around with this a bit and don't think this is a great way to go about this. Going forward, the
Now that I've worked on this a bit, I think it might make sense to include the content of the plugin PRs (i.e. the whole port of the plugin settings serialization) in this one and merge it all in one big step. Could be less noise and intermediate states on the master branch in the end. |
Looked into some of the cases of per-plugin user settings we'd need to port and found a tricky one in the
This would mean a really big number of various settings classes. Could mean a bit of boilerplate code - but then again, we get well-documented properties and a proper definition in return. Could be worth starting with the CamView port as a test case so we can be sure it won't get much worse after that. |
More examples have come up where a It could make sense to refactor those parts as part of the port, which would mean that the call would no longer be necessary - but in that case, every UI change would directly edit the settings object, theoretically requiring to call its To fix this, I'd propose to rename We could get rid of the whole |
One more thing to address: I'd honestly take a shortcut for this fix for now to keep workload low and wrap up this PR soon: Let's just add an Edit: Maybe a better naming for those events would be |
…untime changes of game settings again
Progress
Done. ToDo
|
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'm fine with a (squash-)merge based on the current state as long as the remaining ToDos are categorized in a new issue or PR when merging, I think the current state is solid enough to stand on its own, though individual merging would bump the priority of the followup PRs to not remain in this intermediate state for too long. Alternatively, we can do it all in this PR directly. Thoughts?
# Conflicts: # Source/Core/Duality/Audio/SoundDevice.cs
We could cherrypick/merge the commits for the other PR's into to this branch before merging this PR to master. The main reason I splitted them up is for reviewing purposes. |
Added a few more commits where I removed the need for explicit "Update XY" calls by subscribing to the settings event handlers instead. It should now be a simple Load / Save call in all cases. |
Okay, so after letting this sink in a bit, I think it would be better to merge this as-is and continue with individual PRs for porting the existing user data:
|
Changes:
EditorPlugin.GetDefaultUserData
.Editorplugins will be updated in separate PR's