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

Method OnQueryTextFinished

src/newgrf_gui.cpp:1162–1178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1160 }
1161
1162 void OnQueryTextFinished(std::optional<std::string> str) override
1163 {
1164 if (!str.has_value()) return;
1165
1166 SaveGRFPresetToConfig(*str, this->actives);
1167 this->grf_presets = GetGRFPresetList();
1168
1169 /* Switch to this preset */
1170 for (uint i = 0; i < this->grf_presets.size(); i++) {
1171 if (this->grf_presets[i] == str) {
1172 this->preset = i;
1173 break;
1174 }
1175 }
1176
1177 this->InvalidateData();
1178 }
1179
1180 /**
1181 * Updates the scroll bars for the active and inactive NewGRF lists.

Callers 1

OnClickMethod · 0.45

Calls 4

SaveGRFPresetToConfigFunction · 0.85
GetGRFPresetListFunction · 0.85
sizeMethod · 0.45
InvalidateDataMethod · 0.45

Tested by

no test coverage detected