Route loadout restore through checkpoints

This commit is contained in:
Meta Vens 2026-06-16 03:18:55 +01:00
commit 8d802ce1e0
5 changed files with 99 additions and 11 deletions

View file

@ -198,16 +198,8 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
var price = blueprint.Price(GameManager.ItemManager);
return ($"{template.Name} - {price:n0}", () =>
{
var entity = EntityConstructionBlueprintProjector.InstantiateFromBlueprint(GameManager.ItemManager, GameManager.Zone, blueprint, true);
entity.SetParent(GameManager.DockedEntity);
GameManager.Credits -= price;
GameManager.CurrentEntity = entity;
if(entity is Ship ship)
{
ship.IsPlayerShip = true;
GameManager.DockingBay.DockedShip = ship;
}
Display(entity);
if (GameManager.CommitRuntimeLoadoutRestore(template, out var entity))
Display(entity);
}, price < GameManager.Credits);
}