Resolve runtime catalog items by typed keys
This commit is contained in:
parent
d2996bc072
commit
4891c7fafc
14 changed files with 34 additions and 52 deletions
|
|
@ -169,10 +169,7 @@ public class ActionBarGearBinding : ActionBarBinding
|
|||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedGearItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
return ActionGameManager.RuntimeCatalog?.FindItem(item?.ItemKey ?? "");
|
||||
}
|
||||
|
||||
public override void Activate()
|
||||
|
|
|
|||
|
|
@ -249,8 +249,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
private ItemInstance CreateLoadoutItem(AetheriaRuntimeLoadoutItemSnapshot item)
|
||||
{
|
||||
var legacyId = ParseLegacyIdFromReferenceKey(item.ItemKey, "aetheria.item_definition");
|
||||
var typedItem = RuntimeCatalog?.FindItemByLegacyId(legacyId);
|
||||
var typedItem = RuntimeCatalog?.FindItem(item.ItemKey);
|
||||
if (typedItem == null)
|
||||
return null;
|
||||
|
||||
|
|
@ -1648,10 +1647,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
AetheriaRuntimeCatalogItem FindTypedActionBarItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
return RuntimeCatalog?.FindItem(item?.ItemKey ?? "");
|
||||
}
|
||||
|
||||
var bindings = RuntimePlayerSettings.InputSettings.ActionBarInputs.OrderBy(i => i)
|
||||
|
|
|
|||
|
|
@ -62,10 +62,7 @@ public class EntityInstance : MonoBehaviour
|
|||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedHull(ItemInstance hull)
|
||||
{
|
||||
var itemId = hull?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
return ActionGameManager.RuntimeCatalog?.FindItem(hull?.ItemKey ?? "");
|
||||
}
|
||||
|
||||
private static Shape ToShape(int width, int height, IReadOnlyList<AetheriaRuntimeShapeCell> cells)
|
||||
|
|
|
|||
|
|
@ -142,9 +142,6 @@ public class ShipInstance : EntityInstance
|
|||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
return ActionGameManager.RuntimeCatalog?.FindItem(item?.ItemKey ?? "");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue