Wait for daemon state after inventory requests
This commit is contained in:
parent
d9d2a1d3c4
commit
8848463b49
3 changed files with 19 additions and 8 deletions
|
|
@ -9532,6 +9532,15 @@ static void RequireInventoryLoadoutRestoreRequestAuthority(string root)
|
|||
{
|
||||
throw new InvalidOperationException("InventoryPanel no longer routes loadout restore through ActionGameManager.");
|
||||
}
|
||||
|
||||
if (actionGameManager.Contains("RequestRuntimeLoadoutRestore(AetheriaRuntimeLoadoutTemplateSnapshot template, out Entity", StringComparison.Ordinal) ||
|
||||
inventoryPanel.Contains("RequestRuntimeLoadoutRestore(template, out", StringComparison.Ordinal) ||
|
||||
inventoryPanel.Contains("RequestRuntimeLoadoutRestore(loadoutEntry.template, out", StringComparison.Ordinal) ||
|
||||
inventoryPanel.Contains("Display(entity)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Loadout restore is still pretending daemon submission synchronously yields the restored Unity entity.");
|
||||
}
|
||||
}
|
||||
|
||||
static void RequireDockedCurrentShipRequestAuthority(string root)
|
||||
|
|
@ -9607,6 +9616,12 @@ static void RequireDockedCurrentShipRequestAuthority(string root)
|
|||
{
|
||||
throw new InvalidOperationException("InventoryPanel no longer routes current-ship selection through ActionGameManager.");
|
||||
}
|
||||
|
||||
if (inventoryPanel.Contains("Current.targetGraphic.color = ToggleEnabledColor;", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"InventoryPanel still paints current-ship selection as accepted immediately after daemon submission.");
|
||||
}
|
||||
}
|
||||
|
||||
static IEnumerable<(string MethodName, int LineNumber, string Line)> FindMethodScopedLineHits(
|
||||
|
|
|
|||
|
|
@ -897,9 +897,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public bool RequestRuntimeLoadoutRestore(AetheriaRuntimeLoadoutTemplateSnapshot template, out Entity entity)
|
||||
public bool RequestRuntimeLoadoutRestore(AetheriaRuntimeLoadoutTemplateSnapshot template)
|
||||
{
|
||||
entity = null;
|
||||
var blueprint = CreateEntityConstructionBlueprint(template);
|
||||
if (blueprint == null ||
|
||||
Zone == null ||
|
||||
|
|
|
|||
|
|
@ -138,8 +138,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
{
|
||||
if(_displayedEntity is Ship ship)
|
||||
{
|
||||
if (GameManager.RequestDockedCurrentShip(ship))
|
||||
Current.targetGraphic.color = ToggleEnabledColor;
|
||||
GameManager.RequestDockedCurrentShip(ship);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -187,8 +186,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
var price = blueprint.Price(GameManager.ItemManager);
|
||||
return ($"{template.Name} - {price:n0}", () =>
|
||||
{
|
||||
if (GameManager.RequestRuntimeLoadoutRestore(template, out var entity) && entity != null)
|
||||
Display(entity);
|
||||
GameManager.RequestRuntimeLoadoutRestore(template);
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
|
@ -258,8 +256,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
var restoreCommand = AetheriaRuntimeInventoryDropdownSurfaceBuilder.LoadoutCommand(loadoutEntry.templateIndex);
|
||||
_dropdownCommands[restoreCommand] = () =>
|
||||
{
|
||||
if (GameManager.RequestRuntimeLoadoutRestore(loadoutEntry.template, out var entity) && entity != null)
|
||||
Display(entity);
|
||||
GameManager.RequestRuntimeLoadoutRestore(loadoutEntry.template);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue