| 454 | UIToastNotificationManager_t UIToastNotificationManager; |
| 455 | static ConsoleVariable<bool> cvar_achievements_warning("/achievements_warning", true); |
| 456 | void UIToastNotificationManager_t::drawNotifications(bool isMoviePlaying, bool beforeFadeout) |
| 457 | { |
| 458 | if ( !bIsInit ) |
| 459 | { |
| 460 | return; |
| 461 | } |
| 462 | |
| 463 | if (achievementsCheck && !intro) { |
| 464 | if ( gameModeManager.currentSession.challengeRun.isActive() |
| 465 | && gameModeManager.currentSession.challengeRun.lid.find("challenge") != std::string::npos ) |
| 466 | { |
| 467 | achievementsCheck = false; |
| 468 | if ( *cvar_achievements_warning ) |
| 469 | { |
| 470 | createAchievementsDisabledNotification(); |
| 471 | if ( auto n = UIToastNotificationManager.getNotificationSingle(UIToastNotification::CardType::UI_CARD_ACHIEVEMENTS_DISABLED) ) |
| 472 | { |
| 473 | n->setIdleSeconds(3); |
| 474 | n->setHeaderText(Language::get(6139)); |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | else if (conductGameChallenges[CONDUCT_CHEATS_ENABLED] |
| 479 | || conductGameChallenges[CONDUCT_LIFESAVING] |
| 480 | || conductGameChallenges[CONDUCT_ASSISTANCE_CLAIMED] >= GenericGUIMenu::AssistShrineGUI_t::achievementDisabledLimit |
| 481 | || Mods::disableSteamAchievements) { |
| 482 | achievementsCheck = false; |
| 483 | if ( *cvar_achievements_warning ) |
| 484 | { |
| 485 | createAchievementsDisabledNotification(); |
| 486 | } |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | frame->setSize(gui->getSize()); |
| 491 | frame->bringToTop(); |
| 492 | |
| 493 | int cardPosY = 110; // update the card y values if number of notifications change. |
| 494 | for ( auto& card : allNotifications ) |
| 495 | { |
| 496 | card.skipDrawingCardThisTick = false; |
| 497 | } |
| 498 | |
| 499 | bool bFirstDockedCard = true; |
| 500 | |
| 501 | for ( auto& card : allNotifications ) |
| 502 | { |
| 503 | if (isMoviePlaying || !intro) |
| 504 | { |
| 505 | if (!(card.actionFlags & UIToastNotification::ActionFlags::UI_NOTIFICATION_REMOVABLE)) |
| 506 | { |
| 507 | continue; |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | bool docked = false; |
| 512 | if ( !(card.actionFlags & UIToastNotification::ActionFlags::UI_NOTIFICATION_REMOVABLE) ) |
| 513 | { |
no test coverage detected