Пример #1
0
        public bool GotoGlobalScores(Helpers.HighScoreType type)
        {
            bool success = Helpers.GetGlobalHighScores(type);

            if (success)
            {
                showOnlineScores = true;

                menuHighscoreName  = new string[Helpers.GlobalHighscoreNames.Length];
                menuHighscoreScore = new int[Helpers.GlobalHighscoreNames.Length];

                menuHighscoreName  = Helpers.GlobalHighscoreNames;
                menuHighscoreScore = Helpers.GlobalHighscoreScores;

#if (WINDOWS && STEAM)
                FrameworkCore.RefreshSteamFriendArray();

                isSteamFriend = new bool[menuHighscoreName.Length];

                try
                {
                    for (int i = 0; i < menuHighscoreName.Length; i++)
                    {
                        for (int x = 0; x < FrameworkCore.SteamFriendNames.Length; x++)
                        {
                            string steamFriendName = Helpers.StripOutAmpersands(FrameworkCore.SteamFriendNames[x]);

                            if (System.String.Compare(menuHighscoreName[i], steamFriendName, true, CultureInfo.InvariantCulture) == 0)
                            {
                                isSteamFriend[i] = true;
                                break;
                            }
                            else
                            {
                                isSteamFriend[i] = false;
                            }
                        }
                    }
                }
                catch
                {
                }
#endif
            }
            else
            {
                menuHighscoreName  = new string[0];
                menuHighscoreScore = new int[0];
            }

            return(success);
        }
Пример #2
0
        public override void ToggleOnline()
        {
            Offset = 0;

            if (curTable == 0)
            {
                //go to local table.
                ShowOnlineScores = false;
                GotoLocalScores();
                curTable = 1;



                string buttonText = string.Empty;
                if (FrameworkCore.isHardcoreMode)
                {
                    buttonText = Resource.MenuHighscoresHardcore;
                }
                else
                {
                    buttonText = Resource.MenuHighscoresOnline;
                }

                onlineButtonText = buttonText;
            }
            else
            {
                Helpers.HighScoreType type = Helpers.HighScoreType.Normal;
                if (FrameworkCore.isHardcoreMode)
                {
                    type = Helpers.HighScoreType.Hardcore;
                }
                else
                {
                    type = Helpers.HighScoreType.Normal;
                }



                //go to normal online scores.
                ShowOnlineScores = true;
                if (!GotoGlobalScores(type))
                {
                    base.OnlineError();
                }

                curTable         = 0;
                onlineButtonText = Resource.MenuHighscoresLocal;
            }
        }
Пример #3
0
        public override void Activate()
        {
            //save the data.
            FrameworkCore.adventureNumber++;

            SaveInfo save = FrameworkCore.storagemanager.GetDefaultSaveData();

            FrameworkCore.storagemanager.SaveData(save);

            finalScore = Helpers.GenerateFinalScore();

            //add high score to the high score table.
            string playerName = "";

            if (FrameworkCore.players.Count > 1)
            {
                playerName = FrameworkCore.players[0].commanderName + " " + Resource.MenuHighScoresPlus +
                             " " + FrameworkCore.players[1].commanderName;
            }
            else
            {
                playerName = FrameworkCore.players[0].commanderName;
            }


            //disable high score recording in trial mode.
            if (FrameworkCore.isTrialMode())
            {
                addedIndex = -1;
            }
            else
            {
                addedIndex = Helpers.AddHighScore(playerName, finalScore, out newGlobalHighScore);
            }


#if WINDOWS
            Helpers.HighScoreType type = Helpers.HighScoreType.Normal;

            if (FrameworkCore.isHardcoreMode)
            {
                type = Helpers.HighScoreType.Hardcore;
            }
            else
            {
                type = Helpers.HighScoreType.Normal;
            }


            //base.GotoGlobalScores(type);
#else
            //base.GotoLocalScores();
#endif

            //BC2019 Go to local scoreboard only.
            base.GotoLocalScores();


            onlineButtonText = Resource.MenuHighscoresLocal;


            base.Activate();
        }