You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 11, 2025. It is now read-only.
There are some things that might be improved in the settings department of duality:
First it seems that duality uses 2 approaches to storing settings.
EditorUserData.xml seems to use a completely separate code flow for writing to the settings file in DualityEditorApp.SaveUserData(). The file itself also has 2 <?xml version="1.0" encoding="utf-8"?> which I have never seen before in a single file. Maybe some hack around dockpanel behavior?
Other setting files are using the duality Serializer class to write to the files. They also use the .dat file extension instead of .xml
Second there's not a clear location for where saving and loading is implemented. Sometimes it happens in DualityApp or DualityEditorApp and other times it happens in the settings class itself. I think we might benefit from making a interface with Save and Load methods where these are implemented on the class itself as that would allow us to treat settings in a more generic way (such as here https://github.com/AdamsLair/duality/blob/master/Source/Editor/DualityEditor/DualityEditorApp.cs#L1012) and also clean up some code from the already big DualityApp and DualityEditorApp classes.
Thirdly because of how the serializer api works atm it always creates a new instance. This makes it impossible to put change events on the settings class itself because then you would also have to resubscribe to those events which kinda defeats the purpose. It might be beneficial if the serializer api could take a already existing instance and update that instance.
Summary
There are some things that might be improved in the settings department of duality:
First it seems that duality uses 2 approaches to storing settings.
EditorUserData.xmlseems to use a completely separate code flow for writing to the settings file inDualityEditorApp.SaveUserData(). The file itself also has 2<?xml version="1.0" encoding="utf-8"?>which I have never seen before in a single file. Maybe some hack around dockpanel behavior?Serializerclass to write to the files. They also use the.datfile extension instead of.xmlSecond there's not a clear location for where saving and loading is implemented. Sometimes it happens in
DualityApporDualityEditorAppand other times it happens in the settings class itself. I think we might benefit from making a interface with Save and Load methods where these are implemented on the class itself as that would allow us to treat settings in a more generic way (such as here https://github.com/AdamsLair/duality/blob/master/Source/Editor/DualityEditor/DualityEditorApp.cs#L1012) and also clean up some code from the already bigDualityAppandDualityEditorAppclasses.Thirdly because of how the serializer api works atm it always creates a new instance. This makes it impossible to put change events on the settings class itself because then you would also have to resubscribe to those events which kinda defeats the purpose. It might be beneficial if the serializer api could take a already existing instance and update that instance.