Skip to content

Commit

Permalink
v3.2
Browse files Browse the repository at this point in the history
- Fix version check for Switch 19.0.0 Support
  • Loading branch information
zyro670 committed Oct 17, 2024
1 parent 91d67f8 commit 0318b2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions PokeViewer.NET/MainViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.IO.Compression;
using System.Net.Sockets;
using System.Reflection;
using System.Text.RegularExpressions;
using static PokeViewer.NET.CommandsUtil.CommandsUtil;
using static PokeViewer.NET.RoutineExecutor;
using static PokeViewer.NET.ViewerUtil;
Expand All @@ -26,7 +27,7 @@ namespace PokeViewer.NET
public partial class MainViewer : Form
{
public ViewerExecutor Executor = null!;
private const string ViewerVersion = "3.1.1";
private const string ViewerVersion = "3.2";
private readonly bool[] FormLoaded = new bool[8];
private int GameType;
private SimpleTrainerInfo TrainerInfo = new();
Expand Down Expand Up @@ -72,7 +73,10 @@ private async Task<bool> CheckBotBaseReq(CancellationToken token)
GitHubClient client = new(new ProductHeaderValue("usb-botbase"));
Release releases = await client.Repository.Release.GetLatest("zyro670", "usb-botbase");
var sbb = await Executor.SwitchConnection.GetBotbaseVersion(token).ConfigureAwait(false);
if (!sbb.Equals("2.353\n"))
string replacement = Regex.Replace(sbb, @"\t|\n|\r", "");
string vIn = replacement.Replace('"', ' ').Trim();
var vOut = Convert.ToDouble(vIn);
if (vOut < 2.4)
{
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);
if (dialogResult == DialogResult.Yes)
Expand Down Expand Up @@ -344,7 +348,7 @@ private async void FillPokeData(PKM pk, ulong offset, uint offset2, int size)
case 1: gender = " (F)"; break;
case 2: break;
}
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}";
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}";
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";
ViewBox.Text = output;
sprite = PokeImg(pk, isGmax);
Expand Down
2 changes: 1 addition & 1 deletion PokeViewer.NET/SubForms/BoxViewerMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ private async Task<Image> Sanitize(PKM pk, CancellationToken token)
if (!string.IsNullOrEmpty(pid) && !string.IsNullOrEmpty(ec))
sens = pid + ec;
CurrentSlotSpecies.Add($"{(pk.ShinyXor == 0 ? "■ - " : pk.ShinyXor <= 16 ? "★ - " : "")}{gMax}{alpha}{(Species)pk.Species}{form}{gender}{Environment.NewLine}{sens}");
CurrentSlotNature.Add($"Nature: {(Nature)pk.Nature}");
CurrentSlotNature.Add($"Nature: {pk.Nature}");
CurrentSlotAbility.Add($"Ability: {(Ability)pk.Ability}");
CurrentSlotIVs.Add($"IVs: {pk.IV_HP}/{pk.IV_ATK}/{pk.IV_DEF}/{pk.IV_SPA}/{pk.IV_SPD}/{pk.IV_SPE}");
CurrentSlotScale.Add(scale);
Expand Down

0 comments on commit 0318b2b

Please sign in to comment.