0x00456D2D
| 309 | |
| 310 | // 0x00456D2D |
| 311 | Window* open(IndustryId industryId) |
| 312 | { |
| 313 | auto window = WindowManager::bringToFront(WindowType::industry, enumValue(industryId)); |
| 314 | if (window != nullptr) |
| 315 | { |
| 316 | if (ToolManager::isToolActive(window->type, window->number)) |
| 317 | { |
| 318 | ToolManager::toolCancel(); |
| 319 | } |
| 320 | |
| 321 | window = WindowManager::bringToFront(WindowType::industry, enumValue(industryId)); |
| 322 | } |
| 323 | |
| 324 | if (window == nullptr) |
| 325 | { |
| 326 | // 0x00456DBC start |
| 327 | const WindowFlags newFlags = WindowFlags::viewportNoShiftPixels | WindowFlags::resizable; |
| 328 | window = WindowManager::createWindow(WindowType::industry, Industry::kWindowSize, newFlags, Industry::getEvents()); |
| 329 | window->number = enumValue(industryId); |
| 330 | window->minWidth = 192; |
| 331 | window->minHeight = 137; |
| 332 | window->maxWidth = 600; |
| 333 | window->maxHeight = 440; |
| 334 | |
| 335 | auto skin = ObjectManager::get<InterfaceSkinObject>(); |
| 336 | if (skin != nullptr) |
| 337 | { |
| 338 | window->setColour(WindowColour::primary, skin->windowTitlebarColour); |
| 339 | window->setColour(WindowColour::secondary, skin->windowColour); |
| 340 | } |
| 341 | // 0x00456DBC end |
| 342 | |
| 343 | window->savedView.clear(); |
| 344 | } |
| 345 | |
| 346 | window->currentTab = Common::widx::tab_industry - Common::widx::tab_industry; |
| 347 | window->invalidate(); |
| 348 | |
| 349 | window->setWidgets(Industry::widgets); |
| 350 | window->holdableWidgets = 0; |
| 351 | window->eventHandlers = &Industry::getEvents(); |
| 352 | window->activatedWidgets = 0; |
| 353 | |
| 354 | Common::setDisabledWidgets(*window); |
| 355 | |
| 356 | window->initScrollWidgets(); |
| 357 | Industry::initViewport(*window); |
| 358 | |
| 359 | return window; |
| 360 | } |
| 361 | |
| 362 | namespace Production |
| 363 | { |
nothing calls this directly
no test coverage detected