mirror of
https://github.com/kwsch/NHSE.git
synced 2026-07-17 16:59:53 -05:00
Show map viewport to indicate current acre
This commit is contained in:
parent
8b3c650eff
commit
e098f85afc
|
|
@ -44,12 +44,21 @@ private void LoadGrid(int index)
|
|||
RefreshTile(b, tile);
|
||||
}
|
||||
UpdateArrowVisibility(index);
|
||||
ReloadMap();
|
||||
}
|
||||
|
||||
private void ReloadMap()
|
||||
{
|
||||
var img = TerrainSprite.CreateMap(Terrain);
|
||||
PB_Map.Image = ImageUtil.ResizeImage(img, img.Width * 2, img.Height * 2);
|
||||
var map = ImageUtil.ResizeImage(img, img.Width * 2, img.Height * 2);
|
||||
|
||||
using var gfx = Graphics.FromImage(map);
|
||||
using var pen = new Pen(Color.Red);
|
||||
|
||||
var acre = Terrain.Acres[AcreIndex];
|
||||
gfx.DrawRectangle(pen, acre.X * TerrainManager.GridWidth * 2, acre.Y * TerrainManager.GridHeight * 2, TerrainManager.GridWidth * 2, TerrainManager.GridHeight * 2);
|
||||
|
||||
PB_Map.Image = map;
|
||||
}
|
||||
|
||||
private void UpdateArrowVisibility(int index)
|
||||
|
|
@ -246,7 +255,6 @@ private void B_ImportAcre_Click(object sender, EventArgs e)
|
|||
var data = File.ReadAllBytes(path);
|
||||
Terrain.ImportAcre(AcreIndex, data);
|
||||
LoadGrid(AcreIndex);
|
||||
ReloadMap();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
}
|
||||
|
||||
|
|
@ -273,7 +281,6 @@ private void B_ImportAllAcres_Click(object sender, EventArgs e)
|
|||
var data = File.ReadAllBytes(path);
|
||||
Terrain.ImportAllAcres(data);
|
||||
LoadGrid(AcreIndex);
|
||||
ReloadMap();
|
||||
System.Media.SystemSounds.Asterisk.Play();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user