Skip to content

Commit 2e70fe1

Browse files
Updated to version 1.0.0.0 Release
1 parent 5cb98b5 commit 2e70fe1

37 files changed

+493
-77
lines changed

Diff for: PokemonManager.v11.suo

-29.5 KB
Binary file not shown.

Diff for: PokemonManager/Items/MailBox.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public void Reset() {
146146
listViewItems.Clear();
147147

148148
Mail defaultMail = new Mail();
149-
defaultMail.TrainerName = "TRIGGER";
150-
defaultMail.SetTrainerIDs(60000, 0);
149+
defaultMail.TrainerName = "Trigger";
150+
defaultMail.SetTrainerIDs(45465, 28557);
151151
defaultMail.MailItemID = 130;
152152
defaultMail.OriginalHolderDexID = 197;
153153

Diff for: PokemonManager/PokeManager.cs

+25
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
using System.Threading.Tasks;
2525
using System.Windows;
2626
using System.Windows.Controls;
27+
using System.Windows.Documents;
2728
using System.Windows.Media;
2829
using System.Windows.Media.Imaging;
30+
using System.Windows.Navigation;
2931
using System.Xml;
3032

3133
namespace PokemonManager {
@@ -2315,6 +2317,15 @@ public static bool CanSwitchPokemon(IPokemon pokemon) {
23152317
public static bool CanSwitchShadowPokemon(IPokemon pokemon) {
23162318
if (IsHoldingPokemon) {
23172319
bool needsNewLocation = pokemon.IsShadowPokemon && pokemon.GameSave != holdPokemon.Container.GameSave;
2320+
if (holdPokemon.Container.GameSave.GameType == GameTypes.XD) {
2321+
if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Daycare)
2322+
needsNewLocation = true;
2323+
else if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
2324+
needsNewLocation = true;
2325+
else if (!pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index == 0)
2326+
needsNewLocation = true;
2327+
}
2328+
23182329
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
23192330
for (int j = 0; j < 30 && needsNewLocation; j++) {
23202331
if (pokemon.PokePC[i][j] == null) {
@@ -2330,6 +2341,8 @@ public static bool CanSwitchShadowPokemon(IPokemon pokemon) {
23302341
public static bool CanSwitchEgg(IPokemon pokemon) {
23312342
if (IsHoldingPokemon) {
23322343
bool needsNewLocation = pokemon.IsEgg && (holdPokemon.Container.GameType == GameTypes.Colosseum || holdPokemon.Container.GameType == GameTypes.XD);
2344+
if (pokemon.IsEgg && holdPokemon.Container.Type == ContainerTypes.Daycare)
2345+
needsNewLocation = true;
23332346
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
23342347
for (int j = 0; j < 30 && needsNewLocation; j++) {
23352348
if (pokemon.PokePC[i][j] == null) {
@@ -2365,6 +2378,16 @@ public static void SwitchPokemon(IPokemon pokemon) {
23652378
// Try to make the pokemon drop in the current game. It's only required for shadow Pokemon though.
23662379
bool needsNewLocation = (pokemon.IsShadowPokemon && pokemon.GameSave != holdPokemon.Container.GameSave) ||
23672380
(pokemon.IsEgg && (holdPokemon.Container.GameType == GameTypes.Colosseum || holdPokemon.Container.GameType == GameTypes.XD));
2381+
if (holdPokemon.Container.GameSave.GameType == GameTypes.XD) {
2382+
if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Daycare)
2383+
needsNewLocation = true;
2384+
else if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
2385+
needsNewLocation = true;
2386+
else if (!pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index == 0)
2387+
needsNewLocation = true;
2388+
}
2389+
if (pokemon.IsEgg && holdPokemon.Container.Type == ContainerTypes.Daycare)
2390+
needsNewLocation = true;
23682391
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
23692392
for (int j = 0; j < 30 && needsNewLocation; j++) {
23702393
if (pokemon.PokePC[i][j] == null) {
@@ -2400,6 +2423,8 @@ public static void DropPokemon() {
24002423
holdPokemon.Pokemon.IsMoving = false;
24012424
if (holdPokemon.Container.Type == ContainerTypes.Party)
24022425
((IPokeParty)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
2426+
else if (holdPokemon.Container.Type == ContainerTypes.Daycare && holdPokemon.Index < 2)
2427+
((IDaycare)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
24032428
else if (holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
24042429
((XDPurificationChamber)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
24052430
else

Diff for: PokemonManager/PokemonDatabase.db

0 Bytes
Binary file not shown.

Diff for: PokemonManager/PokemonManager.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@
14211421
<Content Include="Resources\Audio\Evolution.wav">
14221422
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
14231423
</Content>
1424+
<Resource Include="Resources\UI\Pokemon\BulbapediaIcon.png" />
14241425
<Resource Include="Resources\UI\Pokemon\PurifierWindow.png" />
14251426
<Resource Include="Resources\Splash\SplashVoltorb.png" />
14261427
<Resource Include="Resources\Splash\SplashUrsaring.png" />

Diff for: PokemonManager/PokemonStructures/BoxPokemon.cs

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ public BitmapSource Sprite {
190190
get {
191191
if (IsEgg)
192192
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
193+
if (DexID == 327)
194+
return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
193195
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
194196
}
195197
}

Diff for: PokemonManager/PokemonStructures/ColosseumDaycare.cs

+13
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ public IPokemon this[int index] {
8585
throw new ArgumentOutOfRangeException("Index outside of bounds for Daycare", new Exception());
8686
}
8787
}
88+
public void AddPokemon(IPokemon pokemon) {
89+
pokePC.GameSave.IsChanged = true;
90+
IPokemon pkm = (pokemon != null ? (pokemon is ColosseumPokemon ? pokemon : pokemon.CreateColosseumPokemon(((GCGameSave)GameSave).CurrentRegion)): null);
91+
pkm.GameType = GameType;
92+
pkm.PokeContainer = this;
93+
if (pokePC.GameSave != null)
94+
pokePC.GameSave.OwnPokemon(pkm);
95+
depositedPokemon = pkm as ColosseumPokemon;
96+
depositedPokemon = pkm as ColosseumPokemon;
97+
DaycareStatus = 1;
98+
InitialLevel = 0;
99+
InitialPurification = 0;
100+
}
88101
public int IndexOf(IPokemon pokemon) {
89102
if (pokemon == depositedPokemon)
90103
return 0;

Diff for: PokemonManager/PokemonStructures/ColosseumPokemon.cs

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ public BitmapSource Sprite {
166166
get {
167167
if (IsEgg)
168168
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
169+
if (DexID == 327)
170+
return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
169171
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
170172
}
171173
}

Diff for: PokemonManager/PokemonStructures/Events/PokemonEventDistribution.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public override void GenerateReward(IGameSave gameSave) {
6060
pkm.DexID = DexID;
6161
pkm.Personality = (Personality.HasValue ? Personality.Value : (uint)random.Next());
6262
pkm.Experience = PokemonDatabase.GetExperienceFromLevel(pokemonData.ExperienceGroup, (IsEgg ? (byte)5 : Level));
63-
pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (pokemonData.HasTwoAbilities && random.Next(2) == 1)); // TODO: TESTING
63+
pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (!pokemonData.CanOnlyHaveFirstAbility && random.Next(2) == 1));
6464
pkm.Nickname = (Nickname != null ? Nickname : pokemonData.Name.ToUpper());
6565
pkm.BallCaughtID = 4;
6666
pkm.MetLocationID = 255;

Diff for: PokemonManager/PokemonStructures/GBADaycare.cs

+16
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,22 @@ public IPokemon this[int index] {
163163
}
164164
}
165165
}
166+
public void AddPokemon(IPokemon pokemon) {
167+
pokePC.GameSave.IsChanged = true;
168+
IPokemon pkm = (pokemon != null ? (pokemon is GBAPokemon ? pokemon : pokemon.CreateGBAPokemon(GameType)): null);
169+
int index = 0;
170+
for (index = 0; index < 3; index++) {
171+
if (originalPokemon[index] == null)
172+
break;
173+
}
174+
pkm.GameType = GameType;
175+
pkm.PokeContainer = this;
176+
if (pokePC.GameSave != null)
177+
pokePC.GameSave.SetPokemonOwned(pkm.DexID, true);
178+
finalPokemon[index] = pkm as GBAPokemon;
179+
originalPokemon[index] = pkm as GBAPokemon;
180+
SetGainedExperience(index, 0);
181+
}
166182
public int IndexOf(IPokemon pokemon) {
167183
for (int i = 0; i < finalPokemon.Length; i++) {
168184
if (finalPokemon[i] == pokemon)

Diff for: PokemonManager/PokemonStructures/GBAPokemon.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ public GBAPokemon(byte[] data, bool decrypted = false) {
8989
else
9090
OpenEncryptedData(data);
9191

92+
// A pretty old bug, we don't really need this anymore.
9293
// Fix Colosseum Game Origin being incorrect. (Support for users of previous versions)
93-
if ((byte)GameOrigin == 11)
94-
GameOrigin = GameOrigins.ColosseumXD;
94+
//if ((byte)GameOrigin == 11)
95+
// GameOrigin = GameOrigins.ColosseumXD;
9596
}
9697

9798
#region Basic Info

Diff for: PokemonManager/PokemonStructures/IDaycare.cs

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ namespace PokemonManager.PokemonStructures {
1010
public interface IDaycare : IPokeContainer {
1111

1212
uint GetWithdrawCost(int index);
13+
void AddPokemon(IPokemon pokemon);
1314
}
1415
}

Diff for: PokemonManager/PokemonStructures/PokemonData.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public PokemonData(DataRow row) {
4444
this.type2 = (row["Type2"] as string == null ? this.type1 : GetPokemonTypeFromString(row["Type2"] as string));
4545

4646
this.ability1ID = PokemonDatabase.GetAbilityIDFromString(row["Ability1"] as string);
47-
this.ability2ID = (row["Ability2"] as string == null ? this.ability1ID : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
47+
this.ability2ID = (row["Ability2"] as string == null ? (byte)0 : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
48+
//this.ability2ID = (row["Ability2"] as string == null ? this.ability1ID : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
4849

4950
this.eggGroup1 = GetEggGroupFromString(row["EggGroup1"] as string);
5051
this.eggGroup2 = GetEggGroupFromString(row["EggGroup2"] as string);
@@ -132,6 +133,9 @@ public byte Ability2ID {
132133
public bool HasTwoAbilities {
133134
get { return ability1ID != ability2ID; }
134135
}
136+
public bool CanOnlyHaveFirstAbility {
137+
get { return ability2ID == 0; }
138+
}
135139
public EggGroups EggGroup1 {
136140
get { return eggGroup1; }
137141
}

Diff for: PokemonManager/PokemonStructures/XDDaycare.cs

+13
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ public IPokemon this[int index] {
8585
throw new ArgumentOutOfRangeException("Index outside of bounds for Daycare", new Exception());
8686
}
8787
}
88+
public void AddPokemon(IPokemon pokemon) {
89+
pokePC.GameSave.IsChanged = true;
90+
IPokemon pkm = (pokemon != null ? (pokemon is XDPokemon ? pokemon : pokemon.CreateXDPokemon(((GCGameSave)GameSave).CurrentRegion)): null);
91+
pkm.GameType = GameType;
92+
pkm.PokeContainer = this;
93+
if (pokePC.GameSave != null)
94+
pokePC.GameSave.OwnPokemon(pkm);
95+
depositedPokemon = pkm as XDPokemon;
96+
depositedPokemon = pkm as XDPokemon;
97+
DaycareStatus = 1;
98+
InitialLevel = 0;
99+
InitialPurification = 0;
100+
}
88101
public int IndexOf(IPokemon pokemon) {
89102
if (pokemon == depositedPokemon)
90103
return 0;

Diff for: PokemonManager/PokemonStructures/XDPokemon.cs

+2
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ public BitmapSource Sprite {
167167
return ResourceDatabase.GetImageFromName("XD001FrontSprite");
168168
if (IsEgg)
169169
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
170+
if (DexID == 327)
171+
return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
170172
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
171173
}
172174
}

Diff for: PokemonManager/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.4.5.5")]
55-
[assembly: AssemblyFileVersion("1.4.5.5")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]
5656
[assembly: GuidAttribute("d527114e-3888-417f-807f-e08fef41029c")]
5757
[assembly: NeutralResourcesLanguageAttribute("en")]

Diff for: PokemonManager/Properties/Resources.Designer.cs

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: PokemonManager/Properties/Resources.resx

+3
Original file line numberDiff line numberDiff line change
@@ -1270,4 +1270,7 @@
12701270
<data name="YoungsterMale" type="System.Resources.ResXFileRef, System.Windows.Forms">
12711271
<value>..\Resources\Trainers\YoungsterMale.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
12721272
</data>
1273+
<data name="BulbapediaIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
1274+
<value>..\Resources\UI\Pokemon\BulbapediaIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
1275+
</data>
12731276
</root>
829 Bytes
Loading

Diff for: PokemonManager/Windows/AboutWindow.xaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@
3636
</Hyperlink>
3737
</Label>
3838
<Label HorizontalAlignment="Left" Margin="116,299,0,0" VerticalAlignment="Top" FontWeight="Bold">
39-
<Hyperlink NavigateUri="https://github.com/trigger-death/TriggersPC" RequestNavigate="OnRequestNavigate">
40-
<Run Text="GitHub"/>
41-
</Hyperlink>
39+
<TextBlock Cursor="Arrow" TextWrapping="WrapWithOverflow">
40+
<Hyperlink NavigateUri="https://github.com/trigger-death/TriggersPC" RequestNavigate="OnRequestNavigate">
41+
<Run Text="GitHub"/>
42+
</Hyperlink>
43+
<Run Text="("/>
44+
<Hyperlink NavigateUri="https://github.com/trigger-death/TriggersPC/wiki" RequestNavigate="OnRequestNavigate">
45+
<Run Text="Wiki"/>
46+
</Hyperlink>
47+
<Run Text=")"/>
48+
</TextBlock>
4249
</Label>
4350
<Rectangle Margin="10,123,10,0" Stroke="Black" RadiusY="2" RadiusX="2" Fill="#FFF4F4F5" Height="114" VerticalAlignment="Top"/>
4451
<Label Content="Trigger's PC" HorizontalAlignment="Left" Margin="15,128,0,0" VerticalAlignment="Top" FontWeight="Bold"/>

Diff for: PokemonManager/Windows/AboutWindow.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public AboutWindow() {
2525
InitializeComponent();
2626

2727
DateTime buildDate = GetLinkerTime(Assembly.GetExecutingAssembly());
28-
this.labelVersion.Content = Assembly.GetExecutingAssembly().GetName().Version.ToString() + " Beta";
28+
this.labelVersion.Content = Assembly.GetExecutingAssembly().GetName().Version.ToString() + " Release";
2929
this.labelBuildDate.Content = buildDate.ToShortDateString() + " (" + buildDate.ToShortTimeString() + ")";
3030
}
3131

Diff for: PokemonManager/Windows/ControlsWindow.xaml

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Window x:Class="PokemonManager.Windows.ControlsWindow"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
Title="Trigger's PC Controls" Height="424" Width="308" ResizeMode="NoResize" Background="#FF286496" Icon="/TriggersPC;component/Resources/Icons/IconControls.png" WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
4+
Title="Trigger's PC Controls" Height="553" Width="308" ResizeMode="NoResize" Background="#FF286496" Icon="/TriggersPC;component/Resources/Icons/IconControls.png" WindowStartupLocation="CenterOwner" ShowInTaskbar="False">
55
<Grid>
66

77
<Rectangle Fill="#FFF4F4F5" Margin="0" StrokeThickness="0" VerticalAlignment="Bottom" Height="41" RenderTransformOrigin="0.5,0.5">
@@ -27,7 +27,7 @@
2727
</Grid>
2828

2929
<Label Content="Pokémon Boxes" HorizontalAlignment="Left" Margin="10,93,0,0" VerticalAlignment="Top" Foreground="White" FontWeight="Bold"/>
30-
<Grid Height="156" Margin="10,119,10,0" VerticalAlignment="Top">
30+
<Grid Height="287" Margin="10,119,10,0" VerticalAlignment="Top">
3131
<Rectangle Margin="0" Stroke="Black" RadiusY="2" RadiusX="2" Fill="#FFF4F4F5"/>
3232
<Label Content="R/Middle Click" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold"/>
3333
<Label Content="Toggle Move Mode" HorizontalAlignment="Right" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right"/>
@@ -41,14 +41,24 @@
4141
<Label Content="Left Click Box Name" HorizontalAlignment="Left" Margin="0,104,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
4242
<Label Content="T/Hold LShift" HorizontalAlignment="Left" Margin="0,26,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
4343
<Label Content="Toggle Summary Mode" HorizontalAlignment="Right" Margin="0,26,0,0" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right"/>
44+
<Label Content="Z" HorizontalAlignment="Left" Margin="0,156,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
45+
<Label Content="Unselect All" HorizontalAlignment="Right" Margin="0,156,0,0" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right" Width="153"/>
46+
<Label Content="X" HorizontalAlignment="Left" Margin="0,182,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
47+
<Label Content="Select All" HorizontalAlignment="Right" Margin="0,182,0,0" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right" Width="153"/>
48+
<Label Content="C" HorizontalAlignment="Left" Margin="0,208,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
49+
<Label Content="Pickup All" HorizontalAlignment="Right" Margin="0,208,0,0" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right" Width="153"/>
50+
<Label Content="V" HorizontalAlignment="Left" Margin="1,234,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
51+
<Label Content="Place All in First Slot" HorizontalAlignment="Right" Margin="0,234,0,0" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right" Width="153"/>
52+
<Label Content="Ctrl+Click Box Name/Ctrl+X" HorizontalAlignment="Left" Margin="0,260,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
53+
<Label Content="Select All+" HorizontalAlignment="Right" Margin="0,260,2,0" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right" Width="153"/>
4454
</Grid>
45-
<Label Content="Inventory" HorizontalAlignment="Left" Margin="10,281,0,0" VerticalAlignment="Top" Foreground="White" FontWeight="Bold"/>
46-
<Button Content="Close" HorizontalAlignment="Right" Margin="0,0,10,10" VerticalAlignment="Bottom" Width="75" FontSize="11" Foreground="White" FontWeight="Bold" Background="#FF007ACC" Focusable="False" IsTabStop="False" IsCancel="True"/>
47-
<Grid Height="26" Margin="10,307,10,0" VerticalAlignment="Top">
55+
<Label Content="Inventory" HorizontalAlignment="Left" Margin="10,411,0,0" VerticalAlignment="Top" Foreground="White" FontWeight="Bold"/>
56+
<Grid Height="26" Margin="10,437,10,0" VerticalAlignment="Top">
4857
<Rectangle Margin="0" Stroke="Black" RadiusY="2" RadiusX="2" Fill="#FFF4F4F5"/>
4958
<Label Content="Ctrl/Shift+Click" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold"/>
5059
<Label Content="Select Items" HorizontalAlignment="Right" VerticalAlignment="Top" FontWeight="Bold" HorizontalContentAlignment="Right"/>
5160
</Grid>
61+
<Button Content="Close" HorizontalAlignment="Right" Margin="0,0,10,10" VerticalAlignment="Bottom" Width="75" FontSize="11" Foreground="White" FontWeight="Bold" Background="#FF007ACC" Focusable="False" IsTabStop="False" IsCancel="True"/>
5262

5363
</Grid>
5464
</Window>

Diff for: PokemonManager/Windows/DecorationViewerTab.xaml.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ public void GotoDecoration(byte decorationID) {
7171
double offset = scrollHeight * index / listViewItems.Items.Count;
7272
vsp.SetVerticalOffset(offset);*/
7373

74-
listViewItems.ScrollIntoView(listViewItems.SelectedItem);
75-
((Control)listViewItems.SelectedItem).Focus();
74+
if (index != -1) {
75+
listViewItems.ScrollIntoView(listViewItems.SelectedItem);
76+
((Control)listViewItems.SelectedItem).Focus();
77+
}
7678
}
7779

7880
public void LoadPocket(DecorationPocket pocket) {

Diff for: PokemonManager/Windows/ItemViewerTab.xaml.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public void GotoItem(ushort itemID) {
6464
double offset = scrollHeight * index / listViewItems.Items.Count;
6565
vsp.SetVerticalOffset(offset);*/
6666

67-
listViewItems.ScrollIntoView(listViewItems.SelectedItem);
68-
((Control)listViewItems.SelectedItem).Focus();
67+
if (index != -1) {
68+
listViewItems.ScrollIntoView(listViewItems.SelectedItem);
69+
((Control)listViewItems.SelectedItem).Focus();
70+
}
6971
}
7072

7173
public void LoadPocket(ItemPocket pocket) {

0 commit comments

Comments
 (0)