0x0048F210
| 296 | |
| 297 | // 0x0048F210 |
| 298 | Window* open(StationId stationId) |
| 299 | { |
| 300 | auto window = WindowManager::bringToFront(WindowType::station, enumValue(stationId)); |
| 301 | if (window != nullptr) |
| 302 | { |
| 303 | if (ToolManager::isToolActive(window->type, window->number)) |
| 304 | { |
| 305 | ToolManager::toolCancel(); |
| 306 | } |
| 307 | |
| 308 | window = WindowManager::bringToFront(WindowType::station, enumValue(stationId)); |
| 309 | } |
| 310 | |
| 311 | if (window == nullptr) |
| 312 | { |
| 313 | // 0x0048F29F start |
| 314 | const WindowFlags newFlags = WindowFlags::resizable | WindowFlags::lighterFrame; |
| 315 | window = WindowManager::createWindow(WindowType::station, Station::kWindowSize, newFlags, Station::getEvents()); |
| 316 | window->number = enumValue(stationId); |
| 317 | auto station = StationManager::get(stationId); |
| 318 | window->owner = station->owner; |
| 319 | window->minWidth = Common::kMinWindowSize.width; |
| 320 | window->minHeight = Common::kMinWindowSize.height; |
| 321 | window->maxWidth = Common::kMaxWindowSize.width; |
| 322 | window->maxHeight = Common::kMaxWindowSize.height; |
| 323 | |
| 324 | window->savedView.clear(); |
| 325 | |
| 326 | auto skin = ObjectManager::get<InterfaceSkinObject>(); |
| 327 | window->setColour(WindowColour::secondary, skin->windowPlayerColor); |
| 328 | // 0x0048F29F end |
| 329 | } |
| 330 | |
| 331 | window->currentTab = Common::widx::tab_station - Common::widx::tab_station; |
| 332 | window->invalidate(); |
| 333 | |
| 334 | // We'll need the vehicle list to determine what vehicle tabs to show |
| 335 | VehiclesStopping::populateVehicleList(*window); |
| 336 | |
| 337 | window->setWidgets(Station::widgets); |
| 338 | window->holdableWidgets = 0; |
| 339 | window->eventHandlers = &Station::getEvents(); |
| 340 | window->activatedWidgets = 0; |
| 341 | window->disabledWidgets = 0; |
| 342 | window->initScrollWidgets(); |
| 343 | Station::initViewport(*window); |
| 344 | |
| 345 | return window; |
| 346 | } |
| 347 | |
| 348 | void reset() |
| 349 | { |
no test coverage detected