MCPcopy Create free account
hub / github.com/TurningWheel/Barony / drawNotifications

Method drawNotifications

src/interface/ui_general.cpp:456–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454UIToastNotificationManager_t UIToastNotificationManager;
455static ConsoleVariable<bool> cvar_achievements_warning("/achievements_warning", true);
456void 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 {

Callers 2

ingameHudFunction · 0.80
mainFunction · 0.80

Calls 14

getNotificationSingleMethod · 0.80
setIdleSecondsMethod · 0.80
setHeaderTextMethod · 0.80
getSizeMethod · 0.80
bringToTopMethod · 0.80
getCardStateMethod · 0.80
cardForceTickUpdateMethod · 0.80
setInvisibleMethod · 0.80
isActiveMethod · 0.45
setSizeMethod · 0.45
initMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected