private void Mods_CheckedChanged(object sender, EventArgs e) { this.modValue = ReplayAPI.Mods.None; for (int i = 0; i < 14; i++) { if (this.mods[i].Checked) { this.modValue |= mods[i].ModValue; } } }
public void LoadReplay(int id) { if (id >= 0) { this.replay = MainForm.self.CurrentReplays[id]; } if (this.replay == null) { this.gameMode.Value = 0; this.version.Value = 0; this.playerName.Value = ""; this.mapHash.Value = ""; this.replayHash.Value = ""; this.count300.Value = 0; this.count100.Value = 0; this.count50.Value = 0; this.score.Value = 0; this.countGeki.Value = 0; this.countKatsu.Value = 0; this.countMiss.Value = 0; this.maxCombo.Value = 0; this.isPerfect.Value = 0; this.modValue = ReplayAPI.Mods.None; } else { this.gameMode.Value = (byte)this.replay.GameMode; this.version.Value = this.replay.FileFormat; this.playerName.Value = this.replay.PlayerName; this.mapHash.Value = this.replay.MapHash; this.replayHash.Value = this.replay.ReplayHash; this.count300.Value = this.replay.Count300; this.count100.Value = this.replay.Count100; this.count50.Value = this.replay.Count50; this.score.Value = (int)this.replay.TotalScore; this.countGeki.Value = this.replay.CountGeki; this.countKatsu.Value = this.replay.CountKatu; this.countMiss.Value = this.replay.CountMiss; this.maxCombo.Value = this.replay.MaxCombo; this.isPerfect.Value = Convert.ToByte(!this.replay.IsPerfect); this.modValue = this.replay.Mods; } for (int i = 0; i < 14; i++) { mods[i].Checked = this.modValue.HasFlag(this.mods[i].ModValue); } }
public ModCheckBox(int x, int y, string text, int index) { this.Left = x; this.Top = y; this.Text = text; this.AutoSize = true; /* * 00 : No Fail * 01 : Hard Rock * 02 : Relax * 03 : Spun Out * 04 : Double Time * 05 : Easy * 06 : Hidden * 07 : Autopilot * 08 : Perfect * 09 : Nightcore * 10 : Half Time * 11 : Flashlight * 12 : Auto * 13 : Sudden Death */ if (index == 0) { this.ModValue = ReplayAPI.Mods.NoFail; } else if (index == 1) { this.ModValue = ReplayAPI.Mods.HardRock; } else if (index == 2) { this.ModValue = ReplayAPI.Mods.Relax; } else if (index == 3) { this.ModValue = ReplayAPI.Mods.SpunOut; } else if (index == 4) { this.ModValue = ReplayAPI.Mods.DoubleTime; } else if (index == 5) { this.ModValue = ReplayAPI.Mods.Easy; } else if (index == 6) { this.ModValue = ReplayAPI.Mods.Hidden; } else if (index == 7) { this.ModValue = ReplayAPI.Mods.AutoPilot; } else if (index == 8) { this.ModValue = ReplayAPI.Mods.Perfect; } else if (index == 9) { this.ModValue = ReplayAPI.Mods.NightCore; } else if (index == 10) { this.ModValue = ReplayAPI.Mods.HalfTime; } else if (index == 11) { this.ModValue = ReplayAPI.Mods.FlashLight; } else if (index == 12) { this.ModValue = ReplayAPI.Mods.Auto; } else if (index == 13) { this.ModValue = ReplayAPI.Mods.SuddenDeath; } else { this.ModValue = ReplayAPI.Mods.None; } }