Page MenuHomeWildfire Games

Forward constructor arguments to AddSetting
AbandonedPublic

Authored by elexis on Sep 1 2019, 12:20 AM.

Details

Reviewers
None
Summary

Some GUI Object classes call AddSetting and immediately afterwards set the value of the setting to some default.
It seems this is indirection - one could just create the object with the correct value in place instead of doing it in two steps.
This also means that the code is more grouped.

Test Plan

Notice that there is a behavior change - the GUIM_SETTINGS_UPDATED message is not sent anymore in the constructor.
As far as I see this might not be a problem, but perhaps for some cases it might.
Notice that this patch might actually turn out to be impossible due to linking issues, because the compiler doesnt know in advance which template specializations to generate;
and because some Setting value classes (CGUIColor) are noncopyable.

Event Timeline

elexis created this revision.Sep 1 2019, 12:20 AM
elexis planned changes to this revision.Sep 1 2019, 12:20 AM

This doesn't work currently.
The patch might be impossible even.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/21/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/530/display/redirect

elexis abandoned this revision.Sep 27 2019, 2:52 PM

Initial setting values now provided in the class constructor following D2313, and don't need magic for that but only initializer list.