Skip to content

Commit ca2554f

Browse files
committed
include shape file group in error message
1 parent b4cca3d commit ca2554f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

RockCollect/Stages/TileSelectUI.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ private void buttonCopySettingsFromClosest_Click(object sender, EventArgs e)
143143
{
144144
if (Stage.GetActiveTileAddress(out int x, out int y))
145145
{
146-
int idx = Stage.GetClosestTunedTile(Stage.GetTileIndex(x, y), (i) => Stage.ValidTileJSON(i));
147-
if (idx >= 0)
146+
int closest = Stage.GetClosestTunedTile(Stage.GetTileIndex(x, y), (i) => Stage.ValidTileJSON(i));
147+
if (closest >= 0)
148148
{
149-
Stage.CopySettings(idx, Stage.GetActiveTile(), confirm: true);
149+
Stage.CopySettings(closest, Stage.GetActiveTile(), confirm: true);
150150
}
151151
else
152152
{
153-
MessageBox.Show(string.Format("No closest tuned tile found to tile ({0}, {1}).", x, y),
153+
string grp = Stage.GetActiveTileGroup();
154+
MessageBox.Show(string.Format("No closest tuned tile found to tile ({0}, {1}){2}.", x, y,
155+
!string.IsNullOrEmpty(grp) ? " in shape file group " + grp : ""),
154156
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
155157
}
156158
}

0 commit comments

Comments
 (0)