mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-22 10:35:15 -05:00
Fixed bug w/bulk spawn wraps onto 2 lines in horizontal layout
c1bc5ae97f
Add Vertical spawn mode, since people like to do that for their treasure islands
Co-Authored-By: MadDanEccles <5344903+MadDanEccles@users.noreply.github.com>
This commit is contained in:
@@ -97,8 +97,14 @@ private void B_Apply_Click(object sender, EventArgs e)
|
||||
|
||||
private static int SpawnItems(ItemLayer layer, IReadOnlyList<Item> items, int x, int y, SpawnArrangement arrange, int sizeX, int sizeY, bool noOverwrite)
|
||||
{
|
||||
// every {setting} tiles, we jump down to the next available row of tiles.
|
||||
int x0 = x;
|
||||
var newline = arrange == SpawnArrangement.Square ? (int)Math.Sqrt(items.Count * sizeX * sizeY) : items.Count;
|
||||
var newline = arrange switch
|
||||
{
|
||||
SpawnArrangement.Square => (int)Math.Sqrt(items.Count * sizeX * sizeY),
|
||||
SpawnArrangement.Vertical => 1 * sizeY,
|
||||
_ => items.Count * sizeX // Horizontal
|
||||
};
|
||||
|
||||
int ctr = 0;
|
||||
for (var i = 0; i < items.Count; i++)
|
||||
@@ -180,6 +186,7 @@ private enum SpawnArrangement
|
||||
{
|
||||
Square,
|
||||
Horizontal,
|
||||
Vertical,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user