diff --git a/PokemonManager.v11.suo b/PokemonManager.v11.suo
index faf79f7..474252b 100644
Binary files a/PokemonManager.v11.suo and b/PokemonManager.v11.suo differ
diff --git a/PokemonManager/Items/MailBox.cs b/PokemonManager/Items/MailBox.cs
index 2453964..689121c 100644
--- a/PokemonManager/Items/MailBox.cs
+++ b/PokemonManager/Items/MailBox.cs
@@ -146,8 +146,8 @@ public void Reset() {
listViewItems.Clear();
Mail defaultMail = new Mail();
- defaultMail.TrainerName = "TRIGGER";
- defaultMail.SetTrainerIDs(60000, 0);
+ defaultMail.TrainerName = "Trigger";
+ defaultMail.SetTrainerIDs(45465, 28557);
defaultMail.MailItemID = 130;
defaultMail.OriginalHolderDexID = 197;
diff --git a/PokemonManager/PokeManager.cs b/PokemonManager/PokeManager.cs
index c69b74b..49678e1 100644
--- a/PokemonManager/PokeManager.cs
+++ b/PokemonManager/PokeManager.cs
@@ -24,8 +24,10 @@
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
using System.Xml;
namespace PokemonManager {
@@ -2315,6 +2317,15 @@ public static bool CanSwitchPokemon(IPokemon pokemon) {
public static bool CanSwitchShadowPokemon(IPokemon pokemon) {
if (IsHoldingPokemon) {
bool needsNewLocation = pokemon.IsShadowPokemon && pokemon.GameSave != holdPokemon.Container.GameSave;
+ if (holdPokemon.Container.GameSave.GameType == GameTypes.XD) {
+ if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Daycare)
+ needsNewLocation = true;
+ else if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
+ needsNewLocation = true;
+ else if (!pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index == 0)
+ needsNewLocation = true;
+ }
+
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
for (int j = 0; j < 30 && needsNewLocation; j++) {
if (pokemon.PokePC[i][j] == null) {
@@ -2330,6 +2341,8 @@ public static bool CanSwitchShadowPokemon(IPokemon pokemon) {
public static bool CanSwitchEgg(IPokemon pokemon) {
if (IsHoldingPokemon) {
bool needsNewLocation = pokemon.IsEgg && (holdPokemon.Container.GameType == GameTypes.Colosseum || holdPokemon.Container.GameType == GameTypes.XD);
+ if (pokemon.IsEgg && holdPokemon.Container.Type == ContainerTypes.Daycare)
+ needsNewLocation = true;
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
for (int j = 0; j < 30 && needsNewLocation; j++) {
if (pokemon.PokePC[i][j] == null) {
@@ -2365,6 +2378,16 @@ public static void SwitchPokemon(IPokemon pokemon) {
// Try to make the pokemon drop in the current game. It's only required for shadow Pokemon though.
bool needsNewLocation = (pokemon.IsShadowPokemon && pokemon.GameSave != holdPokemon.Container.GameSave) ||
(pokemon.IsEgg && (holdPokemon.Container.GameType == GameTypes.Colosseum || holdPokemon.Container.GameType == GameTypes.XD));
+ if (holdPokemon.Container.GameSave.GameType == GameTypes.XD) {
+ if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Daycare)
+ needsNewLocation = true;
+ else if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
+ needsNewLocation = true;
+ else if (!pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index == 0)
+ needsNewLocation = true;
+ }
+ if (pokemon.IsEgg && holdPokemon.Container.Type == ContainerTypes.Daycare)
+ needsNewLocation = true;
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
for (int j = 0; j < 30 && needsNewLocation; j++) {
if (pokemon.PokePC[i][j] == null) {
@@ -2400,6 +2423,8 @@ public static void DropPokemon() {
holdPokemon.Pokemon.IsMoving = false;
if (holdPokemon.Container.Type == ContainerTypes.Party)
((IPokeParty)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
+ else if (holdPokemon.Container.Type == ContainerTypes.Daycare && holdPokemon.Index < 2)
+ ((IDaycare)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
else if (holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
((XDPurificationChamber)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
else
diff --git a/PokemonManager/PokemonDatabase.db b/PokemonManager/PokemonDatabase.db
index b0b96f5..0c286a0 100644
Binary files a/PokemonManager/PokemonDatabase.db and b/PokemonManager/PokemonDatabase.db differ
diff --git a/PokemonManager/PokemonManager.csproj b/PokemonManager/PokemonManager.csproj
index 4433d8b..2274b96 100644
--- a/PokemonManager/PokemonManager.csproj
+++ b/PokemonManager/PokemonManager.csproj
@@ -1421,6 +1421,7 @@
Always
+
diff --git a/PokemonManager/PokemonStructures/BoxPokemon.cs b/PokemonManager/PokemonStructures/BoxPokemon.cs
index 0032e26..a116465 100644
--- a/PokemonManager/PokemonStructures/BoxPokemon.cs
+++ b/PokemonManager/PokemonStructures/BoxPokemon.cs
@@ -190,6 +190,8 @@ public BitmapSource Sprite {
get {
if (IsEgg)
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
+ if (DexID == 327)
+ return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
}
}
diff --git a/PokemonManager/PokemonStructures/ColosseumDaycare.cs b/PokemonManager/PokemonStructures/ColosseumDaycare.cs
index 7e6b2ed..316d767 100644
--- a/PokemonManager/PokemonStructures/ColosseumDaycare.cs
+++ b/PokemonManager/PokemonStructures/ColosseumDaycare.cs
@@ -85,6 +85,19 @@ public IPokemon this[int index] {
throw new ArgumentOutOfRangeException("Index outside of bounds for Daycare", new Exception());
}
}
+ public void AddPokemon(IPokemon pokemon) {
+ pokePC.GameSave.IsChanged = true;
+ IPokemon pkm = (pokemon != null ? (pokemon is ColosseumPokemon ? pokemon : pokemon.CreateColosseumPokemon(((GCGameSave)GameSave).CurrentRegion)): null);
+ pkm.GameType = GameType;
+ pkm.PokeContainer = this;
+ if (pokePC.GameSave != null)
+ pokePC.GameSave.OwnPokemon(pkm);
+ depositedPokemon = pkm as ColosseumPokemon;
+ depositedPokemon = pkm as ColosseumPokemon;
+ DaycareStatus = 1;
+ InitialLevel = 0;
+ InitialPurification = 0;
+ }
public int IndexOf(IPokemon pokemon) {
if (pokemon == depositedPokemon)
return 0;
diff --git a/PokemonManager/PokemonStructures/ColosseumPokemon.cs b/PokemonManager/PokemonStructures/ColosseumPokemon.cs
index a887fa9..1ed8207 100644
--- a/PokemonManager/PokemonStructures/ColosseumPokemon.cs
+++ b/PokemonManager/PokemonStructures/ColosseumPokemon.cs
@@ -166,6 +166,8 @@ public BitmapSource Sprite {
get {
if (IsEgg)
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
+ if (DexID == 327)
+ return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
}
}
diff --git a/PokemonManager/PokemonStructures/Events/PokemonEventDistribution.cs b/PokemonManager/PokemonStructures/Events/PokemonEventDistribution.cs
index 312c359..8e702ec 100644
--- a/PokemonManager/PokemonStructures/Events/PokemonEventDistribution.cs
+++ b/PokemonManager/PokemonStructures/Events/PokemonEventDistribution.cs
@@ -60,7 +60,7 @@ public override void GenerateReward(IGameSave gameSave) {
pkm.DexID = DexID;
pkm.Personality = (Personality.HasValue ? Personality.Value : (uint)random.Next());
pkm.Experience = PokemonDatabase.GetExperienceFromLevel(pokemonData.ExperienceGroup, (IsEgg ? (byte)5 : Level));
- pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (pokemonData.HasTwoAbilities && random.Next(2) == 1)); // TODO: TESTING
+ pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (!pokemonData.CanOnlyHaveFirstAbility && random.Next(2) == 1));
pkm.Nickname = (Nickname != null ? Nickname : pokemonData.Name.ToUpper());
pkm.BallCaughtID = 4;
pkm.MetLocationID = 255;
diff --git a/PokemonManager/PokemonStructures/GBADaycare.cs b/PokemonManager/PokemonStructures/GBADaycare.cs
index 708b603..122e872 100644
--- a/PokemonManager/PokemonStructures/GBADaycare.cs
+++ b/PokemonManager/PokemonStructures/GBADaycare.cs
@@ -163,6 +163,22 @@ public IPokemon this[int index] {
}
}
}
+ public void AddPokemon(IPokemon pokemon) {
+ pokePC.GameSave.IsChanged = true;
+ IPokemon pkm = (pokemon != null ? (pokemon is GBAPokemon ? pokemon : pokemon.CreateGBAPokemon(GameType)): null);
+ int index = 0;
+ for (index = 0; index < 3; index++) {
+ if (originalPokemon[index] == null)
+ break;
+ }
+ pkm.GameType = GameType;
+ pkm.PokeContainer = this;
+ if (pokePC.GameSave != null)
+ pokePC.GameSave.SetPokemonOwned(pkm.DexID, true);
+ finalPokemon[index] = pkm as GBAPokemon;
+ originalPokemon[index] = pkm as GBAPokemon;
+ SetGainedExperience(index, 0);
+ }
public int IndexOf(IPokemon pokemon) {
for (int i = 0; i < finalPokemon.Length; i++) {
if (finalPokemon[i] == pokemon)
diff --git a/PokemonManager/PokemonStructures/GBAPokemon.cs b/PokemonManager/PokemonStructures/GBAPokemon.cs
index 5295ec7..992333e 100644
--- a/PokemonManager/PokemonStructures/GBAPokemon.cs
+++ b/PokemonManager/PokemonStructures/GBAPokemon.cs
@@ -89,9 +89,10 @@ public GBAPokemon(byte[] data, bool decrypted = false) {
else
OpenEncryptedData(data);
+ // A pretty old bug, we don't really need this anymore.
// Fix Colosseum Game Origin being incorrect. (Support for users of previous versions)
- if ((byte)GameOrigin == 11)
- GameOrigin = GameOrigins.ColosseumXD;
+ //if ((byte)GameOrigin == 11)
+ // GameOrigin = GameOrigins.ColosseumXD;
}
#region Basic Info
diff --git a/PokemonManager/PokemonStructures/IDaycare.cs b/PokemonManager/PokemonStructures/IDaycare.cs
index e7d5882..6c26caf 100644
--- a/PokemonManager/PokemonStructures/IDaycare.cs
+++ b/PokemonManager/PokemonStructures/IDaycare.cs
@@ -10,5 +10,6 @@ namespace PokemonManager.PokemonStructures {
public interface IDaycare : IPokeContainer {
uint GetWithdrawCost(int index);
+ void AddPokemon(IPokemon pokemon);
}
}
diff --git a/PokemonManager/PokemonStructures/PokemonData.cs b/PokemonManager/PokemonStructures/PokemonData.cs
index de0649b..fb9a46b 100644
--- a/PokemonManager/PokemonStructures/PokemonData.cs
+++ b/PokemonManager/PokemonStructures/PokemonData.cs
@@ -44,7 +44,8 @@ public PokemonData(DataRow row) {
this.type2 = (row["Type2"] as string == null ? this.type1 : GetPokemonTypeFromString(row["Type2"] as string));
this.ability1ID = PokemonDatabase.GetAbilityIDFromString(row["Ability1"] as string);
- this.ability2ID = (row["Ability2"] as string == null ? this.ability1ID : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
+ this.ability2ID = (row["Ability2"] as string == null ? (byte)0 : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
+ //this.ability2ID = (row["Ability2"] as string == null ? this.ability1ID : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
this.eggGroup1 = GetEggGroupFromString(row["EggGroup1"] as string);
this.eggGroup2 = GetEggGroupFromString(row["EggGroup2"] as string);
@@ -132,6 +133,9 @@ public byte Ability2ID {
public bool HasTwoAbilities {
get { return ability1ID != ability2ID; }
}
+ public bool CanOnlyHaveFirstAbility {
+ get { return ability2ID == 0; }
+ }
public EggGroups EggGroup1 {
get { return eggGroup1; }
}
diff --git a/PokemonManager/PokemonStructures/XDDaycare.cs b/PokemonManager/PokemonStructures/XDDaycare.cs
index 2dd98b6..6685c13 100644
--- a/PokemonManager/PokemonStructures/XDDaycare.cs
+++ b/PokemonManager/PokemonStructures/XDDaycare.cs
@@ -85,6 +85,19 @@ public IPokemon this[int index] {
throw new ArgumentOutOfRangeException("Index outside of bounds for Daycare", new Exception());
}
}
+ public void AddPokemon(IPokemon pokemon) {
+ pokePC.GameSave.IsChanged = true;
+ IPokemon pkm = (pokemon != null ? (pokemon is XDPokemon ? pokemon : pokemon.CreateXDPokemon(((GCGameSave)GameSave).CurrentRegion)): null);
+ pkm.GameType = GameType;
+ pkm.PokeContainer = this;
+ if (pokePC.GameSave != null)
+ pokePC.GameSave.OwnPokemon(pkm);
+ depositedPokemon = pkm as XDPokemon;
+ depositedPokemon = pkm as XDPokemon;
+ DaycareStatus = 1;
+ InitialLevel = 0;
+ InitialPurification = 0;
+ }
public int IndexOf(IPokemon pokemon) {
if (pokemon == depositedPokemon)
return 0;
diff --git a/PokemonManager/PokemonStructures/XDPokemon.cs b/PokemonManager/PokemonStructures/XDPokemon.cs
index 1325651..f429712 100644
--- a/PokemonManager/PokemonStructures/XDPokemon.cs
+++ b/PokemonManager/PokemonStructures/XDPokemon.cs
@@ -167,6 +167,8 @@ public BitmapSource Sprite {
return ResourceDatabase.GetImageFromName("XD001FrontSprite");
if (IsEgg)
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
+ if (DexID == 327)
+ return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
}
}
diff --git a/PokemonManager/Properties/AssemblyInfo.cs b/PokemonManager/Properties/AssemblyInfo.cs
index b8893a2..325e48c 100644
--- a/PokemonManager/Properties/AssemblyInfo.cs
+++ b/PokemonManager/Properties/AssemblyInfo.cs
@@ -51,7 +51,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4.5.5")]
-[assembly: AssemblyFileVersion("1.4.5.5")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: GuidAttribute("d527114e-3888-417f-807f-e08fef41029c")]
[assembly: NeutralResourcesLanguageAttribute("en")]
diff --git a/PokemonManager/Properties/Resources.Designer.cs b/PokemonManager/Properties/Resources.Designer.cs
index b300501..c702261 100644
--- a/PokemonManager/Properties/Resources.Designer.cs
+++ b/PokemonManager/Properties/Resources.Designer.cs
@@ -180,6 +180,16 @@ internal static System.Drawing.Bitmap BoxSelectorSummaryHover {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap BulbapediaIcon {
+ get {
+ object obj = ResourceManager.GetObject("BulbapediaIcon", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/PokemonManager/Properties/Resources.resx b/PokemonManager/Properties/Resources.resx
index e0afd5e..96fc408 100644
--- a/PokemonManager/Properties/Resources.resx
+++ b/PokemonManager/Properties/Resources.resx
@@ -1270,4 +1270,7 @@
..\Resources\Trainers\YoungsterMale.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\UI\Pokemon\BulbapediaIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/PokemonManager/Resources/UI/Pokemon/BulbapediaIcon.png b/PokemonManager/Resources/UI/Pokemon/BulbapediaIcon.png
new file mode 100644
index 0000000..ee62135
Binary files /dev/null and b/PokemonManager/Resources/UI/Pokemon/BulbapediaIcon.png differ
diff --git a/PokemonManager/Windows/AboutWindow.xaml b/PokemonManager/Windows/AboutWindow.xaml
index e5c212d..a4e3a84 100644
--- a/PokemonManager/Windows/AboutWindow.xaml
+++ b/PokemonManager/Windows/AboutWindow.xaml
@@ -36,9 +36,16 @@
diff --git a/PokemonManager/Windows/AboutWindow.xaml.cs b/PokemonManager/Windows/AboutWindow.xaml.cs
index 2ce7b2b..91d2492 100644
--- a/PokemonManager/Windows/AboutWindow.xaml.cs
+++ b/PokemonManager/Windows/AboutWindow.xaml.cs
@@ -25,7 +25,7 @@ public AboutWindow() {
InitializeComponent();
DateTime buildDate = GetLinkerTime(Assembly.GetExecutingAssembly());
- this.labelVersion.Content = Assembly.GetExecutingAssembly().GetName().Version.ToString() + " Beta";
+ this.labelVersion.Content = Assembly.GetExecutingAssembly().GetName().Version.ToString() + " Release";
this.labelBuildDate.Content = buildDate.ToShortDateString() + " (" + buildDate.ToShortTimeString() + ")";
}
diff --git a/PokemonManager/Windows/ControlsWindow.xaml b/PokemonManager/Windows/ControlsWindow.xaml
index 1d7af55..618dab7 100644
--- a/PokemonManager/Windows/ControlsWindow.xaml
+++ b/PokemonManager/Windows/ControlsWindow.xaml
@@ -1,7 +1,7 @@
+ Title="Trigger's PC Controls" Height="553" Width="308" ResizeMode="NoResize" Background="#FF286496" Icon="/TriggersPC;component/Resources/Icons/IconControls.png" WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
@@ -27,7 +27,7 @@
-
+
@@ -41,14 +41,24 @@
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/PokemonManager/Windows/DecorationViewerTab.xaml.cs b/PokemonManager/Windows/DecorationViewerTab.xaml.cs
index 8d56ebd..3d536b5 100644
--- a/PokemonManager/Windows/DecorationViewerTab.xaml.cs
+++ b/PokemonManager/Windows/DecorationViewerTab.xaml.cs
@@ -71,8 +71,10 @@ public void GotoDecoration(byte decorationID) {
double offset = scrollHeight * index / listViewItems.Items.Count;
vsp.SetVerticalOffset(offset);*/
- listViewItems.ScrollIntoView(listViewItems.SelectedItem);
- ((Control)listViewItems.SelectedItem).Focus();
+ if (index != -1) {
+ listViewItems.ScrollIntoView(listViewItems.SelectedItem);
+ ((Control)listViewItems.SelectedItem).Focus();
+ }
}
public void LoadPocket(DecorationPocket pocket) {
diff --git a/PokemonManager/Windows/ItemViewerTab.xaml.cs b/PokemonManager/Windows/ItemViewerTab.xaml.cs
index 432c50e..df9c4ab 100644
--- a/PokemonManager/Windows/ItemViewerTab.xaml.cs
+++ b/PokemonManager/Windows/ItemViewerTab.xaml.cs
@@ -64,8 +64,10 @@ public void GotoItem(ushort itemID) {
double offset = scrollHeight * index / listViewItems.Items.Count;
vsp.SetVerticalOffset(offset);*/
- listViewItems.ScrollIntoView(listViewItems.SelectedItem);
- ((Control)listViewItems.SelectedItem).Focus();
+ if (index != -1) {
+ listViewItems.ScrollIntoView(listViewItems.SelectedItem);
+ ((Control)listViewItems.SelectedItem).Focus();
+ }
}
public void LoadPocket(ItemPocket pocket) {
diff --git a/PokemonManager/Windows/LearnMoveWindow.xaml b/PokemonManager/Windows/LearnMoveWindow.xaml
index d4a5a0d..aae838d 100644
--- a/PokemonManager/Windows/LearnMoveWindow.xaml
+++ b/PokemonManager/Windows/LearnMoveWindow.xaml
@@ -33,6 +33,9 @@
+
diff --git a/PokemonManager/Windows/LearnMoveWindow.xaml.cs b/PokemonManager/Windows/LearnMoveWindow.xaml.cs
index be7c4a3..e8a932c 100644
--- a/PokemonManager/Windows/LearnMoveWindow.xaml.cs
+++ b/PokemonManager/Windows/LearnMoveWindow.xaml.cs
@@ -29,6 +29,7 @@ public partial class LearnMoveWindow : Window {
private int selectedIndex;
private ushort newMoveID;
private bool contestMode;
+ private MoveData currentMoveData;
public LearnMoveWindow(IPokemon pokemon, ushort moveID) {
InitializeComponent();
@@ -96,6 +97,7 @@ public LearnMoveWindow(IPokemon pokemon, ushort moveID) {
this.labelMoveAppeal.Content = "";
this.labelMoveJam.Content = "";
this.textBlockMoveDescription.Text = "";
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
}
public static bool? ShowDialog(Window owner, IPokemon pokemon, ushort moveID) {
@@ -124,6 +126,7 @@ private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
this.labelMoveAppeal.Content = "";
this.labelMoveJam.Content = "";
this.textBlockMoveDescription.Text = "";
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
}
else {
Move move = (Move)(listViewMoves.Items[selectedIndex] as ListViewItem).Tag;
@@ -133,6 +136,8 @@ private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
this.labelMoveAppeal.Content = move.MoveData.Appeal;
this.labelMoveJam.Content = move.MoveData.Jam;
this.textBlockMoveDescription.Text = (contestMode ? move.MoveData.ContestDescription : move.MoveData.Description);
+ currentMoveData = move.MoveData;
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Visible;
}
buttonReplaceMove.IsEnabled = selectedIndex >= 0 && selectedIndex < 4;
}
@@ -151,5 +156,9 @@ private void OnContestModeChecked(object sender, RoutedEventArgs e) {
OnMoveSelectionChanged(null, null);
}
+ private void OnOpenMoveInBulbapedia(object sender, RoutedEventArgs e) {
+ string url = "http://bulbapedia.bulbagarden.net/wiki/" + currentMoveData.Name + " _(move)";
+ System.Diagnostics.Process.Start(url);
+ }
}
}
diff --git a/PokemonManager/Windows/PokeBoxControl.xaml.cs b/PokemonManager/Windows/PokeBoxControl.xaml.cs
index 40f9184..73752e5 100644
--- a/PokemonManager/Windows/PokeBoxControl.xaml.cs
+++ b/PokemonManager/Windows/PokeBoxControl.xaml.cs
@@ -168,6 +168,7 @@ public void AddSlave(PokeBoxControl slave) {
slave.master = this;
slave.Mode = mode;
slave.IsPickupMode = pickupMode;
+ slave.IsSummaryMode = summaryMode;
slaves.Add(slave);
}
public void RemoveSlave(PokeBoxControl slave) {
@@ -723,6 +724,101 @@ private void OnKeyDown(object sender, KeyEventArgs e) {
//else
IsSummaryMode = true;
}
+ else if (e.Key == Key.Z) {
+ PokeManager.DropAll();
+ PokeManager.ClearSelectedPokemon();
+ PokeManager.RefreshUI();
+ }
+ else if (e.Key == Key.X) {
+ if (mode == PokeBoxControlModes.MovePokemon) {
+ if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) {
+ IPokeContainer container = null;
+ if (hoverIndex != -1) {
+ container = pokeContainer;
+ }
+ else {
+ foreach (PokeBoxControl slave in slaves) {
+ if (slave.hoverIndex != -1 && slave.pokeContainer.Type == ContainerTypes.Box)
+ container = slave.pokeContainer;
+ }
+ }
+ bool isAllSelected = true;
+ foreach (IPokemon pokemon in container) {
+ if (!PokeManager.IsPokemonSelected(pokemon)) {
+ isAllSelected = false;
+ break;
+ }
+ }
+ if (isAllSelected) {
+ foreach (IPokemon pokemon in container) {
+ if (PokeManager.IsPokemonSelected(pokemon))
+ PokeManager.UnselectPokemon(pokemon);
+ }
+ }
+ else {
+ foreach (IPokemon pokemon in container) {
+ if (!PokeManager.IsPokemonSelected(pokemon))
+ PokeManager.SelectPokemon(pokemon);
+ }
+ }
+ PokeManager.RefreshUI();
+ }
+ else {
+ if (hoverIndex != -1) {
+ OnContextMenuSelectAllClicked(null, null);
+ }
+ else {
+ foreach (PokeBoxControl slave in slaves) {
+ if (slave.hoverIndex != -1 && slave.pokeContainer.Type == ContainerTypes.Box) {
+ slave.OnContextMenuSelectAllClicked(null, null);
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (e.Key == Key.C) {
+ if (mode == PokeBoxControlModes.MovePokemon) {
+ if (hoverIndex != -1) {
+ OnContextMenuSelectAllClicked(null, null);
+ PokeManager.PickupSelection(this);
+ PokeManager.RefreshUI();
+ }
+ else {
+ foreach (PokeBoxControl slave in slaves) {
+ if (slave.hoverIndex != -1 && slave.pokeContainer.Type == ContainerTypes.Box) {
+ slave.OnContextMenuSelectAllClicked(null, null);
+ PokeManager.PickupSelection(this);
+ PokeManager.RefreshUI();
+ }
+ }
+ }
+ }
+ }
+ else if (e.Key == Key.V) {
+ if (mode == PokeBoxControlModes.MovePokemon && PokeManager.IsHoldingPokemon) {
+ if (hoverIndex != -1) {
+ for (int i = 0; i < 30; i++) {
+ if (pokeContainer[i] == null) {
+ TryMovePokemon(new PokeBoxTagStructure(this, i));
+ break;
+ }
+ }
+ }
+ else {
+ foreach (PokeBoxControl slave in slaves) {
+ if (slave.hoverIndex != -1 && slave.pokeContainer.Type == ContainerTypes.Box) {
+ for (int i = 0; i < 30; i++) {
+ if (slave.pokeContainer[i] == null) {
+ TryMovePokemon(new PokeBoxTagStructure(slave, i));
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
}
private void OnKeyUp(object sender, KeyEventArgs e) {
@@ -1093,8 +1189,32 @@ private void OnPreviewMouseMove(object sender, MouseEventArgs e) {
private void OnEditBoxClicked(object sender, MouseButtonEventArgs e) {
if (e.ChangedButton == MouseButton.Left && mode == PokeBoxControlModes.MovePokemon) {
- OnBoxContextMenuOpening(null, null);
- rectEditBox.ContextMenu.IsOpen = true;
+ if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) {
+ bool isAllSelected = true;
+ foreach (IPokemon pokemon in pokeContainer) {
+ if (!PokeManager.IsPokemonSelected(pokemon)) {
+ isAllSelected = false;
+ break;
+ }
+ }
+ if (isAllSelected) {
+ foreach (IPokemon pokemon in pokeContainer) {
+ if (PokeManager.IsPokemonSelected(pokemon))
+ PokeManager.UnselectPokemon(pokemon);
+ }
+ }
+ else {
+ foreach (IPokemon pokemon in pokeContainer) {
+ if (!PokeManager.IsPokemonSelected(pokemon))
+ PokeManager.SelectPokemon(pokemon);
+ }
+ }
+ PokeManager.RefreshUI();
+ }
+ else {
+ OnBoxContextMenuOpening(null, null);
+ rectEditBox.ContextMenu.IsOpen = true;
+ }
}
}
@@ -1217,7 +1337,8 @@ private void OnPokemonContextMenuOpening(object sender, ContextMenuEventArgs e)
((MenuItem)contextMenu.Items[1]).Tag = tag;
//((MenuItem)contextMenu.Items[2]).Tag = tag;
((MenuItem)contextMenu.Items[2]).Tag = tag;
- ((MenuItem)contextMenu.Items[4]).Tag = tag;
+ ((MenuItem)contextMenu.Items[3]).Tag = tag;
+ ((MenuItem)contextMenu.Items[5]).Tag = tag;
((MenuItem)contextMenu.Items[0]).IsEnabled = true;
if (pkm == null) {
@@ -1255,19 +1376,26 @@ private void OnPokemonContextMenuOpening(object sender, ContextMenuEventArgs e)
//((MenuItem)contextMenu.Items[2]).IsEnabled = false;
((MenuItem)contextMenu.Items[2]).IsEnabled = false;
}
- ((MenuItem)contextMenu.Items[4]).IsEnabled = (pkm != null && !pkm.IsShadowPokemon);
+ ((MenuItem)contextMenu.Items[5]).IsEnabled = (pkm != null && !pkm.IsShadowPokemon);
if (pkm != null && pkm.IsInDaycare) {
((MenuItem)contextMenu.Items[0]).IsEnabled = false;
//((MenuItem)contextMenu.Items[2]).IsEnabled = false;
((MenuItem)contextMenu.Items[2]).IsEnabled = false;
- ((MenuItem)contextMenu.Items[4]).IsEnabled = false;
+ ((MenuItem)contextMenu.Items[5]).IsEnabled = false;
}
+ ((MenuItem)contextMenu.Items[3]).IsEnabled = PokeManager.IsHoldingPokemon;
}
private void OnBoxContextMenuOpening(object sender, ContextMenuEventArgs e) {
- //((MenuItem)boxContextMenu.Items[0]).IsEnabled = (pokeContainer.GameType != GameTypes.PokemonBox);
- //((MenuItem)boxContextMenu.Items[2]).IsEnabled = (pokeContainer.GameIndex != -1);
- //((MenuItem)boxContextMenu.Items[2]).Header = "Send All To " + PokeManager.Settings.ManagerNickname;
+ ((MenuItem)boxContextMenu.Items[1]).IsEnabled = false;
+ ((MenuItem)boxContextMenu.Items[2]).IsEnabled = false;
+ foreach (IPokemon pokemon in pokeContainer) {
+ ((MenuItem)boxContextMenu.Items[1]).IsEnabled = true;
+ if (pokemon.IsHoldingItem) {
+ ((MenuItem)boxContextMenu.Items[2]).IsEnabled = true;
+ break;
+ }
+ }
}
private void OnContextMenuSendBoxTo(object sender, RoutedEventArgs e) {
PokemonSelectedEventArgs args = new PokemonSelectedEventArgs();
@@ -1290,6 +1418,7 @@ private void OnContextMenuSendBoxTo(object sender, RoutedEventArgs e) {
private void OnContextMenuEditBoxClicked(object sender, RoutedEventArgs e) {
PokeManager.DropAll();
PokeManager.ClearSelectedPokemon();
+ PokeManager.RefreshUI();
EditBoxWindow.ShowDialog(Window.GetWindow(this), (IPokeBox)pokeContainer);
}
private void OnContextMenuSelectAllClicked(object sender, RoutedEventArgs e) {
@@ -1300,6 +1429,57 @@ private void OnContextMenuSelectAllClicked(object sender, RoutedEventArgs e) {
}
PokeManager.RefreshUI();
}
+ private void OnContextMenuTakeAllItemsClicked(object sender, RoutedEventArgs e) {
+ PokeManager.DropAll();
+ PokeManager.ClearSelectedPokemon();
+ int count = 0;
+ bool sentToBag = false;
+ bool sentToPC = false;
+ bool sentToYourPC = false;
+ foreach (IPokemon pokemon in pokeContainer) {
+ if (pokemon.IsHoldingItem) {
+ if (pokemon.GameSave.Inventory != null && pokemon.GameSave.Inventory.Items[pokemon.HeldItemData.PocketType].HasRoomForItem(pokemon.HeldItemID, 1)) {
+ if (pokemon.GameSave.GameType == GameTypes.Any)
+ sentToYourPC = true;
+ else
+ sentToBag = true;
+ pokemon.GameSave.Inventory.Items[pokemon.HeldItemData.PocketType].AddItem(pokemon.HeldItemID, 1);
+ }
+ else if (pokemon.GameSave.Inventory != null && pokemon.GameSave.Inventory.Items.ContainsPocket(ItemTypes.PC) && pokemon.GameSave.Inventory.Items[ItemTypes.PC].HasRoomForItem(pokemon.HeldItemID, 1)) {
+ sentToPC = true;
+ PokeManager.ManagerGameSave.Inventory.Items[pokemon.HeldItemData.PocketType].AddItem(pokemon.HeldItemID, 1);
+ }
+ else {
+ sentToYourPC = true;
+ PokeManager.ManagerGameSave.Inventory.Items[pokemon.HeldItemData.PocketType].AddItem(pokemon.HeldItemID, 1);
+ }
+ pokemon.HeldItemID = 0;
+ count++;
+ }
+ }
+ if (count > 0) {
+ string sentTo = "";
+ if (sentToBag) {
+ sentTo += pokeContainer.GameSave.TrainerName + "'s Bag";
+ if (sentToPC && sentToYourPC)
+ sentTo += ", ";
+ else if (sentToPC || sentToYourPC)
+ sentTo += " and ";
+ }
+ if (sentToPC) {
+ sentTo += pokeContainer.GameSave.TrainerName + "'s PC";
+ if (sentToBag && sentToYourPC)
+ sentTo += ", and ";
+ else if (sentToYourPC)
+ sentTo += " and ";
+ }
+ if (sentToYourPC) {
+ sentTo += PokeManager.Settings.ManagerNickname;
+ }
+ TriggerMessageBox.Show(Window.GetWindow(this), "Sent " + count + " Item" + (count != 1 ? "s" : "") + " to " + sentTo, "Took Items");
+ }
+ PokeManager.RefreshUI();
+ }
private void OnContextMenuReleaseAllClicked(object sender, RoutedEventArgs e) {
PokeManager.DropAll();
PokeManager.ClearSelectedPokemon();
@@ -1314,8 +1494,8 @@ private void OnContextMenuReleaseAllClicked(object sender, RoutedEventArgs e) {
pokemon.PokeContainer.Remove(pokemon);
pokemon.IsReleased = true;
}
- PokeManager.RefreshUI();
}
+ PokeManager.RefreshUI();
}
private void OnContextMenuGiveClicked(object sender, RoutedEventArgs e) {
@@ -1336,6 +1516,10 @@ private void OnContextMenuGiveClicked(object sender, RoutedEventArgs e) {
}
}
}
+ private void OnContextMenuCancelPickupClicked(object sender, RoutedEventArgs e) {
+ PokeManager.DropAll();
+ PokeManager.RefreshUI();
+ }
private void OnContextMenuMoveClicked(object sender, RoutedEventArgs e) {
if (master != null) {
master.OnContextMenuMoveClicked(sender, e);
@@ -1804,17 +1988,6 @@ private void CreateBoxElements() {
shadowMask.IsHitTestVisible = false;
gridBoxPokemon.Children.Insert(gridBoxPokemon.Children.Count - 2, shadowMask);
- Image egg = new Image();
- egg.Stretch = Stretch.None;
- egg.SnapsToDevicePixels = true;
- egg.UseLayoutRounding = true;
- egg.Width = 9;
- egg.Height = 11;
- egg.Margin = new Thickness(j * 24 + 20, i * 24 + 21, 0, 0);
- egg.HorizontalAlignment = HorizontalAlignment.Left;
- egg.VerticalAlignment = VerticalAlignment.Top;
- gridBoxPokemon.Children.Insert(gridBoxPokemon.Children.Count - 2, egg);
-
// Used for multi select highlighting
Rectangle selectMask = new Rectangle();
selectMask.Width = 32;
@@ -1828,6 +2001,17 @@ private void CreateBoxElements() {
selectMask.IsHitTestVisible = false;
gridBoxPokemon.Children.Insert(gridBoxPokemon.Children.Count - 2, selectMask);
+ Image egg = new Image();
+ egg.Stretch = Stretch.None;
+ egg.SnapsToDevicePixels = true;
+ egg.UseLayoutRounding = true;
+ egg.Width = 9;
+ egg.Height = 11;
+ egg.Margin = new Thickness(j * 24 + 20, i * 24 + 21, 0, 0);
+ egg.HorizontalAlignment = HorizontalAlignment.Left;
+ egg.VerticalAlignment = VerticalAlignment.Top;
+ gridBoxPokemon.Children.Insert(gridBoxPokemon.Children.Count - 2, egg);
+
boxImages.Add(image);
boxShadowMasks.Add(shadowMask);
boxEggMarkers.Add(egg);
@@ -1871,6 +2055,9 @@ private void CreateContextMenu() {
MenuItem sendTo = new MenuItem();
sendTo.Header = "Send To";
sendTo.Click += OnContextMenuSendToClicked;
+ MenuItem cancelPickup = new MenuItem();
+ cancelPickup.Header = "Cancel Pickup";
+ cancelPickup.Click += OnContextMenuCancelPickupClicked;
Separator separator = new Separator();
MenuItem release = new MenuItem();
release.Header = "Release";
@@ -1880,6 +2067,7 @@ private void CreateContextMenu() {
contextMenu.Items.Add(summary);
//contextMenu.Items.Add(give);
contextMenu.Items.Add(sendTo);
+ contextMenu.Items.Add(cancelPickup);
contextMenu.Items.Add(separator);
contextMenu.Items.Add(release);
}
@@ -1892,9 +2080,9 @@ private void CreateBoxContextMenu() {
MenuItem selectAll = new MenuItem();
selectAll.Header = "Select All";
selectAll.Click += OnContextMenuSelectAllClicked;
- //MenuItem sendBoxTo = new MenuItem();
- //sendBoxTo.Header = "Send Box To ";
- //sendBoxTo.Click += OnContextMenuSendBoxTo;
+ MenuItem takeAll = new MenuItem();
+ takeAll.Header = "Take All Items";
+ takeAll.Click += OnContextMenuTakeAllItemsClicked;
Separator separator = new Separator();
MenuItem releaseAll = new MenuItem();
releaseAll.Header = "Release All";
@@ -1902,7 +2090,7 @@ private void CreateBoxContextMenu() {
boxContextMenu.Items.Add(edit);
boxContextMenu.Items.Add(selectAll);
- //boxContextMenu.Items.Add(sendBoxTo);
+ boxContextMenu.Items.Add(takeAll);
boxContextMenu.Items.Add(separator);
boxContextMenu.Items.Add(releaseAll);
}
diff --git a/PokemonManager/Windows/PokeManagerWindow.xaml.cs b/PokemonManager/Windows/PokeManagerWindow.xaml.cs
index 98ab7ce..4a2e2b1 100644
--- a/PokemonManager/Windows/PokeManagerWindow.xaml.cs
+++ b/PokemonManager/Windows/PokeManagerWindow.xaml.cs
@@ -642,7 +642,7 @@ public List CheckAllMirageIslandValues() {
}
}
- for (int i = 0; i < PokeManager.NumGameSaves; i++) {
+ for (int i = -1; i < PokeManager.NumGameSaves; i++) {
IGameSave gameSave = PokeManager.GetGameSaveAt(i);
if (gameSave is ManagerGameSave) {
for (int j = 0; j < (gameSave as ManagerGameSave).NumPokePCRows; j++) {
@@ -684,7 +684,7 @@ public List CheckAllEggsForShininess() {
}
}
- for (int i = 0; i < PokeManager.NumGameSaves; i++) {
+ for (int i = -1; i < PokeManager.NumGameSaves; i++) {
IGameSave gameSave = PokeManager.GetGameSaveAt(i);
if (gameSave is ManagerGameSave) {
for (int j = 0; j < (gameSave as ManagerGameSave).NumPokePCRows; j++) {
@@ -728,7 +728,7 @@ public List CheckAllEggsForShininess() {
public List CheckAllPokemonForPokerus() {
List foundStrains = new List();
- for (int i = 0; i < PokeManager.NumGameSaves; i++) {
+ for (int i = -1; i < PokeManager.NumGameSaves; i++) {
IGameSave gameSave = PokeManager.GetGameSaveAt(i);
if (gameSave is ManagerGameSave) {
for (int j = 0; j < (gameSave as ManagerGameSave).NumPokePCRows; j++) {
diff --git a/PokemonManager/Windows/PokemonViewer.xaml b/PokemonManager/Windows/PokemonViewer.xaml
index 6b5752e..f43813a 100644
--- a/PokemonManager/Windows/PokemonViewer.xaml
+++ b/PokemonManager/Windows/PokemonViewer.xaml
@@ -47,8 +47,8 @@
-
+
+
+
@@ -82,6 +85,9 @@
+
+
+
@@ -230,6 +236,9 @@
+
+
+
@@ -264,6 +273,13 @@
+
+
+
+
+
+
+
diff --git a/PokemonManager/Windows/PokemonViewer.xaml.cs b/PokemonManager/Windows/PokemonViewer.xaml.cs
index 0f56311..49a9c91 100644
--- a/PokemonManager/Windows/PokemonViewer.xaml.cs
+++ b/PokemonManager/Windows/PokemonViewer.xaml.cs
@@ -31,6 +31,7 @@ public partial class PokemonViewer : UserControl, IPokemonViewer {
private int currentMoveIndex;
private int gameIndex;
private MediaPlayer playerCry;
+ private MoveData currentMoveData;
public PokemonViewer() {
InitializeComponent();
@@ -197,6 +198,11 @@ public void UnloadPokemon() {
this.labelMovePower.Content = "";
this.labelMoveAccuracy.Content = "";
+ buttonOpenInBulbapedia.Visibility = Visibility.Hidden;
+ buttonOpenAbilityInBulbapedia.Visibility = Visibility.Hidden;
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
+ buttonOpenMoveInBulbapediaContest.Visibility = Visibility.Hidden;
+
buttonBall.IsEnabled = false;
buttonNickname.IsEnabled = false;
buttonDeoxys.IsEnabled = false;
@@ -406,6 +412,8 @@ public void LoadPokemon(IPokemon pokemon) {
this.labelPokerus.ToolTip = tooltip;
}
}
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
+ buttonOpenMoveInBulbapediaContest.Visibility = Visibility.Hidden;
if (pokemon.Move1ID != 0) {
ushort moveID = pokemon.Move1ID;
@@ -632,6 +640,9 @@ public void LoadPokemon(IPokemon pokemon) {
if (pokemon.HasEarthRibbon) AddRibbon("EARTH");
if (pokemon.HasWorldRibbon) AddRibbon("WORLD");
+ buttonOpenInBulbapedia.Visibility = Visibility.Visible;
+ buttonOpenAbilityInBulbapedia.Visibility = Visibility.Visible;
+
buttonBall.IsEnabled = !DisableEditing && !pokemon.IsInDaycare && !pokemon.IsEgg;
buttonNickname.IsEnabled = !DisableEditing && !pokemon.IsInDaycare && !pokemon.IsEgg && !pokemon.IsShadowPokemon;
buttonDeoxys.IsEnabled = !DisableEditing && !pokemon.IsInDaycare && pokemon.DexID == 386;
@@ -801,6 +812,8 @@ public void SetCurrentMove(int moveIndex) {
rectContestMove2.StrokeThickness = 1;
rectContestMove3.StrokeThickness = 1;
rectContestMove4.StrokeThickness = 1;
+ Rectangle rect = null;
+ Rectangle rectContest = null;
if (moveIndex == -1) {
this.textBlockMoveDescription.Text = "";
this.labelMovePower.Content = "";
@@ -817,45 +830,70 @@ public void SetCurrentMove(int moveIndex) {
moveData = PokemonDatabase.GetMoveFromID(355);
else if (pokemon.IsShadowPokemon && pokemon.GameType == GameTypes.XD && ((XDPokemon)pokemon).ShadowMove1ID != 0)
moveData = PokemonDatabase.GetMoveFromID(((XDPokemon)pokemon).ShadowMove1ID);
- rectMove1.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
- rectContestMove1.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
- rectMove1.StrokeThickness = 2;
- rectContestMove1.StrokeThickness = 2;
+ rect = rectMove1;
+ rectContest = rectContestMove1;
+ /*rectMove1.StrokeThickness = 2;
+ rectContestMove1.StrokeThickness = 2;*/
}
else if (moveIndex == 1) {
moveData = pokemon.Move2Data;
if (pokemon.IsShadowPokemon && pokemon.GameType == GameTypes.XD && ((XDPokemon)pokemon).ShadowMove2ID != 0)
moveData = PokemonDatabase.GetMoveFromID(((XDPokemon)pokemon).ShadowMove2ID);
- rectMove2.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
+ rect = rectMove2;
+ rectContest = rectContestMove2;
+ /*rectMove2.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
rectContestMove2.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
rectMove2.StrokeThickness = 2;
- rectContestMove2.StrokeThickness = 2;
+ rectContestMove2.StrokeThickness = 2;*/
}
else if (moveIndex == 2) {
moveData = pokemon.Move3Data;
if (pokemon.IsShadowPokemon && pokemon.GameType == GameTypes.XD && ((XDPokemon)pokemon).ShadowMove3ID != 0)
moveData = PokemonDatabase.GetMoveFromID(((XDPokemon)pokemon).ShadowMove3ID);
- rectMove3.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
+ rect = rectMove3;
+ rectContest = rectContestMove3;
+ /*rectMove3.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
rectContestMove3.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
rectMove3.StrokeThickness = 2;
- rectContestMove3.StrokeThickness = 2;
+ rectContestMove3.StrokeThickness = 2;*/
}
else if (moveIndex == 3) {
moveData = pokemon.Move4Data;
if (pokemon.IsShadowPokemon && pokemon.GameType == GameTypes.XD && ((XDPokemon)pokemon).ShadowMove4ID != 0)
moveData = PokemonDatabase.GetMoveFromID(((XDPokemon)pokemon).ShadowMove4ID);
- rectMove4.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
+ rect = rectMove4;
+ rectContest = rectContestMove4;
+ /*rectMove4.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
rectContestMove4.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
rectMove4.StrokeThickness = 2;
- rectContestMove4.StrokeThickness = 2;
- }
- this.textBlockMoveDescription.Text = moveData.Description;
- this.labelMovePower.Content = (moveData.Power != 0 ? moveData.Power.ToString() : "---");
- this.labelMoveAccuracy.Content = (moveData.Accuracy != 0 ? moveData.Accuracy.ToString() : "---");
- this.labelMoveCategory.Content = moveData.Category.ToString();
- this.textBlockContestMoveDescription.Text = moveData.ContestDescription;
- this.labelMoveAppeal.Content = moveData.Appeal.ToString();
- this.labelMoveJam.Content = moveData.Jam.ToString();
+ rectContestMove4.StrokeThickness = 2;*/
+ }
+ if (moveData == null || moveData.ID == 0) {
+ this.textBlockMoveDescription.Text = "";
+ this.labelMovePower.Content = "";
+ this.labelMoveAccuracy.Content = "";
+ this.labelMoveCategory.Content = "";
+ this.textBlockContestMoveDescription.Text = "";
+ this.labelMoveAppeal.Content = "";
+ this.labelMoveJam.Content = "";
+ }
+ else {
+ this.textBlockMoveDescription.Text = moveData.Description;
+ this.labelMovePower.Content = (moveData.Power != 0 ? moveData.Power.ToString() : "---");
+ this.labelMoveAccuracy.Content = (moveData.Accuracy != 0 ? moveData.Accuracy.ToString() : "---");
+ this.labelMoveCategory.Content = moveData.Category.ToString();
+ this.textBlockContestMoveDescription.Text = moveData.ContestDescription;
+ this.labelMoveAppeal.Content = moveData.Appeal.ToString();
+ this.labelMoveJam.Content = moveData.Jam.ToString();
+ this.currentMoveData = moveData;
+ rect.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
+ rectContest.Stroke = new SolidColorBrush(Color.FromRgb(255, 0, 0));
+ rect.StrokeThickness = 2;
+ rectContest.StrokeThickness = 2;
+ }
+
+ buttonOpenMoveInBulbapedia.Visibility = (moveData.ID != 0 ? Visibility.Visible : Visibility.Hidden);
+ buttonOpenMoveInBulbapediaContest.Visibility = (moveData.ID != 0 ? Visibility.Visible : Visibility.Hidden);
}
private void rectMove1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
@@ -1049,7 +1087,11 @@ private void OnGiveItemClicked(object sender, RoutedEventArgs e) {
else if (pokemon.IsHoldingItem) {
MessageBoxResult result = MessageBoxResult.Yes;
string sentTo = "";
- if (pokemon.GameSave.Inventory.Items[pokemon.HeldItemData.PocketType].HasRoomForItem(pokemon.HeldItemID, 1)) {
+ if (pokemon.GameSave.GameType == GameTypes.PokemonBox) {
+ PokeManager.ManagerGameSave.Inventory.Items[pokemon.HeldItemData.PocketType].AddItem(pokemon.HeldItemID, 1);
+ sentTo = PokeManager.Settings.ManagerNickname;
+ }
+ else if (pokemon.GameSave.Inventory.Items[pokemon.HeldItemData.PocketType].HasRoomForItem(pokemon.HeldItemID, 1)) {
pokemon.GameSave.Inventory.Items[pokemon.HeldItemData.PocketType].AddItem(pokemon.HeldItemID, 1);
if (pokemon.GameSave.GameType == GameTypes.Any)
sentTo = PokeManager.Settings.ManagerNickname;
@@ -1371,5 +1413,20 @@ private void OnWipeConditionClicked(object sender, RoutedEventArgs e) {
PokeManager.ManagerWindow.RefreshSearchResultsUI();
TriggerMessageBox.Show(Window.GetWindow(this), pokemon.Nickname + "'s condition has been wiped", "Condition Wiped");
}
+
+ private void OnOpenPokemonInBulbapedia(object sender, RoutedEventArgs e) {
+ string url = "http://bulbapedia.bulbagarden.net/wiki/" + pokemon.PokemonData.Name + " _(Pokémon)";
+ System.Diagnostics.Process.Start(url);
+ }
+
+ private void OnOpenMoveInBulbapedia(object sender, RoutedEventArgs e) {
+ string url = "http://bulbapedia.bulbagarden.net/wiki/" + currentMoveData.Name + " _(move)";
+ System.Diagnostics.Process.Start(url);
+ }
+
+ private void OnOpenAbilityInBulbapedia(object sender, RoutedEventArgs e) {
+ string url = "http://bulbapedia.bulbagarden.net/wiki/" + pokemon.AbilityData.Name + " _(ability)";
+ System.Diagnostics.Process.Start(url);
+ }
}
}
diff --git a/PokemonManager/Windows/RearangeMovesWindow.xaml b/PokemonManager/Windows/RearangeMovesWindow.xaml
index 18e42b0..5343019 100644
--- a/PokemonManager/Windows/RearangeMovesWindow.xaml
+++ b/PokemonManager/Windows/RearangeMovesWindow.xaml
@@ -33,6 +33,9 @@
+
+
+
diff --git a/PokemonManager/Windows/RearangeMovesWindow.xaml.cs b/PokemonManager/Windows/RearangeMovesWindow.xaml.cs
index f302e25..b090bda 100644
--- a/PokemonManager/Windows/RearangeMovesWindow.xaml.cs
+++ b/PokemonManager/Windows/RearangeMovesWindow.xaml.cs
@@ -31,6 +31,7 @@ public partial class RearangeMovesWindow : Window {
private int selectedIndex;
private Move selectedMove;
private bool contestMode;
+ private MoveData currentMoveData;
public RearangeMovesWindow(IPokemon pokemon) {
InitializeComponent();
@@ -93,6 +94,7 @@ public RearangeMovesWindow(IPokemon pokemon) {
this.labelMoveAppeal.Content = "";
this.labelMoveJam.Content = "";
this.textBlockMoveDescription.Text = "";
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
}
public static bool? ShowDialog(Window owner, IPokemon pokemon) {
@@ -136,6 +138,7 @@ private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
this.labelMoveAppeal.Content = "";
this.labelMoveJam.Content = "";
this.textBlockMoveDescription.Text = "";
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
}
else {
Move move = (Move)moves[selectedIndex].Tag;
@@ -145,6 +148,8 @@ private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
this.labelMoveAppeal.Content = move.MoveData.Appeal;
this.labelMoveJam.Content = move.MoveData.Jam;
this.textBlockMoveDescription.Text = (contestMode ? move.MoveData.ContestDescription : move.MoveData.Description);
+ currentMoveData = move.MoveData;
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Visible;
}
}
@@ -162,5 +167,9 @@ private void OnContestModeChecked(object sender, RoutedEventArgs e) {
OnMoveSelectionChanged(null, null);
}
+ private void OnOpenMoveInBulbapedia(object sender, RoutedEventArgs e) {
+ string url = "http://bulbapedia.bulbagarden.net/wiki/" + currentMoveData.Name + " _(move)";
+ System.Diagnostics.Process.Start(url);
+ }
}
}
diff --git a/PokemonManager/Windows/RelearnMoveWindow.xaml b/PokemonManager/Windows/RelearnMoveWindow.xaml
index a9c3d58..39dfb11 100644
--- a/PokemonManager/Windows/RelearnMoveWindow.xaml
+++ b/PokemonManager/Windows/RelearnMoveWindow.xaml
@@ -33,6 +33,9 @@
+
+
+
diff --git a/PokemonManager/Windows/RelearnMoveWindow.xaml.cs b/PokemonManager/Windows/RelearnMoveWindow.xaml.cs
index b667f67..5d8fcfe 100644
--- a/PokemonManager/Windows/RelearnMoveWindow.xaml.cs
+++ b/PokemonManager/Windows/RelearnMoveWindow.xaml.cs
@@ -29,6 +29,7 @@ public partial class RelearnMoveWindow : Window {
private int selectedIndex;
private Move selectedMove;
private bool contestMode;
+ private MoveData currentMoveData;
public RelearnMoveWindow(IPokemon pokemon) {
InitializeComponent();
@@ -82,6 +83,7 @@ public RelearnMoveWindow(IPokemon pokemon) {
this.labelMoveAppeal.Content = "";
this.labelMoveJam.Content = "";
this.textBlockMoveDescription.Text = "";
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
}
public static bool? ShowDialog(Window owner, IPokemon pokemon) {
@@ -128,6 +130,7 @@ private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
this.labelMoveAppeal.Content = "";
this.labelMoveJam.Content = "";
this.textBlockMoveDescription.Text = "";
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
}
else {
selectedMove = (Move)(listViewMoves.Items[selectedIndex] as ListViewItem).Tag;
@@ -137,6 +140,8 @@ private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
this.labelMoveAppeal.Content = selectedMove.MoveData.Appeal;
this.labelMoveJam.Content = selectedMove.MoveData.Jam;
this.textBlockMoveDescription.Text = (contestMode ? selectedMove.MoveData.ContestDescription : selectedMove.MoveData.Description);
+ currentMoveData = selectedMove.MoveData;
+ buttonOpenMoveInBulbapedia.Visibility = Visibility.Visible;
}
buttonTeachMove.IsEnabled = selectedIndex != -1;
}
@@ -155,5 +160,9 @@ private void OnContestModeChecked(object sender, RoutedEventArgs e) {
OnMoveSelectionChanged(null, null);
}
+ private void OnOpenMoveInBulbapedia(object sender, RoutedEventArgs e) {
+ string url = "http://bulbapedia.bulbagarden.net/wiki/" + currentMoveData.Name + " _(move)";
+ System.Diagnostics.Process.Start(url);
+ }
}
}
diff --git a/PokemonManager/Windows/SendCurrencyToWindow.xaml.cs b/PokemonManager/Windows/SendCurrencyToWindow.xaml.cs
index cf7d9ee..fa8510f 100644
--- a/PokemonManager/Windows/SendCurrencyToWindow.xaml.cs
+++ b/PokemonManager/Windows/SendCurrencyToWindow.xaml.cs
@@ -42,7 +42,8 @@ public SendCurrencyToWindow(int gameIndex, CurrencyTypes currencyType, bool send
this.currencyType = currencyType;
labelCurrencyType.Content = CurrencyName;
-
+ if (!sendMode)
+ Title = "Send Currency From";
for (int i = -1; i < PokeManager.NumGameSaves; i++) {
if (i == gameIndex) {
comboBoxGame.SetGameSaveVisible(i, false);
diff --git a/PokemonManager/Windows/TrainerInfoViewer.xaml b/PokemonManager/Windows/TrainerInfoViewer.xaml
index e1a058a..f9901ab 100644
--- a/PokemonManager/Windows/TrainerInfoViewer.xaml
+++ b/PokemonManager/Windows/TrainerInfoViewer.xaml
@@ -29,11 +29,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/PokemonManager/Windows/TrainerInfoViewer.xaml.cs b/PokemonManager/Windows/TrainerInfoViewer.xaml.cs
index c155f8d..d4fc86e 100644
--- a/PokemonManager/Windows/TrainerInfoViewer.xaml.cs
+++ b/PokemonManager/Windows/TrainerInfoViewer.xaml.cs
@@ -75,10 +75,10 @@ private void AddAlteringCaveItem(ushort dexID) {
public void CreateContextMenu() {
contextMenu = new ContextMenu();
MenuItem sendTo = new MenuItem();
- sendTo.Header = "Send To...";
+ sendTo.Header = "Send To";
sendTo.Click += OnSendTo;
MenuItem sendFrom = new MenuItem();
- sendFrom.Header = "Send From...";
+ sendFrom.Header = "Send From";
sendFrom.Click += OnSendFrom;
contextMenu.Items.Add(sendTo);
contextMenu.Items.Add(sendFrom);
@@ -232,5 +232,9 @@ private void OnRebattleStevenClicked(object sender, RoutedEventArgs e) {
if (!loaded) return;
(gameSave as GBAGameSave).HasBattledStevenEmerald = false;
}
+
+ private void OnSendCurrencyContextMenuOpening(object sender, ContextMenuEventArgs e) {
+ selectedCurrency = (CurrencyTypes)Enum.Parse(typeof(CurrencyTypes), ((Button)sender).Tag as string);
+ }
}
}