mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-25 07:37:02 -05:00
Fix HHP acres display in FieldItemEditor. (#607)
Co-authored-by: MyShiLingStar <MyShiLingStar@STARLIGHT>
This commit is contained in:
parent
f6756e9cb5
commit
8bf246aac9
|
|
@ -6,9 +6,9 @@ public static class AcreTileColor
|
|||
{
|
||||
public static readonly byte[] AcreTiles = ResourceUtil.GetBinaryResource("outside.bin");
|
||||
|
||||
public static int GetAcreTileColor(byte acre, int x, int y)
|
||||
public static int GetAcreTileColor(ushort acre, int x, int y)
|
||||
{
|
||||
if (acre > (byte)OutsideAcre.FldOutSBridge01)
|
||||
if (acre > (ushort)OutsideAcre.FldOutNGardenRFront00)
|
||||
return Color.Transparent.ToArgb();
|
||||
var baseOfs = acre * 32 * 32 * 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace NHSE.Core
|
||||
{
|
||||
|
|
@ -151,14 +152,14 @@ public int GetTileColor(int x, in int y)
|
|||
return TerrainTileColor.GetTileColor(tile).ToArgb();
|
||||
}
|
||||
|
||||
private byte GetTileAcre(int x, int y)
|
||||
private ushort GetTileAcre(int x, int y)
|
||||
{
|
||||
var acreX = 1 + (x / 16);
|
||||
var acreY = 1 + (y / 16);
|
||||
|
||||
var acreIndex = ((AcreWidth + 2) * acreY) + acreX;
|
||||
var ofs = acreIndex * 2;
|
||||
return BaseAcres[ofs]; // u16 array, never > 255
|
||||
return BitConverter.ToUInt16(BaseAcres, ofs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1011,7 +1011,9 @@ private void CB_MapAcreSelect_SelectedValueChanged(object sender, EventArgs e)
|
|||
var oldValue = Map.Terrain.BaseAcres[index * 2];
|
||||
if (value == oldValue)
|
||||
return;
|
||||
Map.Terrain.BaseAcres[index * 2] = (byte)value;
|
||||
byte[] ValueBytes = BitConverter.GetBytes(value);
|
||||
Map.Terrain.BaseAcres[index * 2] = ValueBytes[0];
|
||||
Map.Terrain.BaseAcres[index * 2 + 1] = ValueBytes[1];
|
||||
ReloadBuildingsTerrain();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user