Expose item identity on runtime instances
This commit is contained in:
parent
746c686150
commit
d163b3064c
17 changed files with 48 additions and 42 deletions
|
|
@ -150,7 +150,7 @@ public class ActionBarGearBinding : ActionBarBinding
|
|||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedGearItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.Data?.ItemId ?? Guid.Empty;
|
||||
var itemId = item?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
return new AetheriaRuntimeLoadoutItemCommit
|
||||
{
|
||||
ItemDefinitionLegacyId = item.Data?.ItemId.ToString("D") ?? "",
|
||||
ItemDefinitionLegacyId = item.ItemId == Guid.Empty ? "" : item.ItemId.ToString("D"),
|
||||
Quality = item is CraftedItemInstance crafted ? crafted.Quality : 1.0,
|
||||
Durability = item is EquippableItem equippable ? equippable.Durability : 1.0,
|
||||
Quantity = item is SimpleCommodity commodity ? commodity.Quantity : 1
|
||||
|
|
@ -453,7 +453,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
DirectionX = entity.Direction.x,
|
||||
DirectionY = entity.Direction.y,
|
||||
CorporationLegacyId = entity.Faction?.ID.ToString("D") ?? "",
|
||||
HullItemDefinitionLegacyId = entity.Hull?.Data?.ItemId.ToString("D") ?? "",
|
||||
HullItemDefinitionLegacyId = entity.Hull?.ItemId == Guid.Empty ? "" : entity.Hull.ItemId.ToString("D"),
|
||||
Equipment = ProjectEquippedSlots(entity.Equipment),
|
||||
CargoBays = ProjectEquippedSlots(entity.CargoBays),
|
||||
DockingBays = ProjectEquippedSlots(entity.DockingBays),
|
||||
|
|
@ -772,7 +772,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
AetheriaRuntimeCatalogItem FindTypedActionBarItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.Data?.ItemId ?? Guid.Empty;
|
||||
var itemId = item?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class EntityInstance : MonoBehaviour
|
|||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedHull(ItemInstance hull)
|
||||
{
|
||||
var itemId = hull?.Data?.ItemId ?? Guid.Empty;
|
||||
var itemId = hull?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public class ShipInstance : EntityInstance
|
|||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.Data?.ItemId ?? Guid.Empty;
|
||||
var itemId = item?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue