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

Method RebuildVisibleSettings

src/script/script_gui.cpp:320–332  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

318 * gui.ai_developer_tools is enabled.
319 */
320 void RebuildVisibleSettings()
321 {
322 this->visible_settings.clear();
323
324 for (const auto &item : *this->script_config->GetConfigList()) {
325 bool no_hide = !item.flags.Test(ScriptConfigFlag::Developer);
326 if (no_hide || _settings_client.gui.ai_developer_tools) {
327 this->visible_settings.push_back(&item);
328 }
329 }
330
331 this->vscroll->SetCount(this->visible_settings.size());
332 }
333
334 std::string GetWidgetString(WidgetID widget, StringID stringid) const override
335 {

Callers 1

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