private void btLoad_Click(object sender, RoutedEventArgs e) { if (charInfo.Name == "") { return; } if (LoadCharacter()) { CharacterSelect charSelect = ShellService.Instance.CharacterContent.CharacterSelect; charSelect.UpdateUI(charInfo.Race, charInfo.Gender != 0, charInfo.ClassShortName); } }
private void btImport_Click(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "text|*.txt|All Files|*.*"; dlg.InitialDirectory = Engine.Instance.GetBaseDirectory(); bool?ret = dlg.ShowDialog(ShellService.Instance.MainWindow); if (ret.HasValue && ret.Value) { StreamReader reader = new StreamReader(dlg.FileName); string txt; txt = reader.ReadLine(); raceId = UInt32.Parse(txt); txt = reader.ReadLine(); female = Int32.Parse(txt) != 0; txt = reader.ReadLine(); classShortName = txt; txt = reader.ReadLine(); charFeature.skinColor = UInt32.Parse(txt); txt = reader.ReadLine(); charFeature.faceType = UInt32.Parse(txt); txt = reader.ReadLine(); charFeature.hairStyle = UInt32.Parse(txt); txt = reader.ReadLine(); charFeature.facialHair = UInt32.Parse(txt); txt = reader.ReadLine(); charFeature.hairColor = UInt32.Parse(txt); reader.Dispose(); if (LoadCharacter()) { CharacterSelect charSelect = ShellService.Instance.CharacterContent.CharacterSelect; charSelect.UpdateUI(raceId, female, classShortName); charSelect.UseStartOutfit(classShortName); Update(); } } }