Use runtime catalog for observed UI item metadata
This commit is contained in:
parent
96bed4ccef
commit
95e1b44dce
2 changed files with 18 additions and 3 deletions
|
|
@ -8134,7 +8134,11 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"ObservedAvailableEntities(",
|
||||
"TryGetObservedCurrentEntity(out var currentEntity)",
|
||||
"parentSnapshot.ChildEntityIndices",
|
||||
"TryGetObservedEntityFacade(childEntityIndex, out var entity)"
|
||||
"TryGetObservedEntityFacade(childEntityIndex, out var entity)",
|
||||
"FindTypedRuntimeItem(",
|
||||
"RuntimeCatalog?.FindItem(item?.ItemKey ?? \"\")",
|
||||
"var typedItem = FindTypedRuntimeItem(item?.EquippableItem)",
|
||||
"var targetHull = FindTypedRuntimeItem(target.Hull)"
|
||||
};
|
||||
|
||||
if (actionGameManager.Contains("_authoritativeDaemonEntities", StringComparison.Ordinal))
|
||||
|
|
@ -8143,6 +8147,12 @@ static void RequireMainMenuContinueRunState(string root)
|
|||
"Unity entity wrappers are observed daemon facades, not authoritative state; keep the daemon as authority.");
|
||||
}
|
||||
|
||||
if (actionGameManager.Contains("ItemManager.GetRuntimeItem", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"ActionGameManager still resolves item metadata through Unity ItemManager instead of the runtime catalog.");
|
||||
}
|
||||
|
||||
var missingGameplaySymbols = requiredGameplaySymbols
|
||||
.Where(symbol => !actionGameManager.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
|
|
|
|||
|
|
@ -920,6 +920,11 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
|
||||
private AetheriaRuntimeCatalogItem FindTypedActionBarItem(ItemInstance item)
|
||||
{
|
||||
return FindTypedRuntimeItem(item);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeCatalogItem FindTypedRuntimeItem(ItemInstance item)
|
||||
{
|
||||
return RuntimeCatalog?.FindItem(item?.ItemKey ?? "");
|
||||
}
|
||||
|
|
@ -3480,7 +3485,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
private bool HasArticulatedWeaponBehavior(EquippedItem item)
|
||||
{
|
||||
var typedItem = ItemManager.GetRuntimeItem(item.EquippableItem);
|
||||
var typedItem = FindTypedRuntimeItem(item?.EquippableItem);
|
||||
return typedItem?.BehaviorKinds.Any(ArticulatedWeaponBehaviorKinds.Contains) == true;
|
||||
}
|
||||
|
||||
|
|
@ -3622,7 +3627,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
var visibilityToTarget = GetObservedInfoGathered(target, CurrentEntity);
|
||||
TargetVisibilityFill.fillAmount = Mathf.Lerp(.25f, .75f, (targetInfoGathered - threshold) / (1 - threshold));
|
||||
VisibilityToTargetFill.fillAmount = Mathf.Lerp(.25f, .75f, visibilityToTarget / threshold);
|
||||
var targetHull = ItemManager.GetRuntimeItem(target.Hull);
|
||||
var targetHull = FindTypedRuntimeItem(target.Hull);
|
||||
var targetMaxDurability = targetHull?.Durability > 0
|
||||
? (float)targetHull.Durability
|
||||
: Math.Max(target.Hull.Durability, 1f);
|
||||
|
|
|
|||
Loading…
Reference in a new issue