Exemplo n.º 1
0
        public LeaderboardForm(long steamID, SMBLevel level = null)
        {
            InitializeComponent();
            Icon = Properties.Resources.smb;

            this.steamID = steamID;
            this.level = level;

            cbLeaderboardType.SelectedIndex = level == null ? 0 : 1;
            cbLeaderboardFilterType.SelectedIndex = steamID > 0 ? 0 : 1;
            nudLevelRange.Value = 100;

            lvLevelLeaderboard.SmallImageList = HelperMethods.GetCharactersImageList();

            isFormLoaded = true;
        }
Exemplo n.º 2
0
 public SMBLeaderboard(SMBLevel level)
 {
     Level = level;
 }
Exemplo n.º 3
0
        public SMBLevel GetLevelInfo(int chapter, int level, LevelType type)
        {
            int offset;

            // if The Guy Warp Zone
            if (type == LevelType.Warp && chapter == 5 && level >= 4 && level <= 6)
            {
                offset = TheGuyWarpZoneStart + ((level - 4) * LevelOffset);
            }
            else
            {
                int chaptersOffset = 0;

                for (int i = 1; i < chapter; i++)
                {
                    chaptersOffset += ((SMBHelpers.GetMaxLevelCount(i) * 2) + SMBHelpers.GetMaxWarpLevelCount(i)) * LevelOffset;
                }

                int levelsOffset = (level - 1 + (SMBHelpers.GetMaxLevelCount(chapter) * (int)type)) * LevelOffset;

                offset = LevelStart + chaptersOffset + levelsOffset;
            }

            SMBLevel info = new SMBLevel
            {
                ChapterNumber = chapter,
                LevelNumber = level,
                LevelType = type,
                Time = BitConverter.ToSingle(savegame, offset),
                Progress = (LevelStatus)savegame[offset + LevelProgressOffset]
            };

            // Debug.WriteLine(string.Format("{0} - {1:X} - {1}", info.LevelName, offset));

            return info;
        }