private void RawData_Button_Click(object sender, RoutedEventArgs e) { RAW_JSON impexp = new RAW_JSON(); impexp.Export <VPTU.Pokedex.Pokemon.PokemonData>(PokemonData); bool?dr = impexp.ShowDialog(); if (dr == true) { PokemonData = impexp.Import <VPTU.Pokedex.Pokemon.PokemonData>(); try { Load(); } catch { MessageBox.Show("Failed to load data object!"); } //Load(impexp.Import<VPTU.Pokedex.Pokemon.PokemonData>()); } }
public Pokemon(SaveManager.Data.SaveFile.PTUSaveData _SaveData, VPTU.Pokedex.Pokemon.PokemonData _PokemonData = null) { InitializeComponent(); // Sets up the window SaveData = _SaveData; // Creates Save Data Reference Setup(); // Executes Setup Code if (_PokemonData == null) { PokemonData = new VPTU.Pokedex.Pokemon.PokemonData(); } else { PokemonData = _PokemonData; Update = true; Load(); } }
/// <summary> /// Loads the data from a Dex Entry, Can be used to reset the page /// </summary> private void Load(VPTU.Pokedex.Pokemon.PokemonData _LoadData = null) { VPTU.Pokedex.Pokemon.PokemonData LoadData; if (_LoadData != null) { LoadData = _LoadData; } else { LoadData = PokemonData; } //Save Basic Pokemon Data #region Basic Info try { Basic_Name.Text = LoadData.Species_Name; } catch { } try { Basic_Desc.Text = LoadData.Species_Desc; } catch { } // Try and catch this as old versions of the save will not be able to read this? try { Basic_ID.Text = LoadData.Species_DexID.ToString(); } catch { } try { Basic_Type1.SelectedItem = LoadData.Species_Type1; } catch { } try { Basic_Type2.SelectedItem = LoadData.Species_Type2; } catch { } try { Basic_Weight.SelectedItem = LoadData.Species_WeightClass; } catch { } try { Basic_Size.SelectedItem = LoadData.Species_SizeClass; } catch { } #endregion //Load Pokemon Skill Data #region Skill Data //Skill Rank Data try { Skill_Acrobatics_Rank.SelectedItem = LoadData.Species_Skill_Data.Acrobatics_Rank; } catch { } try { Skill_Athletics_Rank.SelectedItem = LoadData.Species_Skill_Data.Athletics_Rank; } catch { } try { Skill_Charm_Rank.SelectedItem = LoadData.Species_Skill_Data.Charm_Rank; } catch { } try { Skill_Combat_Rank.SelectedItem = LoadData.Species_Skill_Data.Combat_Rank; } catch { } try { Skill_Command_Rank.SelectedItem = LoadData.Species_Skill_Data.Command_Rank; } catch { } try { Skill_Focus_Rank.SelectedItem = LoadData.Species_Skill_Data.Focus_Rank; } catch { } try { Skill_GeneralEDU_Rank.SelectedItem = LoadData.Species_Skill_Data.General_Rank; } catch { } try { Skill_Gulie_Rank.SelectedItem = LoadData.Species_Skill_Data.Guile_Rank; } catch { } try { Skill_Intimidate_Rank.SelectedItem = LoadData.Species_Skill_Data.Intimidate_Rank; } catch { } try { Skill_Intuition_Rank.SelectedItem = LoadData.Species_Skill_Data.Intuition_Rank; } catch { } try { Skill_MedicineEDU_Rank.SelectedItem = LoadData.Species_Skill_Data.Medicine_Rank; } catch { } try { Skill_OccultEDU_Rank.SelectedItem = LoadData.Species_Skill_Data.Occult_Rank; } catch { } try { Skill_Perception_Rank.SelectedItem = LoadData.Species_Skill_Data.Perception_Rank; } catch { } try { Skill_PokemonEDU_Rank.SelectedItem = LoadData.Species_Skill_Data.Pokemon_Rank; } catch { } try { Skill_Stealth_Rank.SelectedItem = LoadData.Species_Skill_Data.Stealth_Rank; } catch { } try { Skill_Survival_Rank.SelectedItem = LoadData.Species_Skill_Data.Survival_Rank; } catch { } try { Skill_TechnologyEDU_Rank.SelectedItem = LoadData.Species_Skill_Data.Technology_Rank; } catch { } //Skill Mod Data try { Skill_Acrobatics_Mod.Value = LoadData.Species_Skill_Data.Acrobatics_Mod; } catch { } try { Skill_Athletics_Mod.Value = LoadData.Species_Skill_Data.Athletics_Mod; } catch { } try { Skill_Charm_Mod.Value = LoadData.Species_Skill_Data.Charm_Mod; } catch { } try { Skill_Combat_Mod.Value = LoadData.Species_Skill_Data.Combat_Mod; } catch { } try { Skill_Command_Mod.Value = LoadData.Species_Skill_Data.Command_Mod; } catch { } try { Skill_Focus_Mod.Value = LoadData.Species_Skill_Data.Focus_Mod; } catch { } try { Skill_GeneralEDU_Mod.Value = LoadData.Species_Skill_Data.General_Mod; } catch { } try { Skill_Gulie_Mod.Value = LoadData.Species_Skill_Data.Guile_Mod; } catch { } try { Skill_Intimidate_Mod.Value = LoadData.Species_Skill_Data.Intimidate_Mod; } catch { } try { Skill_Intuition_Mod.Value = LoadData.Species_Skill_Data.Intuition_Mod; } catch { } try { Skill_MedicineEDU_Mod.Value = LoadData.Species_Skill_Data.Medicine_Mod; } catch { } try { Skill_OccultEDU_Mod.Value = LoadData.Species_Skill_Data.Occult_Mod; } catch { } try { Skill_Perception_Mod.Value = LoadData.Species_Skill_Data.Perception_Mod; } catch { } try { Skill_PokemonEDU_Mod.Value = LoadData.Species_Skill_Data.Pokemon_Mod; } catch { } try { Skill_Stealth_Mod.Value = LoadData.Species_Skill_Data.Stealth_Mod; } catch { } try { Skill_Survival_Mod.Value = LoadData.Species_Skill_Data.Survival_Mod; } catch { } try { Skill_TechnologyEDU_Mod.Value = LoadData.Species_Skill_Data.Technology_Mod; } catch { } #endregion //Load Pokemon Capabilities Data #region Capabilities try { Capabilities_NatureWalk_1.SelectedItem = LoadData.Species_Capability_Data.NatureWalk_1; } catch { } try { Capabilities_NatureWalk_2.SelectedItem = LoadData.Species_Capability_Data.NatureWalk_2; } catch { } try { Capabilities_Burrow.Value = LoadData.Species_Capability_Data.Burrow; } catch { } try { Capabilities_HighJump.Value = LoadData.Species_Capability_Data.HighJump; } catch { } try { Capabilities_Levitate.Value = LoadData.Species_Capability_Data.Levitate; } catch { } try { Capabilities_LongJump.Value = LoadData.Species_Capability_Data.LongJump; } catch { } try { Capabilities_Overland.Value = LoadData.Species_Capability_Data.Overland; } catch { } try { Capabilities_Power.Value = LoadData.Species_Capability_Data.Power; } catch { } try { Capabilities_Sky.Value = LoadData.Species_Capability_Data.Sky; } catch { } try { Capabilities_Swim.Value = LoadData.Species_Capability_Data.Swim; } catch { } try { Capabilities_Teleport.Value = LoadData.Species_Capability_Data.Teleport; } catch { } try { Capabilities_ThrowingRange.Value = LoadData.Species_Capability_Data.ThrowingRange; } catch { } #endregion //Load Special Capabilities Data #region Special Capabilities try { foreach (CheckBox box in Capabilities_Wrap.Children) { if (LoadData.Species_SpecialCapability.FindAll(x => x.Key == (VPTU.Pokedex.Pokemon.Pokemon_Capabilities)box.Tag).Count >= 1) { box.IsChecked = true; //Set Values (If Applicable) } else { box.IsChecked = false; } } } catch { } #endregion //Load Pokemon Base Stat Data #region Base Stats try { BaseStats_HP.Value = LoadData.Species_BaseStats_HP; } catch { } try { BaseStats_Attack.Value = LoadData.Species_BaseStats_Attack; } catch { } try { BaseStats_Defence.Value = LoadData.Species_BaseStats_Defence; } catch { } try { BaseStats_SpAttack.Value = LoadData.Species_BaseStats_SpAttack; } catch { } try { BaseStats_SpDefence.Value = LoadData.Species_BaseStats_SpDefence; } catch { } try { BaseStats_Speed.Value = LoadData.Species_BaseStats_Speed; } catch { } #endregion //All the linked objects get loaded here #region Links //Load Linked Resources #region Resources #endregion //Load Linked Move Data #region Moves try { Moves_List.Items.Clear(); if (LoadData.Moves == null) { LoadData.Moves = new List <VPTU.Pokedex.Pokemon.Link_Moves>(); } foreach (VPTU.Pokedex.Pokemon.Link_Moves ML in LoadData.Moves) { Moves_List.Items.Add(ML); } } catch { } #endregion //Load Linked Forms and Evolution Data here #region Evo Forms try { FormsAndEvos_List.Items.Clear(); if (LoadData.Evolutions == null) { LoadData.Evolutions = new List <VPTU.Pokedex.Pokemon.Link_Evolutions>(); } foreach (VPTU.Pokedex.Pokemon.Link_Evolutions EL in LoadData.Evolutions) { EvoLinks link = new EvoLinks(); link.LinkData = EL; link.PokemonName = Mgr.SaveData.PokedexData.Pokemon.Find(x => x.Species_DexID == EL.Pokemon_Evo).Species_Name; FormsAndEvos_List.Items.Add(link); } } catch { } #endregion #endregion }
private void Moves_SelectionChanged(object sender, SelectionChangedEventArgs e) { Selected_Pokemon = (VPTU.Pokedex.Pokemon.PokemonData)Pokemon.SelectedItem; }