Skip to content

Commit

Permalink
Icon Update!
Browse files Browse the repository at this point in the history
- Fix Kitakami outbreak forms returning 0
- Only Ko Outbreaks that are selected
  • Loading branch information
zyro670 committed Oct 4, 2023
1 parent 0e27d54 commit 6214f33
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 87 deletions.
8 changes: 4 additions & 4 deletions PokeViewer.NET/MainViewer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions PokeViewer.NET/MainViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace PokeViewer.NET
public partial class MainViewer : Form
{
public ViewerExecutor Executor = null!;
private const string ViewerVersion = "2.5.2";
private const int AzureBuildID = 439;
private const string ViewerVersion = "2.5.3";
private const int AzureBuildID = 446;
private readonly bool[] FormLoaded = new bool[8];
private int GameType;
private SimpleTrainerInfo TrainerInfo = new();
Expand Down Expand Up @@ -182,7 +182,7 @@ await Invoke(async () =>
ToggleSwitchProtocol.Enabled = false;
SwitchIP.Enabled = false;
await Executor.Connect(token).ConfigureAwait(false);
Window_Loaded(token);
Window_Loaded(token);
});
}
catch (SocketException err)
Expand All @@ -193,6 +193,7 @@ await Invoke(async () =>
}
else
{
await Executor.SwitchConnection.SendAsync(SwitchCommand.DetachController(true), token).ConfigureAwait(false);
Executor.Disconnect();
System.Windows.Forms.Application.Restart();
}
Expand Down Expand Up @@ -309,11 +310,11 @@ private async void FillPokeData(PKM pk, ulong offset, uint offset2, int size)
if (isGmax)
{
var url = $"https://raw.githubusercontent.com/zyro670/PokeTextures/main/OriginMarks/icon_daimax.png";
System.Drawing.Image img = null!;
Image img = null!;
using (HttpClient client = new())
{
using var response = await client.GetStreamAsync(url, token).ConfigureAwait(false);
img = System.Drawing.Image.FromStream(response);
img = Image.FromStream(response);
}
Specialty.Visible = true;
Specialty.Image = img;
Expand Down Expand Up @@ -579,7 +580,7 @@ private async void Window_Loaded(CancellationToken token)
RaidButton.Enabled = true;
EventRedeemButton.Visible = true;
});
strings = await GetFakeTrainerSAVSV(token).ConfigureAwait(false);
strings = await GetFakeTrainerSAVSV(token).ConfigureAwait(false);
break;
}
case VioletID:
Expand All @@ -595,7 +596,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(MiscPage);
WideButton.Enabled = true;
RaidButton.Enabled = true;
EventRedeemButton.Visible = true;
EventRedeemButton.Visible = true;
});
strings = await GetFakeTrainerSAVSV(token).ConfigureAwait(false);
break;
Expand All @@ -609,7 +610,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(ViewPage);
ViewerControl.TabPages.Add(BoxPage);
ViewerControl.TabPages.Add(InGameScreenshotPage);
WideButton.Enabled = true;
WideButton.Enabled = true;
});
strings = await GetFakeTrainerSAVLA(token).ConfigureAwait(false);
break;
Expand All @@ -624,7 +625,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(BoxPage);
ViewerControl.TabPages.Add(NPCPage);
ViewerControl.TabPages.Add(InGameScreenshotPage);
WideButton.Enabled = true;
WideButton.Enabled = true;
});
strings = await GetFakeTrainerSAVBDSP(type, token).ConfigureAwait(false);
break;
Expand All @@ -639,7 +640,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(BoxPage);
ViewerControl.TabPages.Add(NPCPage);
ViewerControl.TabPages.Add(InGameScreenshotPage);
WideButton.Enabled = true;
WideButton.Enabled = true;
});
strings = await GetFakeTrainerSAVBDSP(type, token).ConfigureAwait(false);
break;
Expand All @@ -656,7 +657,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(BoxPage);
ViewerControl.TabPages.Add(NPCPage);
ViewerControl.TabPages.Add(InGameScreenshotPage);
WideButton.Enabled = true;
WideButton.Enabled = true;
});
strings = await GetFakeTrainerSAVSWSH(token).ConfigureAwait(false);
break;
Expand All @@ -673,7 +674,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(BoxPage);
ViewerControl.TabPages.Add(NPCPage);
ViewerControl.TabPages.Add(InGameScreenshotPage);
WideButton.Enabled = true;
WideButton.Enabled = true;
});
strings = await GetFakeTrainerSAVSWSH(token).ConfigureAwait(false);
break;
Expand All @@ -687,7 +688,7 @@ private async void Window_Loaded(CancellationToken token)
ViewerControl.TabPages.Add(BoxPage);
ViewerControl.TabPages.Add(NPCPage);
ViewerControl.TabPages.Add(InGameScreenshotPage);
WideButton.Enabled = true;
WideButton.Enabled = true;
});
strings = await GetFakeTrainerSAVLGPE(token).ConfigureAwait(false);
break;
Expand Down
7 changes: 4 additions & 3 deletions PokeViewer.NET/PokeViewer.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
<PlatformTarget>x64</PlatformTarget>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<ApplicationIcon>icon.ico</ApplicationIcon>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>portable</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Costura.Fody" Version="5.7.0">
Expand Down
145 changes: 78 additions & 67 deletions PokeViewer.NET/SubForms/MiscView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ private void SelectedIndex_IsChanged(object sender, EventArgs e)
Settings.Default.MapSetting = comboBox1.SelectedIndex;
Settings.Default.Save();
}

