Closed ronso0 closed 1 hour ago
About the inline TODO:
Currently manifests are split into visible/hidden by DlgPrefEffects only (here). And this PR adds similiar actions to EffectsManager::saveEffectsXml()
.
We may keep it that way, or refactor/split VisibleEffectsList in order to have member pointers to both lists in EffectsManager
and simply call getList()
when saving to xml.
Wdyt?
refactor/split VisibleEffectsList in order to have member pointers to both lists in EffectsManager and simply call getList() when saving to xml.
What do you think about refactoring the VisibleEffectsList
, so its just EffectsList
which then manages the hidden vs visible effects internally (enforcing the constraint that the visible and hidden effectslists are disjunct)? That would allow keeping EffectsManager simpler. Alternatively, having VisibleEffectsList
and HiddenEffectsList
would also be an option, though I'm skeptical that that would introduce a lot of boilerplate.
Yeah that could work but I can't promise to work on that soonish.
Alternatively, having
VisibleEffectsList
andHiddenEffectsList
would also be an option, though I'm skeptical that that would introduce a lot of boilerplate.
Well, the difference is only the xml node name for read/write and one else branch when reading. So both could be derived from a common EffectsList. Though, we actually need HiddenEffectsList only for read/write, no unit is accessing that list otherwise (via at(), next() etc.)
Yeah, idk. I can't decide on the best solution either.
After all, this is a TO DO ; p I'll add some more..
As long as the current solution works we should merge it to make the new effects visible. I'll definitely take another look during beta.
Thanks for your review @daschuer. Your comments pretty much point to the refactoring we discussed above.
I'll see what I can do with minimal effort.
Since this is a bug fix it can go to the 2.5 branch at any time. I move that to the 2.5.0 milestone and proceed with the 2.5-beta release.
Well, it's ready. Merge whenever it fits.
Since 2.5 beta is out now, lets merge this into 2.5.
Fixes #11343
Add
HiddenEffects
to effects.xmlSmall one-time issue after upgrade: (new) effects that users have set visible and then set hidden again will now be set visible again :man_shrugging: