mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-24 22:53:02 -05:00
Simplify munchlax tree list usage
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using static System.Buffers.Binary.BinaryPrimitives;
|
||||
|
||||
namespace PKHeX.Core;
|
||||
@@ -229,5 +229,5 @@ public enum PoketchApp
|
||||
|
||||
public readonly record struct MunchlaxTreeSet4(int Tree1, int Tree2, int Tree3, int Tree4)
|
||||
{
|
||||
public int[] ToArray() => new[] { Tree1, Tree2, Tree3, Tree4 };
|
||||
public bool Contains(int tree) => tree == Tree1 || tree == Tree2 || tree == Tree3 || tree == Tree4;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using PKHeX.Core;
|
||||
|
||||
@@ -24,15 +23,20 @@ public SAV_HoneyTree(SAV4Sinnoh sav)
|
||||
};
|
||||
|
||||
// Get Munchlax tree for this savegame in screen
|
||||
MunchlaxTrees = SAV.GetMunchlaxTrees().ToArray();
|
||||
MunchlaxTrees = SAV.GetMunchlaxTrees();
|
||||
|
||||
const string sep = "- ";
|
||||
L_Tree0.Text = string.Join(Environment.NewLine, MunchlaxTrees.Select(z => sep + CB_TreeList.Items[z]));
|
||||
var names = CB_TreeList.Items;
|
||||
L_Tree0.Text = string.Join(Environment.NewLine,
|
||||
sep + names[MunchlaxTrees.Tree1],
|
||||
sep + names[MunchlaxTrees.Tree2],
|
||||
sep + names[MunchlaxTrees.Tree3],
|
||||
sep + names[MunchlaxTrees.Tree4]);
|
||||
|
||||
CB_TreeList.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private readonly int[] MunchlaxTrees;
|
||||
private readonly MunchlaxTreeSet4 MunchlaxTrees;
|
||||
private readonly ushort[][] Table;
|
||||
private int entry;
|
||||
private bool loading;
|
||||
|
||||
Reference in New Issue
Block a user