Skip to content

Commit 0318b2b

Browse files
committed
v3.2
- Fix version check for Switch 19.0.0 Support
1 parent 91d67f8 commit 0318b2b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

PokeViewer.NET/MainViewer.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using System.IO.Compression;
1515
using System.Net.Sockets;
1616
using System.Reflection;
17+
using System.Text.RegularExpressions;
1718
using static PokeViewer.NET.CommandsUtil.CommandsUtil;
1819
using static PokeViewer.NET.RoutineExecutor;
1920
using static PokeViewer.NET.ViewerUtil;
@@ -26,7 +27,7 @@ namespace PokeViewer.NET
2627
public partial class MainViewer : Form
2728
{
2829
public ViewerExecutor Executor = null!;
29-
private const string ViewerVersion = "3.1.1";
30+
private const string ViewerVersion = "3.2";
3031
private readonly bool[] FormLoaded = new bool[8];
3132
private int GameType;
3233
private SimpleTrainerInfo TrainerInfo = new();
@@ -72,7 +73,10 @@ private async Task<bool> CheckBotBaseReq(CancellationToken token)
7273
GitHubClient client = new(new ProductHeaderValue("usb-botbase"));
7374
Release releases = await client.Repository.Release.GetLatest("zyro670", "usb-botbase");
7475
var sbb = await Executor.SwitchConnection.GetBotbaseVersion(token).ConfigureAwait(false);
75-
if (!sbb.Equals("2.353\n"))
76+
string replacement = Regex.Replace(sbb, @"\t|\n|\r", "");
77+
string vIn = replacement.Replace('"', ' ').Trim();
78+
var vOut = Convert.ToDouble(vIn);
79+
if (vOut < 2.4)
7680
{
7781
DialogResult dialogResult = MessageBox.Show($"Current version of sysbot-base v{sbb.ToString().TrimEnd('\r', '\n')} does not match minimum required version. Download latest?", "An update is available", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
7882
if (dialogResult == DialogResult.Yes)
@@ -344,7 +348,7 @@ private async void FillPokeData(PKM pk, ulong offset, uint offset2, int size)
344348
case 1: gender = " (F)"; break;
345349
case 2: break;
346350
}
347-
string output = $"{(pk.ShinyXor == 0 ? "■ - " : pk.ShinyXor <= 16 ? "★ - " : "")}{isAlpha}{(Species)pk.Species}{form}{gender}{ec}{pid}{Environment.NewLine}Nature: {(Nature)pk.Nature}{Environment.NewLine}Ability: {GameInfo.GetStrings(1).Ability[pk.Ability]}{Environment.NewLine}IVs: {pk.IV_HP}/{pk.IV_ATK}/{pk.IV_DEF}/{pk.IV_SPA}/{pk.IV_SPD}/{pk.IV_SPE}{Environment.NewLine}{scale}{msg}";
351+
string output = $"{(pk.ShinyXor == 0 ? "■ - " : pk.ShinyXor <= 16 ? "★ - " : "")}{isAlpha}{(Species)pk.Species}{form}{gender}{ec}{pid}{Environment.NewLine}Nature: {pk.Nature}{Environment.NewLine}Ability: {GameInfo.GetStrings(1).Ability[pk.Ability]}{Environment.NewLine}IVs: {pk.IV_HP}/{pk.IV_ATK}/{pk.IV_DEF}/{pk.IV_SPA}/{pk.IV_SPD}/{pk.IV_SPE}{Environment.NewLine}{scale}{msg}";
348352
LiveStats.Text = $"{GameInfo.GetStrings(1).Move[pk.Move1]} - {pk.Move1_PP}PP{Environment.NewLine}{GameInfo.GetStrings(1).Move[pk.Move2]} - {pk.Move2_PP}PP{Environment.NewLine}{GameInfo.GetStrings(1).Move[pk.Move3]} - {pk.Move3_PP}PP{Environment.NewLine}{GameInfo.GetStrings(1).Move[pk.Move4]} - {pk.Move4_PP}PP";
349353
ViewBox.Text = output;
350354
sprite = PokeImg(pk, isGmax);

PokeViewer.NET/SubForms/BoxViewerMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ private async Task<Image> Sanitize(PKM pk, CancellationToken token)
441441
if (!string.IsNullOrEmpty(pid) && !string.IsNullOrEmpty(ec))
442442
sens = pid + ec;
443443
CurrentSlotSpecies.Add($"{(pk.ShinyXor == 0 ? "■ - " : pk.ShinyXor <= 16 ? "★ - " : "")}{gMax}{alpha}{(Species)pk.Species}{form}{gender}{Environment.NewLine}{sens}");
444-
CurrentSlotNature.Add($"Nature: {(Nature)pk.Nature}");
444+
CurrentSlotNature.Add($"Nature: {pk.Nature}");
445445
CurrentSlotAbility.Add($"Ability: {(Ability)pk.Ability}");
446446
CurrentSlotIVs.Add($"IVs: {pk.IV_HP}/{pk.IV_ATK}/{pk.IV_DEF}/{pk.IV_SPA}/{pk.IV_SPD}/{pk.IV_SPE}");
447447
CurrentSlotScale.Add(scale);

0 commit comments

Comments
 (0)