// ------------------------------------------------------------------- // Constructor // ------------------------------------------------------------------- public DialogStatistics(SystemStatistics statistics) { InitializeComponent(); Control = new DialogStatisticsControl(statistics); ViewModelBindingSource.DataSource = Control; // Initialise general datas textBoxName.InitializeParameters(Control.Model.Names); textBoxGraphicIcon.InitializeParameters(statistics.Bar.CreateCopy(), typeof(DialogPreviewGraphicSelectRectangle), OptionsKind.BarSelection); PictureBoxIcon.SizeMode = PictureBoxSizeMode.StretchImage; PictureBoxIcon.InterpolationMode = InterpolationMode.NearestNeighbor; LoadBar(statistics.Bar); // Game over listView1.Columns[0].Width = listView1.Size.Width - 4; for (int i = 0; i < WANOK.Game.Heroes.HeroesList.Count; i++) { listView1.Items.Add(WANOK.GetStringList(WANOK.Game.Heroes.HeroesList[i].Id, WANOK.Game.Heroes.HeroesList[i].Name)); if (statistics.AllGameOverOptions.HeroesSelected != null && statistics.AllGameOverOptions.HeroesSelected.Contains(WANOK.Game.Heroes.HeroesList[i].Id)) { listView1.Items[i].Checked = true; } } comboBoxComparaison1.InitValues(); comboBoxMeasure1.InitValues(); ListControlsGameOver.Add(new Control[] { }); ListControlsGameOver.Add(new Control[] { radioButton3, radioButton4, listView1, label3, comboBoxComparaison1, label4, numericUpDown1, comboBoxMeasure1 }); ListControlsGameOverHeroes.Add(new Control[] { }); ListControlsGameOverHeroes.Add(new Control[] { listView1 }); if (statistics.AllGameOverOptions.NoImplication) { radioButton1.Checked = true; } else { radioButton2.Checked = true; } if (statistics.AllGameOverOptions.AllHeroes) { radioButton3.Checked = true; } else { radioButton4.Checked = true; } comboBoxComparaison1.SelectedIndex = (int)statistics.AllGameOverOptions.Comparaison; comboBoxMeasure1.SelectedIndex = (int)statistics.AllGameOverOptions.Measure; // Events textBoxGraphicIcon.GetTextBox().SelectedValueChanged += textBoxGraphicIcon_SelectedValueChanged; InitializeDataBindings(); }
// ------------------------------------------------------------------- // Constructor // ------------------------------------------------------------------- public BattleSystemDatas() { // Get defaults lists Elements = SystemElement.GetDefaultElements(); Statistics = SystemStatistics.GetDefaultStatistics(); // Weapons kind WeaponsKind.Add(new SuperListItemName(1, WANOK.GetDefaultNames("Sword"))); WeaponsKind.Add(new SuperListItemName(2, WANOK.GetDefaultNames("Axe"))); WeaponsKind.Add(new SuperListItemName(3, WANOK.GetDefaultNames("Spear"))); WeaponsKind.Add(new SuperListItemName(4, WANOK.GetDefaultNames("Staff"))); WeaponsKind.Add(new SuperListItemName(5, WANOK.GetDefaultNames("Bow"))); WeaponsKind.Add(new SuperListItemName(6, WANOK.GetDefaultNames("Firearm"))); // Armors kind ArmorsKind.Add(new SuperListItemName(1, WANOK.GetDefaultNames("Helmet"))); ArmorsKind.Add(new SuperListItemName(2, WANOK.GetDefaultNames("Cap"))); ArmorsKind.Add(new SuperListItemName(3, WANOK.GetDefaultNames("Mail"))); ArmorsKind.Add(new SuperListItemName(4, WANOK.GetDefaultNames("Vest"))); ArmorsKind.Add(new SuperListItemName(5, WANOK.GetDefaultNames("Vambraces"))); ArmorsKind.Add(new SuperListItemName(6, WANOK.GetDefaultNames("Guards"))); ArmorsKind.Add(new SuperListItemName(7, WANOK.GetDefaultNames("Greaves"))); ArmorsKind.Add(new SuperListItemName(8, WANOK.GetDefaultNames("Leggings"))); }
// ------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------- public DialogStatisticsControl(SystemStatistics statistics) { Model = statistics; }