Expose observed loadout templates as query
This commit is contained in:
parent
43c8c0ed76
commit
c664e963c8
3 changed files with 25 additions and 9 deletions
|
|
@ -4747,7 +4747,8 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"AetheriaRuntimeInventoryDropdownSurfaceBuilder.EntityEquipmentCommand(",
|
||||
"AetheriaRuntimeInventoryDropdownSurfaceBuilder.LoadoutCommand(",
|
||||
"GameManager.TryGetObservedDockingBay(out var dockingBay)",
|
||||
"GameManager.ObservedAvailableEntities()"
|
||||
"GameManager.ObservedAvailableEntities()",
|
||||
"GameManager.ObservedLoadoutTemplates()"
|
||||
};
|
||||
|
||||
var missingSymbols = requiredSymbols
|
||||
|
|
@ -4779,7 +4780,8 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"string.Equals(request.Command, AetheriaRuntimeInventoryDropdownSurfaceBuilder.Close",
|
||||
"_dropdownCommands.TryGetValue(request.Command",
|
||||
"GameManager.DockingBay",
|
||||
"GameManager.AvailableEntities()"
|
||||
"GameManager.AvailableEntities()",
|
||||
"GameManager.LoadoutTemplates"
|
||||
};
|
||||
|
||||
var hits = forbiddenSymbols
|
||||
|
|
@ -10470,6 +10472,14 @@ static void RequireInventoryLoadoutRestoreRequestAuthority(string root)
|
|||
throw new InvalidOperationException("InventoryPanel no longer routes loadout restore through ActionGameManager.");
|
||||
}
|
||||
|
||||
if (!actionGameManager.Contains("public IEnumerable<AetheriaRuntimeLoadoutTemplateSnapshot> ObservedLoadoutTemplates()", StringComparison.Ordinal) ||
|
||||
actionGameManager.Contains("public List<AetheriaRuntimeLoadoutTemplateSnapshot> LoadoutTemplates", StringComparison.Ordinal) ||
|
||||
inventoryPanel.Contains("GameManager.LoadoutTemplates", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"InventoryPanel must enumerate daemon-observed loadout templates through ActionGameManager.ObservedLoadoutTemplates().");
|
||||
}
|
||||
|
||||
if (actionGameManager.Contains("RequestRuntimeLoadoutRestore(AetheriaRuntimeLoadoutTemplateSnapshot template, out Entity", StringComparison.Ordinal) ||
|
||||
actionGameManager.Contains("public bool RequestRuntimeLoadoutRestore(", StringComparison.Ordinal) ||
|
||||
inventoryPanel.Contains("RequestRuntimeLoadoutRestore(template, out", StringComparison.Ordinal) ||
|
||||
|
|
|
|||
|
|
@ -224,11 +224,11 @@ public class ActionGameManager : MonoBehaviour
|
|||
try
|
||||
{
|
||||
var loadouts = AetheriaRuntimeStateReader.ReadLoadoutTemplates(stateFilePath);
|
||||
LoadoutTemplates.Clear();
|
||||
LoadoutTemplates.AddRange(loadouts);
|
||||
_observedLoadoutTemplates.Clear();
|
||||
_observedLoadoutTemplates.AddRange(loadouts);
|
||||
|
||||
if (LoadoutTemplates.Count > 0)
|
||||
Debug.Log($"Loaded {LoadoutTemplates.Count} Aetheria Verse loadout templates from typed state.");
|
||||
if (_observedLoadoutTemplates.Count > 0)
|
||||
Debug.Log($"Loaded {_observedLoadoutTemplates.Count} Aetheria Verse loadout templates from typed state.");
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
|
|
@ -473,6 +473,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
private List<ActionBarSlot> _actionBarSlots = new List<ActionBarSlot>();
|
||||
private List<InputAction> _actionBarActions = new List<InputAction>();
|
||||
private float _hitMarkerTime;
|
||||
private readonly List<AetheriaRuntimeLoadoutTemplateSnapshot> _observedLoadoutTemplates =
|
||||
new List<AetheriaRuntimeLoadoutTemplateSnapshot>();
|
||||
|
||||
public AetheriaInput Input { get; private set; }
|
||||
public EquippedDockingBay DockingBay { get; private set; }
|
||||
|
|
@ -534,7 +536,11 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
public ItemManager ItemManager { get; private set; }
|
||||
public Zone Zone { get; private set; }
|
||||
public List<AetheriaRuntimeLoadoutTemplateSnapshot> LoadoutTemplates { get; } = new List<AetheriaRuntimeLoadoutTemplateSnapshot>();
|
||||
|
||||
public IEnumerable<AetheriaRuntimeLoadoutTemplateSnapshot> ObservedLoadoutTemplates()
|
||||
{
|
||||
return _observedLoadoutTemplates;
|
||||
}
|
||||
|
||||
private readonly (float2 direction, string name)[] _directions = {
|
||||
(new float2(0, 1), "Front"),
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
};
|
||||
}
|
||||
|
||||
foreach (var loadoutEntry in GameManager.LoadoutTemplates.Select((template, templateIndex) => (template, templateIndex)))
|
||||
foreach (var loadoutEntry in GameManager.ObservedLoadoutTemplates().Select((template, templateIndex) => (template, templateIndex)))
|
||||
{
|
||||
var blueprint = GameManager.CreateEntityConstructionBlueprint(loadoutEntry.template);
|
||||
if (blueprint == null)
|
||||
|
|
@ -368,7 +368,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
AetheriaRuntimeInventoryDropdownSurfaceBuilder.SaveLoadout));
|
||||
}
|
||||
|
||||
foreach (var loadoutEntry in GameManager.LoadoutTemplates.Select((template, templateIndex) => (template, templateIndex)))
|
||||
foreach (var loadoutEntry in GameManager.ObservedLoadoutTemplates().Select((template, templateIndex) => (template, templateIndex)))
|
||||
{
|
||||
var restoreCommand = AetheriaRuntimeInventoryDropdownSurfaceBuilder.LoadoutCommand(loadoutEntry.templateIndex);
|
||||
var blueprint = GameManager.CreateEntityConstructionBlueprint(loadoutEntry.template);
|
||||
|
|
|
|||
Loading…
Reference in a new issue