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

Method createLeaderboardNotification

src/interface/ui_general.cpp:757–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

755}
756
757void UIToastNotificationManager_t::createLeaderboardNotification(std::string info)
758{
759#ifdef USE_PLAYFAB
760 bool challenge = info.find("_seed_") != std::string::npos;
761 if ( !challenge ) { return; }
762
763 char buf[128];
764 if ( info.find("oneshot") != std::string::npos )
765 {
766 std::string prefix = Language::get(6110);
767 for ( auto& c : prefix )
768 {
769 if ( c == '\n' )
770 {
771 c = ' ';
772 }
773 }
774 snprintf(buf, sizeof(buf), Language::get(6134), prefix.c_str());
775
776 if ( info.find("lid_victory_seed_oneshot") != std::string::npos )
777 {
778 playfabUser.leaderboardSearch.savedSearchesFromNotification[PlayfabUser_t::LeaderboardSearch_t::CHALLENGE_BOARD_ONESHOT] =
779 "lid_time_victory_seed_oneshot";
780 }
781 else if ( info.find("lid_time_victory_seed_oneshot") != std::string::npos )
782 {
783 playfabUser.leaderboardSearch.savedSearchesFromNotification[PlayfabUser_t::LeaderboardSearch_t::CHALLENGE_BOARD_ONESHOT] =
784 "lid_time_victory_seed_oneshot";
785 }
786 else if ( info.find("lid_time_novictory_seed_oneshot") != std::string::npos )
787 {
788 playfabUser.leaderboardSearch.savedSearchesFromNotification[PlayfabUser_t::LeaderboardSearch_t::CHALLENGE_BOARD_ONESHOT] =
789 "lid_time_novictory_seed_oneshot";
790 }
791 }
792 else if ( info.find("unlimited") != std::string::npos )
793 {
794 std::string prefix = Language::get(6111);
795 for ( auto& c : prefix )
796 {
797 if ( c == '\n' )
798 {
799 c = ' ';
800 }
801 }
802 snprintf(buf, sizeof(buf), Language::get(6134), prefix.c_str());
803
804 if ( info.find("lid_victory_seed_unlimited") != std::string::npos )
805 {
806 playfabUser.leaderboardSearch.savedSearchesFromNotification[PlayfabUser_t::LeaderboardSearch_t::CHALLENGE_BOARD_UNLIMITED] =
807 "lid_victory_seed_unlimited";
808 }
809 else if ( info.find("lid_time_victory_seed_unlimited") != std::string::npos )
810 {
811 playfabUser.leaderboardSearch.savedSearchesFromNotification[PlayfabUser_t::LeaderboardSearch_t::CHALLENGE_BOARD_UNLIMITED] =
812 "lid_time_victory_seed_unlimited";
813 }
814 else if ( info.find("lid_time_novictory_seed_unlimited") != std::string::npos )

Callers 2

OnFunctionExecuteMethod · 0.80
ui_general.cppFile · 0.80

Calls 5

c_strMethod · 0.80
setHeaderTextMethod · 0.80
setMainTextMethod · 0.80
setIdleSecondsMethod · 0.80
addNotificationMethod · 0.45

Tested by

no test coverage detected