Move catalog enum parsing onto typed items
This commit is contained in:
parent
1c269627c3
commit
b32a412df2
5 changed files with 136 additions and 43 deletions
|
|
@ -967,7 +967,7 @@ private void Update()
|
|||
return Color.white * .25f;
|
||||
|
||||
var c = float3(1);
|
||||
if (TryGetTypedHardpointType(item, out var typedHardpoint))
|
||||
if (FindTypedInventoryItem(item)?.TryGetHardpointType(out HardpointType typedHardpoint) == true)
|
||||
c = HardpointData.GetColor(typedHardpoint).ToUnityFloat3();
|
||||
|
||||
if(!highlight)
|
||||
|
|
@ -977,15 +977,6 @@ private void Update()
|
|||
}
|
||||
}
|
||||
|
||||
private bool TryGetTypedHardpointType(ItemInstance item, out HardpointType hardpointType)
|
||||
{
|
||||
hardpointType = HardpointType.Hull;
|
||||
var typedItem = FindTypedInventoryItem(item);
|
||||
return typedItem != null &&
|
||||
!string.IsNullOrWhiteSpace(typedItem.HardpointType) &&
|
||||
Enum.TryParse(typedItem.HardpointType, true, out hardpointType);
|
||||
}
|
||||
|
||||
private float GetMaxDurability(ItemInstance item)
|
||||
{
|
||||
var typedItem = FindTypedInventoryItem(item);
|
||||
|
|
|
|||
Loading…
Reference in a new issue