Add sensitive scaling for field item map

if ppl have something other than 100% scale somehow
Closes #248
This commit is contained in:
Kurt 2020-05-25 09:39:22 -07:00
parent 72312641a9
commit 25262478ae
3 changed files with 9 additions and 4 deletions

View File

@ -8,14 +8,18 @@ public class MapView
public readonly MapManager Map;
public int MapScale { get; } = 1;
public int AcreScale { get; } = 16;
public int AcreScale { get; }
public int TerrainScale => AcreScale * 2;
// Top Left Anchor Coordinates
public int X { get; set; }
public int Y { get; set; }
protected MapView(MapManager m) => Map = m;
protected MapView(MapManager m, int scale = 16)
{
AcreScale = scale;
Map = m;
}
public bool CanUp => Y != 0;
public bool CanDown => Y < Map.CurrentLayer.MaxHeight - Map.CurrentLayer.GridHeight;

View File

@ -20,7 +20,7 @@ public sealed class MapViewer : MapView, IDisposable
private readonly int[] PixelsBackgroundMapX;
private readonly Bitmap BackgroundMap;
public MapViewer(MapManager m) : base(m)
public MapViewer(MapManager m, int scale) : base(m)
{
var l1 = m.Items.Layer1;
PixelsItemAcre1 = new int[l1.GridWidth * l1.GridHeight];

View File

@ -32,9 +32,10 @@ public FieldItemEditor(MainSave sav)
InitializeComponent();
this.TranslateInterface(GameInfo.CurrentLanguage);
var scale = (PB_Acre.Width - 2) / 32;
SAV = sav;
Map = new MapManager(sav);
View = new MapViewer(Map);
View = new MapViewer(Map, scale);
Loading = true;