mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-25 12:05:24 -05:00
BulkSpawn alphabetically sorted DIY recipes
This commit is contained in:
@@ -39,7 +39,7 @@ private void B_Apply_Click(object sender, EventArgs e)
|
||||
IReadOnlyList<Item> items;
|
||||
int sizeX;
|
||||
int sizeY;
|
||||
if (type == SpawnType.SequentialDIY)
|
||||
if (type is SpawnType.SequentialDIY or SpawnType.AlphabeticalDIY)
|
||||
{
|
||||
var min = (ushort)NUD_DIYStart.Value;
|
||||
var max = (ushort)NUD_DIYStop.Value;
|
||||
@@ -48,6 +48,9 @@ private void B_Apply_Click(object sender, EventArgs e)
|
||||
.Select(z => z.Key)
|
||||
.Select(z => new Item(Item.DIYRecipe) {FreeParam = z});
|
||||
|
||||
if (type == SpawnType.AlphabeticalDIY)
|
||||
diy = diy.OrderBy(x => GameInfo.Strings.GetItemName(x));
|
||||
|
||||
items = Enumerable.Repeat(diy, count).SelectMany(z => z).ToArray();
|
||||
sizeX = sizeY = 2;
|
||||
}
|
||||
@@ -145,11 +148,12 @@ private static int SpawnItems(ItemLayer layer, IReadOnlyList<Item> items, int x,
|
||||
private void CB_SpawnType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var index = (SpawnType)CB_SpawnType.SelectedIndex;
|
||||
L_DIYStart.Visible = L_DIYStop.Visible = NUD_DIYStart.Visible = NUD_DIYStop.Visible = index == SpawnType.SequentialDIY;
|
||||
L_DIYStart.Visible = L_DIYStop.Visible = NUD_DIYStart.Visible = NUD_DIYStop.Visible = index is SpawnType.SequentialDIY or SpawnType.AlphabeticalDIY;
|
||||
L_NHI.Visible = L_NHIFileName.Visible = index == SpawnType.ItemsFromNHI;
|
||||
NUD_SpawnCount.Value = index switch
|
||||
{
|
||||
SpawnType.SequentialDIY => 1,
|
||||
SpawnType.AlphabeticalDIY => 1,
|
||||
SpawnType.ItemsFromNHI => 1,
|
||||
_ => 8,
|
||||
};
|
||||
@@ -179,6 +183,7 @@ private enum SpawnType
|
||||
{
|
||||
ItemFromEditor,
|
||||
SequentialDIY,
|
||||
AlphabeticalDIY,
|
||||
ItemsFromNHI,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user