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

Method OnInvalidateData

src/industry_gui.cpp:1162–1172  ·  view source on GitHub ↗

* Some data on this window has become invalid. * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */

Source from the content-addressed store, hash-verified

1160 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
1161 */
1162 void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
1163 {
1164 if (!gui_scope) return;
1165 const Industry *i = Industry::Get(this->window_number);
1166 if (IsProductionAlterable(i)) {
1167 const IndustrySpec *ind = GetIndustrySpec(i->type);
1168 this->editable = ind->UsesOriginalEconomy() ? EA_MULTIPLIER : EA_RATE;
1169 } else {
1170 this->editable = EA_NONE;
1171 }
1172 }
1173
1174 bool IsNewGRFInspectable() const override
1175 {

Callers

nothing calls this directly

Calls 3

IsProductionAlterableFunction · 0.85
GetIndustrySpecFunction · 0.85
UsesOriginalEconomyMethod · 0.80

Tested by

no test coverage detected