diff --git a/NHSE.Core/Editing/ItemRequest/ItemParser.cs b/NHSE.Core/Editing/ItemRequest/ItemParser.cs index 96bd067..daba25c 100644 --- a/NHSE.Core/Editing/ItemRequest/ItemParser.cs +++ b/NHSE.Core/Editing/ItemRequest/ItemParser.cs @@ -211,7 +211,7 @@ private static Item CreateItem(byte[] convert, int requestIndex, IConfigItem con try { if (convert.Length != Item.SIZE) - throw new Exception(); + throw new Exception($"Invalid item byte length (expected {Item.SIZE}, got {convert.Length})."); item = convert.ToClass(); } catch (Exception ex) diff --git a/NHSE.Core/Structures/Building/BuildingType.cs b/NHSE.Core/Structures/Building/BuildingType.cs index aa01b05..0dab870 100644 --- a/NHSE.Core/Structures/Building/BuildingType.cs +++ b/NHSE.Core/Structures/Building/BuildingType.cs @@ -37,4 +37,11 @@ public enum BuildingType : ushort Studio = 29, Hotel = 42, -} \ No newline at end of file +} +public static class BuildingUtil +{ + public static (int Width, int Height) GetDimensions(this BuildingType type) => type switch + { + _ => (2, 2), + }; +} diff --git a/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs b/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs index 66ee70d..5a007d5 100644 --- a/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs +++ b/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs @@ -12,10 +12,12 @@ namespace NHSE.Core; /// Vertical acre shift from the map's origin. /// Number of tiles per acre in one dimension (16 or 32). /// Bit shift value to convert between tiles and acres (4 for 16 tiles, 5 for 32 tiles). +/// Size of tile compared to the smallest tile possible (2 for 16 tiles, 1 for 32 tiles). public readonly record struct LayerPositionConfig( byte CountWidth, byte CountHeight, byte ShiftWidth, byte ShiftHeight, - [ConstantExpected] byte TilesPerAcre, byte TileBitShift) + [ConstantExpected] byte TilesPerAcre, byte TileBitShift, + [ConstantExpected(Max = 2, Min = 1)] byte MetaTileSize) { // Maps in Animal Crossing: New Horizons are made up of acres that are 9 tiles wide and 8 tiles high. // 5 columns in the center are land, surrounded by 2 tiles of beach and 2 tiles of sea on each side. @@ -47,115 +49,55 @@ namespace NHSE.Core; /// Width of the layer in acres. /// Height of the layer in acres. /// Number of tiles per acre (16 or 32). + /// Size of tile compared to the smallest tile possible (2 for 16 tiles, 1 for 32 tiles). /// A new instance. - public static LayerPositionConfig Create(byte width, byte height, [ConstantExpected(Min = Grid16, Max = Grid32)] byte tilesPerAcre) + public static LayerPositionConfig Create(byte width, byte height, + [ConstantExpected(Min = Grid16, Max = Grid32)] byte tilesPerAcre, + [ConstantExpected(Min = 1, Max = 2)] byte metaTileSize) { var shiftW = (byte)((MapAcreWidth - width) / 2); // centered var shiftH = (byte)((MapAcreHeight - height) / 2); // centered var bitShift = tilesPerAcre == Grid16 ? Shift16 : Shift32; #pragma warning disable CA1857 - return new LayerPositionConfig(width, height, shiftW, shiftH, tilesPerAcre, bitShift); + return new LayerPositionConfig(width, height, shiftW, shiftH, tilesPerAcre, bitShift, metaTileSize); #pragma warning restore CA1857 } - /// - /// Converts absolute coordinates to coordinates relative to the stored layer. - /// - /// Absolute X coordinate on the map. - /// Absolute Y coordinate on the map. - /// Relative X coordinate in the layer. - /// Relative Y coordinate in the layer. - /// if the absolute coordinates are within the layer; otherwise, . - public bool TryGetRelativeCoordinates(int absX, int absY, out int relX, out int relY) + public (int X, int Y) GetCoordinatesAbsolute(int relX, int relY) { - relX = 0; - relY = 0; + var absX = relX - ((ShiftWidth * MetaTileSize) << TileBitShift); + var absY = relY - ((ShiftHeight * MetaTileSize) << TileBitShift); + return (absX, absY); + } - // Get relative acre - var (acreX, acreY) = GetAbsoluteAcre(absX, absY); - acreX -= ShiftWidth; - acreY -= ShiftHeight; - - // Performance: single if-check by using underflow casting to unsigned - if ((uint)acreX >= CountWidth) - return false; - if ((uint)acreY >= CountHeight) - return false; - - // Return relative position - relX = absX - (ShiftWidth << TileBitShift); - relY = absY - (ShiftHeight << TileBitShift); - return true; + public (int X, int Y) GetCoordinatesRelative(int absX, int absY) + { + var relX = absX + ((ShiftWidth * MetaTileSize) << TileBitShift); + var relY = absY + ((ShiftHeight * MetaTileSize) << TileBitShift); + return (relX, relY); } /// /// Determines whether the specified absolute X and Y coordinates are within the valid bounds of the map. /// - /// The absolute X coordinate to validate. Must be within the horizontal bounds of the map. - /// The absolute Y coordinate to validate. Must be within the vertical bounds of the map. + /// The absolute X coordinate to validate. Must be within the horizontal bounds of the map. + /// The absolute Y coordinate to validate. Must be within the vertical bounds of the map. /// if the coordinates are valid; otherwise, . - public bool IsAbsoluteCoordinateValid(int absX, int absY) + public bool IsCoordinateValidRelative(int relX, int relY) { - if ((uint)absX >= ((uint)MapAcreWidth << TileBitShift)) - return false; - if ((uint)absY >= ((uint)MapAcreHeight << TileBitShift)) - return false; - return true; - } - - /// - /// Gets the absolute acre coordinates from absolute tile coordinates. - /// - public (int X, int Y) GetAbsoluteAcre(int absX, int absY) - { - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)absX, (uint)MapAcreWidth << TileBitShift); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)absY, (uint)MapAcreHeight << TileBitShift); - var acreX = absX >> TileBitShift; - var acreY = absY >> TileBitShift; - return (acreX, acreY); + var index = GetIndexTileRelative(relX, relY); + return (uint)index < (CountWidth * CountHeight << (TileBitShift * 2)); } /// /// Gets the requested tile index within the layer, given relative tile coordinates. /// /// The tile index within the layer. - /// public int GetIndexTileRelative(int relX, int relY) { - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)relX, (uint)CountWidth << TileBitShift); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)relY, (uint)CountHeight << TileBitShift); // Tile ordering is top-down, left-to-right. // In other words, Item[1] is X=0,Y=1 return (relX * (CountHeight << TileBitShift)) + relY; } - - /// - /// Gets the requested tile index within the absolute map boundary, given absolute tile coordinates in the map. - /// - /// The tile index within the map. - /// - public int GetIndexTileAbsolute(int absX, int absY) - { - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)absX, (uint)MapAcreWidth << TileBitShift); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)absY, (uint)MapAcreHeight << TileBitShift); - // Tile ordering is top-down, left-to-right. - // In other words, Item[1] is X=0,Y=1 - return (absX * (MapAcreHeight << TileBitShift)) + absY; - } - - /// - /// Gets the acre index (not the value selection of the acre) based on the absolute coordinates on the map. - /// - /// The acre index within the map. - /// - public int GetIndexAcre(int absX, int absY) - { - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)absX, MapAcreWidth); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)absY, MapAcreHeight); - - // Acre ordering is top-down, left-to-right. - var (x, y) = GetAbsoluteAcre(absX, absY); - return (x * MapAcreHeight) + y; - } } \ No newline at end of file diff --git a/NHSE.Core/Structures/Map/Layers/LayerTerrain.cs b/NHSE.Core/Structures/Map/Layers/LayerTerrain.cs index e5fc899..727fb93 100644 --- a/NHSE.Core/Structures/Map/Layers/LayerTerrain.cs +++ b/NHSE.Core/Structures/Map/Layers/LayerTerrain.cs @@ -140,18 +140,7 @@ public void SetAllRoad(TerrainTile tile, bool interiorOnly = true) } } - public bool IsWithinGrid(int acreScale, int relX, int relY) - { - if ((uint)relX >= TileInfo.ViewWidth * acreScale) - return false; - - if ((uint)relY >= TileInfo.ViewHeight * acreScale) - return false; - - return true; - } - - public int GetTileColor(int x, in int y, int relativeX, int relativeY) + public int GetTileColor(int x, int y, int relativeX, int relativeY) { var acre = GetTileAcre(x, y); if (acre != 0) diff --git a/NHSE.Core/Structures/Map/Managers/MapEditor.cs b/NHSE.Core/Structures/Map/Managers/MapEditor.cs index 5c5ebea..7c7ce15 100644 --- a/NHSE.Core/Structures/Map/Managers/MapEditor.cs +++ b/NHSE.Core/Structures/Map/Managers/MapEditor.cs @@ -10,12 +10,12 @@ public sealed class MapEditor /// /// Amount of pixel upscaling compared to a 1px = 1 tile map. /// - public int MapScale { get; set; } = 2; + public int MapScale { get; set; } = 1; /// /// Amount of pixel upscaling compared to a 1px = 1 tile map. /// - public int AcreScale { get; set; } = 8; + public int ViewScale { get; set; } = 16; /// /// Converts an upscaled coordinate to a tile coordinate. @@ -44,4 +44,87 @@ public static MapEditor FromSaveFile(MainSave sav) public LayerTerrain Terrain => Mutator.Manager.LayerTerrain; public ILayerBuilding Buildings => Mutator.Manager.LayerBuildings; public ILayerFieldItemSet Items => Mutator.Manager.FieldItems; + + /// + /// Converts building map coordinates to view pixel coordinates. + /// + /// Building map X coordinate. + /// Building map Y coordinate. + /// View coordinates. + public (int X, int Y) GetViewCoordinatesBuilding(uint relX, uint relY) + => GetViewCoordinates((int)relX, (int)relY, Mutator.Manager.ConfigBuildings); + + public (int X, int Y) GetViewCoordinatesTerrain(int relX, int relY) + => GetViewCoordinates(relX, relY, Mutator.Manager.ConfigTerrain); + + public (int X, int Y) GetViewCoordinatesFieldItem(int relX, int relY) + => GetViewCoordinates(relX, relY, Mutator.Manager.ConfigItems); + + public (int X, int Y) GetViewCoordinates(int posX, int posY, LayerPositionConfig shifter) + { + // Get absolute coordinates from the layer. + var (x, y) = shifter.GetCoordinatesAbsolute(posX, posY); + + // Shift to view coordinates + x -= X; + y -= Y; + // Scale to pixel coordinates + x *= ViewScale; + y *= ViewScale; + return (x, y); + } + + /// + /// From a map pixel coordinate (), get the clamped map tile coordinate. + /// + /// Upscaled Map pixel X coordinate. + /// Upscaled Map pixel Y coordinate. + /// Option to adjust the coordinates to a desired type. + /// + public (int X, int Y) GetMapCoordinates(int x, int y, MapViewCoordinateRequest type) + { + x /= MapScale; + y /= MapScale; + + if (x < 0) x = 0; + if (y < 0) y = 0; + + // Adjust the view coordinate + if (type == MapViewCoordinateRequest.Centered) + { + // Reticle size is GridWidth, center = /2 + var shift = (LayerFieldItem.TilesPerAcreDim * MapScale) / 2; + x -= shift; + y -= shift; + } + else if (type == MapViewCoordinateRequest.SnapAcre) + { + // Snap to the nearest acre + x -= x % LayerFieldItem.TilesPerAcreDim; + y -= y % LayerFieldItem.TilesPerAcreDim; + } + + var view = Mutator.View; + // Clamp to viewport dimensions, and center to nearest acre if desired. + // Clamp to boundaries so that we always have a full grid to view. + return view.EnforceEdgeBuffer(x, y); + } +} + +public enum MapViewCoordinateRequest +{ + /// + /// No adjustment to the coordinates. + /// + None = 0, + + /// + /// Snap the coordinates to the nearest acre boundary. + /// + SnapAcre, + + /// + /// Center the view around the requested (x,y). + /// + Centered, } \ No newline at end of file diff --git a/NHSE.Core/Structures/Map/Managers/MapMutator.cs b/NHSE.Core/Structures/Map/Managers/MapMutator.cs index e8ec5b6..b6ddedd 100644 --- a/NHSE.Core/Structures/Map/Managers/MapMutator.cs +++ b/NHSE.Core/Structures/Map/Managers/MapMutator.cs @@ -2,7 +2,7 @@ namespace NHSE.Core; -public sealed class MapMutator +public sealed record MapMutator { public MapViewState View { get; init; } = new(); public required MapTileManager Manager { get; init; } @@ -58,4 +58,12 @@ private int ReplaceFieldItems(Item oldItem, Item newItem, bool wholeMap, LayerFi /// A MapMutator instance populated with data from the provided save file. public static MapMutator FromSaveFile(MainSave sav) => new() { Manager = MapTileManagerUtil.FromSaveFile(sav) }; + + /// + /// Creates a separate view-mutator with shared map objects. + /// + public MapMutator CreateCopy() => this with + { + View = View with { }, + }; } \ No newline at end of file diff --git a/NHSE.Core/Structures/Map/Managers/MapTileManagerUtil.cs b/NHSE.Core/Structures/Map/Managers/MapTileManagerUtil.cs index ed70aef..54b2e3a 100644 --- a/NHSE.Core/Structures/Map/Managers/MapTileManagerUtil.cs +++ b/NHSE.Core/Structures/Map/Managers/MapTileManagerUtil.cs @@ -7,9 +7,9 @@ public static class MapTileManagerUtil /// public static MapTileManager FromSaveFile(MainSave sav) => new() { - ConfigTerrain = LayerPositionConfig.Create(7, 6, 16), - ConfigBuildings = LayerPositionConfig.Create(5, 4, 16), - ConfigItems = LayerPositionConfig.Create(sav.FieldItemAcreWidth, sav.FieldItemAcreHeight, 32), + ConfigTerrain = LayerPositionConfig.Create(7, 6, 16, 1), + ConfigBuildings = LayerPositionConfig.Create(5, 4, 16, 2), + ConfigItems = LayerPositionConfig.Create(sav.FieldItemAcreWidth, sav.FieldItemAcreHeight, 32, 1), LayerTerrain = new LayerTerrain(sav.GetTerrainTiles(), sav.GetAcreBytes()), LayerBuildings = new LayerBuilding { Buildings = sav.Buildings }, diff --git a/NHSE.Core/Structures/Map/Managers/MapViewState.cs b/NHSE.Core/Structures/Map/Managers/MapViewState.cs index eeed45a..0b561f3 100644 --- a/NHSE.Core/Structures/Map/Managers/MapViewState.cs +++ b/NHSE.Core/Structures/Map/Managers/MapViewState.cs @@ -129,4 +129,20 @@ public void SetViewToAcre(int acre) var acreY = acre / (MaxX / EdgeBuffer); SetViewTo(acreX * EdgeBuffer, acreY * EdgeBuffer); } + + public (int X, int Y) EnforceEdgeBuffer(int x, int y) + { + x = (int)Math.Clamp((uint)x, 0, MaxX - EdgeBuffer); + y = (int)Math.Clamp((uint)y, 0, MaxY - EdgeBuffer); + return (x, y); + } + + public bool IsWithinView(int x, int y, int tileStride) + { + if (x < X || x >= X + tileStride) + return false; + if (y < Y || y >= Y + tileStride) + return false; + return true; + } } \ No newline at end of file diff --git a/NHSE.Core/Structures/Map/TileGridViewport.cs b/NHSE.Core/Structures/Map/TileGridViewport.cs index 7c266a1..62a23fd 100644 --- a/NHSE.Core/Structures/Map/TileGridViewport.cs +++ b/NHSE.Core/Structures/Map/TileGridViewport.cs @@ -57,28 +57,4 @@ private static void ClampCoordinatesTo(ref int x, ref int y, int maxX, int maxY) x = Math.Clamp(x, 0, maxX); y = Math.Clamp(y, 0, maxY); } - - public void GetViewAnchorCoordinates(ref int x, ref int y, in bool centerReticle) - { - // If we aren't snapping the reticle to the nearest acre - // we want to put the middle of the reticle rectangle where the cursor is. - // Adjust the view coordinate - if (!centerReticle) - { - // Reticle size is GridWidth, center = /2 - x -= ViewWidth / 2; - y -= ViewWidth / 2; - } - - // Clamp to viewport dimensions, and center to nearest acre if desired. - // Clamp to boundaries so that we always have a full grid to view. - SetTopLeftNearest(ref x, ref y); - } - - private void SetTopLeftNearest(ref int x, ref int y) - { - int maxX = TotalWidth - ViewWidth; - int maxY = TotalHeight - ViewHeight; - ClampCoordinatesTo(ref x, ref y, maxX, maxY); - } } \ No newline at end of file diff --git a/NHSE.Injection/SysBot/Decoder.cs b/NHSE.Injection/SysBot/Decoder.cs index 0de97c1..59f45ba 100644 --- a/NHSE.Injection/SysBot/Decoder.cs +++ b/NHSE.Injection/SysBot/Decoder.cs @@ -7,44 +7,35 @@ public static class Decoder private static bool IsNum(char c) => (uint)(c - '0') <= 9; private static bool IsHexUpper(char c) => (uint)(c - 'A') <= 5; - public static byte[] ConvertHexByteStringToBytes(byte[] bytes) + public static byte[] ConvertHexByteStringToBytes(ReadOnlySpan bytes) { var dest = new byte[bytes.Length / 2]; - for (int i = 0; i < dest.Length; i++) - { - int ofs = i * 2; - var _0 = (char)bytes[ofs + 0]; - var _1 = (char)bytes[ofs + 1]; - dest[i] = DecodeTuple(_0, _1); - } + LoadHexBytesTo(bytes, dest, 2); return dest; } + public static void LoadHexBytesTo(ReadOnlySpan str, Span dest, int tupleSize) + { + // The input string is 2-char hex values optionally separated. + // The destination array should always be larger or equal than the bytes written. Let the runtime bounds check us. + // Iterate through the string without allocating. + for (int i = 0, j = 0; i < str.Length; i += tupleSize) + dest[j++] = DecodeTuple((char)str[i + 0], (char)str[i + 1]); + } + private static byte DecodeTuple(char _0, char _1) { - byte result; - if (IsNum(_0)) - result = (byte)((_0 - '0') << 4); - else if (IsHexUpper(_0)) - result = (byte)((_0 - 'A' + 10) << 4); - else + return (byte)(DecodeChar(_0) << 4 | DecodeChar(_1)); + + static int DecodeChar(char x) + { + if (char.IsAsciiDigit(x)) + return (byte)(x - '0'); + if (char.IsAsciiHexDigitUpper(x)) + return (byte)(x - 'A' + 10); + if (char.IsAsciiHexDigitLower(x)) + return (byte)(x - 'a' + 10); throw new ArgumentOutOfRangeException(nameof(_0)); - - if (IsNum(_1)) - result |= (byte)(_1 - '0'); - else if (IsHexUpper(_1)) - result |= (byte)(_1 - 'A' + 10); - else - throw new ArgumentOutOfRangeException(nameof(_1)); - return result; - } - - public static byte[] StringToByteArray(string hex) - { - int NumberChars = hex.Length; - byte[] bytes = new byte[NumberChars / 2]; - for (int i = 0; i < NumberChars; i += 2) - bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); - return bytes; + } } } \ No newline at end of file diff --git a/NHSE.Sprites/Field/ItemLayerSprite.cs b/NHSE.Sprites/Field/ItemLayerSprite.cs index d171d42..465907e 100644 --- a/NHSE.Sprites/Field/ItemLayerSprite.cs +++ b/NHSE.Sprites/Field/ItemLayerSprite.cs @@ -4,183 +4,298 @@ namespace NHSE.Sprites; +/// +/// Logic for rendering an . +/// public static class ItemLayerSprite { + private static readonly Pen Reticle = new(Color.Red); + + /// + /// Generates a bitmap representation of the provided item layer at a 1px-per-tile scale. + /// + /// Item layer to render. public static Bitmap GetBitmapItemLayer(LayerItem layer) { var items = layer.Tiles; - var height = layer.TileInfo.TotalHeight; - var width = items.Length / height; + var imgHeight = layer.TileInfo.TotalHeight; + var imgWidth = items.Length / imgHeight; - var bmpData = new int[width * height]; - LoadBitmapLayer(items, bmpData, width, height); + var bmpData = new int[imgWidth * imgHeight]; + LoadBitmapLayer(items, bmpData, imgWidth, imgHeight); - return ImageUtil.GetBitmap(bmpData, width, height); + return ImageUtil.GetBitmap(bmpData, imgWidth, imgHeight); } - private static void LoadBitmapLayer(ReadOnlySpan items, Span bmpData, int width, int height) + /// + /// Populates a bitmap data buffer with color values derived from a collection of items, arranging the colors in column-major order based on the specified width and height. + /// + /// + /// Each item's color is determined using FieldItemColor.GetItemColor and stored in ARGB format. + /// Colors are written to bmpData in column-major order, where each column is filled from top to bottom. + /// + /// List of items from which color values are extracted. The span must contain at least width × height elements. + /// Pixel data for the bitmap. The span must have a length of at least width × height. + /// The number of columns in the bitmap. Must be greater than zero. + /// The number of rows in the bitmap. Must be greater than zero. + private static void LoadBitmapLayer(ReadOnlySpan items, Span bmpData, int imgWidth, int imgHeight) { - for (int x = 0; x < width; x++) + for (int x = 0; x < imgWidth; x++) { - var ix = x * height; - for (int y = 0; y < height; y++) + var ix = x * imgHeight; + for (int y = 0; y < imgHeight; y++) { var index = ix + y; var tile = items[index]; - bmpData[(y * width) + x] = FieldItemColor.GetItemColor(tile).ToArgb(); + bmpData[(y * imgWidth) + x] = FieldItemColor.GetItemColor(tile).ToArgb(); } } } - private static void LoadPixelsFromLayer(LayerItem layer, int x0, int y0, int width, Span bmpData) + /// + /// Loads an item layer into a bitmap, scaling it up to the desired size, drawing special symbols, and overlaying a grid. + /// + /// Inflated acre bitmap to write to. + /// Item layer to draw from. + /// Top-left X coordinate to start drawing from, relative to the origin of the layer (not map coordinates). + /// Top-left Y coordinate to start drawing from. + /// Pixel data for 1px per tile image. + /// >Pixel data for final inflated image. + /// Scaling factor from 1px => final image dimensions. + /// Optional transparency override color. + /// Color to use for gridlines. + public static void LoadItemLayerViewGrid(Bitmap img, LayerItem layer, int relX, int relY, + Span imgSingle, Span imgUpscaled, int imgScale, int transparency = -1, int gridlineColor = 0) { - var stride = layer.TileInfo.ViewWidth; + // Update the 1px view-grid image pixel data. + LoadViewport(imgSingle, layer, relX, relY); - for (int y = 0; y < stride; y++) + // Get the final inflated size of the image. + int imgWidth = layer.TileInfo.ViewWidth; + int h = layer.TileInfo.ViewHeight; + imgWidth *= imgScale; + h *= imgScale; + // Inflate to the final size storage. + ImageUtil.ScalePixelImage(imgSingle, imgUpscaled, imgWidth, h, imgScale); + + // Optional transparency clamping to make image fainter. + if (transparency >>> 24 != 0xFF) + ImageUtil.ClampAllTransparencyTo(imgUpscaled, transparency); + + // Draw symbols over special items now? + DrawDirectionals(imgUpscaled, layer, relX, relY, imgWidth, imgScale); + + // Apply gridlines to visually separate each cell. + DrawGrid(imgUpscaled, imgWidth, h, gridlineColor, imgScale); + + // Update the bitmap, final data. + img.SetBitmapData(imgUpscaled); + } + + /// + /// Loads pixel data from the specified layer into the provided span, using the given starting coordinates and the layer's view dimensions. + /// + /// Pixel data of the final image. + /// The layer from which to load pixel data. + /// The x-coordinate of the upper-left corner in the layer from which to start loading pixels. + /// The y-coordinate of the upper-left corner in the layer from which to start loading pixels. + private static void LoadViewport(Span data, LayerItem layer, int relX, int relY) + { + var width = layer.TileInfo.ViewWidth; + var height = layer.TileInfo.ViewHeight; + + for (int y = 0; y < height; y++) { var baseIndex = (y * width); - for (int x = 0; x < stride; x++) + for (int x = 0; x < width; x++) { - var tile = layer.GetTile(x + x0, y + y0); + var tile = layer.GetTile(relX + x, relY + y); var color = FieldItemColor.GetItemColor(tile).ToArgb(); var index = baseIndex + x; - bmpData[index] = color; + data[index] = color; } } } - // non-allocation image generator - public static Bitmap GetBitmapItemLayerViewGrid(LayerItem layer, int x0, int y0, int scale, Span acre1, int[] acreScale, Bitmap dest, int transparency = -1, int gridlineColor = 0) + /// + /// Draws extension tile info for the tiles in the specified layer onto the provided pixel data. + /// + /// Pixel data of the entire image. + /// The layer containing the tiles to process. + /// Top-left X coordinate to start drawing from, relative to the origin of the layer (not map coordinates). + /// Top-left Y coordinate to start drawing from. + /// Width of the entire image. + /// Scaling factor from 1px => final image dimensions. + private static void DrawDirectionals(Span data, LayerItem layer, int relX, int relY, int imgWidth, int imgScale) { - int w = layer.TileInfo.ViewWidth; - int h = layer.TileInfo.ViewHeight; - LoadPixelsFromLayer(layer, x0, y0, w, acre1); - w *= scale; - h *= scale; - ImageUtil.ScalePixelImage(acre1, acreScale, w, h, scale); + var width = layer.TileInfo.ViewWidth; + var height = layer.TileInfo.ViewHeight; - if (transparency >>> 24 != 0xFF) - ImageUtil.ClampAllTransparencyTo(acreScale, transparency); - - // draw symbols over special items now? - DrawDirectionals(acreScale, layer, w, x0, y0, scale); - - // Slap on a grid - DrawGrid(acreScale, w, h, scale, gridlineColor); - - // Return final data - ImageUtil.SetBitmapData(dest, acreScale); - return dest; - } - - private static void DrawDirectionals(Span data, LayerItem layer, int w, int x0, int y0, int scale) - { - for (int x = x0; x < x0 + layer.TileInfo.ViewWidth; x++) + for (int x = 0; x < width; x++) { - for (int y = y0; y < y0 + layer.TileInfo.ViewHeight; y++) + for (int y = 0; y < height; y++) { - var tile = layer.GetTile(x, y); + var pX = relX + x; + var pY = relY + y; + var tile = layer.GetTile(pX, pY); if (tile.IsNone) continue; - if (tile.IsBuried) - DrawX(data, (x - x0) * scale, (y - y0) * scale, scale, w); - else if (tile.IsDropped) - DrawPlus(data, (x - x0) * scale, (y - y0) * scale, scale, w); - else if (tile.IsExtension) - DrawDirectional(data, tile, (x - x0) * scale, (y - y0) * scale, scale, w); + // Apply cosmetic details based on the tile's details. + if (tile.IsBuried) + DrawX(data, relX * imgScale, relY * imgScale, imgScale, imgWidth); + else if (tile.IsDropped) + DrawPlus(data, relX * imgScale, relY * imgScale, imgScale, imgWidth); + else if (tile.IsExtension) + DrawDirectional(data, tile, relX * imgScale, relY * imgScale, imgScale, imgWidth); + + // Based on the display item, apply details. var id = tile.DisplayItemId; var kind = ItemInfo.GetItemKind(id); if (kind.IsFlowerGene(id)) { - int geneIndex; - if (tile.IsRoot) - { - geneIndex = 0; - } - else - { - geneIndex = (tile.ExtensionY << 1) | tile.ExtensionX; - tile = layer.GetTile(x - tile.ExtensionX, y - tile.ExtensionY); - } - + var geneIndex = GetGeneIndex(ref tile, layer, pX, pY); var genes = ((uint)tile.Genes ^ 0b00_11_00_00); // invert W bits var geneValue = (genes >> (geneIndex * 2)) & 3; if (geneValue == 0) continue; - DrawGene(data, (x - x0) * scale, (y - y0) * scale, scale, w, geneValue, geneIndex); + DrawGene(data, relX * imgScale, relY * imgScale, imgScale, imgWidth, geneValue, geneIndex); } } } } - private static void DrawGene(Span data, int x0, int y0, int scale, int w, uint geneValue, int geneIndex) + /// + /// Gets the index of the gene based on the specified extension value. Repoints the tile to root node if it is an extension tile. + /// + private static int GetGeneIndex(ref Item tile, LayerItem layer, int relX, int relY) { - var c = ShiftToGeneCoordinate(ref x0, ref y0, scale, geneIndex); - FillSquare(data, x0, y0, scale / 2, w, c, geneValue == 3 ? 1 : 2); + if (tile.IsRoot) + return 0; + var geneIndex = (tile.ExtensionY << 1) | tile.ExtensionX; + tile = layer.GetTile(relX - tile.ExtensionX, relY - tile.ExtensionY); + return geneIndex; } - private static void FillSquare(Span data, int x0, int y0, int scale, int w, int color, int increment) + /// + /// Draws a flower gene on the item cell. + /// + /// Pixel data of the entire image. + /// Top-left X coordinate to start drawing from. + /// Top-left Y coordinate to start drawing from. + /// Scale of the entire cell. + /// Width of the entire image. + /// Value of the gene (0-3). + /// 0-3 value indicating which gene (quadrant) to draw. + private static void DrawGene(Span data, int x0, int y0, int imgScale, int imgWidth, uint geneValue, int geneIndex) { - var baseIndex = (y0 * w) + x0; - for (int i = 0; i < scale * scale; i += increment) + var c = ShiftToGeneCoordinate(ref x0, ref y0, imgScale, geneIndex); + FillSquare(data, x0, y0, imgScale / 2, imgWidth, c, geneValue == 3 ? 1 : 2); + } + + /// + /// Fills a square region within a one-dimensional span with the specified color value, using a given increment to control the fill step. + /// + /// This method assumes that the specified region fits within the bounds of the provided span. + /// No bounds checking is performed. + /// The increment parameter can be used to fill a subset with the square's elements, which may be useful for performance or pattern effects. + /// + /// The span representing the target buffer to fill. Each element corresponds to a pixel or cell in a row-major order grid. + /// Top-left X coordinate to start drawing from. + /// Top-left Y coordinate to start drawing from. + /// Scale of the entire cell. + /// Width of the entire image. + /// The color value to assign to each filled element in the square region. + /// The step size to use when filling elements. Must be positive. A larger increment skips more elements within the square. + private static void FillSquare(Span data, int x0, int y0, int imgScale, int imgWidth, int color, int increment) + { + var baseIndex = (y0 * imgWidth) + x0; + for (int i = 0; i < imgScale * imgScale; i += increment) { - var x = i % scale; - var y = i / scale; - var index = (y * w) + x; + var x = i % imgScale; + var y = i / imgScale; + var index = (y * imgWidth) + x; data[baseIndex + index] = color; } } - private static int ShiftToGeneCoordinate(ref int x0, ref int y0, int scale, int geneIndex) + /// + /// Adjusts the specified coordinates to the center of a gene region based on the given gene index and scale, and returns the corresponding ARGB color value for that region. + /// + /// + /// The method modifies the input coordinates in place according to the specified gene region. + /// The returned color value corresponds to the region: Red for bottom right, Yellow for bottom left, AntiqueWhite for top right, and Black for top left or any other index. + /// + /// Top-left X coordinate to start drawing from. + /// Top-left Y coordinate to start drawing from. + /// Scale of the entire cell. + /// The index of the gene region to shift to. Valid values are 0 (bottom right), 1 (bottom left), 2 (top right), and any other value for top left. + /// An integer representing the ARGB color value associated with the specified gene region. + private static int ShiftToGeneCoordinate(ref int x0, ref int y0, int imgScale, int geneIndex) { switch (geneIndex) { case 0: // bottom right - x0 += scale / 2; - y0 += scale / 2; + x0 += imgScale / 2; + y0 += imgScale / 2; return Color.Red.ToArgb(); case 1: // bottom left - y0 += scale / 2; + y0 += imgScale / 2; return Color.Yellow.ToArgb(); case 2: // top right - x0 += scale / 2; + x0 += imgScale / 2; return Color.AntiqueWhite.ToArgb(); default: // top left return Color.Black.ToArgb(); } } - private static void DrawPlus(Span data, int x0, int y0, int scale, int w) + /// + /// Updates the pixel data to draw a `+`, indicating the item as "dropped". + /// + /// Pixel data of the entire image. + /// Top-left X coordinate to start drawing from. + /// Top-left Y coordinate to start drawing from. + /// Scaling factor from 1px => final image dimensions. + /// Width of the entire image. + private static void DrawPlus(Span data, int x0, int y0, int imgScale, int imgWidth) { - var x0y0 = (w * y0) + x0; - var s2 = scale / 2; - var ws2 = w * s2; + var x0y0 = (imgWidth * y0) + x0; + var s2 = imgScale / 2; + var ws2 = imgWidth * s2; var v0 = x0y0 + s2; var h0 = x0y0 + ws2; - for (int x = scale / 4; x <= 3 * (scale / 4); x++) + for (int x = imgScale / 4; x <= 3 * (imgScale / 4); x++) { - var vert = v0 + (w * x); + var vert = v0 + (imgWidth * x); data[vert] ^= 0x808080; var hori = h0 + x; data[hori] ^= 0x808080; } } - private static void DrawX(Span data, int x0, int y0, int scale, int w) + /// + /// Updates the pixel data to draw an `X`, indicating the item as "buried". + /// + /// Pixel data of the entire image. + /// Top-left X coordinate to start drawing from. + /// Top-left Y coordinate to start drawing from. + /// Scaling factor from 1px => final image dimensions. + /// Width of the entire image. + private static void DrawX(Span data, int x0, int y0, int imgScale, int imgWidth) { - var opposite = scale - 1; - var wo = w * opposite; + var opposite = imgScale - 1; + var wo = imgWidth * opposite; // Starting offsets for each of the slashes - var bBackward = (w * y0) + x0; // Backwards \ + var bBackward = (imgWidth * y0) + x0; // Backwards \ var bForward = bBackward + wo; // Forwards / - for (int x = 0; x < scale; x++) + for (int x = 0; x < imgScale; x++) { - var wx = w * x; + var wx = imgWidth * x; var backward = bBackward + x + wx; data[backward] ^= 0x808080; var forward = bForward + x - wx; @@ -188,32 +303,49 @@ private static void DrawX(Span data, int x0, int y0, int scale, int w) } } - private static void DrawDirectional(Span data, Item tile, int x0, int y0, int scale, int w) + /// + /// Updates the pixel data to draw a directional, indicating the item as an extension of a root item node. + /// + /// Pixel data of the entire image. + /// Extension tile data. + /// Top-left X coordinate to start drawing from. + /// Top-left Y coordinate to start drawing from. + /// Scaling factor from 1px => final image dimensions. + /// Width of the entire image. + private static void DrawDirectional(Span data, Item tile, int x0, int y0, int imgScale, int imgWidth) { var eX = tile.ExtensionX; var eY = tile.ExtensionY; if (eX == 0 && eY == 0) return; var sum = eX + eY; - var start = scale / (sum + 1); + var start = imgScale / (sum + 1); var startX = eX >= eY ? 0 : start; var startY = eX <= eY ? 0 : start; - var baseIndex = (w * y0) + x0; - for (int x = startX, y = startY; x < scale && y < scale; x += eX, y += eY) + var baseIndex = (imgWidth * y0) + x0; + for (int x = startX, y = startY; x < imgScale && y < imgScale; x += eX, y += eY) { - var index = baseIndex + (w * y) + x; - data[index] ^= 0x808080; + var index = baseIndex + (imgWidth * y) + x; + data[index] ^= 0x00_808080; } } - public static void DrawGrid(Span data, int w, int h, int scale, int gridlineColor) + /// + /// Draws gridlines on the provided pixel data at the specified scale. + /// + /// Pixel data of the entire image. + /// Width of the entire image. + /// Height of the entire image. + /// Color to use for gridlines. + /// Pixel interval to draw gridlines. + public static void DrawGrid(Span data, int imgWidth, int imgHeight, int gridlineColor, int gridlineInterval) { // Horizontal Lines - for (int y = scale; y < h; y += scale) + for (int y = gridlineInterval; y < imgHeight; y += gridlineInterval) { - var baseIndex = y * w; - for (int x = 0; x < w; x++) + var baseIndex = y * imgWidth; + for (int x = 0; x < imgWidth; x++) { var index = baseIndex + x; data[index] = gridlineColor; @@ -221,10 +353,10 @@ public static void DrawGrid(Span data, int w, int h, int scale, int gridlin } // Vertical Lines - for (int y = 0; y < h; y++) + for (int y = 0; y < imgHeight; y++) { - var baseIndex = y * w; - for (int x = scale; x < w; x += scale) + var baseIndex = y * imgWidth; + for (int x = gridlineInterval; x < imgWidth; x += gridlineInterval) { var index = baseIndex + x; data[index] = gridlineColor; @@ -232,23 +364,26 @@ public static void DrawGrid(Span data, int w, int h, int scale, int gridlin } } - public static Bitmap GetBitmapItemLayer(LayerItem layer, int x, int y, int[] data, Bitmap dest, int transparency = -1) + public static Bitmap GetBitmapItemLayer(Bitmap dest, LayerItem layer, int topX, int topY, Span data, int transparency = -1) { LoadBitmapLayer(layer.Tiles, data, layer.TileInfo.TotalWidth, layer.TileInfo.TotalHeight); if (transparency >>> 24 != 0xFF) ImageUtil.ClampAllTransparencyTo(data, transparency); - ImageUtil.SetBitmapData(dest, data); - return DrawViewReticle(dest, layer.TileInfo, x, y); + dest.SetBitmapData(data); + return DrawViewReticle(dest, layer.TileInfo, topX, topY); } - private static Bitmap DrawViewReticle(Bitmap map, TileGridViewport g, int x, int y, int scale = 1) + private static Bitmap DrawViewReticle(Bitmap map, TileGridViewport g, int topX, int topY, int scale = 1) { using var gfx = Graphics.FromImage(map); - using var pen = new Pen(Color.Red); - - int w = g.ViewWidth * scale; - int h = g.ViewHeight * scale; - gfx.DrawRectangle(pen, x * scale, y * scale, w, h); + gfx.DrawViewReticle(g, topX, topY, scale); return map; } + + private static void DrawViewReticle(this Graphics gfx, TileGridViewport g, int topX, int topY, int scale) + { + int w = g.ViewWidth * scale; + int h = g.ViewHeight * scale; + gfx.DrawRectangle(Reticle, topX * scale, topY * scale, w, h); + } } \ No newline at end of file diff --git a/NHSE.Sprites/Field/MapRenderer.cs b/NHSE.Sprites/Field/MapRenderer.cs index d87cfbb..f6e1a95 100644 --- a/NHSE.Sprites/Field/MapRenderer.cs +++ b/NHSE.Sprites/Field/MapRenderer.cs @@ -10,10 +10,9 @@ namespace NHSE.Sprites; public sealed class MapRenderer : IDisposable { private readonly MapEditor Map; - private int AcreScale => Map.MapScale; - private int MapScale => Map.MapScale * 2; + private int MapScale => Map.MapScale; + private int ViewScale => Map.ViewScale; - private const byte ScaleAsMap = 2; private const byte FieldItemWidthOld = 7; private const byte FieldItemWidthNew = 9; @@ -39,17 +38,17 @@ public MapRenderer(MapEditor m) var l1 = m.Mutator.Manager.FieldItems.Layer0; var info = l1.TileInfo; PixelsItemAcre1 = new int[info.ViewWidth * info.ViewHeight]; - PixelsItemAcreX = new int[PixelsItemAcre1.Length * AcreScale * AcreScale]; - ScaleAcre = new Bitmap(info.ViewWidth * AcreScale, info.ViewHeight * AcreScale); + PixelsItemAcreX = new int[PixelsItemAcre1.Length * ViewScale * ViewScale]; + ScaleAcre = new Bitmap(info.ViewWidth * ViewScale, info.ViewHeight * ViewScale); PixelsItemMap = new int[info.TotalWidth * info.TotalHeight * MapScale * MapScale]; MapReticle = new Bitmap(info.TotalWidth * MapScale, info.TotalHeight * MapScale); - PixelsBackgroundAcre1 = new int[(int)Math.Pow(16, 4)]; + PixelsBackgroundAcre1 = new int[PixelsItemAcre1.Length]; PixelsBackgroundAcreX = new int[PixelsItemAcreX.Length]; BackgroundAcre = new Bitmap(ScaleAcre.Width, ScaleAcre.Height); - PixelsBackgroundMap1 = new int[PixelsItemMap.Length / 4]; + PixelsBackgroundMap1 = new int[PixelsItemMap.Length / (MapScale * MapScale)]; PixelsBackgroundMapX = new int[PixelsItemMap.Length]; BackgroundMap = new Bitmap(MapReticle.Width, MapReticle.Height); } @@ -67,7 +66,7 @@ public void Dispose() public Bitmap GetBackgroundTerrain(int index = -1) { - return TerrainSprite.GetMapWithBuildings(Map, null, PixelsBackgroundMap1, PixelsBackgroundMapX, BackgroundMap, ScaleAsMap, index); + return TerrainSprite.GetMapWithBuildings(Map, null, PixelsBackgroundMap1, PixelsBackgroundMapX, BackgroundMap, index); } public Bitmap GetInflatedImage(Bitmap regular) @@ -90,12 +89,14 @@ public Bitmap GetInflatedImage(Bitmap regular) private Bitmap GetLayerAcre(int topX, int topY, int transparency) { var layer = Map.Mutator.CurrentLayer; - return ItemLayerSprite.GetBitmapItemLayerViewGrid(layer, topX, topY, AcreScale, PixelsItemAcre1, PixelsItemAcreX, ScaleAcre, transparency); + ItemLayerSprite.LoadItemLayerViewGrid(ScaleAcre, layer, topX, topY, PixelsItemAcre1, PixelsItemAcreX, ViewScale, transparency); + return ScaleAcre; } public Bitmap GetBackgroundAcre(Font f, byte transparencyBuilding, byte transparencyTerrain, int index = -1) { - return TerrainSprite.CreateAcreView(this, f, PixelsBackgroundAcre1, PixelsBackgroundAcreX, BackgroundAcre, index, transparencyBuilding, transparencyTerrain); + TerrainSprite.LoadViewport(BackgroundAcre, Map, f, PixelsBackgroundAcre1, PixelsBackgroundAcreX, index, transparencyBuilding, transparencyTerrain); + return BackgroundAcre; } private Bitmap GetMapWithReticle(int topX, int topY, int t, LayerFieldItem layerField) diff --git a/NHSE.Sprites/Field/TerrainSprite.cs b/NHSE.Sprites/Field/TerrainSprite.cs index e751a4d..bc26678 100644 --- a/NHSE.Sprites/Field/TerrainSprite.cs +++ b/NHSE.Sprites/Field/TerrainSprite.cs @@ -5,6 +5,9 @@ namespace NHSE.Sprites; +/// +/// Logic to build a viewport render of a subsection of a map (or the entire "map", assuming it is small enough). +/// public static class TerrainSprite { private static readonly Brush Selected = Brushes.Red; @@ -12,17 +15,113 @@ public static class TerrainSprite private static readonly Brush Text = Brushes.White; private static readonly Brush Tile = Brushes.Black; private static readonly Brush Plaza = Brushes.RosyBrown; + private static readonly Color PlazaColor = Color.RosyBrown; private static readonly StringFormat BuildingTextFormat = new() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; - private const int PlazaWidth = 6 * 2; - private const int PlazaHeight = 5 * 2; + // 6x5 in a 16x16 acre scale. Since we are in 32x32 scale for items, double. + private const int Scale = 2; + private const int PlazaWidth = 6 * Scale; + private const int PlazaHeight = 5 * Scale; - public static void CreateMap(LayerTerrain mgr, Span pixels) + public static void GenerateMap(Bitmap map, MapMutator mut, Span scale1, Span scaleX, int imgScale, int acreIndex = -1) + { + // Load the terrain pixels, then upscale. + var mgr = mut.Manager.LayerTerrain; + LoadTerrainPixels(mgr, scale1); + ImageUtil.ScalePixelImage(scale1, scaleX, map.Width, map.Height, imgScale); + map.SetBitmapData(scaleX); + + if (acreIndex < 0) + return; + + var acre = AcreCoordinate.Acres[acreIndex]; + var x = acre.X * mgr.TileInfo.ViewWidth; + var y = acre.Y * mgr.TileInfo.ViewHeight; + + DrawReticle(map, mgr.TileInfo, x, y, imgScale); + } + + public static Bitmap GetMapWithBuildings(MapEditor m, Font? f, Span scale1, Span scaleX, Bitmap map, int buildingIndex = -1) + { + GenerateMap(map, m.Mutator, scale1, scaleX, m.MapScale); + using var gfx = Graphics.FromImage(map); + + var plaza = m.Mutator.Manager.Plaza; + gfx.DrawPlaza(m, (ushort)plaza.X, (ushort)plaza.Z, m.MapScale); + gfx.DrawBuildings(m, m.Buildings.Buildings, m.MapScale, f, buildingIndex); + return map; + } + + public static void LoadViewport(Bitmap img, MapEditor m, Font f, Span scale1, Span scaleX, int index, byte transBuild, byte transTerrain) + { + // Convert from absolute to relative. + int mx = m.X / 2; + int my = m.Y / 2; + SetAcreTerrainPixels(m.Terrain, mx, my, scale1, scaleX, m.ViewScale); + + // Drawing building tiles currently uses the graphics API rather than writing pixels. + img.SetBitmapData(scaleX); + using var gfx = Graphics.FromImage(img); + gfx.DrawViewPlaza(m, transBuild); + gfx.DrawViewBuildings(m, index, transBuild); + + // Return to pixel writing mode + img.GetBitmapData(scaleX); + + // Apply Grid + const int grid1 = unchecked((int)0xFF888888u); // lighter + const int grid2 = unchecked((int)0xFF666666u); // darker + ItemLayerSprite.DrawGrid(scaleX, img.Width, img.Height, grid1, m.ViewScale); // minor + ItemLayerSprite.DrawGrid(scaleX, img.Width, img.Height, grid2, m.ViewScale * 2); // major + + // Switch back to graphics mode + img.SetBitmapData(scaleX); + // Draw Text of Building Names + foreach (var b in m.Buildings.Buildings) + { + var type = b.BuildingType; + var (x, y) = m.GetViewCoordinatesBuilding(b.X, b.Y); + const int cellsAbove = 2; // Show label above the building, 2 cells up. + y -= (m.ViewScale * cellsAbove); + + // Don't bother drawing if not in view. + if (!m.Mutator.View.IsWithinView(m.ViewScale, x, y)) + continue; + + var name = b.BuildingType.ToString(); + var labelPosition = new PointF(x, y - (m.ViewScale * 2)); + gfx.DrawString(name, f, Text, labelPosition, BuildingTextFormat); + } + + // Draw Text of Terrain Tile Names + if (transTerrain != 0) + DrawTerrainTileNames(gfx, f, mx, my, m.Terrain, m.ViewScale, transTerrain); + + // Done. + } + + private static void DrawViewBuildings(this Graphics gfx, MapEditor m, int selectedBuildingIndex, byte transBuild) + { + var buildings = m.Buildings.Buildings; + for (var i = 0; i < buildings.Count; i++) + { + var b = buildings[i]; + var pen = selectedBuildingIndex == i ? Selected : Others; + if (transBuild != byte.MaxValue) + { + var orig = ((SolidBrush)pen).Color; + pen = new SolidBrush(Color.FromArgb(transBuild, orig)); + } + gfx.DrawBuilding(b, m, pen, m.ViewScale, Text); + } + } + + private static void LoadTerrainPixels(LayerTerrain mgr, Span pixels) { // Populate the image, with each pixel being a single tile. - int width = mgr.TileInfo.TotalWidth; - int height = mgr.TileInfo.TotalHeight; - int i = 0; + var width = mgr.TileInfo.TotalWidth; + var height = mgr.TileInfo.TotalHeight; + var i = 0; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++, i++) @@ -30,22 +129,6 @@ public static void CreateMap(LayerTerrain mgr, Span pixels) } } - public static Bitmap CreateMap(LayerTerrain mgr, Span scale1, Span scaleX, Bitmap map, int scale, int acreIndex = -1) - { - CreateMap(mgr, scale1); - ImageUtil.ScalePixelImage(scale1, scaleX, map.Width, map.Height, scale); - map.SetBitmapData(scaleX); - - if (acreIndex < 0) - return map; - - var acre = AcreCoordinate.Acres[acreIndex]; - var x = acre.X * mgr.TileInfo.ViewWidth; - var y = acre.Y * mgr.TileInfo.ViewHeight; - - return DrawReticle(map, mgr.TileInfo, x, y, scale); - } - private static Bitmap DrawReticle(Bitmap map, TileGridViewport mgr, int x, int y, int scale) { using var gfx = Graphics.FromImage(map); @@ -57,70 +140,75 @@ private static Bitmap DrawReticle(Bitmap map, TileGridViewport mgr, int x, int y return map; } - public static Bitmap GetMapWithBuildings(MapTerrainStructure m, Font? f, Span scale1, Span scaleX, Bitmap map, int scale = 4, int index = -1) + private static void DrawPlaza(this Graphics gfx, MapEditor map, ushort px, ushort py, int scale) { - CreateMap(m.Terrain, scale1, scaleX, map, scale); - using var gfx = Graphics.FromImage(map); + var (x, y) = map.GetViewCoordinatesBuilding(px, py); - gfx.DrawPlaza(m.Terrain, (ushort)m.PlazaX, (ushort)m.PlazaY, scale); - gfx.DrawBuildings(m.Terrain, m.Buildings, f, scale, index); - return map; - } - - private static void DrawPlaza(this Graphics gfx, LayerTerrain g, ushort px, ushort py, int scale) - { - g.GetBuildingCoordinate(px, py, scale, out var x, out var y); - - var width = scale * PlazaWidth; - var height = scale * PlazaHeight; + int width = scale * PlazaWidth; + int height = scale * PlazaHeight; gfx.FillRectangle(Plaza, x, y, width, height); } - private static void DrawBuildings(this Graphics gfx, LayerTerrain g, IReadOnlyList buildings, Font? f, int scale, int index = -1) + private static void DrawBuildings(this Graphics gfx, MapEditor map, IReadOnlyList buildings, int imgScale, Font? textFont = null, int selectedBuildingIndex = -1) { for (int i = 0; i < buildings.Count; i++) { var b = buildings[i]; if (b.BuildingType == 0) continue; - g.GetBuildingCoordinate(b.X, b.Y, scale, out var x, out var y); - var pen = index == i ? Selected : Others; - DrawBuilding(gfx, f, scale, pen, x, y, b, Text); + var pen = selectedBuildingIndex == i ? Selected : Others; + gfx.DrawBuilding(b, map, pen, imgScale, Text, textFont); } } - private static void DrawBuilding(Graphics gfx, Font? f, int scale, Brush pen, int x, int y, Building b, Brush text) + private static void DrawBuilding(this Graphics gfx, Building b, MapEditor map, Brush bBrush, int imgScale, Brush textBrush, Font? textFont = null) { - gfx.FillRectangle(pen, x - scale, y - scale, scale * 2, scale * 2); + var (x, y) = map.GetViewCoordinatesBuilding(b.X, b.Y); + var type = b.BuildingType; + var (width, height) = type.GetDimensions(); - if (f == null) + // Draw the building. + x -= width / 2; + y -= height / 2; + gfx.FillRectangle(bBrush, x, y, width * imgScale, height * imgScale); + + if (textFont == null) return; - var name = b.BuildingType.ToString(); - gfx.DrawString(name, f, text, new PointF(x, y - (scale * 2)), BuildingTextFormat); + // Draw the text label above it. + const int cellsAbove = 2; + var name = type.ToString(); + gfx.DrawString(name, textFont, textBrush, new PointF(x, y - (imgScale * cellsAbove)), BuildingTextFormat); } - private static void SetAcreTerrainPixels(int x, int y, LayerTerrain t, Span data, Span scaleX, int scale) + private static void SetAcreTerrainPixels(LayerTerrain t, int relX, int relY, Span data, Span scaleX, int imgScale) { - GetAcre1(x, y, t, data); - ImageUtil.ScalePixelImage(data, scaleX, 16 * scale, 16 * scale, scale / 16); + GetAcre1(t, relX, relY, data); + ImageUtil.ScalePixelImage(data, scaleX, TilesPerViewport * imgScale, TilesPerViewport * imgScale, imgScale / TileScale); } - private static void GetAcre1(int tileTopX, int tileTopY, LayerTerrain t, Span data) + // Tiles are always rendered as 16x16 squares, to match the precomputed tile appearance bitmaps. + private const int TileScale = 16; + private const int TilesPerViewport = 16; + + private static void GetAcre1(LayerTerrain t, int relX, int relY, Span data) { + const int viewWidth = 16; + const int viewHeight = 16; + int index = 0; - - for (int tileY = 0; tileY < 16; tileY++) + for (int tileY = 0; tileY < viewHeight; tileY++) { - var tileYIx = tileY + tileTopY; - for (int pixelY = 0; pixelY < 16; pixelY++) + var tileYIx = tileY + relY; + for (int pixelY = 0; pixelY < viewWidth; pixelY++) { - for (int tileX = 0; tileX < 16; tileX++) + // Draw the tile row + for (int tileX = 0; tileX < TileScale; tileX++) { - var tileXIx = tileX + tileTopX; - for (int pixelX = 0; pixelX < 16; pixelX++) + var tileXIx = tileX + relX; + for (int pixelX = 0; pixelX < TileScale; pixelX++) { data[index] = t.GetTileColor(tileXIx, tileYIx, pixelX, pixelY); index++; @@ -130,63 +218,11 @@ private static void GetAcre1(int tileTopX, int tileTopY, LayerTerrain t, Span scale1, Span scaleX, Bitmap acre, int index, byte tbuild, byte tterrain) + private static void DrawTerrainTileNames(Graphics gfx, Font f, int topX, int topY, LayerTerrain t, int scale, byte transparency) { - // Convert from absolute to relative. - int mx = m.X / 2; - int my = m.Y / 2; - SetAcreTerrainPixels(mx, my, m.Terrain, scale1, scaleX, m.Terrain.Scale); - - const int grid1 = unchecked((int)0xFF888888u); - const int grid2 = unchecked((int)0xFF666666u); - acre.SetBitmapData(scaleX); - - using var gfx = Graphics.FromImage(acre); - - var plaza = m.Mutator.Manager.Plaza; - gfx.DrawAcrePlaza(m.Terrain, mx, my, plaza.X, plaza.Z, m.Terrain.Scale, tbuild); - - var buildings = m.Buildings.Buildings; - var t = m.Terrain; - for (var i = 0; i < buildings.Count; i++) - { - var b = buildings[i]; - t.GetBuildingRelativeCoordinates(mx, my, m.Terrain.Scale, b.X, b.Y, out var x, out var y); - - var pen = index == i ? Selected : Others; - if (tbuild != byte.MaxValue) - { - var orig = ((SolidBrush)pen).Color; - pen = new SolidBrush(Color.FromArgb(tbuild, orig)); - } - - DrawBuilding(gfx, null, m.Terrain.Scale, pen, x, y, b, Text); - } - - acre.GetBitmapData(scaleX); - ItemLayerSprite.DrawGrid(scaleX, acre.Width, acre.Height, m.AcreScale, grid1); - ItemLayerSprite.DrawGrid(scaleX, acre.Width, acre.Height, m.Terrain.Scale, grid2); - acre.SetBitmapData(scaleX); - - foreach (var b in buildings) - { - t.GetBuildingRelativeCoordinates(mx, my, m.Terrain.Scale, b.X, b.Y, out var x, out var y); - if (!t.IsWithinGrid(m.Terrain.Scale, x, y)) - continue; - var name = b.BuildingType.ToString(); - var labelPosition = new PointF(x, y - (m.Terrain.Scale * 2)); - gfx.DrawString(name, f, Text, labelPosition, BuildingTextFormat); - } - - if (tterrain != 0) - DrawTerrainTileNames(mx, my, gfx, t, f, m.Terrain.Scale, tterrain); - - return acre; - } - - private static void DrawTerrainTileNames(int topX, int topY, Graphics gfx, LayerTerrain t, Font f, int scale, byte transparency) - { - var pen = transparency != byte.MaxValue ? new SolidBrush(Color.FromArgb(transparency, Color.Black)) : Tile; + var pen = Tile; + if (transparency != byte.MaxValue) + pen = new SolidBrush(Color.FromArgb(transparency, Color.Black)); for (int y = 0; y < 16; y++) { @@ -204,19 +240,18 @@ private static void DrawTerrainTileNames(int topX, int topY, Graphics gfx, Layer } } - private static void DrawAcrePlaza(this Graphics gfx, LayerTerrain g, int topX, int topY, uint plazaX, uint plazaY, int scale, byte transparency) + private static void DrawViewPlaza(this Graphics gfx, MapEditor m, byte transparency) { - g.GetBuildingRelativeCoordinates(topX, topY, scale, plazaX, plazaY, out var x, out var y); + var plaza = m.Mutator.Manager.Plaza; + var (x, y) = m.GetViewCoordinatesBuilding(plaza.X, plaza.Z); + var scale = m.ViewScale; var width = scale * PlazaWidth; var height = scale * PlazaHeight; var pen = Plaza; if (transparency != byte.MaxValue) - { - var orig = ((SolidBrush)pen).Color; - pen = new SolidBrush(Color.FromArgb(transparency, orig)); - } + pen = new SolidBrush(Color.FromArgb(transparency, PlazaColor)); gfx.FillRectangle(pen, x, y, width, height); } } \ No newline at end of file diff --git a/NHSE.Sprites/Util/ImageUtil.cs b/NHSE.Sprites/Util/ImageUtil.cs index 014f547..879ac87 100644 --- a/NHSE.Sprites/Util/ImageUtil.cs +++ b/NHSE.Sprites/Util/ImageUtil.cs @@ -111,39 +111,37 @@ public static Bitmap ResizeImage(Image image, int width, int height) return destImage; } - public static int[] ScalePixelImage(ReadOnlySpan data, int scale, int w, int h, out int fW, out int fH) + public static int[] ScalePixelImage(ReadOnlySpan data, int imgScale, int imgWidthSingle, int imgHeightSingle, out int imgWidthUpscaled, out int imgHeightUpscaled) { - fW = scale * w; - fH = scale * h; - var scaled = new int[fW * fH]; - - ScalePixelImage(data, scaled, fW, fH, scale); - + imgWidthUpscaled = imgScale * imgWidthSingle; + imgHeightUpscaled = imgScale * imgHeightSingle; + var scaled = new int[imgWidthUpscaled * imgHeightUpscaled]; + ScalePixelImage(data, scaled, imgWidthUpscaled, imgHeightUpscaled, imgScale); return scaled; } - public static void ScalePixelImage(ReadOnlySpan data, Span scaled, int fW, int fH, int scale) + public static void ScalePixelImage(ReadOnlySpan data, Span scaled, int imgWidth, int imgHeight, int imgScale) { // For each pixel, copy to the X indexes, then block copy the row to the other rows. int i = 0; - for (int y = 0; y < fH; y += scale) + for (int y = 0; y < imgHeight; y += imgScale) { // Fill the X pixels - var baseIndex = y * fW; - for (int x = 0; x < fW; x += scale) + var baseIndex = y * imgWidth; + for (int x = 0; x < imgWidth; x += imgScale) { var v = data[i]; var xi = baseIndex + x; - for (int x1 = 0; x1 < scale; x1++) + for (int x1 = 0; x1 < imgScale; x1++) scaled[xi + x1] = v; i++; } // Copy entire pixel row down - for (int y1 = 1; y1 < scale; y1++) + for (int y1 = 1; y1 < imgScale; y1++) { - var src = scaled.Slice(baseIndex, fW); - var dest = scaled.Slice(baseIndex + (y1 * fW), fW); + var src = scaled.Slice(baseIndex, imgWidth); + var dest = scaled.Slice(baseIndex + (y1 * imgWidth), imgWidth); src.CopyTo(dest); } } diff --git a/NHSE.WinForms/Editor.cs b/NHSE.WinForms/Editor.cs index 272468b..561bd00 100644 --- a/NHSE.WinForms/Editor.cs +++ b/NHSE.WinForms/Editor.cs @@ -206,14 +206,17 @@ private void SaveMain() #region Player Editing private void LoadPlayers() { + // A valid save file has at least one player (main player). if (SAV.Players.Count == 0) throw new Exception("No players found in the loaded directory."); + // Load the player names to the selection box. CB_Players.Items.Clear(); var playerList = SAV.Players.Select(z => z.DirectoryName); foreach (var p in playerList) CB_Players.Items.Add(p); + // Trigger a load. PlayerIndex = -1; CB_Players.SelectedIndex = 0; } diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs b/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs index 3818241..7e0adce 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.Designer.cs @@ -14,10 +14,7 @@ partial class FieldItemEditor protected override void Dispose(bool disposing) { if (disposing && (components != null)) - { components.Dispose(); - View.Dispose(); - } base.Dispose(disposing); } @@ -29,1473 +26,1446 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.B_Cancel = new System.Windows.Forms.Button(); - this.B_Save = new System.Windows.Forms.Button(); - this.CB_Acre = new System.Windows.Forms.ComboBox(); - this.L_Acre = new System.Windows.Forms.Label(); - this.CM_Click = new System.Windows.Forms.ContextMenuStrip(this.components); - this.Menu_View = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_Set = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_Reset = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_Activate = new System.Windows.Forms.ToolStripMenuItem(); - this.B_Up = new System.Windows.Forms.Button(); - this.B_Left = new System.Windows.Forms.Button(); - this.B_Right = new System.Windows.Forms.Button(); - this.B_Down = new System.Windows.Forms.Button(); - this.PB_Map = new System.Windows.Forms.PictureBox(); - this.CM_Picture = new System.Windows.Forms.ContextMenuStrip(this.components); - this.Menu_SavePNG = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_SavePNGItems = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_SavePNGTerrain = new System.Windows.Forms.ToolStripMenuItem(); - this.CHK_SnapToAcre = new System.Windows.Forms.CheckBox(); - this.L_Coordinates = new System.Windows.Forms.Label(); - this.NUD_Layer = new System.Windows.Forms.NumericUpDown(); - this.L_Layer = new System.Windows.Forms.Label(); - this.TT_Hover = new System.Windows.Forms.ToolTip(this.components); - this.PB_Acre = new System.Windows.Forms.PictureBox(); - this.TR_Transparency = new System.Windows.Forms.TrackBar(); - this.CHK_NoOverwrite = new System.Windows.Forms.CheckBox(); - this.CHK_AutoExtension = new System.Windows.Forms.CheckBox(); - this.B_RemoveItemDropDown = new System.Windows.Forms.Button(); - this.CM_Remove = new System.Windows.Forms.ContextMenuStrip(this.components); - this.B_RemoveAllWeeds = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveAllTrees = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemovePlants = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveObjects = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemovePlacedItems = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveFences = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveBranches = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveShells = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveFlowers = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveBushes = new System.Windows.Forms.ToolStripMenuItem(); - this.B_FillHoles = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveEditor = new System.Windows.Forms.ToolStripMenuItem(); - this.B_RemoveAll = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.B_WaterFlowers = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_Spawn = new System.Windows.Forms.ToolStripMenuItem(); - this.Menu_Batch = new System.Windows.Forms.ToolStripMenuItem(); - this.GB_Remove = new System.Windows.Forms.Label(); - this.TC_Editor = new System.Windows.Forms.TabControl(); - this.Tab_Item = new System.Windows.Forms.TabPage(); - this.ItemEdit = new NHSE.WinForms.ItemEditor(); - this.B_DumpLoadField = new System.Windows.Forms.Button(); - this.CM_DLField = new System.Windows.Forms.ContextMenuStrip(this.components); - this.B_DumpAcre = new System.Windows.Forms.ToolStripMenuItem(); - this.B_DumpAllAcres = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportAcre = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportAllAcres = new System.Windows.Forms.ToolStripMenuItem(); - this.Tab_Building = new System.Windows.Forms.TabPage(); - this.B_DumpLoadBuildings = new System.Windows.Forms.Button(); - this.CM_DLBuilding = new System.Windows.Forms.ContextMenuStrip(this.components); - this.B_DumpBuildings = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportBuildings = new System.Windows.Forms.ToolStripMenuItem(); - this.L_Bit = new System.Windows.Forms.Label(); - this.NUD_Bit = new System.Windows.Forms.NumericUpDown(); - this.L_BuildingType = new System.Windows.Forms.Label(); - this.NUD_BuildingType = new System.Windows.Forms.NumericUpDown(); - this.NUD_UniqueID = new System.Windows.Forms.NumericUpDown(); - this.L_BuildingX = new System.Windows.Forms.Label(); - this.L_BuildingUniqueID = new System.Windows.Forms.Label(); - this.NUD_X = new System.Windows.Forms.NumericUpDown(); - this.NUD_TypeArg = new System.Windows.Forms.NumericUpDown(); - this.L_BuildingY = new System.Windows.Forms.Label(); - this.L_BuildingStructureArg = new System.Windows.Forms.Label(); - this.NUD_Y = new System.Windows.Forms.NumericUpDown(); - this.NUD_Type = new System.Windows.Forms.NumericUpDown(); - this.L_BuildingRotation = new System.Windows.Forms.Label(); - this.L_BuildingStructureType = new System.Windows.Forms.Label(); - this.NUD_Angle = new System.Windows.Forms.NumericUpDown(); - this.L_PlazaX = new System.Windows.Forms.Label(); - this.NUD_PlazaX = new System.Windows.Forms.NumericUpDown(); - this.L_PlazaY = new System.Windows.Forms.Label(); - this.NUD_PlazaY = new System.Windows.Forms.NumericUpDown(); - this.B_Help = new System.Windows.Forms.Button(); - this.LB_Items = new System.Windows.Forms.ListBox(); - this.Tab_Terrain = new System.Windows.Forms.TabPage(); - this.B_TerrainBrush = new System.Windows.Forms.Button(); - this.L_TerrainTileLabelTransparency = new System.Windows.Forms.Label(); - this.TR_Terrain = new System.Windows.Forms.TrackBar(); - this.TR_BuildingTransparency = new System.Windows.Forms.TrackBar(); - this.L_BuildingTransparency = new System.Windows.Forms.Label(); - this.PG_TerrainTile = new System.Windows.Forms.PropertyGrid(); - this.L_FieldItemTransparency = new System.Windows.Forms.Label(); - this.B_DumpLoadTerrain = new System.Windows.Forms.Button(); - this.B_ModifyAllTerrain = new System.Windows.Forms.Button(); - this.Tab_Acres = new System.Windows.Forms.TabPage(); - this.NUD_MapAcreTemplateField = new System.Windows.Forms.NumericUpDown(); - this.L_MapAcreTemplateField = new System.Windows.Forms.Label(); - this.L_MapAcreTemplateOutside = new System.Windows.Forms.Label(); - this.NUD_MapAcreTemplateOutside = new System.Windows.Forms.NumericUpDown(); - this.CB_MapAcreSelect = new System.Windows.Forms.ComboBox(); - this.B_DumpLoadAcres = new System.Windows.Forms.Button(); - this.CM_DLMapAcres = new System.Windows.Forms.ContextMenuStrip(this.components); - this.B_DumpMapAcres = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportMapAcres = new System.Windows.Forms.ToolStripMenuItem(); - this.L_MapAcre = new System.Windows.Forms.Label(); - this.CB_MapAcre = new System.Windows.Forms.ComboBox(); - this.CM_DLTerrain = new System.Windows.Forms.ContextMenuStrip(this.components); - this.B_DumpTerrainAcre = new System.Windows.Forms.ToolStripMenuItem(); - this.B_DumpTerrainAll = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportTerrainAcre = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportTerrainAll = new System.Windows.Forms.ToolStripMenuItem(); - this.CM_Terrain = new System.Windows.Forms.ContextMenuStrip(this.components); - this.B_ZeroElevation = new System.Windows.Forms.ToolStripMenuItem(); - this.B_SetAllTerrain = new System.Windows.Forms.ToolStripMenuItem(); - this.B_SetAllRoadTiles = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ClearPlacedDesigns = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ImportPlacedDesigns = new System.Windows.Forms.ToolStripMenuItem(); - this.B_ExportPlacedDesigns = new System.Windows.Forms.ToolStripMenuItem(); - this.RB_Item = new System.Windows.Forms.RadioButton(); - this.RB_Terrain = new System.Windows.Forms.RadioButton(); - this.L_TileMode = new System.Windows.Forms.Label(); - this.CHK_RedirectExtensionLoad = new System.Windows.Forms.CheckBox(); - this.CHK_MoveOnDrag = new System.Windows.Forms.CheckBox(); - this.CHK_FieldItemSnap = new System.Windows.Forms.CheckBox(); - this.CM_Click.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.PB_Map)).BeginInit(); - this.CM_Picture.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Layer)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.PB_Acre)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.TR_Transparency)).BeginInit(); - this.CM_Remove.SuspendLayout(); - this.TC_Editor.SuspendLayout(); - this.Tab_Item.SuspendLayout(); - this.CM_DLField.SuspendLayout(); - this.Tab_Building.SuspendLayout(); - this.CM_DLBuilding.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Bit)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_BuildingType)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_UniqueID)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_X)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_TypeArg)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Y)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Type)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Angle)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_PlazaX)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_PlazaY)).BeginInit(); - this.Tab_Terrain.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.TR_Terrain)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.TR_BuildingTransparency)).BeginInit(); - this.Tab_Acres.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_MapAcreTemplateField)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_MapAcreTemplateOutside)).BeginInit(); - this.CM_DLMapAcres.SuspendLayout(); - this.CM_DLTerrain.SuspendLayout(); - this.CM_Terrain.SuspendLayout(); - this.SuspendLayout(); + components = new System.ComponentModel.Container(); + B_Cancel = new System.Windows.Forms.Button(); + B_Save = new System.Windows.Forms.Button(); + CM_Click = new System.Windows.Forms.ContextMenuStrip(components); + Menu_View = new System.Windows.Forms.ToolStripMenuItem(); + Menu_Set = new System.Windows.Forms.ToolStripMenuItem(); + Menu_Reset = new System.Windows.Forms.ToolStripMenuItem(); + Menu_Activate = new System.Windows.Forms.ToolStripMenuItem(); + B_Up = new System.Windows.Forms.Button(); + B_Left = new System.Windows.Forms.Button(); + B_Right = new System.Windows.Forms.Button(); + B_Down = new System.Windows.Forms.Button(); + PB_Map = new System.Windows.Forms.PictureBox(); + CM_Picture = new System.Windows.Forms.ContextMenuStrip(components); + Menu_SavePNG = new System.Windows.Forms.ToolStripMenuItem(); + Menu_SavePNGItems = new System.Windows.Forms.ToolStripMenuItem(); + Menu_SavePNGTerrain = new System.Windows.Forms.ToolStripMenuItem(); + CHK_SnapToAcre = new System.Windows.Forms.CheckBox(); + L_Coordinates = new System.Windows.Forms.Label(); + NUD_Layer = new System.Windows.Forms.NumericUpDown(); + L_Layer = new System.Windows.Forms.Label(); + TT_Hover = new System.Windows.Forms.ToolTip(components); + PB_Acre = new System.Windows.Forms.PictureBox(); + TR_Transparency = new System.Windows.Forms.TrackBar(); + CHK_NoOverwrite = new System.Windows.Forms.CheckBox(); + CHK_AutoExtension = new System.Windows.Forms.CheckBox(); + B_RemoveItemDropDown = new System.Windows.Forms.Button(); + CM_Remove = new System.Windows.Forms.ContextMenuStrip(components); + B_RemoveAllWeeds = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveAllTrees = new System.Windows.Forms.ToolStripMenuItem(); + B_RemovePlants = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveObjects = new System.Windows.Forms.ToolStripMenuItem(); + B_RemovePlacedItems = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveFences = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveBranches = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveShells = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveFlowers = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveBushes = new System.Windows.Forms.ToolStripMenuItem(); + B_FillHoles = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveEditor = new System.Windows.Forms.ToolStripMenuItem(); + B_RemoveAll = new System.Windows.Forms.ToolStripMenuItem(); + toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + B_WaterFlowers = new System.Windows.Forms.ToolStripMenuItem(); + Menu_Spawn = new System.Windows.Forms.ToolStripMenuItem(); + Menu_Batch = new System.Windows.Forms.ToolStripMenuItem(); + GB_Remove = new System.Windows.Forms.Label(); + TC_Editor = new System.Windows.Forms.TabControl(); + Tab_Item = new System.Windows.Forms.TabPage(); + ItemEdit = new ItemEditor(); + B_DumpLoadField = new System.Windows.Forms.Button(); + CM_DLField = new System.Windows.Forms.ContextMenuStrip(components); + B_DumpAcre = new System.Windows.Forms.ToolStripMenuItem(); + B_DumpAllAcres = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportAcre = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportAllAcres = new System.Windows.Forms.ToolStripMenuItem(); + Tab_Building = new System.Windows.Forms.TabPage(); + B_DumpLoadBuildings = new System.Windows.Forms.Button(); + CM_DLBuilding = new System.Windows.Forms.ContextMenuStrip(components); + B_DumpBuildings = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportBuildings = new System.Windows.Forms.ToolStripMenuItem(); + L_Bit = new System.Windows.Forms.Label(); + NUD_Bit = new System.Windows.Forms.NumericUpDown(); + L_BuildingType = new System.Windows.Forms.Label(); + NUD_BuildingType = new System.Windows.Forms.NumericUpDown(); + NUD_UniqueID = new System.Windows.Forms.NumericUpDown(); + L_BuildingX = new System.Windows.Forms.Label(); + L_BuildingUniqueID = new System.Windows.Forms.Label(); + NUD_X = new System.Windows.Forms.NumericUpDown(); + NUD_TypeArg = new System.Windows.Forms.NumericUpDown(); + L_BuildingY = new System.Windows.Forms.Label(); + L_BuildingStructureArg = new System.Windows.Forms.Label(); + NUD_Y = new System.Windows.Forms.NumericUpDown(); + NUD_Type = new System.Windows.Forms.NumericUpDown(); + L_BuildingRotation = new System.Windows.Forms.Label(); + L_BuildingStructureType = new System.Windows.Forms.Label(); + NUD_Angle = new System.Windows.Forms.NumericUpDown(); + L_PlazaX = new System.Windows.Forms.Label(); + NUD_PlazaX = new System.Windows.Forms.NumericUpDown(); + L_PlazaY = new System.Windows.Forms.Label(); + NUD_PlazaY = new System.Windows.Forms.NumericUpDown(); + B_Help = new System.Windows.Forms.Button(); + LB_Items = new System.Windows.Forms.ListBox(); + Tab_Terrain = new System.Windows.Forms.TabPage(); + B_TerrainBrush = new System.Windows.Forms.Button(); + L_TerrainTileLabelTransparency = new System.Windows.Forms.Label(); + TR_Terrain = new System.Windows.Forms.TrackBar(); + TR_BuildingTransparency = new System.Windows.Forms.TrackBar(); + L_BuildingTransparency = new System.Windows.Forms.Label(); + PG_TerrainTile = new System.Windows.Forms.PropertyGrid(); + L_FieldItemTransparency = new System.Windows.Forms.Label(); + B_DumpLoadTerrain = new System.Windows.Forms.Button(); + B_ModifyAllTerrain = new System.Windows.Forms.Button(); + Tab_Acres = new System.Windows.Forms.TabPage(); + NUD_MapAcreTemplateField = new System.Windows.Forms.NumericUpDown(); + L_MapAcreTemplateField = new System.Windows.Forms.Label(); + L_MapAcreTemplateOutside = new System.Windows.Forms.Label(); + NUD_MapAcreTemplateOutside = new System.Windows.Forms.NumericUpDown(); + CB_MapAcreSelect = new System.Windows.Forms.ComboBox(); + B_DumpLoadAcres = new System.Windows.Forms.Button(); + CM_DLMapAcres = new System.Windows.Forms.ContextMenuStrip(components); + B_DumpMapAcres = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportMapAcres = new System.Windows.Forms.ToolStripMenuItem(); + L_MapAcre = new System.Windows.Forms.Label(); + CB_MapAcre = new System.Windows.Forms.ComboBox(); + CM_DLTerrain = new System.Windows.Forms.ContextMenuStrip(components); + B_DumpTerrainAcre = new System.Windows.Forms.ToolStripMenuItem(); + B_DumpTerrainAll = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportTerrainAcre = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportTerrainAll = new System.Windows.Forms.ToolStripMenuItem(); + CM_Terrain = new System.Windows.Forms.ContextMenuStrip(components); + B_ZeroElevation = new System.Windows.Forms.ToolStripMenuItem(); + B_SetAllTerrain = new System.Windows.Forms.ToolStripMenuItem(); + B_SetAllRoadTiles = new System.Windows.Forms.ToolStripMenuItem(); + B_ClearPlacedDesigns = new System.Windows.Forms.ToolStripMenuItem(); + B_ImportPlacedDesigns = new System.Windows.Forms.ToolStripMenuItem(); + B_ExportPlacedDesigns = new System.Windows.Forms.ToolStripMenuItem(); + RB_Item = new System.Windows.Forms.RadioButton(); + RB_Terrain = new System.Windows.Forms.RadioButton(); + L_TileMode = new System.Windows.Forms.Label(); + CHK_RedirectExtensionLoad = new System.Windows.Forms.CheckBox(); + CHK_MoveOnDrag = new System.Windows.Forms.CheckBox(); + CHK_FieldItemSnap = new System.Windows.Forms.CheckBox(); + flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + L_Acre = new System.Windows.Forms.Label(); + CB_Acre = new System.Windows.Forms.ComboBox(); + CM_Click.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)PB_Map).BeginInit(); + CM_Picture.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)NUD_Layer).BeginInit(); + ((System.ComponentModel.ISupportInitialize)PB_Acre).BeginInit(); + ((System.ComponentModel.ISupportInitialize)TR_Transparency).BeginInit(); + CM_Remove.SuspendLayout(); + TC_Editor.SuspendLayout(); + Tab_Item.SuspendLayout(); + CM_DLField.SuspendLayout(); + Tab_Building.SuspendLayout(); + CM_DLBuilding.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)NUD_Bit).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_BuildingType).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_UniqueID).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_X).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_TypeArg).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_Y).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_Type).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_Angle).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_PlazaX).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_PlazaY).BeginInit(); + Tab_Terrain.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)TR_Terrain).BeginInit(); + ((System.ComponentModel.ISupportInitialize)TR_BuildingTransparency).BeginInit(); + Tab_Acres.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)NUD_MapAcreTemplateField).BeginInit(); + ((System.ComponentModel.ISupportInitialize)NUD_MapAcreTemplateOutside).BeginInit(); + CM_DLMapAcres.SuspendLayout(); + CM_DLTerrain.SuspendLayout(); + CM_Terrain.SuspendLayout(); + flowLayoutPanel1.SuspendLayout(); + SuspendLayout(); // // B_Cancel // - this.B_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.B_Cancel.Location = new System.Drawing.Point(866, 502); - this.B_Cancel.Name = "B_Cancel"; - this.B_Cancel.Size = new System.Drawing.Size(72, 23); - this.B_Cancel.TabIndex = 7; - this.B_Cancel.Text = "Cancel"; - this.B_Cancel.UseVisualStyleBackColor = true; - this.B_Cancel.Click += new System.EventHandler(this.B_Cancel_Click); + B_Cancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + B_Cancel.Location = new System.Drawing.Point(950, 656); + B_Cancel.Margin = new System.Windows.Forms.Padding(4); + B_Cancel.Name = "B_Cancel"; + B_Cancel.Size = new System.Drawing.Size(84, 30); + B_Cancel.TabIndex = 7; + B_Cancel.Text = "Cancel"; + B_Cancel.UseVisualStyleBackColor = true; + B_Cancel.Click += B_Cancel_Click; // // B_Save // - this.B_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.B_Save.Location = new System.Drawing.Point(944, 502); - this.B_Save.Name = "B_Save"; - this.B_Save.Size = new System.Drawing.Size(72, 23); - this.B_Save.TabIndex = 6; - this.B_Save.Text = "Save"; - this.B_Save.UseVisualStyleBackColor = true; - this.B_Save.Click += new System.EventHandler(this.B_Save_Click); - // - // CB_Acre - // - this.CB_Acre.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.CB_Acre.FormattingEnabled = true; - this.CB_Acre.Location = new System.Drawing.Point(712, 358); - this.CB_Acre.Name = "CB_Acre"; - this.CB_Acre.Size = new System.Drawing.Size(49, 21); - this.CB_Acre.TabIndex = 10; - this.CB_Acre.SelectedIndexChanged += new System.EventHandler(this.ChangeAcre); - // - // L_Acre - // - this.L_Acre.Location = new System.Drawing.Point(619, 360); - this.L_Acre.Name = "L_Acre"; - this.L_Acre.Size = new System.Drawing.Size(87, 19); - this.L_Acre.TabIndex = 11; - this.L_Acre.Text = "Acre:"; - this.L_Acre.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + B_Save.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + B_Save.Location = new System.Drawing.Point(1041, 656); + B_Save.Margin = new System.Windows.Forms.Padding(4); + B_Save.Name = "B_Save"; + B_Save.Size = new System.Drawing.Size(84, 30); + B_Save.TabIndex = 6; + B_Save.Text = "Save"; + B_Save.UseVisualStyleBackColor = true; + B_Save.Click += B_Save_Click; // // CM_Click // - this.CM_Click.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.Menu_View, - this.Menu_Set, - this.Menu_Reset, - this.Menu_Activate}); - this.CM_Click.Name = "CM_Click"; - this.CM_Click.Size = new System.Drawing.Size(181, 114); - this.CM_Click.Opening += new System.ComponentModel.CancelEventHandler(this.CM_Click_Opening); + CM_Click.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { Menu_View, Menu_Set, Menu_Reset, Menu_Activate }); + CM_Click.Name = "CM_Click"; + CM_Click.Size = new System.Drawing.Size(122, 92); + CM_Click.Opening += CM_Click_Opening; // // Menu_View // - this.Menu_View.Name = "Menu_View"; - this.Menu_View.Size = new System.Drawing.Size(180, 22); - this.Menu_View.Text = "View"; - this.Menu_View.Click += new System.EventHandler(this.Menu_View_Click); + Menu_View.Name = "Menu_View"; + Menu_View.Size = new System.Drawing.Size(121, 22); + Menu_View.Text = "View"; + Menu_View.Click += Menu_View_Click; // // Menu_Set // - this.Menu_Set.Name = "Menu_Set"; - this.Menu_Set.Size = new System.Drawing.Size(180, 22); - this.Menu_Set.Text = "Set"; - this.Menu_Set.Click += new System.EventHandler(this.Menu_Set_Click); + Menu_Set.Name = "Menu_Set"; + Menu_Set.Size = new System.Drawing.Size(121, 22); + Menu_Set.Text = "Set"; + Menu_Set.Click += Menu_Set_Click; // // Menu_Reset // - this.Menu_Reset.Name = "Menu_Reset"; - this.Menu_Reset.Size = new System.Drawing.Size(180, 22); - this.Menu_Reset.Text = "Reset"; - this.Menu_Reset.Click += new System.EventHandler(this.Menu_Reset_Click); + Menu_Reset.Name = "Menu_Reset"; + Menu_Reset.Size = new System.Drawing.Size(121, 22); + Menu_Reset.Text = "Reset"; + Menu_Reset.Click += Menu_Reset_Click; // // Menu_Activate // - this.Menu_Activate.Name = "Menu_Activate"; - this.Menu_Activate.Size = new System.Drawing.Size(180, 22); - this.Menu_Activate.Text = "Activate"; - this.Menu_Activate.Click += new System.EventHandler(this.Menu_Activate_Click); + Menu_Activate.Name = "Menu_Activate"; + Menu_Activate.Size = new System.Drawing.Size(121, 22); + Menu_Activate.Text = "Activate"; + Menu_Activate.Click += Menu_Activate_Click; // // B_Up // - this.B_Up.Location = new System.Drawing.Point(578, 287); - this.B_Up.Name = "B_Up"; - this.B_Up.Size = new System.Drawing.Size(32, 32); - this.B_Up.TabIndex = 18; - this.B_Up.Text = "↑"; - this.B_Up.UseVisualStyleBackColor = true; - this.B_Up.Click += new System.EventHandler(this.B_Up_Click); + B_Up.Location = new System.Drawing.Point(575, 307); + B_Up.Margin = new System.Windows.Forms.Padding(4); + B_Up.Name = "B_Up"; + B_Up.Size = new System.Drawing.Size(40, 40); + B_Up.TabIndex = 18; + B_Up.Text = "↑"; + B_Up.UseVisualStyleBackColor = true; + B_Up.Click += B_Up_Click; // // B_Left // - this.B_Left.Location = new System.Drawing.Point(548, 317); - this.B_Left.Name = "B_Left"; - this.B_Left.Size = new System.Drawing.Size(32, 32); - this.B_Left.TabIndex = 19; - this.B_Left.Text = "←"; - this.B_Left.UseVisualStyleBackColor = true; - this.B_Left.Click += new System.EventHandler(this.B_Left_Click); + B_Left.Location = new System.Drawing.Point(536, 347); + B_Left.Margin = new System.Windows.Forms.Padding(4); + B_Left.Name = "B_Left"; + B_Left.Size = new System.Drawing.Size(40, 40); + B_Left.TabIndex = 19; + B_Left.Text = "←"; + B_Left.UseVisualStyleBackColor = true; + B_Left.Click += B_Left_Click; // // B_Right // - this.B_Right.Location = new System.Drawing.Point(608, 317); - this.B_Right.Name = "B_Right"; - this.B_Right.Size = new System.Drawing.Size(32, 32); - this.B_Right.TabIndex = 20; - this.B_Right.Text = "→"; - this.B_Right.UseVisualStyleBackColor = true; - this.B_Right.Click += new System.EventHandler(this.B_Right_Click); + B_Right.Location = new System.Drawing.Point(614, 347); + B_Right.Margin = new System.Windows.Forms.Padding(4); + B_Right.Name = "B_Right"; + B_Right.Size = new System.Drawing.Size(40, 40); + B_Right.TabIndex = 20; + B_Right.Text = "→"; + B_Right.UseVisualStyleBackColor = true; + B_Right.Click += B_Right_Click; // // B_Down // - this.B_Down.Location = new System.Drawing.Point(578, 347); - this.B_Down.Name = "B_Down"; - this.B_Down.Size = new System.Drawing.Size(32, 32); - this.B_Down.TabIndex = 22; - this.B_Down.Text = "↓"; - this.B_Down.UseVisualStyleBackColor = true; - this.B_Down.Click += new System.EventHandler(this.B_Down_Click); + B_Down.Location = new System.Drawing.Point(575, 386); + B_Down.Margin = new System.Windows.Forms.Padding(4); + B_Down.Name = "B_Down"; + B_Down.Size = new System.Drawing.Size(40, 40); + B_Down.TabIndex = 22; + B_Down.Text = "↓"; + B_Down.UseVisualStyleBackColor = true; + B_Down.Click += B_Down_Click; // // PB_Map // - this.PB_Map.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.PB_Map.ContextMenuStrip = this.CM_Picture; - this.PB_Map.Location = new System.Drawing.Point(535, 35); - this.PB_Map.Name = "PB_Map"; - this.PB_Map.Size = new System.Drawing.Size(226, 194); - this.PB_Map.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.PB_Map.TabIndex = 23; - this.PB_Map.TabStop = false; - this.PB_Map.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PB_Map_MouseDown); - this.PB_Map.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PB_Map_MouseMove); + PB_Map.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + PB_Map.ContextMenuStrip = CM_Picture; + PB_Map.Location = new System.Drawing.Point(536, 43); + PB_Map.Margin = new System.Windows.Forms.Padding(4); + PB_Map.Name = "PB_Map"; + PB_Map.Size = new System.Drawing.Size(288, 256); + PB_Map.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + PB_Map.TabIndex = 23; + PB_Map.TabStop = false; + PB_Map.MouseDown += PB_Map_MouseDown; + PB_Map.MouseMove += PB_Map_MouseMove; // // CM_Picture // - this.CM_Picture.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.Menu_SavePNG, - this.Menu_SavePNGItems, - this.Menu_SavePNGTerrain}); - this.CM_Picture.Name = "CM_Picture"; - this.CM_Picture.Size = new System.Drawing.Size(152, 70); - this.CM_Picture.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.CM_Picture_Closing); + CM_Picture.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { Menu_SavePNG, Menu_SavePNGItems, Menu_SavePNGTerrain }); + CM_Picture.Name = "CM_Picture"; + CM_Picture.Size = new System.Drawing.Size(162, 70); + CM_Picture.Closing += CM_Picture_Closing; // // Menu_SavePNG // - this.Menu_SavePNG.Name = "Menu_SavePNG"; - this.Menu_SavePNG.Size = new System.Drawing.Size(151, 22); - this.Menu_SavePNG.Text = "Save .png"; - this.Menu_SavePNG.Click += new System.EventHandler(this.Menu_SavePNG_Click); + Menu_SavePNG.Name = "Menu_SavePNG"; + Menu_SavePNG.Size = new System.Drawing.Size(161, 22); + Menu_SavePNG.Text = "Save .png"; + Menu_SavePNG.Click += Menu_SavePNG_Click; // // Menu_SavePNGItems // - this.Menu_SavePNGItems.Checked = true; - this.Menu_SavePNGItems.CheckOnClick = true; - this.Menu_SavePNGItems.CheckState = System.Windows.Forms.CheckState.Checked; - this.Menu_SavePNGItems.Name = "Menu_SavePNGItems"; - this.Menu_SavePNGItems.Size = new System.Drawing.Size(151, 22); - this.Menu_SavePNGItems.Text = "Include Items"; + Menu_SavePNGItems.Checked = true; + Menu_SavePNGItems.CheckOnClick = true; + Menu_SavePNGItems.CheckState = System.Windows.Forms.CheckState.Checked; + Menu_SavePNGItems.Name = "Menu_SavePNGItems"; + Menu_SavePNGItems.Size = new System.Drawing.Size(161, 22); + Menu_SavePNGItems.Text = "Include Items"; // // Menu_SavePNGTerrain // - this.Menu_SavePNGTerrain.Checked = true; - this.Menu_SavePNGTerrain.CheckOnClick = true; - this.Menu_SavePNGTerrain.CheckState = System.Windows.Forms.CheckState.Checked; - this.Menu_SavePNGTerrain.Name = "Menu_SavePNGTerrain"; - this.Menu_SavePNGTerrain.Size = new System.Drawing.Size(151, 22); - this.Menu_SavePNGTerrain.Text = "Include Terrain"; + Menu_SavePNGTerrain.Checked = true; + Menu_SavePNGTerrain.CheckOnClick = true; + Menu_SavePNGTerrain.CheckState = System.Windows.Forms.CheckState.Checked; + Menu_SavePNGTerrain.Name = "Menu_SavePNGTerrain"; + Menu_SavePNGTerrain.Size = new System.Drawing.Size(161, 22); + Menu_SavePNGTerrain.Text = "Include Terrain"; // // CHK_SnapToAcre // - this.CHK_SnapToAcre.AutoSize = true; - this.CHK_SnapToAcre.Location = new System.Drawing.Point(534, 12); - this.CHK_SnapToAcre.Name = "CHK_SnapToAcre"; - this.CHK_SnapToAcre.Size = new System.Drawing.Size(167, 17); - this.CHK_SnapToAcre.TabIndex = 24; - this.CHK_SnapToAcre.Text = "Snap to nearest Acre on Click"; - this.CHK_SnapToAcre.UseVisualStyleBackColor = true; + CHK_SnapToAcre.AutoSize = true; + CHK_SnapToAcre.Location = new System.Drawing.Point(536, 13); + CHK_SnapToAcre.Margin = new System.Windows.Forms.Padding(4); + CHK_SnapToAcre.Name = "CHK_SnapToAcre"; + CHK_SnapToAcre.Size = new System.Drawing.Size(198, 21); + CHK_SnapToAcre.TabIndex = 24; + CHK_SnapToAcre.Text = "Snap to nearest Acre on Click"; + CHK_SnapToAcre.UseVisualStyleBackColor = true; // // L_Coordinates // - this.L_Coordinates.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.L_Coordinates.Location = new System.Drawing.Point(590, 232); - this.L_Coordinates.Name = "L_Coordinates"; - this.L_Coordinates.Size = new System.Drawing.Size(173, 15); - this.L_Coordinates.TabIndex = 25; - this.L_Coordinates.Text = "(000,000) = (0x00,0x00)"; - this.L_Coordinates.TextAlign = System.Drawing.ContentAlignment.TopRight; + L_Coordinates.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); + L_Coordinates.Location = new System.Drawing.Point(622, 303); + L_Coordinates.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_Coordinates.Name = "L_Coordinates"; + L_Coordinates.Size = new System.Drawing.Size(202, 20); + L_Coordinates.TabIndex = 25; + L_Coordinates.Text = "(000,000) = (0x00,0x00)"; + L_Coordinates.TextAlign = System.Drawing.ContentAlignment.TopRight; // // NUD_Layer // - this.NUD_Layer.Location = new System.Drawing.Point(712, 385); - this.NUD_Layer.Maximum = new decimal(new int[] { - 2, - 0, - 0, - 0}); - this.NUD_Layer.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.NUD_Layer.Name = "NUD_Layer"; - this.NUD_Layer.Size = new System.Drawing.Size(49, 20); - this.NUD_Layer.TabIndex = 26; - this.NUD_Layer.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.NUD_Layer.ValueChanged += new System.EventHandler(this.NUD_Layer_ValueChanged); + NUD_Layer.Location = new System.Drawing.Point(767, 409); + NUD_Layer.Margin = new System.Windows.Forms.Padding(4); + NUD_Layer.Maximum = new decimal(new int[] { 2, 0, 0, 0 }); + NUD_Layer.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); + NUD_Layer.Name = "NUD_Layer"; + NUD_Layer.Size = new System.Drawing.Size(57, 25); + NUD_Layer.TabIndex = 26; + NUD_Layer.Value = new decimal(new int[] { 1, 0, 0, 0 }); + NUD_Layer.ValueChanged += NUD_Layer_ValueChanged; // // L_Layer // - this.L_Layer.Location = new System.Drawing.Point(619, 385); - this.L_Layer.Name = "L_Layer"; - this.L_Layer.Size = new System.Drawing.Size(87, 19); - this.L_Layer.TabIndex = 27; - this.L_Layer.Text = "Item Layer:"; - this.L_Layer.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_Layer.Location = new System.Drawing.Point(658, 409); + L_Layer.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_Layer.Name = "L_Layer"; + L_Layer.Size = new System.Drawing.Size(102, 25); + L_Layer.TabIndex = 27; + L_Layer.Text = "Item Layer:"; + L_Layer.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // TT_Hover // - this.TT_Hover.AutomaticDelay = 100; + TT_Hover.AutomaticDelay = 100; // // PB_Acre // - this.PB_Acre.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.PB_Acre.ContextMenuStrip = this.CM_Click; - this.PB_Acre.Location = new System.Drawing.Point(12, 12); - this.PB_Acre.Name = "PB_Acre"; - this.PB_Acre.Size = new System.Drawing.Size(514, 514); - this.PB_Acre.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.PB_Acre.TabIndex = 28; - this.PB_Acre.TabStop = false; - this.PB_Acre.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PB_Acre_MouseClick); - this.PB_Acre.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PB_Acre_MouseDown); - this.PB_Acre.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PB_Acre_MouseMove); + PB_Acre.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + PB_Acre.ContextMenuStrip = CM_Click; + PB_Acre.Location = new System.Drawing.Point(14, 16); + PB_Acre.Margin = new System.Windows.Forms.Padding(4); + PB_Acre.Name = "PB_Acre"; + PB_Acre.Size = new System.Drawing.Size(514, 514); + PB_Acre.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + PB_Acre.TabIndex = 28; + PB_Acre.TabStop = false; + PB_Acre.MouseClick += PB_Acre_MouseClick; + PB_Acre.MouseDown += PB_Acre_MouseDown; + PB_Acre.MouseMove += PB_Acre_MouseMove; // // TR_Transparency // - this.TR_Transparency.AutoSize = false; - this.TR_Transparency.Location = new System.Drawing.Point(3, 332); - this.TR_Transparency.Maximum = 100; - this.TR_Transparency.Name = "TR_Transparency"; - this.TR_Transparency.Size = new System.Drawing.Size(237, 28); - this.TR_Transparency.TabIndex = 36; - this.TR_Transparency.TickFrequency = 10; - this.TR_Transparency.Value = 90; - this.TR_Transparency.Scroll += new System.EventHandler(this.TR_Transparency_Scroll); + TR_Transparency.AutoSize = false; + TR_Transparency.Location = new System.Drawing.Point(4, 434); + TR_Transparency.Margin = new System.Windows.Forms.Padding(4); + TR_Transparency.Maximum = 100; + TR_Transparency.Name = "TR_Transparency"; + TR_Transparency.Size = new System.Drawing.Size(276, 37); + TR_Transparency.TabIndex = 36; + TR_Transparency.TickFrequency = 10; + TR_Transparency.Value = 90; + TR_Transparency.Scroll += TR_Transparency_Scroll; // // CHK_NoOverwrite // - this.CHK_NoOverwrite.AutoSize = true; - this.CHK_NoOverwrite.Checked = true; - this.CHK_NoOverwrite.CheckState = System.Windows.Forms.CheckState.Checked; - this.CHK_NoOverwrite.Location = new System.Drawing.Point(535, 478); - this.CHK_NoOverwrite.Name = "CHK_NoOverwrite"; - this.CHK_NoOverwrite.Size = new System.Drawing.Size(196, 17); - this.CHK_NoOverwrite.TabIndex = 37; - this.CHK_NoOverwrite.Text = "Prevent Writing Occupied Item Tiles"; - this.CHK_NoOverwrite.UseVisualStyleBackColor = true; + CHK_NoOverwrite.AutoSize = true; + CHK_NoOverwrite.Checked = true; + CHK_NoOverwrite.CheckState = System.Windows.Forms.CheckState.Checked; + CHK_NoOverwrite.Location = new System.Drawing.Point(0, 21); + CHK_NoOverwrite.Margin = new System.Windows.Forms.Padding(0); + CHK_NoOverwrite.Name = "CHK_NoOverwrite"; + CHK_NoOverwrite.Size = new System.Drawing.Size(234, 21); + CHK_NoOverwrite.TabIndex = 37; + CHK_NoOverwrite.Text = "Prevent Writing Occupied Item Tiles"; + CHK_NoOverwrite.UseVisualStyleBackColor = true; // // CHK_AutoExtension // - this.CHK_AutoExtension.AutoSize = true; - this.CHK_AutoExtension.Checked = true; - this.CHK_AutoExtension.CheckState = System.Windows.Forms.CheckState.Checked; - this.CHK_AutoExtension.Location = new System.Drawing.Point(535, 460); - this.CHK_AutoExtension.Name = "CHK_AutoExtension"; - this.CHK_AutoExtension.Size = new System.Drawing.Size(202, 17); - this.CHK_AutoExtension.TabIndex = 38; - this.CHK_AutoExtension.Text = "Handle Item Extensions Automatically"; - this.CHK_AutoExtension.UseVisualStyleBackColor = true; + CHK_AutoExtension.AutoSize = true; + CHK_AutoExtension.Checked = true; + CHK_AutoExtension.CheckState = System.Windows.Forms.CheckState.Checked; + CHK_AutoExtension.Location = new System.Drawing.Point(0, 42); + CHK_AutoExtension.Margin = new System.Windows.Forms.Padding(0); + CHK_AutoExtension.Name = "CHK_AutoExtension"; + CHK_AutoExtension.Size = new System.Drawing.Size(243, 21); + CHK_AutoExtension.TabIndex = 38; + CHK_AutoExtension.Text = "Handle Item Extensions Automatically"; + CHK_AutoExtension.UseVisualStyleBackColor = true; // // B_RemoveItemDropDown // - this.B_RemoveItemDropDown.ContextMenuStrip = this.CM_Remove; - this.B_RemoveItemDropDown.Location = new System.Drawing.Point(126, 413); - this.B_RemoveItemDropDown.Name = "B_RemoveItemDropDown"; - this.B_RemoveItemDropDown.Size = new System.Drawing.Size(112, 40); - this.B_RemoveItemDropDown.TabIndex = 37; - this.B_RemoveItemDropDown.Text = "Remove Items..."; - this.B_RemoveItemDropDown.UseVisualStyleBackColor = true; - this.B_RemoveItemDropDown.Click += new System.EventHandler(this.B_RemoveItemDropDown_Click); + B_RemoveItemDropDown.ContextMenuStrip = CM_Remove; + B_RemoveItemDropDown.Location = new System.Drawing.Point(147, 540); + B_RemoveItemDropDown.Margin = new System.Windows.Forms.Padding(4); + B_RemoveItemDropDown.Name = "B_RemoveItemDropDown"; + B_RemoveItemDropDown.Size = new System.Drawing.Size(131, 52); + B_RemoveItemDropDown.TabIndex = 37; + B_RemoveItemDropDown.Text = "Remove Items..."; + B_RemoveItemDropDown.UseVisualStyleBackColor = true; + B_RemoveItemDropDown.Click += B_RemoveItemDropDown_Click; // // CM_Remove // - this.CM_Remove.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.B_RemoveAllWeeds, - this.B_RemoveAllTrees, - this.B_RemovePlants, - this.B_RemoveObjects, - this.B_RemovePlacedItems, - this.B_RemoveFences, - this.B_RemoveBranches, - this.B_RemoveShells, - this.B_RemoveFlowers, - this.B_RemoveBushes, - this.B_FillHoles, - this.B_RemoveEditor, - this.B_RemoveAll, - this.toolStripSeparator1, - this.B_WaterFlowers, - this.Menu_Spawn, - this.Menu_Batch}); - this.CM_Remove.Name = "CM_Picture"; - this.CM_Remove.ShowImageMargin = false; - this.CM_Remove.Size = new System.Drawing.Size(124, 362); + CM_Remove.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { B_RemoveAllWeeds, B_RemoveAllTrees, B_RemovePlants, B_RemoveObjects, B_RemovePlacedItems, B_RemoveFences, B_RemoveBranches, B_RemoveShells, B_RemoveFlowers, B_RemoveBushes, B_FillHoles, B_RemoveEditor, B_RemoveAll, toolStripSeparator1, B_WaterFlowers, Menu_Spawn, Menu_Batch }); + CM_Remove.Name = "CM_Picture"; + CM_Remove.ShowImageMargin = false; + CM_Remove.Size = new System.Drawing.Size(134, 362); // // B_RemoveAllWeeds // - this.B_RemoveAllWeeds.Name = "B_RemoveAllWeeds"; - this.B_RemoveAllWeeds.Size = new System.Drawing.Size(123, 22); - this.B_RemoveAllWeeds.Text = "Weeds"; - this.B_RemoveAllWeeds.Click += new System.EventHandler(this.B_RemoveAllWeeds_Click); + B_RemoveAllWeeds.Name = "B_RemoveAllWeeds"; + B_RemoveAllWeeds.Size = new System.Drawing.Size(133, 22); + B_RemoveAllWeeds.Text = "Weeds"; + B_RemoveAllWeeds.Click += B_RemoveAllWeeds_Click; // // B_RemoveAllTrees // - this.B_RemoveAllTrees.Name = "B_RemoveAllTrees"; - this.B_RemoveAllTrees.Size = new System.Drawing.Size(123, 22); - this.B_RemoveAllTrees.Text = "Trees"; - this.B_RemoveAllTrees.Click += new System.EventHandler(this.B_RemoveAllTrees_Click); + B_RemoveAllTrees.Name = "B_RemoveAllTrees"; + B_RemoveAllTrees.Size = new System.Drawing.Size(133, 22); + B_RemoveAllTrees.Text = "Trees"; + B_RemoveAllTrees.Click += B_RemoveAllTrees_Click; // // B_RemovePlants // - this.B_RemovePlants.Name = "B_RemovePlants"; - this.B_RemovePlants.Size = new System.Drawing.Size(123, 22); - this.B_RemovePlants.Text = "Plants"; - this.B_RemovePlants.Click += new System.EventHandler(this.B_RemovePlants_Click); + B_RemovePlants.Name = "B_RemovePlants"; + B_RemovePlants.Size = new System.Drawing.Size(133, 22); + B_RemovePlants.Text = "Plants"; + B_RemovePlants.Click += B_RemovePlants_Click; // // B_RemoveObjects // - this.B_RemoveObjects.Name = "B_RemoveObjects"; - this.B_RemoveObjects.Size = new System.Drawing.Size(123, 22); - this.B_RemoveObjects.Text = "Objects"; - this.B_RemoveObjects.Click += new System.EventHandler(this.B_RemoveObjects_Click); + B_RemoveObjects.Name = "B_RemoveObjects"; + B_RemoveObjects.Size = new System.Drawing.Size(133, 22); + B_RemoveObjects.Text = "Objects"; + B_RemoveObjects.Click += B_RemoveObjects_Click; // // B_RemovePlacedItems // - this.B_RemovePlacedItems.Name = "B_RemovePlacedItems"; - this.B_RemovePlacedItems.Size = new System.Drawing.Size(123, 22); - this.B_RemovePlacedItems.Text = "Placed Items"; - this.B_RemovePlacedItems.Click += new System.EventHandler(this.B_RemovePlacedItems_Click); + B_RemovePlacedItems.Name = "B_RemovePlacedItems"; + B_RemovePlacedItems.Size = new System.Drawing.Size(133, 22); + B_RemovePlacedItems.Text = "Placed Items"; + B_RemovePlacedItems.Click += B_RemovePlacedItems_Click; // // B_RemoveFences // - this.B_RemoveFences.Name = "B_RemoveFences"; - this.B_RemoveFences.Size = new System.Drawing.Size(123, 22); - this.B_RemoveFences.Text = "Fences"; - this.B_RemoveFences.Click += new System.EventHandler(this.B_RemoveFences_Click); + B_RemoveFences.Name = "B_RemoveFences"; + B_RemoveFences.Size = new System.Drawing.Size(133, 22); + B_RemoveFences.Text = "Fences"; + B_RemoveFences.Click += B_RemoveFences_Click; // // B_RemoveBranches // - this.B_RemoveBranches.Name = "B_RemoveBranches"; - this.B_RemoveBranches.Size = new System.Drawing.Size(123, 22); - this.B_RemoveBranches.Text = "Branches"; - this.B_RemoveBranches.Click += new System.EventHandler(this.B_RemoveBranches_Click); + B_RemoveBranches.Name = "B_RemoveBranches"; + B_RemoveBranches.Size = new System.Drawing.Size(133, 22); + B_RemoveBranches.Text = "Branches"; + B_RemoveBranches.Click += B_RemoveBranches_Click; // // B_RemoveShells // - this.B_RemoveShells.Name = "B_RemoveShells"; - this.B_RemoveShells.Size = new System.Drawing.Size(123, 22); - this.B_RemoveShells.Text = "Shells"; - this.B_RemoveShells.Click += new System.EventHandler(this.B_RemoveShells_Click); + B_RemoveShells.Name = "B_RemoveShells"; + B_RemoveShells.Size = new System.Drawing.Size(133, 22); + B_RemoveShells.Text = "Shells"; + B_RemoveShells.Click += B_RemoveShells_Click; // // B_RemoveFlowers // - this.B_RemoveFlowers.Name = "B_RemoveFlowers"; - this.B_RemoveFlowers.Size = new System.Drawing.Size(123, 22); - this.B_RemoveFlowers.Text = "Flowers"; - this.B_RemoveFlowers.Click += new System.EventHandler(this.B_RemoveFlowers_Click); + B_RemoveFlowers.Name = "B_RemoveFlowers"; + B_RemoveFlowers.Size = new System.Drawing.Size(133, 22); + B_RemoveFlowers.Text = "Flowers"; + B_RemoveFlowers.Click += B_RemoveFlowers_Click; // // B_RemoveBushes // - this.B_RemoveBushes.Name = "B_RemoveBushes"; - this.B_RemoveBushes.Size = new System.Drawing.Size(123, 22); - this.B_RemoveBushes.Text = "Bushes"; - this.B_RemoveBushes.Click += new System.EventHandler(this.B_RemoveBushes_Click); + B_RemoveBushes.Name = "B_RemoveBushes"; + B_RemoveBushes.Size = new System.Drawing.Size(133, 22); + B_RemoveBushes.Text = "Bushes"; + B_RemoveBushes.Click += B_RemoveBushes_Click; // // B_FillHoles // - this.B_FillHoles.Name = "B_FillHoles"; - this.B_FillHoles.Size = new System.Drawing.Size(123, 22); - this.B_FillHoles.Text = "Holes"; - this.B_FillHoles.Click += new System.EventHandler(this.B_FillHoles_Click); + B_FillHoles.Name = "B_FillHoles"; + B_FillHoles.Size = new System.Drawing.Size(133, 22); + B_FillHoles.Text = "Holes"; + B_FillHoles.Click += B_FillHoles_Click; // // B_RemoveEditor // - this.B_RemoveEditor.Name = "B_RemoveEditor"; - this.B_RemoveEditor.Size = new System.Drawing.Size(123, 22); - this.B_RemoveEditor.Text = "Editor Item"; - this.B_RemoveEditor.Click += new System.EventHandler(this.B_RemoveEditor_Click); + B_RemoveEditor.Name = "B_RemoveEditor"; + B_RemoveEditor.Size = new System.Drawing.Size(133, 22); + B_RemoveEditor.Text = "Editor Item"; + B_RemoveEditor.Click += B_RemoveEditor_Click; // // B_RemoveAll // - this.B_RemoveAll.Name = "B_RemoveAll"; - this.B_RemoveAll.Size = new System.Drawing.Size(123, 22); - this.B_RemoveAll.Text = "All"; - this.B_RemoveAll.Click += new System.EventHandler(this.B_RemoveAll_Click); + B_RemoveAll.Name = "B_RemoveAll"; + B_RemoveAll.Size = new System.Drawing.Size(133, 22); + B_RemoveAll.Text = "All"; + B_RemoveAll.Click += B_RemoveAll_Click; // // toolStripSeparator1 // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(120, 6); + toolStripSeparator1.Name = "toolStripSeparator1"; + toolStripSeparator1.Size = new System.Drawing.Size(130, 6); // // B_WaterFlowers // - this.B_WaterFlowers.Name = "B_WaterFlowers"; - this.B_WaterFlowers.Size = new System.Drawing.Size(123, 22); - this.B_WaterFlowers.Text = "Water Flowers"; - this.B_WaterFlowers.Click += new System.EventHandler(this.B_WaterFlowers_Click); + B_WaterFlowers.Name = "B_WaterFlowers"; + B_WaterFlowers.Size = new System.Drawing.Size(133, 22); + B_WaterFlowers.Text = "Water Flowers"; + B_WaterFlowers.Click += B_WaterFlowers_Click; // // Menu_Spawn // - this.Menu_Spawn.Name = "Menu_Spawn"; - this.Menu_Spawn.Size = new System.Drawing.Size(123, 22); - this.Menu_Spawn.Text = "Spawn..."; - this.Menu_Spawn.Click += new System.EventHandler(this.Menu_Spawn_Click); + Menu_Spawn.Name = "Menu_Spawn"; + Menu_Spawn.Size = new System.Drawing.Size(133, 22); + Menu_Spawn.Text = "Spawn..."; + Menu_Spawn.Click += Menu_Spawn_Click; // // Menu_Batch // - this.Menu_Batch.Name = "Menu_Batch"; - this.Menu_Batch.Size = new System.Drawing.Size(123, 22); - this.Menu_Batch.Text = "Batch Editor"; - this.Menu_Batch.Click += new System.EventHandler(this.Menu_Bulk_Click); + Menu_Batch.Name = "Menu_Batch"; + Menu_Batch.Size = new System.Drawing.Size(133, 22); + Menu_Batch.Text = "Batch Editor"; + Menu_Batch.Click += Menu_Bulk_Click; // // GB_Remove // - this.GB_Remove.AutoSize = true; - this.GB_Remove.Location = new System.Drawing.Point(60, 396); - this.GB_Remove.Name = "GB_Remove"; - this.GB_Remove.Size = new System.Drawing.Size(178, 13); - this.GB_Remove.TabIndex = 39; - this.GB_Remove.Text = "Remove from View (Hold Shift=Map)"; + GB_Remove.AutoSize = true; + GB_Remove.Location = new System.Drawing.Point(8, 499); + GB_Remove.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + GB_Remove.Name = "GB_Remove"; + GB_Remove.Size = new System.Drawing.Size(223, 17); + GB_Remove.TabIndex = 39; + GB_Remove.Text = "Remove from View (Hold Shift=Map)"; // // TC_Editor // - this.TC_Editor.Controls.Add(this.Tab_Item); - this.TC_Editor.Controls.Add(this.Tab_Building); - this.TC_Editor.Controls.Add(this.Tab_Terrain); - this.TC_Editor.Controls.Add(this.Tab_Acres); - this.TC_Editor.Location = new System.Drawing.Point(767, 12); - this.TC_Editor.Name = "TC_Editor"; - this.TC_Editor.SelectedIndex = 0; - this.TC_Editor.Size = new System.Drawing.Size(252, 484); - this.TC_Editor.TabIndex = 40; + TC_Editor.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + TC_Editor.Controls.Add(Tab_Item); + TC_Editor.Controls.Add(Tab_Building); + TC_Editor.Controls.Add(Tab_Terrain); + TC_Editor.Controls.Add(Tab_Acres); + TC_Editor.Location = new System.Drawing.Point(835, 16); + TC_Editor.Margin = new System.Windows.Forms.Padding(4); + TC_Editor.Name = "TC_Editor"; + TC_Editor.SelectedIndex = 0; + TC_Editor.Size = new System.Drawing.Size(294, 633); + TC_Editor.TabIndex = 40; // // Tab_Item // - this.Tab_Item.Controls.Add(this.ItemEdit); - this.Tab_Item.Controls.Add(this.B_DumpLoadField); - this.Tab_Item.Controls.Add(this.B_RemoveItemDropDown); - this.Tab_Item.Controls.Add(this.GB_Remove); - this.Tab_Item.Location = new System.Drawing.Point(4, 22); - this.Tab_Item.Name = "Tab_Item"; - this.Tab_Item.Padding = new System.Windows.Forms.Padding(3); - this.Tab_Item.Size = new System.Drawing.Size(244, 458); - this.Tab_Item.TabIndex = 0; - this.Tab_Item.Text = "Items"; - this.Tab_Item.UseVisualStyleBackColor = true; + Tab_Item.Controls.Add(ItemEdit); + Tab_Item.Controls.Add(B_DumpLoadField); + Tab_Item.Controls.Add(B_RemoveItemDropDown); + Tab_Item.Controls.Add(GB_Remove); + Tab_Item.Location = new System.Drawing.Point(4, 26); + Tab_Item.Margin = new System.Windows.Forms.Padding(4); + Tab_Item.Name = "Tab_Item"; + Tab_Item.Padding = new System.Windows.Forms.Padding(4); + Tab_Item.Size = new System.Drawing.Size(286, 603); + Tab_Item.TabIndex = 0; + Tab_Item.Text = "Items"; + Tab_Item.UseVisualStyleBackColor = true; // // ItemEdit // - this.ItemEdit.Dock = System.Windows.Forms.DockStyle.Top; - this.ItemEdit.Location = new System.Drawing.Point(3, 3); - this.ItemEdit.Name = "ItemEdit"; - this.ItemEdit.Size = new System.Drawing.Size(238, 390); - this.ItemEdit.TabIndex = 40; + ItemEdit.Dock = System.Windows.Forms.DockStyle.Top; + ItemEdit.Location = new System.Drawing.Point(4, 4); + ItemEdit.Margin = new System.Windows.Forms.Padding(5); + ItemEdit.Name = "ItemEdit"; + ItemEdit.Size = new System.Drawing.Size(278, 437); + ItemEdit.TabIndex = 40; // // B_DumpLoadField // - this.B_DumpLoadField.ContextMenuStrip = this.CM_DLField; - this.B_DumpLoadField.Location = new System.Drawing.Point(6, 413); - this.B_DumpLoadField.Name = "B_DumpLoadField"; - this.B_DumpLoadField.Size = new System.Drawing.Size(112, 40); - this.B_DumpLoadField.TabIndex = 38; - this.B_DumpLoadField.Text = "Dump/Import"; - this.B_DumpLoadField.UseVisualStyleBackColor = true; - this.B_DumpLoadField.Click += new System.EventHandler(this.B_DumpLoadField_Click); + B_DumpLoadField.ContextMenuStrip = CM_DLField; + B_DumpLoadField.Location = new System.Drawing.Point(7, 540); + B_DumpLoadField.Margin = new System.Windows.Forms.Padding(4); + B_DumpLoadField.Name = "B_DumpLoadField"; + B_DumpLoadField.Size = new System.Drawing.Size(131, 52); + B_DumpLoadField.TabIndex = 38; + B_DumpLoadField.Text = "Dump/Import"; + B_DumpLoadField.UseVisualStyleBackColor = true; + B_DumpLoadField.Click += B_DumpLoadField_Click; // // CM_DLField // - this.CM_DLField.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.B_DumpAcre, - this.B_DumpAllAcres, - this.B_ImportAcre, - this.B_ImportAllAcres}); - this.CM_DLField.Name = "CM_Picture"; - this.CM_DLField.ShowImageMargin = false; - this.CM_DLField.Size = new System.Drawing.Size(135, 92); + CM_DLField.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { B_DumpAcre, B_DumpAllAcres, B_ImportAcre, B_ImportAllAcres }); + CM_DLField.Name = "CM_Picture"; + CM_DLField.ShowImageMargin = false; + CM_DLField.Size = new System.Drawing.Size(145, 92); // // B_DumpAcre // - this.B_DumpAcre.Name = "B_DumpAcre"; - this.B_DumpAcre.Size = new System.Drawing.Size(134, 22); - this.B_DumpAcre.Text = "Dump Acre"; - this.B_DumpAcre.Click += new System.EventHandler(this.B_DumpAcre_Click); + B_DumpAcre.Name = "B_DumpAcre"; + B_DumpAcre.Size = new System.Drawing.Size(144, 22); + B_DumpAcre.Text = "Dump Acre"; + B_DumpAcre.Click += B_DumpAcre_Click; // // B_DumpAllAcres // - this.B_DumpAllAcres.Name = "B_DumpAllAcres"; - this.B_DumpAllAcres.Size = new System.Drawing.Size(134, 22); - this.B_DumpAllAcres.Text = "Dump All Acres"; - this.B_DumpAllAcres.Click += new System.EventHandler(this.B_DumpAllAcres_Click); + B_DumpAllAcres.Name = "B_DumpAllAcres"; + B_DumpAllAcres.Size = new System.Drawing.Size(144, 22); + B_DumpAllAcres.Text = "Dump All Acres"; + B_DumpAllAcres.Click += B_DumpAllAcres_Click; // // B_ImportAcre // - this.B_ImportAcre.Name = "B_ImportAcre"; - this.B_ImportAcre.Size = new System.Drawing.Size(134, 22); - this.B_ImportAcre.Text = "Import Acre"; - this.B_ImportAcre.Click += new System.EventHandler(this.B_ImportAcre_Click); + B_ImportAcre.Name = "B_ImportAcre"; + B_ImportAcre.Size = new System.Drawing.Size(144, 22); + B_ImportAcre.Text = "Import Acre"; + B_ImportAcre.Click += B_ImportAcre_Click; // // B_ImportAllAcres // - this.B_ImportAllAcres.Name = "B_ImportAllAcres"; - this.B_ImportAllAcres.Size = new System.Drawing.Size(134, 22); - this.B_ImportAllAcres.Text = "Import All Acres"; - this.B_ImportAllAcres.Click += new System.EventHandler(this.B_ImportAllAcres_Click); + B_ImportAllAcres.Name = "B_ImportAllAcres"; + B_ImportAllAcres.Size = new System.Drawing.Size(144, 22); + B_ImportAllAcres.Text = "Import All Acres"; + B_ImportAllAcres.Click += B_ImportAllAcres_Click; // // Tab_Building // - this.Tab_Building.Controls.Add(this.B_DumpLoadBuildings); - this.Tab_Building.Controls.Add(this.L_Bit); - this.Tab_Building.Controls.Add(this.NUD_Bit); - this.Tab_Building.Controls.Add(this.L_BuildingType); - this.Tab_Building.Controls.Add(this.NUD_BuildingType); - this.Tab_Building.Controls.Add(this.NUD_UniqueID); - this.Tab_Building.Controls.Add(this.L_BuildingX); - this.Tab_Building.Controls.Add(this.L_BuildingUniqueID); - this.Tab_Building.Controls.Add(this.NUD_X); - this.Tab_Building.Controls.Add(this.NUD_TypeArg); - this.Tab_Building.Controls.Add(this.L_BuildingY); - this.Tab_Building.Controls.Add(this.L_BuildingStructureArg); - this.Tab_Building.Controls.Add(this.NUD_Y); - this.Tab_Building.Controls.Add(this.NUD_Type); - this.Tab_Building.Controls.Add(this.L_BuildingRotation); - this.Tab_Building.Controls.Add(this.L_BuildingStructureType); - this.Tab_Building.Controls.Add(this.NUD_Angle); - this.Tab_Building.Controls.Add(this.L_PlazaX); - this.Tab_Building.Controls.Add(this.NUD_PlazaX); - this.Tab_Building.Controls.Add(this.L_PlazaY); - this.Tab_Building.Controls.Add(this.NUD_PlazaY); - this.Tab_Building.Controls.Add(this.B_Help); - this.Tab_Building.Controls.Add(this.LB_Items); - this.Tab_Building.Location = new System.Drawing.Point(4, 22); - this.Tab_Building.Name = "Tab_Building"; - this.Tab_Building.Padding = new System.Windows.Forms.Padding(3); - this.Tab_Building.Size = new System.Drawing.Size(244, 458); - this.Tab_Building.TabIndex = 1; - this.Tab_Building.Text = "Buildings"; - this.Tab_Building.UseVisualStyleBackColor = true; + Tab_Building.Controls.Add(B_DumpLoadBuildings); + Tab_Building.Controls.Add(L_Bit); + Tab_Building.Controls.Add(NUD_Bit); + Tab_Building.Controls.Add(L_BuildingType); + Tab_Building.Controls.Add(NUD_BuildingType); + Tab_Building.Controls.Add(NUD_UniqueID); + Tab_Building.Controls.Add(L_BuildingX); + Tab_Building.Controls.Add(L_BuildingUniqueID); + Tab_Building.Controls.Add(NUD_X); + Tab_Building.Controls.Add(NUD_TypeArg); + Tab_Building.Controls.Add(L_BuildingY); + Tab_Building.Controls.Add(L_BuildingStructureArg); + Tab_Building.Controls.Add(NUD_Y); + Tab_Building.Controls.Add(NUD_Type); + Tab_Building.Controls.Add(L_BuildingRotation); + Tab_Building.Controls.Add(L_BuildingStructureType); + Tab_Building.Controls.Add(NUD_Angle); + Tab_Building.Controls.Add(L_PlazaX); + Tab_Building.Controls.Add(NUD_PlazaX); + Tab_Building.Controls.Add(L_PlazaY); + Tab_Building.Controls.Add(NUD_PlazaY); + Tab_Building.Controls.Add(B_Help); + Tab_Building.Controls.Add(LB_Items); + Tab_Building.Location = new System.Drawing.Point(4, 26); + Tab_Building.Margin = new System.Windows.Forms.Padding(4); + Tab_Building.Name = "Tab_Building"; + Tab_Building.Padding = new System.Windows.Forms.Padding(4); + Tab_Building.Size = new System.Drawing.Size(286, 603); + Tab_Building.TabIndex = 1; + Tab_Building.Text = "Buildings"; + Tab_Building.UseVisualStyleBackColor = true; // // B_DumpLoadBuildings // - this.B_DumpLoadBuildings.ContextMenuStrip = this.CM_DLBuilding; - this.B_DumpLoadBuildings.Location = new System.Drawing.Point(6, 413); - this.B_DumpLoadBuildings.Name = "B_DumpLoadBuildings"; - this.B_DumpLoadBuildings.Size = new System.Drawing.Size(112, 40); - this.B_DumpLoadBuildings.TabIndex = 132; - this.B_DumpLoadBuildings.Text = "Dump/Import"; - this.B_DumpLoadBuildings.UseVisualStyleBackColor = true; - this.B_DumpLoadBuildings.Click += new System.EventHandler(this.B_DumpLoadBuildings_Click); + B_DumpLoadBuildings.ContextMenuStrip = CM_DLBuilding; + B_DumpLoadBuildings.Location = new System.Drawing.Point(7, 540); + B_DumpLoadBuildings.Margin = new System.Windows.Forms.Padding(4); + B_DumpLoadBuildings.Name = "B_DumpLoadBuildings"; + B_DumpLoadBuildings.Size = new System.Drawing.Size(131, 52); + B_DumpLoadBuildings.TabIndex = 132; + B_DumpLoadBuildings.Text = "Dump/Import"; + B_DumpLoadBuildings.UseVisualStyleBackColor = true; + B_DumpLoadBuildings.Click += B_DumpLoadBuildings_Click; // // CM_DLBuilding // - this.CM_DLBuilding.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.B_DumpBuildings, - this.B_ImportBuildings}); - this.CM_DLBuilding.Name = "CM_Picture"; - this.CM_DLBuilding.ShowImageMargin = false; - this.CM_DLBuilding.Size = new System.Drawing.Size(138, 48); + CM_DLBuilding.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { B_DumpBuildings, B_ImportBuildings }); + CM_DLBuilding.Name = "CM_Picture"; + CM_DLBuilding.ShowImageMargin = false; + CM_DLBuilding.Size = new System.Drawing.Size(147, 48); // // B_DumpBuildings // - this.B_DumpBuildings.Name = "B_DumpBuildings"; - this.B_DumpBuildings.Size = new System.Drawing.Size(137, 22); - this.B_DumpBuildings.Text = "Dump Buildings"; - this.B_DumpBuildings.Click += new System.EventHandler(this.B_DumpBuildings_Click); + B_DumpBuildings.Name = "B_DumpBuildings"; + B_DumpBuildings.Size = new System.Drawing.Size(146, 22); + B_DumpBuildings.Text = "Dump Buildings"; + B_DumpBuildings.Click += B_DumpBuildings_Click; // // B_ImportBuildings // - this.B_ImportBuildings.Name = "B_ImportBuildings"; - this.B_ImportBuildings.Size = new System.Drawing.Size(137, 22); - this.B_ImportBuildings.Text = "Import Buildings"; - this.B_ImportBuildings.Click += new System.EventHandler(this.B_ImportBuildings_Click); + B_ImportBuildings.Name = "B_ImportBuildings"; + B_ImportBuildings.Size = new System.Drawing.Size(146, 22); + B_ImportBuildings.Text = "Import Buildings"; + B_ImportBuildings.Click += B_ImportBuildings_Click; // // L_Bit // - this.L_Bit.Location = new System.Drawing.Point(36, 303); - this.L_Bit.Name = "L_Bit"; - this.L_Bit.Size = new System.Drawing.Size(100, 18); - this.L_Bit.TabIndex = 130; - this.L_Bit.Text = "Bit:"; - this.L_Bit.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_Bit.Location = new System.Drawing.Point(42, 396); + L_Bit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_Bit.Name = "L_Bit"; + L_Bit.Size = new System.Drawing.Size(117, 24); + L_Bit.TabIndex = 130; + L_Bit.Text = "Bit:"; + L_Bit.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_Bit // - this.NUD_Bit.Location = new System.Drawing.Point(142, 304); - this.NUD_Bit.Maximum = new decimal(new int[] { - 200, - 0, - 0, - 0}); - this.NUD_Bit.Minimum = new decimal(new int[] { - 200, - 0, - 0, - -2147483648}); - this.NUD_Bit.Name = "NUD_Bit"; - this.NUD_Bit.Size = new System.Drawing.Size(69, 20); - this.NUD_Bit.TabIndex = 131; - this.NUD_Bit.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_Bit.Location = new System.Drawing.Point(166, 398); + NUD_Bit.Margin = new System.Windows.Forms.Padding(4); + NUD_Bit.Maximum = new decimal(new int[] { 200, 0, 0, 0 }); + NUD_Bit.Minimum = new decimal(new int[] { 200, 0, 0, int.MinValue }); + NUD_Bit.Name = "NUD_Bit"; + NUD_Bit.Size = new System.Drawing.Size(80, 25); + NUD_Bit.TabIndex = 131; + NUD_Bit.ValueChanged += NUD_BuildingType_ValueChanged; // // L_BuildingType // - this.L_BuildingType.Location = new System.Drawing.Point(36, 236); - this.L_BuildingType.Name = "L_BuildingType"; - this.L_BuildingType.Size = new System.Drawing.Size(100, 18); - this.L_BuildingType.TabIndex = 116; - this.L_BuildingType.Text = "Building Type:"; - this.L_BuildingType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingType.Location = new System.Drawing.Point(42, 309); + L_BuildingType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingType.Name = "L_BuildingType"; + L_BuildingType.Size = new System.Drawing.Size(117, 24); + L_BuildingType.TabIndex = 116; + L_BuildingType.Text = "Building Type:"; + L_BuildingType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_BuildingType // - this.NUD_BuildingType.Location = new System.Drawing.Point(142, 237); - this.NUD_BuildingType.Name = "NUD_BuildingType"; - this.NUD_BuildingType.Size = new System.Drawing.Size(69, 20); - this.NUD_BuildingType.TabIndex = 117; - this.NUD_BuildingType.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_BuildingType.Location = new System.Drawing.Point(166, 310); + NUD_BuildingType.Margin = new System.Windows.Forms.Padding(4); + NUD_BuildingType.Name = "NUD_BuildingType"; + NUD_BuildingType.Size = new System.Drawing.Size(80, 25); + NUD_BuildingType.TabIndex = 117; + NUD_BuildingType.ValueChanged += NUD_BuildingType_ValueChanged; // // NUD_UniqueID // - this.NUD_UniqueID.Location = new System.Drawing.Point(142, 371); - this.NUD_UniqueID.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.NUD_UniqueID.Name = "NUD_UniqueID"; - this.NUD_UniqueID.Size = new System.Drawing.Size(69, 20); - this.NUD_UniqueID.TabIndex = 129; - this.NUD_UniqueID.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_UniqueID.Location = new System.Drawing.Point(166, 485); + NUD_UniqueID.Margin = new System.Windows.Forms.Padding(4); + NUD_UniqueID.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_UniqueID.Name = "NUD_UniqueID"; + NUD_UniqueID.Size = new System.Drawing.Size(80, 25); + NUD_UniqueID.TabIndex = 129; + NUD_UniqueID.ValueChanged += NUD_BuildingType_ValueChanged; // // L_BuildingX // - this.L_BuildingX.Location = new System.Drawing.Point(65, 257); - this.L_BuildingX.Name = "L_BuildingX"; - this.L_BuildingX.Size = new System.Drawing.Size(20, 18); - this.L_BuildingX.TabIndex = 118; - this.L_BuildingX.Text = "X:"; - this.L_BuildingX.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingX.Location = new System.Drawing.Point(76, 336); + L_BuildingX.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingX.Name = "L_BuildingX"; + L_BuildingX.Size = new System.Drawing.Size(23, 24); + L_BuildingX.TabIndex = 118; + L_BuildingX.Text = "X:"; + L_BuildingX.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // L_BuildingUniqueID // - this.L_BuildingUniqueID.Location = new System.Drawing.Point(36, 370); - this.L_BuildingUniqueID.Name = "L_BuildingUniqueID"; - this.L_BuildingUniqueID.Size = new System.Drawing.Size(100, 18); - this.L_BuildingUniqueID.TabIndex = 128; - this.L_BuildingUniqueID.Text = "UniqueID:"; - this.L_BuildingUniqueID.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingUniqueID.Location = new System.Drawing.Point(42, 484); + L_BuildingUniqueID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingUniqueID.Name = "L_BuildingUniqueID"; + L_BuildingUniqueID.Size = new System.Drawing.Size(117, 24); + L_BuildingUniqueID.TabIndex = 128; + L_BuildingUniqueID.Text = "UniqueID:"; + L_BuildingUniqueID.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_X // - this.NUD_X.Location = new System.Drawing.Point(91, 258); - this.NUD_X.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.NUD_X.Name = "NUD_X"; - this.NUD_X.Size = new System.Drawing.Size(45, 20); - this.NUD_X.TabIndex = 119; - this.NUD_X.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_X.Location = new System.Drawing.Point(106, 337); + NUD_X.Margin = new System.Windows.Forms.Padding(4); + NUD_X.Maximum = new decimal(new int[] { 255, 0, 0, 0 }); + NUD_X.Name = "NUD_X"; + NUD_X.Size = new System.Drawing.Size(52, 25); + NUD_X.TabIndex = 119; + NUD_X.ValueChanged += NUD_BuildingType_ValueChanged; // // NUD_TypeArg // - this.NUD_TypeArg.Location = new System.Drawing.Point(142, 350); - this.NUD_TypeArg.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.NUD_TypeArg.Name = "NUD_TypeArg"; - this.NUD_TypeArg.Size = new System.Drawing.Size(69, 20); - this.NUD_TypeArg.TabIndex = 127; - this.NUD_TypeArg.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_TypeArg.Location = new System.Drawing.Point(166, 458); + NUD_TypeArg.Margin = new System.Windows.Forms.Padding(4); + NUD_TypeArg.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_TypeArg.Name = "NUD_TypeArg"; + NUD_TypeArg.Size = new System.Drawing.Size(80, 25); + NUD_TypeArg.TabIndex = 127; + NUD_TypeArg.ValueChanged += NUD_BuildingType_ValueChanged; // // L_BuildingY // - this.L_BuildingY.Location = new System.Drawing.Point(137, 257); - this.L_BuildingY.Name = "L_BuildingY"; - this.L_BuildingY.Size = new System.Drawing.Size(23, 18); - this.L_BuildingY.TabIndex = 120; - this.L_BuildingY.Text = "Y:"; - this.L_BuildingY.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingY.Location = new System.Drawing.Point(160, 336); + L_BuildingY.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingY.Name = "L_BuildingY"; + L_BuildingY.Size = new System.Drawing.Size(27, 24); + L_BuildingY.TabIndex = 120; + L_BuildingY.Text = "Y:"; + L_BuildingY.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // L_BuildingStructureArg // - this.L_BuildingStructureArg.Location = new System.Drawing.Point(36, 349); - this.L_BuildingStructureArg.Name = "L_BuildingStructureArg"; - this.L_BuildingStructureArg.Size = new System.Drawing.Size(100, 18); - this.L_BuildingStructureArg.TabIndex = 126; - this.L_BuildingStructureArg.Text = "TypeArg:"; - this.L_BuildingStructureArg.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingStructureArg.Location = new System.Drawing.Point(42, 456); + L_BuildingStructureArg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingStructureArg.Name = "L_BuildingStructureArg"; + L_BuildingStructureArg.Size = new System.Drawing.Size(117, 24); + L_BuildingStructureArg.TabIndex = 126; + L_BuildingStructureArg.Text = "TypeArg:"; + L_BuildingStructureArg.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_Y // - this.NUD_Y.Location = new System.Drawing.Point(166, 258); - this.NUD_Y.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.NUD_Y.Name = "NUD_Y"; - this.NUD_Y.Size = new System.Drawing.Size(45, 20); - this.NUD_Y.TabIndex = 121; - this.NUD_Y.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_Y.Location = new System.Drawing.Point(194, 337); + NUD_Y.Margin = new System.Windows.Forms.Padding(4); + NUD_Y.Maximum = new decimal(new int[] { 255, 0, 0, 0 }); + NUD_Y.Name = "NUD_Y"; + NUD_Y.Size = new System.Drawing.Size(52, 25); + NUD_Y.TabIndex = 121; + NUD_Y.ValueChanged += NUD_BuildingType_ValueChanged; // // NUD_Type // - this.NUD_Type.Location = new System.Drawing.Point(142, 329); - this.NUD_Type.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.NUD_Type.Name = "NUD_Type"; - this.NUD_Type.Size = new System.Drawing.Size(69, 20); - this.NUD_Type.TabIndex = 125; - this.NUD_Type.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_Type.Location = new System.Drawing.Point(166, 430); + NUD_Type.Margin = new System.Windows.Forms.Padding(4); + NUD_Type.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_Type.Name = "NUD_Type"; + NUD_Type.Size = new System.Drawing.Size(80, 25); + NUD_Type.TabIndex = 125; + NUD_Type.ValueChanged += NUD_BuildingType_ValueChanged; // // L_BuildingRotation // - this.L_BuildingRotation.Location = new System.Drawing.Point(36, 282); - this.L_BuildingRotation.Name = "L_BuildingRotation"; - this.L_BuildingRotation.Size = new System.Drawing.Size(100, 18); - this.L_BuildingRotation.TabIndex = 122; - this.L_BuildingRotation.Text = "Angle:"; - this.L_BuildingRotation.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingRotation.Location = new System.Drawing.Point(42, 369); + L_BuildingRotation.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingRotation.Name = "L_BuildingRotation"; + L_BuildingRotation.Size = new System.Drawing.Size(117, 24); + L_BuildingRotation.TabIndex = 122; + L_BuildingRotation.Text = "Angle:"; + L_BuildingRotation.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // L_BuildingStructureType // - this.L_BuildingStructureType.Location = new System.Drawing.Point(36, 328); - this.L_BuildingStructureType.Name = "L_BuildingStructureType"; - this.L_BuildingStructureType.Size = new System.Drawing.Size(100, 18); - this.L_BuildingStructureType.TabIndex = 124; - this.L_BuildingStructureType.Text = "Type:"; - this.L_BuildingStructureType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_BuildingStructureType.Location = new System.Drawing.Point(42, 429); + L_BuildingStructureType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingStructureType.Name = "L_BuildingStructureType"; + L_BuildingStructureType.Size = new System.Drawing.Size(117, 24); + L_BuildingStructureType.TabIndex = 124; + L_BuildingStructureType.Text = "Type:"; + L_BuildingStructureType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_Angle // - this.NUD_Angle.Location = new System.Drawing.Point(142, 283); - this.NUD_Angle.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.NUD_Angle.Name = "NUD_Angle"; - this.NUD_Angle.Size = new System.Drawing.Size(69, 20); - this.NUD_Angle.TabIndex = 123; - this.NUD_Angle.ValueChanged += new System.EventHandler(this.NUD_BuildingType_ValueChanged); + NUD_Angle.Location = new System.Drawing.Point(166, 370); + NUD_Angle.Margin = new System.Windows.Forms.Padding(4); + NUD_Angle.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_Angle.Name = "NUD_Angle"; + NUD_Angle.Size = new System.Drawing.Size(80, 25); + NUD_Angle.TabIndex = 123; + NUD_Angle.ValueChanged += NUD_BuildingType_ValueChanged; // // L_PlazaX // - this.L_PlazaX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.L_PlazaX.Location = new System.Drawing.Point(65, 2); - this.L_PlazaX.Name = "L_PlazaX"; - this.L_PlazaX.Size = new System.Drawing.Size(62, 20); - this.L_PlazaX.TabIndex = 115; - this.L_PlazaX.Text = "Plaza X:"; - this.L_PlazaX.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_PlazaX.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + L_PlazaX.Location = new System.Drawing.Point(76, 3); + L_PlazaX.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_PlazaX.Name = "L_PlazaX"; + L_PlazaX.Size = new System.Drawing.Size(72, 26); + L_PlazaX.TabIndex = 115; + L_PlazaX.Text = "Plaza X:"; + L_PlazaX.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_PlazaX // - this.NUD_PlazaX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.NUD_PlazaX.Location = new System.Drawing.Point(128, 3); - this.NUD_PlazaX.Maximum = new decimal(new int[] { - 1024, - 0, - 0, - 0}); - this.NUD_PlazaX.Name = "NUD_PlazaX"; - this.NUD_PlazaX.Size = new System.Drawing.Size(39, 20); - this.NUD_PlazaX.TabIndex = 114; - this.NUD_PlazaX.Value = new decimal(new int[] { - 555, - 0, - 0, - 0}); - this.NUD_PlazaX.ValueChanged += new System.EventHandler(this.NUD_PlazaX_ValueChanged); + NUD_PlazaX.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + NUD_PlazaX.Location = new System.Drawing.Point(149, 4); + NUD_PlazaX.Margin = new System.Windows.Forms.Padding(4); + NUD_PlazaX.Maximum = new decimal(new int[] { 1024, 0, 0, 0 }); + NUD_PlazaX.Name = "NUD_PlazaX"; + NUD_PlazaX.Size = new System.Drawing.Size(46, 25); + NUD_PlazaX.TabIndex = 114; + NUD_PlazaX.Value = new decimal(new int[] { 555, 0, 0, 0 }); + NUD_PlazaX.ValueChanged += NUD_PlazaX_ValueChanged; // // L_PlazaY // - this.L_PlazaY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.L_PlazaY.Location = new System.Drawing.Point(65, 23); - this.L_PlazaY.Name = "L_PlazaY"; - this.L_PlazaY.Size = new System.Drawing.Size(62, 20); - this.L_PlazaY.TabIndex = 113; - this.L_PlazaY.Text = "Plaza Y:"; - this.L_PlazaY.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_PlazaY.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + L_PlazaY.Location = new System.Drawing.Point(76, 30); + L_PlazaY.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_PlazaY.Name = "L_PlazaY"; + L_PlazaY.Size = new System.Drawing.Size(72, 26); + L_PlazaY.TabIndex = 113; + L_PlazaY.Text = "Plaza Y:"; + L_PlazaY.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_PlazaY // - this.NUD_PlazaY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.NUD_PlazaY.Location = new System.Drawing.Point(128, 24); - this.NUD_PlazaY.Maximum = new decimal(new int[] { - 1024, - 0, - 0, - 0}); - this.NUD_PlazaY.Name = "NUD_PlazaY"; - this.NUD_PlazaY.Size = new System.Drawing.Size(39, 20); - this.NUD_PlazaY.TabIndex = 112; - this.NUD_PlazaY.Value = new decimal(new int[] { - 555, - 0, - 0, - 0}); - this.NUD_PlazaY.ValueChanged += new System.EventHandler(this.NUD_PlazaY_ValueChanged); + NUD_PlazaY.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + NUD_PlazaY.Location = new System.Drawing.Point(149, 31); + NUD_PlazaY.Margin = new System.Windows.Forms.Padding(4); + NUD_PlazaY.Maximum = new decimal(new int[] { 1024, 0, 0, 0 }); + NUD_PlazaY.Name = "NUD_PlazaY"; + NUD_PlazaY.Size = new System.Drawing.Size(46, 25); + NUD_PlazaY.TabIndex = 112; + NUD_PlazaY.Value = new decimal(new int[] { 555, 0, 0, 0 }); + NUD_PlazaY.ValueChanged += NUD_PlazaY_ValueChanged; // // B_Help // - this.B_Help.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.B_Help.Location = new System.Drawing.Point(126, 413); - this.B_Help.Name = "B_Help"; - this.B_Help.Size = new System.Drawing.Size(112, 40); - this.B_Help.TabIndex = 111; - this.B_Help.Text = "Help"; - this.B_Help.UseVisualStyleBackColor = true; - this.B_Help.Click += new System.EventHandler(this.B_Help_Click); + B_Help.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + B_Help.Location = new System.Drawing.Point(147, 540); + B_Help.Margin = new System.Windows.Forms.Padding(4); + B_Help.Name = "B_Help"; + B_Help.Size = new System.Drawing.Size(131, 52); + B_Help.TabIndex = 111; + B_Help.Text = "Help"; + B_Help.UseVisualStyleBackColor = true; + B_Help.Click += B_Help_Click; // // LB_Items // - this.LB_Items.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.LB_Items.FormattingEnabled = true; - this.LB_Items.Location = new System.Drawing.Point(6, 45); - this.LB_Items.Name = "LB_Items"; - this.LB_Items.Size = new System.Drawing.Size(232, 186); - this.LB_Items.TabIndex = 109; - this.LB_Items.SelectedIndexChanged += new System.EventHandler(this.LB_Items_SelectedIndexChanged); + LB_Items.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + LB_Items.FormattingEnabled = true; + LB_Items.Location = new System.Drawing.Point(7, 59); + LB_Items.Margin = new System.Windows.Forms.Padding(4); + LB_Items.Name = "LB_Items"; + LB_Items.Size = new System.Drawing.Size(270, 242); + LB_Items.TabIndex = 109; + LB_Items.SelectedIndexChanged += LB_Items_SelectedIndexChanged; // // Tab_Terrain // - this.Tab_Terrain.Controls.Add(this.B_TerrainBrush); - this.Tab_Terrain.Controls.Add(this.L_TerrainTileLabelTransparency); - this.Tab_Terrain.Controls.Add(this.TR_Terrain); - this.Tab_Terrain.Controls.Add(this.TR_BuildingTransparency); - this.Tab_Terrain.Controls.Add(this.L_BuildingTransparency); - this.Tab_Terrain.Controls.Add(this.PG_TerrainTile); - this.Tab_Terrain.Controls.Add(this.L_FieldItemTransparency); - this.Tab_Terrain.Controls.Add(this.TR_Transparency); - this.Tab_Terrain.Controls.Add(this.B_DumpLoadTerrain); - this.Tab_Terrain.Controls.Add(this.B_ModifyAllTerrain); - this.Tab_Terrain.Location = new System.Drawing.Point(4, 22); - this.Tab_Terrain.Name = "Tab_Terrain"; - this.Tab_Terrain.Size = new System.Drawing.Size(244, 458); - this.Tab_Terrain.TabIndex = 2; - this.Tab_Terrain.Text = "Terrain"; - this.Tab_Terrain.UseVisualStyleBackColor = true; + Tab_Terrain.Controls.Add(B_TerrainBrush); + Tab_Terrain.Controls.Add(L_TerrainTileLabelTransparency); + Tab_Terrain.Controls.Add(TR_Terrain); + Tab_Terrain.Controls.Add(TR_BuildingTransparency); + Tab_Terrain.Controls.Add(L_BuildingTransparency); + Tab_Terrain.Controls.Add(PG_TerrainTile); + Tab_Terrain.Controls.Add(L_FieldItemTransparency); + Tab_Terrain.Controls.Add(TR_Transparency); + Tab_Terrain.Controls.Add(B_DumpLoadTerrain); + Tab_Terrain.Controls.Add(B_ModifyAllTerrain); + Tab_Terrain.Location = new System.Drawing.Point(4, 26); + Tab_Terrain.Margin = new System.Windows.Forms.Padding(4); + Tab_Terrain.Name = "Tab_Terrain"; + Tab_Terrain.Size = new System.Drawing.Size(286, 603); + Tab_Terrain.TabIndex = 2; + Tab_Terrain.Text = "Terrain"; + Tab_Terrain.UseVisualStyleBackColor = true; // // B_TerrainBrush // - this.B_TerrainBrush.Location = new System.Drawing.Point(155, 413); - this.B_TerrainBrush.Name = "B_TerrainBrush"; - this.B_TerrainBrush.Size = new System.Drawing.Size(83, 40); - this.B_TerrainBrush.TabIndex = 48; - this.B_TerrainBrush.Text = "Terrain brushes"; - this.B_TerrainBrush.UseVisualStyleBackColor = true; - this.B_TerrainBrush.Click += new System.EventHandler(this.B_TerrainBrush_Click); + B_TerrainBrush.Location = new System.Drawing.Point(181, 540); + B_TerrainBrush.Margin = new System.Windows.Forms.Padding(4); + B_TerrainBrush.Name = "B_TerrainBrush"; + B_TerrainBrush.Size = new System.Drawing.Size(97, 52); + B_TerrainBrush.TabIndex = 48; + B_TerrainBrush.Text = "Terrain brushes"; + B_TerrainBrush.UseVisualStyleBackColor = true; + B_TerrainBrush.Click += B_TerrainBrush_Click; // // L_TerrainTileLabelTransparency // - this.L_TerrainTileLabelTransparency.AutoSize = true; - this.L_TerrainTileLabelTransparency.Location = new System.Drawing.Point(8, 272); - this.L_TerrainTileLabelTransparency.Name = "L_TerrainTileLabelTransparency"; - this.L_TerrainTileLabelTransparency.Size = new System.Drawing.Size(157, 13); - this.L_TerrainTileLabelTransparency.TabIndex = 46; - this.L_TerrainTileLabelTransparency.Text = "Terrain Tile Label Transparency"; + L_TerrainTileLabelTransparency.AutoSize = true; + L_TerrainTileLabelTransparency.Location = new System.Drawing.Point(9, 356); + L_TerrainTileLabelTransparency.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_TerrainTileLabelTransparency.Name = "L_TerrainTileLabelTransparency"; + L_TerrainTileLabelTransparency.Size = new System.Drawing.Size(188, 17); + L_TerrainTileLabelTransparency.TabIndex = 46; + L_TerrainTileLabelTransparency.Text = "Terrain Tile Label Transparency"; // // TR_Terrain // - this.TR_Terrain.AutoSize = false; - this.TR_Terrain.Location = new System.Drawing.Point(3, 285); - this.TR_Terrain.Maximum = 255; - this.TR_Terrain.Name = "TR_Terrain"; - this.TR_Terrain.Size = new System.Drawing.Size(237, 28); - this.TR_Terrain.TabIndex = 45; - this.TR_Terrain.TickFrequency = 32; - this.TR_Terrain.Scroll += new System.EventHandler(this.TR_Terrain_Scroll); + TR_Terrain.AutoSize = false; + TR_Terrain.Location = new System.Drawing.Point(4, 373); + TR_Terrain.Margin = new System.Windows.Forms.Padding(4); + TR_Terrain.Maximum = 255; + TR_Terrain.Name = "TR_Terrain"; + TR_Terrain.Size = new System.Drawing.Size(276, 37); + TR_Terrain.TabIndex = 45; + TR_Terrain.TickFrequency = 32; + TR_Terrain.Scroll += TR_Terrain_Scroll; // // TR_BuildingTransparency // - this.TR_BuildingTransparency.AutoSize = false; - this.TR_BuildingTransparency.Location = new System.Drawing.Point(3, 381); - this.TR_BuildingTransparency.Maximum = 255; - this.TR_BuildingTransparency.Name = "TR_BuildingTransparency"; - this.TR_BuildingTransparency.Size = new System.Drawing.Size(237, 28); - this.TR_BuildingTransparency.TabIndex = 43; - this.TR_BuildingTransparency.TickFrequency = 16; - this.TR_BuildingTransparency.Value = 255; - this.TR_BuildingTransparency.Scroll += new System.EventHandler(this.TR_BuildingTransparency_Scroll); + TR_BuildingTransparency.AutoSize = false; + TR_BuildingTransparency.Location = new System.Drawing.Point(4, 498); + TR_BuildingTransparency.Margin = new System.Windows.Forms.Padding(4); + TR_BuildingTransparency.Maximum = 255; + TR_BuildingTransparency.Name = "TR_BuildingTransparency"; + TR_BuildingTransparency.Size = new System.Drawing.Size(276, 37); + TR_BuildingTransparency.TabIndex = 43; + TR_BuildingTransparency.TickFrequency = 16; + TR_BuildingTransparency.Value = 255; + TR_BuildingTransparency.Scroll += TR_BuildingTransparency_Scroll; // // L_BuildingTransparency // - this.L_BuildingTransparency.AutoSize = true; - this.L_BuildingTransparency.Location = new System.Drawing.Point(8, 365); - this.L_BuildingTransparency.Name = "L_BuildingTransparency"; - this.L_BuildingTransparency.Size = new System.Drawing.Size(112, 13); - this.L_BuildingTransparency.TabIndex = 44; - this.L_BuildingTransparency.Text = "Building Transparency"; + L_BuildingTransparency.AutoSize = true; + L_BuildingTransparency.Location = new System.Drawing.Point(9, 477); + L_BuildingTransparency.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_BuildingTransparency.Name = "L_BuildingTransparency"; + L_BuildingTransparency.Size = new System.Drawing.Size(135, 17); + L_BuildingTransparency.TabIndex = 44; + L_BuildingTransparency.Text = "Building Transparency"; // // PG_TerrainTile // - this.PG_TerrainTile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.PG_TerrainTile.Location = new System.Drawing.Point(3, 3); - this.PG_TerrainTile.Name = "PG_TerrainTile"; - this.PG_TerrainTile.PropertySort = System.Windows.Forms.PropertySort.Categorized; - this.PG_TerrainTile.Size = new System.Drawing.Size(238, 266); - this.PG_TerrainTile.TabIndex = 41; - this.PG_TerrainTile.ToolbarVisible = false; + PG_TerrainTile.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + PG_TerrainTile.BackColor = System.Drawing.SystemColors.Control; + PG_TerrainTile.Location = new System.Drawing.Point(4, 4); + PG_TerrainTile.Margin = new System.Windows.Forms.Padding(4); + PG_TerrainTile.Name = "PG_TerrainTile"; + PG_TerrainTile.PropertySort = System.Windows.Forms.PropertySort.Categorized; + PG_TerrainTile.Size = new System.Drawing.Size(278, 348); + PG_TerrainTile.TabIndex = 41; + PG_TerrainTile.ToolbarVisible = false; // // L_FieldItemTransparency // - this.L_FieldItemTransparency.AutoSize = true; - this.L_FieldItemTransparency.Location = new System.Drawing.Point(8, 316); - this.L_FieldItemTransparency.Name = "L_FieldItemTransparency"; - this.L_FieldItemTransparency.Size = new System.Drawing.Size(120, 13); - this.L_FieldItemTransparency.TabIndex = 42; - this.L_FieldItemTransparency.Text = "Field Item Transparency"; + L_FieldItemTransparency.AutoSize = true; + L_FieldItemTransparency.Location = new System.Drawing.Point(9, 413); + L_FieldItemTransparency.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_FieldItemTransparency.Name = "L_FieldItemTransparency"; + L_FieldItemTransparency.Size = new System.Drawing.Size(145, 17); + L_FieldItemTransparency.TabIndex = 42; + L_FieldItemTransparency.Text = "Field Item Transparency"; // // B_DumpLoadTerrain // - this.B_DumpLoadTerrain.Location = new System.Drawing.Point(6, 413); - this.B_DumpLoadTerrain.Name = "B_DumpLoadTerrain"; - this.B_DumpLoadTerrain.Size = new System.Drawing.Size(49, 40); - this.B_DumpLoadTerrain.TabIndex = 40; - this.B_DumpLoadTerrain.Text = "Dump/Import"; - this.B_DumpLoadTerrain.UseVisualStyleBackColor = true; - this.B_DumpLoadTerrain.Click += new System.EventHandler(this.B_DumpLoadTerrain_Click); + B_DumpLoadTerrain.Location = new System.Drawing.Point(7, 540); + B_DumpLoadTerrain.Margin = new System.Windows.Forms.Padding(4); + B_DumpLoadTerrain.Name = "B_DumpLoadTerrain"; + B_DumpLoadTerrain.Size = new System.Drawing.Size(57, 52); + B_DumpLoadTerrain.TabIndex = 40; + B_DumpLoadTerrain.Text = "Dump/Import"; + B_DumpLoadTerrain.UseVisualStyleBackColor = true; + B_DumpLoadTerrain.Click += B_DumpLoadTerrain_Click; // // B_ModifyAllTerrain // - this.B_ModifyAllTerrain.Location = new System.Drawing.Point(60, 413); - this.B_ModifyAllTerrain.Name = "B_ModifyAllTerrain"; - this.B_ModifyAllTerrain.Size = new System.Drawing.Size(89, 40); - this.B_ModifyAllTerrain.TabIndex = 39; - this.B_ModifyAllTerrain.Text = "Modify All..."; - this.B_ModifyAllTerrain.UseVisualStyleBackColor = true; - this.B_ModifyAllTerrain.Click += new System.EventHandler(this.B_ModifyAllTerrain_Click); + B_ModifyAllTerrain.Location = new System.Drawing.Point(70, 540); + B_ModifyAllTerrain.Margin = new System.Windows.Forms.Padding(4); + B_ModifyAllTerrain.Name = "B_ModifyAllTerrain"; + B_ModifyAllTerrain.Size = new System.Drawing.Size(104, 52); + B_ModifyAllTerrain.TabIndex = 39; + B_ModifyAllTerrain.Text = "Modify All..."; + B_ModifyAllTerrain.UseVisualStyleBackColor = true; + B_ModifyAllTerrain.Click += B_ModifyAllTerrain_Click; // // Tab_Acres // - this.Tab_Acres.Controls.Add(this.NUD_MapAcreTemplateField); - this.Tab_Acres.Controls.Add(this.L_MapAcreTemplateField); - this.Tab_Acres.Controls.Add(this.L_MapAcreTemplateOutside); - this.Tab_Acres.Controls.Add(this.NUD_MapAcreTemplateOutside); - this.Tab_Acres.Controls.Add(this.CB_MapAcreSelect); - this.Tab_Acres.Controls.Add(this.B_DumpLoadAcres); - this.Tab_Acres.Controls.Add(this.L_MapAcre); - this.Tab_Acres.Controls.Add(this.CB_MapAcre); - this.Tab_Acres.Location = new System.Drawing.Point(4, 22); - this.Tab_Acres.Name = "Tab_Acres"; - this.Tab_Acres.Padding = new System.Windows.Forms.Padding(3); - this.Tab_Acres.Size = new System.Drawing.Size(244, 458); - this.Tab_Acres.TabIndex = 3; - this.Tab_Acres.Text = "Acres"; - this.Tab_Acres.UseVisualStyleBackColor = true; + Tab_Acres.Controls.Add(NUD_MapAcreTemplateField); + Tab_Acres.Controls.Add(L_MapAcreTemplateField); + Tab_Acres.Controls.Add(L_MapAcreTemplateOutside); + Tab_Acres.Controls.Add(NUD_MapAcreTemplateOutside); + Tab_Acres.Controls.Add(CB_MapAcreSelect); + Tab_Acres.Controls.Add(B_DumpLoadAcres); + Tab_Acres.Controls.Add(L_MapAcre); + Tab_Acres.Controls.Add(CB_MapAcre); + Tab_Acres.Location = new System.Drawing.Point(4, 26); + Tab_Acres.Margin = new System.Windows.Forms.Padding(4); + Tab_Acres.Name = "Tab_Acres"; + Tab_Acres.Padding = new System.Windows.Forms.Padding(4); + Tab_Acres.Size = new System.Drawing.Size(286, 603); + Tab_Acres.TabIndex = 3; + Tab_Acres.Text = "Acres"; + Tab_Acres.UseVisualStyleBackColor = true; // // NUD_MapAcreTemplateField // - this.NUD_MapAcreTemplateField.Location = new System.Drawing.Point(169, 352); - this.NUD_MapAcreTemplateField.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.NUD_MapAcreTemplateField.Name = "NUD_MapAcreTemplateField"; - this.NUD_MapAcreTemplateField.Size = new System.Drawing.Size(69, 20); - this.NUD_MapAcreTemplateField.TabIndex = 127; + NUD_MapAcreTemplateField.Location = new System.Drawing.Point(197, 460); + NUD_MapAcreTemplateField.Margin = new System.Windows.Forms.Padding(4); + NUD_MapAcreTemplateField.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_MapAcreTemplateField.Name = "NUD_MapAcreTemplateField"; + NUD_MapAcreTemplateField.Size = new System.Drawing.Size(80, 25); + NUD_MapAcreTemplateField.TabIndex = 127; // // L_MapAcreTemplateField // - this.L_MapAcreTemplateField.Location = new System.Drawing.Point(10, 351); - this.L_MapAcreTemplateField.Name = "L_MapAcreTemplateField"; - this.L_MapAcreTemplateField.Size = new System.Drawing.Size(154, 19); - this.L_MapAcreTemplateField.TabIndex = 126; - this.L_MapAcreTemplateField.Text = "Field Acre Template:"; - this.L_MapAcreTemplateField.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_MapAcreTemplateField.Location = new System.Drawing.Point(12, 459); + L_MapAcreTemplateField.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_MapAcreTemplateField.Name = "L_MapAcreTemplateField"; + L_MapAcreTemplateField.Size = new System.Drawing.Size(180, 25); + L_MapAcreTemplateField.TabIndex = 126; + L_MapAcreTemplateField.Text = "Field Acre Template:"; + L_MapAcreTemplateField.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // L_MapAcreTemplateOutside // - this.L_MapAcreTemplateOutside.Location = new System.Drawing.Point(10, 325); - this.L_MapAcreTemplateOutside.Name = "L_MapAcreTemplateOutside"; - this.L_MapAcreTemplateOutside.Size = new System.Drawing.Size(154, 19); - this.L_MapAcreTemplateOutside.TabIndex = 125; - this.L_MapAcreTemplateOutside.Text = "Outside Acre Template:"; - this.L_MapAcreTemplateOutside.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_MapAcreTemplateOutside.Location = new System.Drawing.Point(12, 425); + L_MapAcreTemplateOutside.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_MapAcreTemplateOutside.Name = "L_MapAcreTemplateOutside"; + L_MapAcreTemplateOutside.Size = new System.Drawing.Size(180, 25); + L_MapAcreTemplateOutside.TabIndex = 125; + L_MapAcreTemplateOutside.Text = "Outside Acre Template:"; + L_MapAcreTemplateOutside.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // NUD_MapAcreTemplateOutside // - this.NUD_MapAcreTemplateOutside.Location = new System.Drawing.Point(169, 327); - this.NUD_MapAcreTemplateOutside.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.NUD_MapAcreTemplateOutside.Name = "NUD_MapAcreTemplateOutside"; - this.NUD_MapAcreTemplateOutside.Size = new System.Drawing.Size(69, 20); - this.NUD_MapAcreTemplateOutside.TabIndex = 124; + NUD_MapAcreTemplateOutside.Location = new System.Drawing.Point(197, 428); + NUD_MapAcreTemplateOutside.Margin = new System.Windows.Forms.Padding(4); + NUD_MapAcreTemplateOutside.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_MapAcreTemplateOutside.Name = "NUD_MapAcreTemplateOutside"; + NUD_MapAcreTemplateOutside.Size = new System.Drawing.Size(80, 25); + NUD_MapAcreTemplateOutside.TabIndex = 124; // // CB_MapAcreSelect // - this.CB_MapAcreSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.CB_MapAcreSelect.FormattingEnabled = true; - this.CB_MapAcreSelect.Location = new System.Drawing.Point(9, 33); - this.CB_MapAcreSelect.Name = "CB_MapAcreSelect"; - this.CB_MapAcreSelect.Size = new System.Drawing.Size(213, 21); - this.CB_MapAcreSelect.TabIndex = 102; - this.CB_MapAcreSelect.SelectedValueChanged += new System.EventHandler(this.CB_MapAcreSelect_SelectedValueChanged); + CB_MapAcreSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + CB_MapAcreSelect.FormattingEnabled = true; + CB_MapAcreSelect.Location = new System.Drawing.Point(10, 43); + CB_MapAcreSelect.Margin = new System.Windows.Forms.Padding(4); + CB_MapAcreSelect.Name = "CB_MapAcreSelect"; + CB_MapAcreSelect.Size = new System.Drawing.Size(248, 25); + CB_MapAcreSelect.TabIndex = 102; + CB_MapAcreSelect.SelectedValueChanged += CB_MapAcreSelect_SelectedValueChanged; // // B_DumpLoadAcres // - this.B_DumpLoadAcres.ContextMenuStrip = this.CM_DLMapAcres; - this.B_DumpLoadAcres.Location = new System.Drawing.Point(6, 413); - this.B_DumpLoadAcres.Name = "B_DumpLoadAcres"; - this.B_DumpLoadAcres.Size = new System.Drawing.Size(112, 40); - this.B_DumpLoadAcres.TabIndex = 101; - this.B_DumpLoadAcres.Text = "Dump/Import"; - this.B_DumpLoadAcres.UseVisualStyleBackColor = true; - this.B_DumpLoadAcres.Click += new System.EventHandler(this.B_DumpLoadAcres_Click); + B_DumpLoadAcres.ContextMenuStrip = CM_DLMapAcres; + B_DumpLoadAcres.Location = new System.Drawing.Point(7, 540); + B_DumpLoadAcres.Margin = new System.Windows.Forms.Padding(4); + B_DumpLoadAcres.Name = "B_DumpLoadAcres"; + B_DumpLoadAcres.Size = new System.Drawing.Size(131, 52); + B_DumpLoadAcres.TabIndex = 101; + B_DumpLoadAcres.Text = "Dump/Import"; + B_DumpLoadAcres.UseVisualStyleBackColor = true; + B_DumpLoadAcres.Click += B_DumpLoadAcres_Click; // // CM_DLMapAcres // - this.CM_DLMapAcres.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.B_DumpMapAcres, - this.B_ImportMapAcres}); - this.CM_DLMapAcres.Name = "CM_Picture"; - this.CM_DLMapAcres.ShowImageMargin = false; - this.CM_DLMapAcres.Size = new System.Drawing.Size(145, 48); + CM_DLMapAcres.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { B_DumpMapAcres, B_ImportMapAcres }); + CM_DLMapAcres.Name = "CM_Picture"; + CM_DLMapAcres.ShowImageMargin = false; + CM_DLMapAcres.Size = new System.Drawing.Size(158, 48); // // B_DumpMapAcres // - this.B_DumpMapAcres.Name = "B_DumpMapAcres"; - this.B_DumpMapAcres.Size = new System.Drawing.Size(144, 22); - this.B_DumpMapAcres.Text = "Dump Map Acres"; - this.B_DumpMapAcres.Click += new System.EventHandler(this.B_DumpMapAcres_Click); + B_DumpMapAcres.Name = "B_DumpMapAcres"; + B_DumpMapAcres.Size = new System.Drawing.Size(157, 22); + B_DumpMapAcres.Text = "Dump Map Acres"; + B_DumpMapAcres.Click += B_DumpMapAcres_Click; // // B_ImportMapAcres // - this.B_ImportMapAcres.Name = "B_ImportMapAcres"; - this.B_ImportMapAcres.Size = new System.Drawing.Size(144, 22); - this.B_ImportMapAcres.Text = "Import Map Acres"; - this.B_ImportMapAcres.Click += new System.EventHandler(this.B_ImportMapAcres_Click); + B_ImportMapAcres.Name = "B_ImportMapAcres"; + B_ImportMapAcres.Size = new System.Drawing.Size(157, 22); + B_ImportMapAcres.Text = "Import Map Acres"; + B_ImportMapAcres.Click += B_ImportMapAcres_Click; // // L_MapAcre // - this.L_MapAcre.Location = new System.Drawing.Point(6, 6); - this.L_MapAcre.Name = "L_MapAcre"; - this.L_MapAcre.Size = new System.Drawing.Size(89, 19); - this.L_MapAcre.TabIndex = 99; - this.L_MapAcre.Text = "Acre:"; - this.L_MapAcre.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_MapAcre.Location = new System.Drawing.Point(7, 8); + L_MapAcre.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_MapAcre.Name = "L_MapAcre"; + L_MapAcre.Size = new System.Drawing.Size(104, 25); + L_MapAcre.TabIndex = 99; + L_MapAcre.Text = "Acre:"; + L_MapAcre.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // CB_MapAcre // - this.CB_MapAcre.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.CB_MapAcre.FormattingEnabled = true; - this.CB_MapAcre.Location = new System.Drawing.Point(101, 6); - this.CB_MapAcre.Name = "CB_MapAcre"; - this.CB_MapAcre.Size = new System.Drawing.Size(49, 21); - this.CB_MapAcre.TabIndex = 98; - this.CB_MapAcre.SelectedIndexChanged += new System.EventHandler(this.CB_MapAcre_SelectedIndexChanged); + CB_MapAcre.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + CB_MapAcre.FormattingEnabled = true; + CB_MapAcre.Location = new System.Drawing.Point(118, 8); + CB_MapAcre.Margin = new System.Windows.Forms.Padding(4); + CB_MapAcre.Name = "CB_MapAcre"; + CB_MapAcre.Size = new System.Drawing.Size(56, 25); + CB_MapAcre.TabIndex = 98; + CB_MapAcre.SelectedIndexChanged += CB_MapAcre_SelectedIndexChanged; // // CM_DLTerrain // - this.CM_DLTerrain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.B_DumpTerrainAcre, - this.B_DumpTerrainAll, - this.B_ImportTerrainAcre, - this.B_ImportTerrainAll}); - this.CM_DLTerrain.Name = "CM_Picture"; - this.CM_DLTerrain.ShowImageMargin = false; - this.CM_DLTerrain.Size = new System.Drawing.Size(135, 92); + CM_DLTerrain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { B_DumpTerrainAcre, B_DumpTerrainAll, B_ImportTerrainAcre, B_ImportTerrainAll }); + CM_DLTerrain.Name = "CM_Picture"; + CM_DLTerrain.ShowImageMargin = false; + CM_DLTerrain.Size = new System.Drawing.Size(145, 92); // // B_DumpTerrainAcre // - this.B_DumpTerrainAcre.Name = "B_DumpTerrainAcre"; - this.B_DumpTerrainAcre.Size = new System.Drawing.Size(134, 22); - this.B_DumpTerrainAcre.Text = "Dump Acre"; - this.B_DumpTerrainAcre.Click += new System.EventHandler(this.B_DumpTerrainAcre_Click); + B_DumpTerrainAcre.Name = "B_DumpTerrainAcre"; + B_DumpTerrainAcre.Size = new System.Drawing.Size(144, 22); + B_DumpTerrainAcre.Text = "Dump Acre"; + B_DumpTerrainAcre.Click += B_DumpTerrainAcre_Click; // // B_DumpTerrainAll // - this.B_DumpTerrainAll.Name = "B_DumpTerrainAll"; - this.B_DumpTerrainAll.Size = new System.Drawing.Size(134, 22); - this.B_DumpTerrainAll.Text = "Dump All Acres"; - this.B_DumpTerrainAll.Click += new System.EventHandler(this.B_DumpTerrainAll_Click); + B_DumpTerrainAll.Name = "B_DumpTerrainAll"; + B_DumpTerrainAll.Size = new System.Drawing.Size(144, 22); + B_DumpTerrainAll.Text = "Dump All Acres"; + B_DumpTerrainAll.Click += B_DumpTerrainAll_Click; // // B_ImportTerrainAcre // - this.B_ImportTerrainAcre.Name = "B_ImportTerrainAcre"; - this.B_ImportTerrainAcre.Size = new System.Drawing.Size(134, 22); - this.B_ImportTerrainAcre.Text = "Import Acre"; - this.B_ImportTerrainAcre.Click += new System.EventHandler(this.B_ImportTerrainAcre_Click); + B_ImportTerrainAcre.Name = "B_ImportTerrainAcre"; + B_ImportTerrainAcre.Size = new System.Drawing.Size(144, 22); + B_ImportTerrainAcre.Text = "Import Acre"; + B_ImportTerrainAcre.Click += B_ImportTerrainAcre_Click; // // B_ImportTerrainAll // - this.B_ImportTerrainAll.Name = "B_ImportTerrainAll"; - this.B_ImportTerrainAll.Size = new System.Drawing.Size(134, 22); - this.B_ImportTerrainAll.Text = "Import All Acres"; - this.B_ImportTerrainAll.Click += new System.EventHandler(this.B_ImportTerrainAll_Click); + B_ImportTerrainAll.Name = "B_ImportTerrainAll"; + B_ImportTerrainAll.Size = new System.Drawing.Size(144, 22); + B_ImportTerrainAll.Text = "Import All Acres"; + B_ImportTerrainAll.Click += B_ImportTerrainAll_Click; // // CM_Terrain // - this.CM_Terrain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.B_ZeroElevation, - this.B_SetAllTerrain, - this.B_SetAllRoadTiles, - this.B_ClearPlacedDesigns, - this.B_ImportPlacedDesigns, - this.B_ExportPlacedDesigns}); - this.CM_Terrain.Name = "CM_Picture"; - this.CM_Terrain.ShowImageMargin = false; - this.CM_Terrain.Size = new System.Drawing.Size(225, 136); + CM_Terrain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { B_ZeroElevation, B_SetAllTerrain, B_SetAllRoadTiles, B_ClearPlacedDesigns, B_ImportPlacedDesigns, B_ExportPlacedDesigns }); + CM_Terrain.Name = "CM_Picture"; + CM_Terrain.ShowImageMargin = false; + CM_Terrain.Size = new System.Drawing.Size(248, 136); // // B_ZeroElevation // - this.B_ZeroElevation.Name = "B_ZeroElevation"; - this.B_ZeroElevation.Size = new System.Drawing.Size(224, 22); - this.B_ZeroElevation.Text = "Zero Elevation"; - this.B_ZeroElevation.Click += new System.EventHandler(this.B_ZeroElevation_Click); + B_ZeroElevation.Name = "B_ZeroElevation"; + B_ZeroElevation.Size = new System.Drawing.Size(247, 22); + B_ZeroElevation.Text = "Zero Elevation"; + B_ZeroElevation.Click += B_ZeroElevation_Click; // // B_SetAllTerrain // - this.B_SetAllTerrain.Name = "B_SetAllTerrain"; - this.B_SetAllTerrain.Size = new System.Drawing.Size(224, 22); - this.B_SetAllTerrain.Text = "Set All Tiles using Tile from Editor"; - this.B_SetAllTerrain.Click += new System.EventHandler(this.B_SetAllTerrain_Click); + B_SetAllTerrain.Name = "B_SetAllTerrain"; + B_SetAllTerrain.Size = new System.Drawing.Size(247, 22); + B_SetAllTerrain.Text = "Set All Tiles using Tile from Editor"; + B_SetAllTerrain.Click += B_SetAllTerrain_Click; // // B_SetAllRoadTiles // - this.B_SetAllRoadTiles.Name = "B_SetAllRoadTiles"; - this.B_SetAllRoadTiles.Size = new System.Drawing.Size(224, 22); - this.B_SetAllRoadTiles.Text = "Set All Road Tiles from Editor"; - this.B_SetAllRoadTiles.Click += new System.EventHandler(this.B_SetAllRoadTiles_Click); + B_SetAllRoadTiles.Name = "B_SetAllRoadTiles"; + B_SetAllRoadTiles.Size = new System.Drawing.Size(247, 22); + B_SetAllRoadTiles.Text = "Set All Road Tiles from Editor"; + B_SetAllRoadTiles.Click += B_SetAllRoadTiles_Click; // // B_ClearPlacedDesigns // - this.B_ClearPlacedDesigns.Name = "B_ClearPlacedDesigns"; - this.B_ClearPlacedDesigns.Size = new System.Drawing.Size(224, 22); - this.B_ClearPlacedDesigns.Text = "Clear all Placed Designs"; - this.B_ClearPlacedDesigns.Click += new System.EventHandler(this.B_ClearPlacedDesigns_Click); + B_ClearPlacedDesigns.Name = "B_ClearPlacedDesigns"; + B_ClearPlacedDesigns.Size = new System.Drawing.Size(247, 22); + B_ClearPlacedDesigns.Text = "Clear all Placed Designs"; + B_ClearPlacedDesigns.Click += B_ClearPlacedDesigns_Click; // // B_ImportPlacedDesigns // - this.B_ImportPlacedDesigns.Name = "B_ImportPlacedDesigns"; - this.B_ImportPlacedDesigns.Size = new System.Drawing.Size(224, 22); - this.B_ImportPlacedDesigns.Text = "Import all Placed Design Choices"; - this.B_ImportPlacedDesigns.Click += new System.EventHandler(this.B_ImportPlacedDesigns_Click); + B_ImportPlacedDesigns.Name = "B_ImportPlacedDesigns"; + B_ImportPlacedDesigns.Size = new System.Drawing.Size(247, 22); + B_ImportPlacedDesigns.Text = "Import all Placed Design Choices"; + B_ImportPlacedDesigns.Click += B_ImportPlacedDesigns_Click; // // B_ExportPlacedDesigns // - this.B_ExportPlacedDesigns.Name = "B_ExportPlacedDesigns"; - this.B_ExportPlacedDesigns.Size = new System.Drawing.Size(224, 22); - this.B_ExportPlacedDesigns.Text = "Export all Placed Design Choices"; - this.B_ExportPlacedDesigns.Click += new System.EventHandler(this.B_ExportPlacedDesigns_Click); + B_ExportPlacedDesigns.Name = "B_ExportPlacedDesigns"; + B_ExportPlacedDesigns.Size = new System.Drawing.Size(247, 22); + B_ExportPlacedDesigns.Text = "Export all Placed Design Choices"; + B_ExportPlacedDesigns.Click += B_ExportPlacedDesigns_Click; // // RB_Item // - this.RB_Item.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; - this.RB_Item.Checked = true; - this.RB_Item.Location = new System.Drawing.Point(641, 299); - this.RB_Item.Name = "RB_Item"; - this.RB_Item.Size = new System.Drawing.Size(120, 20); - this.RB_Item.TabIndex = 43; - this.RB_Item.TabStop = true; - this.RB_Item.Text = "Items"; - this.RB_Item.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.RB_Item.UseVisualStyleBackColor = true; + RB_Item.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + RB_Item.Checked = true; + RB_Item.Location = new System.Drawing.Point(684, 375); + RB_Item.Margin = new System.Windows.Forms.Padding(4); + RB_Item.Name = "RB_Item"; + RB_Item.Size = new System.Drawing.Size(140, 26); + RB_Item.TabIndex = 43; + RB_Item.TabStop = true; + RB_Item.Text = "Items"; + RB_Item.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + RB_Item.UseVisualStyleBackColor = true; // // RB_Terrain // - this.RB_Terrain.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; - this.RB_Terrain.Location = new System.Drawing.Point(641, 282); - this.RB_Terrain.Name = "RB_Terrain"; - this.RB_Terrain.Size = new System.Drawing.Size(120, 20); - this.RB_Terrain.TabIndex = 44; - this.RB_Terrain.Text = "Terrain"; - this.RB_Terrain.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.RB_Terrain.UseVisualStyleBackColor = true; + RB_Terrain.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + RB_Terrain.Location = new System.Drawing.Point(684, 353); + RB_Terrain.Margin = new System.Windows.Forms.Padding(4); + RB_Terrain.Name = "RB_Terrain"; + RB_Terrain.Size = new System.Drawing.Size(140, 26); + RB_Terrain.TabIndex = 44; + RB_Terrain.Text = "Terrain"; + RB_Terrain.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + RB_Terrain.UseVisualStyleBackColor = true; // // L_TileMode // - this.L_TileMode.Location = new System.Drawing.Point(641, 259); - this.L_TileMode.Name = "L_TileMode"; - this.L_TileMode.Size = new System.Drawing.Size(120, 20); - this.L_TileMode.TabIndex = 45; - this.L_TileMode.Text = "Tile Editor Mode"; - this.L_TileMode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + L_TileMode.Location = new System.Drawing.Point(684, 323); + L_TileMode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_TileMode.Name = "L_TileMode"; + L_TileMode.Size = new System.Drawing.Size(140, 26); + L_TileMode.TabIndex = 45; + L_TileMode.Text = "Tile Editor Mode"; + L_TileMode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // CHK_RedirectExtensionLoad // - this.CHK_RedirectExtensionLoad.AutoSize = true; - this.CHK_RedirectExtensionLoad.Checked = true; - this.CHK_RedirectExtensionLoad.CheckState = System.Windows.Forms.CheckState.Checked; - this.CHK_RedirectExtensionLoad.Location = new System.Drawing.Point(535, 441); - this.CHK_RedirectExtensionLoad.Name = "CHK_RedirectExtensionLoad"; - this.CHK_RedirectExtensionLoad.Size = new System.Drawing.Size(173, 17); - this.CHK_RedirectExtensionLoad.TabIndex = 46; - this.CHK_RedirectExtensionLoad.Text = "View Root instead of Extension"; - this.CHK_RedirectExtensionLoad.UseVisualStyleBackColor = true; + CHK_RedirectExtensionLoad.AutoSize = true; + CHK_RedirectExtensionLoad.Checked = true; + CHK_RedirectExtensionLoad.CheckState = System.Windows.Forms.CheckState.Checked; + CHK_RedirectExtensionLoad.Location = new System.Drawing.Point(0, 63); + CHK_RedirectExtensionLoad.Margin = new System.Windows.Forms.Padding(0); + CHK_RedirectExtensionLoad.Name = "CHK_RedirectExtensionLoad"; + CHK_RedirectExtensionLoad.Size = new System.Drawing.Size(207, 21); + CHK_RedirectExtensionLoad.TabIndex = 46; + CHK_RedirectExtensionLoad.Text = "View Root instead of Extension"; + CHK_RedirectExtensionLoad.UseVisualStyleBackColor = true; // // CHK_MoveOnDrag // - this.CHK_MoveOnDrag.AutoSize = true; - this.CHK_MoveOnDrag.Checked = true; - this.CHK_MoveOnDrag.CheckState = System.Windows.Forms.CheckState.Checked; - this.CHK_MoveOnDrag.Location = new System.Drawing.Point(535, 423); - this.CHK_MoveOnDrag.Name = "CHK_MoveOnDrag"; - this.CHK_MoveOnDrag.Size = new System.Drawing.Size(204, 17); - this.CHK_MoveOnDrag.TabIndex = 46; - this.CHK_MoveOnDrag.Text = "Move Field Item Editor on mouse drag"; - this.CHK_MoveOnDrag.UseVisualStyleBackColor = true; + CHK_MoveOnDrag.AutoSize = true; + CHK_MoveOnDrag.Checked = true; + CHK_MoveOnDrag.CheckState = System.Windows.Forms.CheckState.Checked; + CHK_MoveOnDrag.Location = new System.Drawing.Point(0, 0); + CHK_MoveOnDrag.Margin = new System.Windows.Forms.Padding(0); + CHK_MoveOnDrag.Name = "CHK_MoveOnDrag"; + CHK_MoveOnDrag.Size = new System.Drawing.Size(253, 21); + CHK_MoveOnDrag.TabIndex = 46; + CHK_MoveOnDrag.Text = "Move Field Item Editor on mouse drag"; + CHK_MoveOnDrag.UseVisualStyleBackColor = true; // // CHK_FieldItemSnap // - this.CHK_FieldItemSnap.AutoSize = true; - this.CHK_FieldItemSnap.Checked = true; - this.CHK_FieldItemSnap.CheckState = System.Windows.Forms.CheckState.Checked; - this.CHK_FieldItemSnap.Location = new System.Drawing.Point(535, 496); - this.CHK_FieldItemSnap.Name = "CHK_FieldItemSnap"; - this.CHK_FieldItemSnap.Size = new System.Drawing.Size(172, 17); - this.CHK_FieldItemSnap.TabIndex = 47; - this.CHK_FieldItemSnap.Text = "Snap Field Items to Grid on Set"; - this.CHK_FieldItemSnap.UseVisualStyleBackColor = true; + CHK_FieldItemSnap.AutoSize = true; + CHK_FieldItemSnap.Checked = true; + CHK_FieldItemSnap.CheckState = System.Windows.Forms.CheckState.Checked; + CHK_FieldItemSnap.Location = new System.Drawing.Point(0, 84); + CHK_FieldItemSnap.Margin = new System.Windows.Forms.Padding(0); + CHK_FieldItemSnap.Name = "CHK_FieldItemSnap"; + CHK_FieldItemSnap.Size = new System.Drawing.Size(208, 21); + CHK_FieldItemSnap.TabIndex = 47; + CHK_FieldItemSnap.Text = "Snap Field Items to Grid on Set"; + CHK_FieldItemSnap.UseVisualStyleBackColor = true; + // + // flowLayoutPanel1 + // + flowLayoutPanel1.Controls.Add(CHK_MoveOnDrag); + flowLayoutPanel1.Controls.Add(CHK_NoOverwrite); + flowLayoutPanel1.Controls.Add(CHK_AutoExtension); + flowLayoutPanel1.Controls.Add(CHK_RedirectExtensionLoad); + flowLayoutPanel1.Controls.Add(CHK_FieldItemSnap); + flowLayoutPanel1.Location = new System.Drawing.Point(14, 537); + flowLayoutPanel1.Name = "flowLayoutPanel1"; + flowLayoutPanel1.Size = new System.Drawing.Size(269, 112); + flowLayoutPanel1.TabIndex = 48; + // + // L_Acre + // + L_Acre.Location = new System.Drawing.Point(657, 442); + L_Acre.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + L_Acre.Name = "L_Acre"; + L_Acre.Size = new System.Drawing.Size(104, 25); + L_Acre.TabIndex = 101; + L_Acre.Text = "Acre:"; + L_Acre.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // CB_Acre + // + CB_Acre.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + CB_Acre.FormattingEnabled = true; + CB_Acre.Location = new System.Drawing.Point(768, 442); + CB_Acre.Margin = new System.Windows.Forms.Padding(4); + CB_Acre.Name = "CB_Acre"; + CB_Acre.Size = new System.Drawing.Size(56, 25); + CB_Acre.TabIndex = 100; // // FieldItemEditor // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1027, 537); - this.Controls.Add(this.CHK_FieldItemSnap); - this.Controls.Add(this.CHK_RedirectExtensionLoad); - this.Controls.Add(this.CHK_MoveOnDrag); - this.Controls.Add(this.L_TileMode); - this.Controls.Add(this.RB_Terrain); - this.Controls.Add(this.RB_Item); - this.Controls.Add(this.TC_Editor); - this.Controls.Add(this.CHK_AutoExtension); - this.Controls.Add(this.CHK_NoOverwrite); - this.Controls.Add(this.PB_Acre); - this.Controls.Add(this.L_Layer); - this.Controls.Add(this.NUD_Layer); - this.Controls.Add(this.L_Coordinates); - this.Controls.Add(this.CHK_SnapToAcre); - this.Controls.Add(this.PB_Map); - this.Controls.Add(this.B_Down); - this.Controls.Add(this.B_Right); - this.Controls.Add(this.B_Left); - this.Controls.Add(this.B_Up); - this.Controls.Add(this.L_Acre); - this.Controls.Add(this.CB_Acre); - this.Controls.Add(this.B_Cancel); - this.Controls.Add(this.B_Save); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = global::NHSE.WinForms.Properties.Resources.icon; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FieldItemEditor"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Field Item Editor"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FieldItemEditor_FormClosed); - this.CM_Click.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.PB_Map)).EndInit(); - this.CM_Picture.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Layer)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.PB_Acre)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.TR_Transparency)).EndInit(); - this.CM_Remove.ResumeLayout(false); - this.TC_Editor.ResumeLayout(false); - this.Tab_Item.ResumeLayout(false); - this.Tab_Item.PerformLayout(); - this.CM_DLField.ResumeLayout(false); - this.Tab_Building.ResumeLayout(false); - this.CM_DLBuilding.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Bit)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_BuildingType)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_UniqueID)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_X)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_TypeArg)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Y)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Type)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_Angle)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_PlazaX)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_PlazaY)).EndInit(); - this.Tab_Terrain.ResumeLayout(false); - this.Tab_Terrain.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.TR_Terrain)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.TR_BuildingTransparency)).EndInit(); - this.Tab_Acres.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.NUD_MapAcreTemplateField)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NUD_MapAcreTemplateOutside)).EndInit(); - this.CM_DLMapAcres.ResumeLayout(false); - this.CM_DLTerrain.ResumeLayout(false); - this.CM_Terrain.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(1138, 702); + Controls.Add(L_Acre); + Controls.Add(CB_Acre); + Controls.Add(flowLayoutPanel1); + Controls.Add(L_TileMode); + Controls.Add(RB_Terrain); + Controls.Add(RB_Item); + Controls.Add(TC_Editor); + Controls.Add(PB_Acre); + Controls.Add(L_Layer); + Controls.Add(NUD_Layer); + Controls.Add(L_Coordinates); + Controls.Add(CHK_SnapToAcre); + Controls.Add(PB_Map); + Controls.Add(B_Down); + Controls.Add(B_Right); + Controls.Add(B_Left); + Controls.Add(B_Up); + Controls.Add(B_Cancel); + Controls.Add(B_Save); + FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + Icon = Properties.Resources.icon; + Margin = new System.Windows.Forms.Padding(4); + MaximizeBox = false; + MinimizeBox = false; + Name = "FieldItemEditor"; + StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + Text = "Field Item Editor"; + FormClosed += FieldItemEditor_FormClosed; + CM_Click.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)PB_Map).EndInit(); + CM_Picture.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)NUD_Layer).EndInit(); + ((System.ComponentModel.ISupportInitialize)PB_Acre).EndInit(); + ((System.ComponentModel.ISupportInitialize)TR_Transparency).EndInit(); + CM_Remove.ResumeLayout(false); + TC_Editor.ResumeLayout(false); + Tab_Item.ResumeLayout(false); + Tab_Item.PerformLayout(); + CM_DLField.ResumeLayout(false); + Tab_Building.ResumeLayout(false); + CM_DLBuilding.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)NUD_Bit).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_BuildingType).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_UniqueID).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_X).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_TypeArg).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_Y).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_Type).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_Angle).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_PlazaX).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_PlazaY).EndInit(); + Tab_Terrain.ResumeLayout(false); + Tab_Terrain.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)TR_Terrain).EndInit(); + ((System.ComponentModel.ISupportInitialize)TR_BuildingTransparency).EndInit(); + Tab_Acres.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)NUD_MapAcreTemplateField).EndInit(); + ((System.ComponentModel.ISupportInitialize)NUD_MapAcreTemplateOutside).EndInit(); + CM_DLMapAcres.ResumeLayout(false); + CM_DLTerrain.ResumeLayout(false); + CM_Terrain.ResumeLayout(false); + flowLayoutPanel1.ResumeLayout(false); + flowLayoutPanel1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); } @@ -1503,8 +1473,6 @@ private void InitializeComponent() private System.Windows.Forms.Button B_Cancel; private System.Windows.Forms.Button B_Save; - private System.Windows.Forms.ComboBox CB_Acre; - private System.Windows.Forms.Label L_Acre; private System.Windows.Forms.ContextMenuStrip CM_Click; private System.Windows.Forms.ToolStripMenuItem Menu_View; private System.Windows.Forms.ToolStripMenuItem Menu_Set; @@ -1624,5 +1592,8 @@ private void InitializeComponent() private System.Windows.Forms.Button B_TerrainBrush; private System.Windows.Forms.ToolStripMenuItem B_RemoveEditor; private System.Windows.Forms.ToolStripMenuItem Menu_Activate; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Label L_Acre; + private System.Windows.Forms.ComboBox CB_Acre; } } \ No newline at end of file diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs b/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs index 48cf3fd..456fd81 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.cs @@ -15,6 +15,7 @@ public sealed partial class FieldItemEditor : Form, IItemLayerEditor { private readonly MainSave SAV; private readonly MapEditor Editor; + private readonly MapRenderer Renderer; private MapViewState View => Editor.Mutator.View; private MapTileManager Map => Editor.Mutator.Manager; @@ -52,7 +53,7 @@ public FieldItemEditor(MainSave sav) IsExtendedMap30 = sav.FieldItemAcreWidth != 7; Editor = MapEditor.FromSaveFile(sav); Editor.MapScale = scale; - Editor.AcreScale = scale; + Editor.ViewScale = scale; Renderer = new MapRenderer(Editor); Loading = true; @@ -129,24 +130,22 @@ private void LoadItemGridAcre() private void ReloadMapBackground() { - var img = View.GetBackgroundTerrain(SelectedBuildingIndex); + var img = Renderer.GetBackgroundTerrain(SelectedBuildingIndex); SetMapBackgroundImage(img); } - private void ReloadMapItemGrid() => SetMapForegroundImage(View.GetMapWithReticle(GetItemTransparency())); + private void ReloadMapItemGrid() => SetMapForegroundImage(Renderer.GetMapWithReticle(GetItemTransparency())); private void SetMapBackgroundImage(Bitmap img) { if (IsExtendedMap30) - img = View.GetInflatedImage(img); + img = Renderer.GetInflatedImage(img); PB_Map.BackgroundImage = img; PB_Map.Invalidate(); // background image reassigning to same img doesn't redraw; force it } private void SetMapForegroundImage(Bitmap img) { - if (IsExtendedMap30) - img = View.GetInflatedImage(img); PB_Map.Image = img; } @@ -154,12 +153,12 @@ private void ReloadAcreBackground() { var tbuild = (byte)TR_BuildingTransparency.Value; var tterrain = (byte)TR_Terrain.Value; - var img = View.GetBackgroundAcre(L_Coordinates.Font, tbuild, tterrain, SelectedBuildingIndex); + var img = Renderer.GetBackgroundAcre(L_Coordinates.Font, tbuild, tterrain, SelectedBuildingIndex); PB_Acre.BackgroundImage = img; PB_Acre.Invalidate(); // background image reassigning to same img doesn't redraw; force it } - private void ReloadAcreItemGrid() => PB_Acre.Image = View.GetLayerAcre(GetItemTransparency()); + private void ReloadAcreItemGrid() => PB_Acre.Image = Renderer.GetLayerAcre(GetItemTransparency()); public void ReloadItems() { @@ -303,8 +302,8 @@ private void SetHoveredItem(MouseEventArgs e) private void GetAcreCoordinates(MouseEventArgs e, out int x, out int y) { - x = e.X / Editor.AcreScale; - y = e.Y / Editor.AcreScale; + x = e.X / Editor.ViewScale; + y = e.Y / Editor.ViewScale; } private void PB_Acre_MouseDown(object sender, MouseEventArgs e) => ResetDrag(); @@ -772,58 +771,30 @@ private void PB_Map_MouseDown(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Left) return; - ClickMapAt(e, true); + ClickMapAt(e); } - private void ClickMapAt(MouseEventArgs e, bool skipLagCheck) + private void ClickMapAt(MouseEventArgs e) { - var layer = Editor.Items.Layer0; - int mX = e.X; - int mY = e.Y; - bool centerReticle = CHK_SnapToAcre.Checked; - View.GetViewAnchorCoordinates(mX, mY, out var x, out var y, centerReticle); + var (x, y) = Editor.GetMapCoordinates(e.X, e.Y, CHK_SnapToAcre.Checked ? MapViewCoordinateRequest.SnapAcre : MapViewCoordinateRequest.Centered); + + // Truncate to root-node coordinates. The map is only 1px per tile, and nobody is wanting to click on extension-tiles. x &= 0xFFFE; y &= 0xFFFE; - var acre = layer.GetAcre(x, y); - bool sameAcre = AcreIndex == acre; - if (!skipLagCheck) - { - if (CHK_SnapToAcre.Checked) - { - if (sameAcre) - return; - } - else - { - const int delta = 0; // disabled = 0 - var dx = Math.Abs(View.X - x); - var dy = Math.Abs(View.Y - y); - if (dx <= delta && dy <= delta && !sameAcre) - return; - } - } - - if (!CHK_SnapToAcre.Checked) - { - if (View.SetViewTo(x, y)) - LoadItemGridAcre(); - return; - } - - if (!sameAcre) - CB_Acre.SelectedIndex = acre; + if (View.SetViewTo(x, y)) + LoadItemGridAcre(); } private void PB_Map_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - ClickMapAt(e, false); + ClickMapAt(e); } else if (e.Button == MouseButtons.None) { - View.GetCursorCoordinates(e.X, e.Y, out var x, out var y); + Editor.GetCursorCoordinates(e.X, e.Y, out var x, out var y); SetCoordinateText(x, y); } } diff --git a/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx b/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx index b5a05c3..08f9278 100644 --- a/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx +++ b/NHSE.WinForms/Subforms/Map/FieldItemEditor.resx @@ -1,17 +1,17 @@  - diff --git a/NHSE.WinForms/Subforms/Map/PlayerHouseEditor.cs b/NHSE.WinForms/Subforms/Map/PlayerHouseEditor.cs index 6d053ab..cfd6a3a 100644 --- a/NHSE.WinForms/Subforms/Map/PlayerHouseEditor.cs +++ b/NHSE.WinForms/Subforms/Map/PlayerHouseEditor.cs @@ -167,9 +167,10 @@ private void DrawRoom(LayerItem layer) var w = layer.TileInfo.TotalWidth; var h = layer.TileInfo.TotalHeight; Span scale1 = stackalloc int[w * h]; - int[] scaleX = new int[scale * scale * scale1.Length]; + var scaleX = new int[scale * scale * scale1.Length]; var bmp = new Bitmap(scale * w, scale * h); - PB_Room.Image = ItemLayerSprite.GetBitmapItemLayerViewGrid(layer, 0, 0, scale, scale1, scaleX, bmp, gridlineColor: 0x7F000000); + ItemLayerSprite.LoadItemLayerViewGrid(bmp, layer, 0, 0, scale1, scaleX, scale, gridlineColor: 0x7F000000); + PB_Room.Image = bmp; } private void NUD_Room_ValueChanged(object sender, EventArgs e) diff --git a/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs b/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs index 31cdb27..b7157ee 100644 --- a/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs +++ b/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs @@ -1,7 +1,7 @@ -using System.Linq; +using System; +using System.Linq; using System.Windows.Forms; using NHSE.Core; -using NHSE.Injection; namespace NHSE.WinForms; @@ -17,10 +17,10 @@ public SimpleHexEditor(byte[] originalBytes) Bytes = originalBytes; } - private void Update_Click(object sender, System.EventArgs e) + private void Update_Click(object sender, EventArgs e) { var bytestring = RTB_RAM.Text.Replace("\t", "").Replace(" ", "").Trim(); - Bytes = Decoder.StringToByteArray(bytestring); + Bytes = Convert.FromHexString(bytestring); DialogResult = DialogResult.OK; Close(); } diff --git a/NHSE.WinForms/Subforms/SysBot/SysBotController.cs b/NHSE.WinForms/Subforms/SysBot/SysBotController.cs index 687fb1c..266421f 100644 --- a/NHSE.WinForms/Subforms/SysBot/SysBotController.cs +++ b/NHSE.WinForms/Subforms/SysBot/SysBotController.cs @@ -8,10 +8,10 @@ namespace NHSE.WinForms; public sealed class SysBotController(InjectionType type) { public readonly SysBot Bot = new(); - private readonly Settings Settings = Settings.Default; + private readonly Settings _settings = Settings.Default; - public string IP => Settings.SysBotIP; - public string Port => Settings.SysBotPort.ToString(); + public string IP => _settings.SysBotIP; + public string Port => _settings.SysBotPort.ToString(); public bool Connect(string ip, string port) { @@ -28,35 +28,29 @@ public bool Connect(string ip, string port) return false; } - var settings = Settings; - settings.SysBotIP = ip; - settings.SysBotPort = p; - settings.Save(); + _settings.SysBotIP = ip; + _settings.SysBotPort = p; + _settings.Save(); return true; } - public uint GetDefaultOffset() + public uint GetDefaultOffset() => type switch { - var settings = Settings; - return type switch - { - InjectionType.Generic => settings.SysBotGenericOffset, - InjectionType.Pouch => settings.SysBotPouchOffset, - _ => throw new ArgumentOutOfRangeException() - }; - } + InjectionType.Generic => _settings.SysBotGenericOffset, + InjectionType.Pouch => _settings.SysBotPouchOffset, + _ => throw new ArgumentOutOfRangeException(nameof(type), type, null), + }; public void SetOffset(uint value) { - var settings = Settings; switch (type) { - case InjectionType.Generic: settings.SysBotGenericOffset = value; break; - case InjectionType.Pouch: settings.SysBotPouchOffset = value; break; + case InjectionType.Generic: _settings.SysBotGenericOffset = value; break; + case InjectionType.Pouch: _settings.SysBotPouchOffset = value; break; default: return; } - settings.Save(); + _settings.Save(); } public void HexEdit(uint offset, int length) @@ -84,12 +78,12 @@ public void HexEdit(uint offset, int length) public void PopPrompt() { - if (Settings.SysBotPrompted) + if (_settings.SysBotPrompted) return; WinFormsUtil.Alert(MessageStrings.MsgSysBotInfo, MessageStrings.MsgSysBotRequired); - Settings.SysBotPrompted = true; - Settings.Save(); + _settings.SysBotPrompted = true; + _settings.Save(); } public void WriteBytes(byte[] data, uint offset)