private void Form1_Load(object sender, EventArgs e) { if (Util.isGameRunning()) { MessageBox.Show("Please close Valheim before editing your character.", "ERROR", MessageBoxButtons.OK); Application.Exit(); } try { Customization.GetCharacters(); } catch { MessageBox.Show("There was an error while scanning for characters.", "ERROR", MessageBoxButtons.OK); } comboBox_Characters.DataSource = Customization.Characters; comboBox_Characters.SelectedIndex = -1; comboBox_Beard.DataSource = Customization.Beards_UI; comboBox_Hair.DataSource = Customization.Hairs_UI; comboBox_HairColor.DataSource = Customization.Hair_Colors; Customization.FirstRun = false; }
private void _Populate() { // Get characters try { Customization.GetCharacters(); } catch { MessageBox.Show("There was an error while scanning for characters.", "ERROR", MessageBoxButtons.OK); } // Populate forms with data label_Character.Text = Customization.SelectedCharacter.Data.Name; //add controls for editable skills int SkillStartPositionV = 40; int SkillStartPositionH = 18; foreach (var skill in ValheimEngine.SkillsUI) { Controls.Skill_control skillcontrol = new Controls.Skill_control(); skillcontrol.Location = new System.Drawing.Point(SkillStartPositionH, SkillStartPositionV); skillcontrol.skill_name = skill.ToString(); int skill_level = 101; ValheimEngine.Character.SkillName SN = (ValheimEngine.Character.SkillName)Enum.Parse(typeof(ValheimEngine.Character.SkillName), skill.ToString()); Customization.SelectedCharacter.Data.Skills.Where(w => w.SkillName == SN).ToList().ForEach(s => skill_level = (int)s.Level); if (skill_level != 101) { skillcontrol.skill_level = skill_level; Controls.Add(skillcontrol); } else { ValheimEngine.Character.Skill add_skill = new ValheimEngine.Character.Skill(); add_skill.Level = 1; add_skill.SkillName = SN; Customization.SelectedCharacter.Data.Skills.Add(add_skill); skillcontrol.skill_level = 1; Controls.Add(skillcontrol); } SkillStartPositionV += 70; if (SkillStartPositionV > 700) { SkillStartPositionH += 500; SkillStartPositionV = 40; } } }
private void _Populate() { // Get characters try { Customization.GetCharacters(); } catch { MessageBox.Show("There was an error while scanning for characters.", "ERROR", MessageBoxButtons.OK); } // Populate forms with data comboBox_Characters.DataSource = Util.GetCharactersNames(Customization.FoundCharacters); comboBox_Characters.SelectedIndex = -1; comboBox_Beard.DataSource = ValheimEngine.BeardsUI; comboBox_Hair.DataSource = ValheimEngine.HairsUI; comboBox_Gender.DataSource = ValheimEngine.Genders; }
private void _Populate() { // Get characters try { Customization.GetCharacters(); } catch { MessageBox.Show("There was an error while scanning for characters.", "ERROR", MessageBoxButtons.OK); } // Populate forms with data comboBox_Characters.DataSource = Customization.Characters; comboBox_Characters.SelectedIndex = -1; comboBox_Beard.DataSource = Customization.Beards_UI; comboBox_Hair.DataSource = Customization.Hairs_UI; comboBox_HairColor.DataSource = Customization.Hair_Colors; }