Closed kianzarrin closed 1 year ago
I think I should make 2 more changes.
1- move UI option classes into options subfolder because the UI.helpers folder is getting crowded.
2- rename PersistTo
to Scope
because these options do not necessarily persist(eg: when used as debug switches).
does everyone agree?
I didn't move default values for global config because they are already handled by xml
how about this: https://github.com/CitiesSkylinesMods/TMPE/issues/1372 To me this PR is complete opposite and I don't see how it paves the path for xml serialization. Could you elaborate a little bit @kianzarrin ? IMO to make it useful for serialization, the rule is quite simple: make UI only an UI and don't hold any state inside, UI controls should be created on demand(now they are static...) always passing default value, e.g.: by creating UI control factory to keep everything in one place which also prevents partial initialization just because you forgot to call some method or set some value.
Partially addresses #1508. Paves the path to xml serialization of options. Store Default Value in
SerializableUIOptionBase
ReorganizedSerializableUIOptionBase<TVal, TUI, TComponent>
:<TVal, TUI, TComponent>
moved toSerializableUIOptionBase
to make it easier in future to write generic code.Note: no functional changes. TMPE.zip