MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ApplyDefaults

Method ApplyDefaults

src/window.cpp:193–201  ·  view source on GitHub ↗

* Read default values from WindowDesc configuration an apply them to the window. */

Source from the content-addressed store, hash-verified

191 * Read default values from WindowDesc configuration an apply them to the window.
192 */
193void Window::ApplyDefaults()
194{
195 if (this->nested_root != nullptr && this->nested_root->GetWidgetOfType(WWT_STICKYBOX) != nullptr) {
196 if (this->window_desc.pref_sticky) this->flags.Set(WindowFlag::Sticky);
197 } else {
198 /* There is no stickybox; clear the preference in case someone tried to be funny */
199 this->window_desc.pref_sticky = false;
200 }
201}
202
203/**
204 * Compute the row of a widget that a user clicked in.

Callers 1

FinishInitNestedMethod · 0.95

Calls 2

GetWidgetOfTypeMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected