00434731
| 2610 | |
| 2611 | // 00434731 |
| 2612 | Window* openChallenge(CompanyId companyId) |
| 2613 | { |
| 2614 | auto window = WindowManager::bringToFront(WindowType::company, enumValue(companyId)); |
| 2615 | if (window != nullptr) |
| 2616 | { |
| 2617 | if (ToolManager::isToolActive(window->type, window->number)) |
| 2618 | { |
| 2619 | ToolManager::toolCancel(); |
| 2620 | window = WindowManager::bringToFront(WindowType::company, enumValue(companyId)); |
| 2621 | } |
| 2622 | } |
| 2623 | |
| 2624 | if (window == nullptr) |
| 2625 | { |
| 2626 | window = create(companyId); |
| 2627 | } |
| 2628 | |
| 2629 | window->currentTab = Common::tab_challenge - Common::tab_status; |
| 2630 | window->width = Challenge::kWindowSize.width; |
| 2631 | window->height = Challenge::kWindowSize.height; |
| 2632 | window->invalidate(); |
| 2633 | |
| 2634 | window->setWidgets(Challenge::widgets); |
| 2635 | window->holdableWidgets = 0; |
| 2636 | window->eventHandlers = &Challenge::getEvents(); |
| 2637 | window->activatedWidgets = 0; |
| 2638 | |
| 2639 | Common::disableChallengeTab(window); |
| 2640 | window->initScrollWidgets(); |
| 2641 | window->moveInsideScreenEdges(); |
| 2642 | |
| 2643 | return window; |
| 2644 | } |
| 2645 | |
| 2646 | namespace Common |
| 2647 | { |
no test coverage detected