diff --git a/PokeViewer.NET/MainViewer.cs b/PokeViewer.NET/MainViewer.cs index 498561c..a3daed5 100644 --- a/PokeViewer.NET/MainViewer.cs +++ b/PokeViewer.NET/MainViewer.cs @@ -26,7 +26,7 @@ namespace PokeViewer.NET public partial class MainViewer : Form { public ViewerExecutor Executor = null!; - private const string ViewerVersion = "3.0.1"; + private const string ViewerVersion = "3.0.2"; private readonly bool[] FormLoaded = new bool[8]; private int GameType; private SimpleTrainerInfo TrainerInfo = new(); diff --git a/PokeViewer.NET/SubForms/MiscViewSV.Designer.cs b/PokeViewer.NET/SubForms/MiscViewSV.Designer.cs index c0c98c2..c8c3927 100644 --- a/PokeViewer.NET/SubForms/MiscViewSV.Designer.cs +++ b/PokeViewer.NET/SubForms/MiscViewSV.Designer.cs @@ -63,14 +63,13 @@ private void InitializeComponent() OpenMapPaldea = new Button(); ScanForEventOutbreak = new CheckBox(); SearchListGroup = new GroupBox(); + FormCombo = new ComboBox(); OutbreakIcon = new PictureBox(); ClearList = new Button(); ViewList = new Button(); - FormBox = new NumericUpDown(); AddSpecies = new Button(); SpeciesBox = new ComboBox(); RemoveSpecies = new Button(); - Form = new Label(); groupBox2 = new GroupBox(); FCETextBox = new TextBox(); ClearFCE = new Button(); @@ -90,7 +89,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)TimeNumeric).BeginInit(); SearchListGroup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)OutbreakIcon).BeginInit(); - ((System.ComponentModel.ISupportInitialize)FormBox).BeginInit(); groupBox2.SuspendLayout(); SuspendLayout(); // @@ -432,15 +430,14 @@ private void InitializeComponent() // // SearchListGroup // + SearchListGroup.Controls.Add(FormCombo); SearchListGroup.Controls.Add(OutbreakIcon); SearchListGroup.Controls.Add(ClearList); SearchListGroup.Controls.Add(ViewList); - SearchListGroup.Controls.Add(FormBox); SearchListGroup.Controls.Add(AddSpecies); SearchListGroup.Controls.Add(SpeciesBox); SearchListGroup.Controls.Add(RemoveSpecies); SearchListGroup.Controls.Add(label9); - SearchListGroup.Controls.Add(Form); SearchListGroup.Location = new Point(218, 12); SearchListGroup.Name = "SearchListGroup"; SearchListGroup.Size = new Size(238, 104); @@ -448,6 +445,14 @@ private void InitializeComponent() SearchListGroup.TabStop = false; SearchListGroup.Text = "Search List"; // + // FormCombo + // + FormCombo.FormattingEnabled = true; + FormCombo.Location = new Point(142, 47); + FormCombo.Name = "FormCombo"; + FormCombo.Size = new Size(93, 23); + FormCombo.TabIndex = 50; + // // OutbreakIcon // OutbreakIcon.Image = (Image)resources.GetObject("OutbreakIcon.Image"); @@ -480,14 +485,6 @@ private void InitializeComponent() ViewList.UseVisualStyleBackColor = false; ViewList.Click += button1_Click; // - // FormBox - // - FormBox.Location = new Point(174, 47); - FormBox.Maximum = new decimal(new int[] { 20, 0, 0, 0 }); - FormBox.Name = "FormBox"; - FormBox.Size = new Size(61, 23); - FormBox.TabIndex = 43; - // // AddSpecies // AddSpecies.BackColor = Color.Transparent; @@ -506,6 +503,7 @@ private void InitializeComponent() SpeciesBox.Name = "SpeciesBox"; SpeciesBox.Size = new Size(91, 23); SpeciesBox.TabIndex = 45; + SpeciesBox.SelectedIndexChanged += SpeciesBox_IsChanged; // // RemoveSpecies // @@ -518,15 +516,6 @@ private void InitializeComponent() RemoveSpecies.UseVisualStyleBackColor = false; RemoveSpecies.Click += RemoveSpecies_Click; // - // Form - // - Form.AutoSize = true; - Form.Location = new Point(140, 50); - Form.Name = "Form"; - Form.Size = new Size(35, 15); - Form.TabIndex = 47; - Form.Text = "Form"; - // // groupBox2 // groupBox2.Controls.Add(FCETextBox); @@ -639,7 +628,6 @@ private void InitializeComponent() SearchListGroup.ResumeLayout(false); SearchListGroup.PerformLayout(); ((System.ComponentModel.ISupportInitialize)OutbreakIcon).EndInit(); - ((System.ComponentModel.ISupportInitialize)FormBox).EndInit(); groupBox2.ResumeLayout(false); groupBox2.PerformLayout(); ResumeLayout(false); @@ -663,11 +651,9 @@ private void InitializeComponent() private CheckBox Apply0To64; private Button OpenMapPaldea; private Button ViewList; - private NumericUpDown FormBox; private Button AddSpecies; private ComboBox SpeciesBox; private Button RemoveSpecies; - private Label Form; private Button ClearList; private Button OpenMapKitakami; private ComboBox MapGroup; @@ -696,5 +682,6 @@ private void InitializeComponent() private Button EnterButton; private Button CaptureRaidButton; private Label RaidDifficultyLabel; + private ComboBox FormCombo; } } \ No newline at end of file diff --git a/PokeViewer.NET/SubForms/MiscViewSV.cs b/PokeViewer.NET/SubForms/MiscViewSV.cs index fb745ac..7f6d2d2 100644 --- a/PokeViewer.NET/SubForms/MiscViewSV.cs +++ b/PokeViewer.NET/SubForms/MiscViewSV.cs @@ -51,6 +51,10 @@ public partial class MiscViewSV : Form private List MapCountObB = []; private List MapStringsObB = []; private List pkList = []; + private readonly string[] SpeciesList = null!; + private readonly string[] FormsList = null!; + private readonly string[] TypesList = null!; + private readonly string[] GenderList = null!; protected ViewerOffsets Offsets { get; } = new(); public MiscViewSV(ViewerExecutor executor, (Color, Color) color) { @@ -64,6 +68,10 @@ public MiscViewSV(ViewerExecutor executor, (Color, Color) color) LoadFilters(path); LoadOutbreakCache(); + SpeciesList = GameInfo.GetStrings(1).specieslist; + FormsList = GameInfo.GetStrings(1).forms; + TypesList = GameInfo.GetStrings(1).types; + GenderList = [.. GameInfo.GenderSymbolUnicode]; } private void LoadFilters(string data) @@ -114,8 +122,8 @@ private void SetColors((Color, Color) color) OutbreakIcon.ForeColor = color.Item2; SpeciesBox.BackColor = color.Item1; SpeciesBox.ForeColor = color.Item2; - FormBox.BackColor = color.Item1; - FormBox.ForeColor = color.Item2; + FormCombo.BackColor = color.Item1; + FormCombo.ForeColor = color.Item2; MapGroup.BackColor = color.Item1; MapGroup.ForeColor = color.Item2; FwdButton.BackColor = color.Item1; @@ -998,9 +1006,6 @@ private async Task SearchForOutbreak(CancellationToken token) MapPOSB = []; MapCountB = []; MapStringsB = []; - - Apply0To64.Checked = false; - OutbreakSearch.Checked = false; } DaySkipTotal.Text = $"Day Skips: {dayskip}"; @@ -1629,12 +1634,29 @@ private void button1_Click(object sender, EventArgs e) MessageBox.Show(r, "Search List"); } + private void SpeciesBox_IsChanged(object sender, EventArgs e) + { + FormCombo.Items.Clear(); + FormCombo.Text = string.Empty; + var formlist = FormConverter.GetFormList((ushort)(Species)SpeciesBox.SelectedIndex, TypesList, FormsList, GenderList, EntityContext.Gen9); + if ((Species)SpeciesBox.SelectedIndex == Species.Minior) + formlist = formlist.Take((formlist.Length + 1) / 2).ToArray(); + + if (formlist.Length == 0 || (formlist.Length == 1 && formlist[0].Equals(""))) + FormCombo.Visible = false; + else + { + FormCombo.Items.AddRange(formlist); + FormCombo.Visible = true; + } + } + private void AddSpecies_Click(object sender, EventArgs e) { PK9 pk = new() { Species = (ushort)(Species)SpeciesBox.SelectedIndex, - Form = (byte)FormBox.Value, + Form = (byte)FormCombo.SelectedIndex, }; if (pk.Species == 0) @@ -1686,7 +1708,7 @@ private void RemoveSpecies_Click(object sender, EventArgs e) PK9 pk = new() { Species = (ushort)(Species)SpeciesBox.SelectedIndex, - Form = (byte)FormBox.Value, + Form = (byte)FormCombo.SelectedIndex, }; foreach (var p in pkList.ToList()) { @@ -1789,7 +1811,7 @@ private async Task EnterRaidCode(CancellationToken token) var strokes = FCETextBox.Text.ToUpper().ToArray(); var number = $"NumPad"; string[] badVals = { "@", "I", "O", "=", "&", ";", "Z", "*", "#", "!", "?" }; - List keystopress = new(); + List keystopress = []; foreach (var str in strokes) { if (badVals.Contains(str.ToString())) diff --git a/PokeViewer.NET/Util/ViewerUtil.cs b/PokeViewer.NET/Util/ViewerUtil.cs index 24ec326..6562bae 100644 --- a/PokeViewer.NET/Util/ViewerUtil.cs +++ b/PokeViewer.NET/Util/ViewerUtil.cs @@ -160,14 +160,6 @@ public class DataBlock public static class Blocks { - public static DataBlock KPlayerCurrentFieldID = new() - { - Name = "KPlayerCurrentFieldID", - Key = 0xF17EB014, - Type = SCTypeCode.SByte, - IsEncrypted = true, - Size = 1, - }; public static DataBlock KMassOutbreakTotalPaldea = new() { Name = "KMassOutbreakTotalPaldea", @@ -2098,14 +2090,5 @@ public static class Blocks Size = 12, }; #endregion - public static DataBlock KBlueberryPoints = new() - { - Name = "KBlueberryPoints", - Key = 0x66A33824, - Type = SCTypeCode.UInt32, - IsEncrypted = true, - Size = 4, - }; } - } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9172f45..5544bf4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,8 @@ steps: inputs: solution: '$(Project)' msbuildArgs: '/t:restore;rebuild;publish - /p:Configuration=$(Configuration);Platform=$(Platform);PublishSingleFile=true;OutputPath=$(Build.ArtifactStagingDirectory)\' + /p:Configuration=$(Configuration);Platform=$(Platform);PublishSingleFile=true;OutputPath=$(Build.ArtifactStagingDirectory)\ + /p:RuntimeIdentifier=win-$(Platform)' - task: PublishPipelineArtifact@1 displayName: 'Publish Artifact: PokeViewer.NET-x64'