public static int SortByTrophyID(TropUsrSingleTrophy t1, TropUsrSingleTrophy t2)
 {
     if (t1 == null)
     {
         if (t2 == null)
         {
             return(0);
         }
         else
         {
             return(-1);
         }
     }
     else
     if (t2 == null)
     {
         return(1);
     }
     //return (int)((t2.Timestamp1 - t1.Timestamp1)/1000000);
     if (t1.TrophyID > t2.TrophyID)
     {
         return(1);
     }
     else if (t1.TrophyID < t2.TrophyID)
     {
         return(-1);
     }
     return(0);
 }
Exemple #2
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TrophyNode t = (TrophyNode)listBox1.SelectedItem;

            this.labelName.Text = t.Name;

            switch (t.TType)
            {
            case "B":
                this.labelTType.Text = "Bronze";
                break;

            case "S":
                this.labelTType.Text = "Silver";
                break;

            case "G":
                this.labelTType.Text = "Gold";
                break;

            case "P":
                this.labelTType.Text = "Platinum";
                break;

            default:
                this.labelTType.Text = t.TType;
                break;
            }

            this.labelDescription.Text = t.Detail;

            if (t.Hidden)
            {
                this.labelHidden.Text = "Hidden";
            }
            else
            {
                this.labelHidden.Text = "Visible";
            }

            this.labelTrophyID.Text = t.ID;

            TropUsrSingleTrophy u = TrophyFile.TropUsrFile.TrophyInfos[UInt32.Parse(t.ID)];

            if (u.Unlocked == 1)
            {
                this.labelUnlocked.Text   = "Acquired";
                this.labelTimestamp.Text  = Util.PS3TimeToDateTime(u.Timestamp1).ToString();
                this.labelTimestamp2.Text = Util.PS3TimeToDateTime(u.Timestamp2).ToString();
            }
            else
            {
                this.labelUnlocked.Text   = "Locked";
                this.labelTimestamp.Text  = "";
                this.labelTimestamp2.Text = "";
            }
        }
 public static int SortByTrophyID( TropUsrSingleTrophy t1, TropUsrSingleTrophy t2 )
 {
     if ( t1 == null )
         if ( t2 == null ) return 0;
         else return -1;
     else
         if ( t2 == null ) return 1;
     //return (int)((t2.Timestamp1 - t1.Timestamp1)/1000000);
     if ( t1.TrophyID > t2.TrophyID )
         return 1;
     else if ( t1.TrophyID < t2.TrophyID )
         return -1;
     return 0;
 }
        public TropUsr( byte[] File )
        {
            this.File = File;

            TrophyAmount = Util.SwapEndian( BitConverter.ToUInt32( File, 0xDC ) );
            UserInfoStart = Util.SwapEndian( BitConverter.ToUInt32( File, 0x144 ) );
            UserInfoSize = 0x70;

            TrophyInfos = new Dictionary<uint, TropUsrSingleTrophy>( (int)TrophyAmount );

            for ( uint i = 0; i < TrophyAmount; i++ ) {
                TropUsrSingleTrophy TrophyInfo = new TropUsrSingleTrophy( File, UserInfoStart + ( i * UserInfoSize ) );
                TrophyInfos.Add( TrophyInfo.TrophyID, TrophyInfo );
            }
        }
Exemple #5
0
        public TropUsr(byte[] File)
        {
            this.File = File;

            TrophyAmount  = Util.SwapEndian(BitConverter.ToUInt32(File, 0xDC));
            UserInfoStart = Util.SwapEndian(BitConverter.ToUInt32(File, 0x144));
            UserInfoSize  = 0x70;

            TrophyInfos = new Dictionary <uint, TropUsrSingleTrophy>((int)TrophyAmount);

            for (uint i = 0; i < TrophyAmount; i++)
            {
                TropUsrSingleTrophy TrophyInfo = new TropUsrSingleTrophy(File, UserInfoStart + (i * UserInfoSize));
                TrophyInfos.Add(TrophyInfo.TrophyID, TrophyInfo);
            }
        }