mirror of
https://github.com/kwsch/NHSE.git
synced 2026-10-01 06:16:38 -05:00
Merge Field Item back into Item
Different means of expression for the 8 byte item structure's FreeParam Will be expanding the ItemEditor so that it has a checkmark to toggle Extension Item editing behavior. Removes IHeldItem as there's no need to abstract it.
This commit is contained in:
@@ -40,7 +40,7 @@ public FieldItemEditor(MainSave sav)
|
||||
LB_Items.Items.Add(obj.ToString());
|
||||
|
||||
ReloadMapBackground();
|
||||
PG_Tile.SelectedObject = new FieldItem();
|
||||
PG_Tile.SelectedObject = new Item();
|
||||
PG_TerrainTile.SelectedObject = new TerrainTile();
|
||||
LB_Items.SelectedIndex = 0;
|
||||
CB_Acre.SelectedIndex = 0;
|
||||
@@ -127,7 +127,7 @@ private void OmniTileTerrain(MouseEventArgs e)
|
||||
OmniTileTerrain(tile);
|
||||
}
|
||||
|
||||
private void OmniTile(FieldItem tile, int x, int y)
|
||||
private void OmniTile(Item tile, int x, int y)
|
||||
{
|
||||
switch (ModifierKeys)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ private void OmniTileTerrain(TerrainTile tile)
|
||||
}
|
||||
}
|
||||
|
||||
private FieldItem GetTile(FieldItemLayer layer, MouseEventArgs e, out int x, out int y)
|
||||
private Item GetTile(FieldItemLayer layer, MouseEventArgs e, out int x, out int y)
|
||||
{
|
||||
SetHoveredItem(e);
|
||||
return layer.GetTile(x = View.X + HoverX, y = View.Y + HoverY);
|
||||
@@ -185,9 +185,9 @@ private void PB_Acre_MouseMove(object sender, MouseEventArgs e)
|
||||
SetCoordinateText(x, y);
|
||||
}
|
||||
|
||||
private void ViewTile(FieldItem tile)
|
||||
private void ViewTile(Item tile)
|
||||
{
|
||||
var pgt = (FieldItem)PG_Tile.SelectedObject;
|
||||
var pgt = (Item)PG_Tile.SelectedObject;
|
||||
pgt.CopyFrom(tile);
|
||||
PG_Tile.SelectedObject = pgt;
|
||||
TC_Editor.SelectedTab = Tab_Item;
|
||||
@@ -201,10 +201,10 @@ private void ViewTile(TerrainTile tile)
|
||||
TC_Editor.SelectedTab = Tab_Terrain;
|
||||
}
|
||||
|
||||
private void SetTile(FieldItem tile, int x, int y)
|
||||
private void SetTile(Item tile, int x, int y)
|
||||
{
|
||||
var l = Map.CurrentLayer;
|
||||
var pgt = (FieldItem)PG_Tile.SelectedObject;
|
||||
var pgt = (Item)PG_Tile.SelectedObject;
|
||||
var permission = l.IsOccupied(pgt, x, y);
|
||||
switch (permission)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ private void SetTile(TerrainTile tile)
|
||||
ReloadBuildingsTerrain();
|
||||
}
|
||||
|
||||
private void DeleteTile(FieldItem tile, int x, int y)
|
||||
private void DeleteTile(Item tile, int x, int y)
|
||||
{
|
||||
if (tile.IsRoot && CHK_AutoExtension.Checked)
|
||||
Map.CurrentLayer.DeleteExtensionTiles(tile, x, y);
|
||||
|
||||
@@ -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 * FieldItem.SIZE;
|
||||
int expect = layer.AcreTileCount * 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 * FieldItem.SIZE;
|
||||
int expect = layer.MapTileCount * Item.SIZE;
|
||||
if (fi.Length != expect)
|
||||
{
|
||||
WinFormsUtil.Error(string.Format(MessageStrings.MsgDataSizeMismatchImport, fi.Length, expect));
|
||||
|
||||
Reference in New Issue
Block a user