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

Method RebuildVisibleSettings

src/game/game_gui.cpp:124–136  ·  view source on GitHub ↗

* Rebuilds the list of visible settings. GS settings with the flag * GSCONFIG_GS_DEVELOPER set will only be visible if the game setting * gui.ai_developer_tools is enabled. */

Source from the content-addressed store, hash-verified

122 * gui.ai_developer_tools is enabled.
123 */
124 void RebuildVisibleSettings()
125 {
126 this->visible_settings.clear();
127
128 for (const auto &item : *this->gs_config->GetConfigList()) {
129 bool no_hide = !item.flags.Test(ScriptConfigFlag::Developer);
130 if (no_hide || _settings_client.gui.ai_developer_tools) {
131 this->visible_settings.push_back(&item);
132 }
133 }
134
135 this->vscroll->SetCount(this->visible_settings.size());
136 }
137
138 void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
139 {

Callers 2

GSConfigWindowMethod · 0.95
OnInvalidateDataMethod · 0.95

Calls 6

TestMethod · 0.80
push_backMethod · 0.80
clearMethod · 0.45
GetConfigListMethod · 0.45
SetCountMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected