public void UnlockTrophies(List <int> trophy_ids)
 {
     if (!this.Available || this._data == null || this._callback_update != null)
     {
         return;
     }
     if (trophy_ids == null)
     {
         return;
     }
     for (int i = 0; i < trophy_ids.get_Count(); i++)
     {
         int num = trophy_ids.get_Item(i);
         this._Log(string.Format("ID:{0} 解除開始", num));
         TrophyManager.TrophyData trophyData = this._GetTrophyData(num);
         trophyData.unlocked = true;
         int num2 = this._IDtoIndex(trophyData);
         if (num2 > 0)
         {
             ErrorCode errorCode = Trophies.AwardTrophy(num2);
             if (errorCode != null)
             {
                 trophyData.unlocked = false;
             }
         }
     }
 }
Beispiel #2
0
        public static void AwardTrophy(int trophyIndex)
        {
            trophiesAvailable = Trophies.TrophiesAreAvailable;
            if (!trophiesAvailable)
            {
                return;
            }

            Trophies.AwardTrophy(trophyIndex);
        }
    public void MenuTrophies(MenuStack menuStack)
    {
        menuTrophies.Update();
        bool trophiesAreAvailable = Trophies.TrophiesAreAvailable;

        if (menuTrophies.AddItem("Game Info", trophiesAreAvailable))
        {
            DumpGameInfo();
        }
        if (menuTrophies.AddItem("Group Info", trophiesAreAvailable && !Trophies.RequestGroupInfoIsBusy()))
        {
            ErrorHandler(Trophies.RequestGroupInfo());
        }
        if (menuTrophies.AddItem("Trophy Info", trophiesAreAvailable && !Trophies.RequestTrophyInfoIsBusy()))
        {
            ErrorHandler(Trophies.RequestTrophyInfo());
        }
        if (menuTrophies.AddItem("Trophy Progress", trophiesAreAvailable && !Trophies.RequestTrophyProgressIsBusy()))
        {
            ErrorHandler(Trophies.RequestTrophyProgress());
        }
        if (menuTrophies.AddItem("Award Trophy", trophiesAreAvailable) && ErrorHandler(Trophies.AwardTrophy(nextTrophyIndex)) == ErrorCode.NP_OK)
        {
            nextTrophyIndex++;
            if (nextTrophyIndex == gameInfo.numTrophies)
            {
                nextTrophyIndex = 1;
            }
        }
        if (menuTrophies.AddItem("Award All Trophies", trophiesAreAvailable))
        {
            for (int i = 1; i < gameInfo.numTrophies; i++)
            {
                ErrorHandler(Trophies.AwardTrophy(i));
            }
        }
        if (menuTrophies.AddBackIndex("Back"))
        {
            menuStack.PopMenu();
        }
    }
    public void MenuTrophies(MenuStack menuStack)
    {
        this.menuTrophies.Update();
        bool trophiesAreAvailable = Trophies.get_TrophiesAreAvailable();

        if (this.menuTrophies.AddItem("Game Info", trophiesAreAvailable))
        {
            this.DumpGameInfo();
        }
        if (this.menuTrophies.AddItem("Group Info", trophiesAreAvailable && !Trophies.RequestGroupInfoIsBusy()))
        {
            this.ErrorHandler(Trophies.RequestGroupInfo());
        }
        if (this.menuTrophies.AddItem("Trophy Info", trophiesAreAvailable && !Trophies.RequestTrophyInfoIsBusy()))
        {
            this.ErrorHandler(Trophies.RequestTrophyInfo());
        }
        if (this.menuTrophies.AddItem("Trophy Progress", trophiesAreAvailable && !Trophies.RequestTrophyProgressIsBusy()))
        {
            this.ErrorHandler(Trophies.RequestTrophyProgress());
        }
        if (this.menuTrophies.AddItem("Award Trophy", trophiesAreAvailable) && this.ErrorHandler(Trophies.AwardTrophy(this.nextTrophyIndex)) == null)
        {
            this.nextTrophyIndex++;
            if (this.nextTrophyIndex == this.gameInfo.numTrophies)
            {
                this.nextTrophyIndex = 1;
            }
        }
        if (this.menuTrophies.AddItem("Award All Trophies", trophiesAreAvailable))
        {
            for (int i = 1; i < this.gameInfo.numTrophies; i++)
            {
                this.ErrorHandler(Trophies.AwardTrophy(i));
            }
        }
        if (this.menuTrophies.AddBackIndex("Back", true))
        {
            menuStack.PopMenu();
        }
    }