* 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. */
| 2232 | * @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. |
| 2233 | */ |
| 2234 | void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override |
| 2235 | { |
| 2236 | if (!gui_scope && HasBit(data, 31) && this->vli.type == VL_SHARED_ORDERS) { |
| 2237 | /* Needs to be done in command-scope, so everything stays valid */ |
| 2238 | this->vli.SetIndex(GB(data, 0, 20)); |
| 2239 | this->window_number = this->vli.ToWindowNumber(); |
| 2240 | this->vehgroups.ForceRebuild(); |
| 2241 | return; |
| 2242 | } |
| 2243 | |
| 2244 | if (data == 0) { |
| 2245 | /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ |
| 2246 | this->vehgroups.ForceRebuild(); |
| 2247 | } else { |
| 2248 | this->vehgroups.ForceResort(); |
| 2249 | } |
| 2250 | } |
| 2251 | }; |
| 2252 | |
| 2253 | static WindowDesc _vehicle_list_desc[] = { |
nothing calls this directly
no test coverage detected