private async Task SearchForOutbreak(CancellationToken token)
{
BaseBlockKeyPointer = await Executor.SwitchConnection.PointerAll(Offsets.BlockKeyPointer, token).ConfigureAwait(false);
Expand Down Expand Up @@ -323,7 +322,7 @@ private async Task SearchForOutbreak(CancellationToken token)
PK9 pk = new()
{
Species = SpeciesConverter.GetNational9((ushort)species),
Form = 0,
Form = form,
};
CommonEdits.SetIsShiny(pk, false);
string pkform = form is 0 ? "" : $"-{form}";
Expand Down Expand Up @@ -575,7 +574,7 @@ private async Task SearchForOutbreak(CancellationToken token)
bool hunted = false;
foreach (var p in pkList)
{
if (p.Species == monsK[i].Species && p.Form == monsK[i].Form)
if ((Species)p.Species == (Species)monsK[i].Species && p.Form == monsK[i].Form)
hunted = true;
}
if (hunted is true && OutbreakSearch.Checked)
Expand Down Expand Up @@ -770,85 +769,97 @@ private async Task KOToSeventy_Click(CancellationToken token)
var OutbreaktotalBCP = Convert.ToInt32(validOutbreaksBCP);
var OutbreaktotalBCK = Convert.ToInt32(validOutbreaksBCK);
var koblock = Blocks.KMassOutbreakKO1;
for (int i = 0; i < 8; i++)
if (comboBox1.SelectedIndex is 0 or 1)
{
StatusLabel.Text = $"KOing Paldea: {8 * i + 1}%";
switch (i)
for (int i = 0; i < 8; i++)
{
case 0: break;
case 1: koblock = Blocks.KMassOutbreakKO2; break;
case 2: koblock = Blocks.KMassOutbreakKO3; break;
case 3: koblock = Blocks.KMassOutbreakKO4; break;
case 4: koblock = Blocks.KMassOutbreakKO5; break;
case 5: koblock = Blocks.KMassOutbreakKO6; break;
case 6: koblock = Blocks.KMassOutbreakKO7; break;
case 7: koblock = Blocks.KMassOutbreakKO8; break;
StatusLabel.Text = $"KOing Paldea: {8 * i + 1}%";
switch (i)
{
case 0: break;
case 1: koblock = Blocks.KMassOutbreakKO2; break;
case 2: koblock = Blocks.KMassOutbreakKO3; break;
case 3: koblock = Blocks.KMassOutbreakKO4; break;
case 4: koblock = Blocks.KMassOutbreakKO5; break;
case 5: koblock = Blocks.KMassOutbreakKO6; break;
case 6: koblock = Blocks.KMassOutbreakKO7; break;
case 7: koblock = Blocks.KMassOutbreakKO8; break;
}
if (i > OutbreaktotalP - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
if (i > OutbreaktotalP - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
for (int i = 0; i < 4; i++)
if (comboBox1.SelectedIndex is 0 or 2)
{
StatusLabel.Text = $"KOing Kitakami: {8 * i + 1}%";
switch (i)
for (int i = 0; i < 4; i++)
{
case 0: koblock = Blocks.KMassOutbreakKO9; break;
case 1: koblock = Blocks.KMassOutbreakKO10; break;
case 2: koblock = Blocks.KMassOutbreakKO11; break;
case 3: koblock = Blocks.KMassOutbreakKO12; break;
StatusLabel.Text = $"KOing Kitakami: {8 * i + 1}%";
switch (i)
{
case 0: koblock = Blocks.KMassOutbreakKO9; break;
case 1: koblock = Blocks.KMassOutbreakKO10; break;
case 2: koblock = Blocks.KMassOutbreakKO11; break;
case 3: koblock = Blocks.KMassOutbreakKO12; break;
}
if (i > OutbreaktotalK - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
if (i > OutbreaktotalK - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
for (int i = 0; i < 10; i++)
if (comboBox1.SelectedIndex is 0 or 1 && ScanForEventOutbreak.Checked)
{
StatusLabel.Text = $"KOing PaldeaEvent: {10 * i}%";
switch (i)
for (int i = 0; i < 10; i++)
{
case 0: koblock = Blocks.KOutbreakBC01MainNumKOed; break;
case 1: koblock = Blocks.KOutbreakBC02MainNumKOed; break;
case 2: koblock = Blocks.KOutbreakBC03MainNumKOed; break;
case 3: koblock = Blocks.KOutbreakBC04MainNumKOed; break;
case 4: koblock = Blocks.KOutbreakBC05MainNumKOed; break;
case 5: koblock = Blocks.KOutbreakBC06MainNumKOed; break;
case 6: koblock = Blocks.KOutbreakBC07MainNumKOed; break;
case 7: koblock = Blocks.KOutbreakBC08MainNumKOed; break;
case 8: koblock = Blocks.KOutbreakBC09MainNumKOed; break;
case 9: koblock = Blocks.KOutbreakBC10MainNumKOed; break;
StatusLabel.Text = $"KOing PaldeaEvent: {10 * i}%";
switch (i)
{
case 0: koblock = Blocks.KOutbreakBC01MainNumKOed; break;
case 1: koblock = Blocks.KOutbreakBC02MainNumKOed; break;
case 2: koblock = Blocks.KOutbreakBC03MainNumKOed; break;
case 3: koblock = Blocks.KOutbreakBC04MainNumKOed; break;
case 4: koblock = Blocks.KOutbreakBC05MainNumKOed; break;
case 5: koblock = Blocks.KOutbreakBC06MainNumKOed; break;
case 6: koblock = Blocks.KOutbreakBC07MainNumKOed; break;
case 7: koblock = Blocks.KOutbreakBC08MainNumKOed; break;
case 8: koblock = Blocks.KOutbreakBC09MainNumKOed; break;
case 9: koblock = Blocks.KOutbreakBC10MainNumKOed; break;
}
if (i > OutbreaktotalBCP - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
if (i > OutbreaktotalBCP - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
for (int i = 0; i < 10; i++)
if (comboBox1.SelectedIndex is 0 or 2 && ScanForEventOutbreak.Checked)
{
StatusLabel.Text = $"KOing KitakamiEvent: {10 * i}%";
switch (i)
for (int i = 0; i < 10; i++)
{
case 0: koblock = Blocks.KOutbreakBC01DLC1NumKOed; break;
case 1: koblock = Blocks.KOutbreakBC02DLC1NumKOed; break;
case 2: koblock = Blocks.KOutbreakBC03DLC1NumKOed; break;
case 3: koblock = Blocks.KOutbreakBC04DLC1NumKOed; break;
case 4: koblock = Blocks.KOutbreakBC05DLC1NumKOed; break;
case 5: koblock = Blocks.KOutbreakBC06DLC1NumKOed; break;
case 6: koblock = Blocks.KOutbreakBC07DLC1NumKOed; break;
case 7: koblock = Blocks.KOutbreakBC08DLC1NumKOed; break;
case 8: koblock = Blocks.KOutbreakBC09DLC1NumKOed; break;
case 9: koblock = Blocks.KOutbreakBC10DLC1NumKOed; break;
StatusLabel.Text = $"KOing KitakamiEvent: {10 * i}%";
switch (i)
{
case 0: koblock = Blocks.KOutbreakBC01DLC1NumKOed; break;
case 1: koblock = Blocks.KOutbreakBC02DLC1NumKOed; break;
case 2: koblock = Blocks.KOutbreakBC03DLC1NumKOed; break;
case 3: koblock = Blocks.KOutbreakBC04DLC1NumKOed; break;
case 4: koblock = Blocks.KOutbreakBC05DLC1NumKOed; break;
case 5: koblock = Blocks.KOutbreakBC06DLC1NumKOed; break;
case 6: koblock = Blocks.KOutbreakBC07DLC1NumKOed; break;
case 7: koblock = Blocks.KOutbreakBC08DLC1NumKOed; break;
case 8: koblock = Blocks.KOutbreakBC09DLC1NumKOed; break;
case 9: koblock = Blocks.KOutbreakBC10DLC1NumKOed; break;
}
if (i > OutbreaktotalBCK - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
if (i > OutbreaktotalBCK - 1)
continue;
var (currentcount, _) = await ReadEncryptedBlockInt32(koblock, 0, token).ConfigureAwait(false);
uint inj = 77;
await WriteBlock(inj, koblock, token, (uint)currentcount).ConfigureAwait(false);
}
StatusLabel.Text = "Status:";
OutbreakScan.Enabled = true;
Expand Down
Binary file modified PokeViewer.NET/deps/PKHeX.Core.dll
Binary file not shown.
Binary file modified PokeViewer.NET/deps/PKHeX.Drawing.Misc.dll
Binary file not shown.
Binary file modified PokeViewer.NET/deps/PKHeX.Drawing.PokeSprite.dll
Binary file not shown.
Binary file modified PokeViewer.NET/deps/PKHeX.Drawing.dll
Binary file not shown.
Binary file modified PokeViewer.NET/icon.ico
Binary file not shown.

0 comments on commit 6214f33

Please sign in to comment.