0x0042A3FF
| 316 | |
| 317 | // 0x0042A3FF |
| 318 | void open() |
| 319 | { |
| 320 | auto window = WindowManager::bringToFront(WindowType::messages); |
| 321 | |
| 322 | if (window != nullptr) |
| 323 | { |
| 324 | if (ToolManager::isToolActive(window->type, window->number)) |
| 325 | { |
| 326 | ToolManager::toolCancel(); |
| 327 | window = WindowManager::bringToFront(WindowType::messages); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | if (window == nullptr) |
| 332 | { |
| 333 | int16_t y = 29; |
| 334 | int16_t x = Ui::width() - 366; |
| 335 | |
| 336 | window = WindowManager::createWindow( |
| 337 | WindowType::messages, |
| 338 | { x, y }, |
| 339 | { 366, 217 }, |
| 340 | WindowFlags::lighterFrame, |
| 341 | Messages::getEvents()); |
| 342 | |
| 343 | window->number = 0; |
| 344 | window->currentTab = 0; |
| 345 | window->frameNo = 0; |
| 346 | window->rowHover = -1; |
| 347 | window->disabledWidgets = 0; |
| 348 | |
| 349 | WindowManager::moveOtherWindowsDown(*window); |
| 350 | |
| 351 | window->minWidth = Messages::kMinWindowSize.width; |
| 352 | window->minHeight = Messages::kMinWindowSize.height; |
| 353 | window->maxWidth = Messages::kMaxWindowSize.width; |
| 354 | window->maxHeight = Messages::kMaxWindowSize.height; |
| 355 | window->flags |= WindowFlags::resizable; |
| 356 | |
| 357 | window->owner = CompanyManager::getControllingId(); |
| 358 | auto skin = ObjectManager::get<InterfaceSkinObject>(); |
| 359 | window->setColour(WindowColour::secondary, skin->windowPlayerColor); |
| 360 | |
| 361 | window->width = Messages::kMinWindowSize.width; |
| 362 | window->height = Messages::kMinWindowSize.height; |
| 363 | } |
| 364 | |
| 365 | window->currentTab = 0; |
| 366 | window->invalidate(); |
| 367 | |
| 368 | window->setWidgets(Messages::widgets); |
| 369 | window->holdableWidgets = 0; |
| 370 | window->eventHandlers = &Messages::getEvents(); |
| 371 | window->disabledWidgets = 0; |
| 372 | |
| 373 | window->callOnResize(); |
| 374 | window->callPrepareDraw(); |
| 375 | window->initScrollWidgets(); |
no test coverage detected