HomeWildfire Games

Change GUI settings to explicitly be member variables.

Description

Change GUI settings to explicitly be member variables.

Completes work starting in D2313 / rP23005:

  • Make C++ mistakes where values can be changed without messages being sent easier to notice / harder to do.
  • Make the IGUISetting interface more flexible, allowing custom settings implementing their own logic. This is used to clean up hotkey code introduced in rP22845.

Side effects:

  • FromJSVal_Vector clears the vector being passed in. I have some vague memory of not doing that in D24 / rP19115 as an optimisation, but it seems more like a footgun to me.
  • Most usage of SetSettingFromString is replaced by direct method calls, as we can generally cast to the proper GUI object type. Where we can't, it is kept as a poor's man virtual dispatch.
  • It moves a few member variables elsewhere, e.g. TextOwner now gets its own member variable settings.

Differential Revision: https://code.wildfiregames.com/D3892

Event Timeline

Langbart raised a concern with this commit.May 7 2021, 7:00 AM
Langbart added a subscriber: Langbart.

I noticed some errors when popLimit is reached. #6173

This commit now has outstanding concerns.May 7 2021, 7:00 AM
wraitii added a comment.EditedMay 7 2021, 9:00 AM

I noticed some errors when popLimit is reached. #6173

That sounds more like rP25365
Edit: nope, you're right, though the stack trace is indeed from rP25365

Langbart resigned from this commit.May 7 2021, 12:28 PM

see D3937 - Fix rP25392 - CGUIColor setting

This commit no longer requires audit.May 7 2021, 12:28 PM