mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-22 10:35:15 -05:00
Remove hardcoded map dimension properties
we can refer to MaxWidth/MaxHeight instead
This commit is contained in:
@@ -20,7 +20,7 @@ public static bool ImportToLayerAcreSingle(FieldItemLayer layer, int acreIndex,
|
||||
var path = ofd.FileName;
|
||||
var fi = new FileInfo(path);
|
||||
|
||||
int expect = layer.AcreTileCount * Item.SIZE;
|
||||
int expect = layer.GridTileCount * Item.SIZE;
|
||||
if (fi.Length != expect)
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expect));
|
||||
@@ -45,7 +45,7 @@ public static bool ImportToLayerAcreAll(FieldItemLayer layer)
|
||||
var path = ofd.FileName;
|
||||
var fi = new FileInfo(path);
|
||||
|
||||
int expect = layer.MapTileCount * Item.SIZE;
|
||||
int expect = layer.MaxTileCount * Item.SIZE;
|
||||
if (fi.Length != expect)
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expect));
|
||||
@@ -100,7 +100,7 @@ public static bool ImportTerrainAcre(TerrainLayer m, int acreIndex, string acre)
|
||||
var path = ofd.FileName;
|
||||
var fi = new FileInfo(path);
|
||||
|
||||
int expect = m.AcreTileCount * TerrainTile.SIZE;
|
||||
int expect = m.GridTileCount * TerrainTile.SIZE;
|
||||
if (fi.Length != expect)
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expect));
|
||||
@@ -125,7 +125,7 @@ public static bool ImportTerrainAll(TerrainLayer m)
|
||||
var path = ofd.FileName;
|
||||
var fi = new FileInfo(path);
|
||||
|
||||
int expect = m.MapTileCount * TerrainTile.SIZE;
|
||||
int expect = m.MaxTileCount * TerrainTile.SIZE;
|
||||
if (fi.Length != expect)
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expect));
|
||||
|
||||
Reference in New Issue
Block a user