Cut ambient runtime catalog lookup
This commit is contained in:
parent
e7d33e5e43
commit
b3e91999be
14 changed files with 79 additions and 46 deletions
|
|
@ -117,7 +117,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
_selectedPanel = panel;
|
||||
_selectedPosition = cargoEvent.CargoBay.Cargo[item];
|
||||
_selectedItem = item;
|
||||
_selectedItemData = item.Data.Value;
|
||||
_selectedItemData = GameManager.ItemManager.GetData(item);
|
||||
foreach (var v in _selectedItemData.Shape.Coordinates)
|
||||
{
|
||||
var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition;
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
//Debug.Log("Entity Pointer Enter");
|
||||
if (!(GameManager.DragObject is ItemDragObject itemDragObject)) return;
|
||||
var item = itemDragObject.Item;
|
||||
var itemData = item.Data.Value;
|
||||
var itemData = GameManager.ItemManager.GetData(item);
|
||||
if (!(item is EquippableItem equippableItem)) return;
|
||||
var placementPosition = v + itemDragObject.OriginCellOffset;
|
||||
if (entity.ItemFits(equippableItem, placementPosition))
|
||||
|
|
@ -586,7 +586,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
if (item != null)
|
||||
{
|
||||
var itemPosition = cargo.Cargo[item];
|
||||
var itemData = item.Data.Value;
|
||||
var itemData = GameManager.ItemManager.GetData(item);
|
||||
var originalOccupancy = cargo.Data.InteriorShape.Inset(itemData.Shape, itemPosition, item.Rotation);
|
||||
_dragCells = originalOccupancy.Coordinates
|
||||
.Select(v1 => Instantiate(CellInstances[v1], DragParent, true).transform).ToArray();
|
||||
|
|
@ -633,7 +633,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
//Debug.Log("Inventory Pointer Enter");
|
||||
if (!(GameManager.DragObject is ItemDragObject itemDragObject)) return;
|
||||
var item = itemDragObject.Item;
|
||||
var itemData = item.Data.Value;
|
||||
var itemData = GameManager.ItemManager.GetData(item);
|
||||
var placementPosition = v + itemDragObject.OriginCellOffset;
|
||||
if (cargo.ItemFits(item, placementPosition))
|
||||
{
|
||||
|
|
@ -851,7 +851,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
return Color.white * .25f;
|
||||
|
||||
var c = float3(1);
|
||||
if (item.Data.Value is EquippableItemData equippable)
|
||||
if (GameManager.ItemManager.GetData(item) is EquippableItemData equippable)
|
||||
c = HardpointData.GetColor(equippable.HardpointType);
|
||||
|
||||
if(!highlight)
|
||||
|
|
|
|||
|
|
@ -90,17 +90,17 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
Properties.AddProperty("Stars", () => starCount);
|
||||
|
||||
var stationCount = zone.PackedContents.Entities
|
||||
.Count(entity => ((HullData) entity.Hull.Data.Value).HullType == HullType.Station)
|
||||
.Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Station)
|
||||
.ToString();
|
||||
Properties.AddProperty("Stations", () => stationCount);
|
||||
|
||||
var turretCount = zone.PackedContents.Entities
|
||||
.Count(entity => ((HullData) entity.Hull.Data.Value).HullType == HullType.Turret)
|
||||
.Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Turret)
|
||||
.ToString();
|
||||
Properties.AddProperty("Turrets", () => turretCount);
|
||||
|
||||
var shipCount = zone.PackedContents.Entities
|
||||
.Count(entity => ((HullData) entity.Hull.Data.Value).HullType == HullType.Ship)
|
||||
.Count(entity => (GameManager.ItemManager.GetData(entity.Hull) as HullData).HullType == HullType.Ship)
|
||||
.ToString();
|
||||
Properties.AddProperty("Ships", () => shipCount);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ public class TradeMenu : MonoBehaviour
|
|||
data => data.Shape.Width*data.Shape.Height));
|
||||
|
||||
var items = Inventory.Cargo.Keys
|
||||
.Select<ItemInstance, (ItemInstance item, ItemData data)>(ii=>(ii, ii.Data.Value));
|
||||
.Select<ItemInstance, (ItemInstance item, ItemData data)>(ii=>(ii, GameManager.ItemManager.GetData(ii)));
|
||||
|
||||
if (MinimumSizeFilter.gameObject.activeSelf)
|
||||
items = items.Where(i =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue