Ship Building & Drydock
Made it possible to turn new hulls into drones which can then be outfitted and activated for service Missing blueprint ingredients no longer crash the game and gracefully log what's broken Loadout cargo is now stored entirely separate from gear
This commit is contained in:
parent
7b3c0cad64
commit
a901a8e829
17 changed files with 167 additions and 226 deletions
|
|
@ -140,6 +140,7 @@ public class ColonyTab : MonoBehaviour
|
|||
if (child)
|
||||
{
|
||||
panel.Title.text = entity.Name;
|
||||
panel.AddField("Active", () => entity.Active, active => entity.Active = active);
|
||||
panel.AddSection("General");
|
||||
panel.AddEntityProperties(entity);
|
||||
}
|
||||
|
|
@ -303,8 +304,17 @@ public class ColonyTab : MonoBehaviour
|
|||
}
|
||||
else if (data.clickCount == 2 && item is Gear gear)
|
||||
{
|
||||
// Equip Item
|
||||
entity.Equip(gear.ID, true);
|
||||
// Item is a hull, create a ship entity and make it a child
|
||||
if (gear.ItemData is HullData)
|
||||
{
|
||||
entity.RemoveCargo(gear);
|
||||
var ship = new Ship(Context, gear.ID, Enumerable.Empty<Guid>(), Enumerable.Empty<Guid>(), entity.Zone, entity.Corporation);
|
||||
ship.Name = gear.Name;
|
||||
_context.Cache.Add(ship);
|
||||
_context.SetParent(ship, entity);
|
||||
}
|
||||
else // Equip Item
|
||||
entity.Equip(gear.ID, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -341,7 +351,7 @@ public class ColonyTab : MonoBehaviour
|
|||
}
|
||||
else
|
||||
{
|
||||
var instanceList = panel.AddList(group.Key.Name);
|
||||
var instanceList = panel.AddList($"{group.Count().ToString()} {group.Key.Name}");
|
||||
foreach (var item in group)
|
||||
{
|
||||
var button = instanceList.AddProperty(item.Name, null, eventData => onClick(item, eventData), true).Button;
|
||||
|
|
|
|||
|
|
@ -440,6 +440,7 @@ public class PropertiesPanel : MonoBehaviour
|
|||
|
||||
public void AddEntityProperties(Entity entity)
|
||||
{
|
||||
AddField("Name", () => entity.Name, name => entity.Name = name);
|
||||
AddProperty("Capacity", () => $"{entity.OccupiedCapacity}/{entity.Capacity:0}");
|
||||
AddProperty("Mass", () => $"{entity.Mass.SignificantDigits(Context.GlobalData.SignificantDigits)}");
|
||||
AddProperty("Temperature", () => $"{entity.Temperature:0}°K");
|
||||
|
|
@ -508,6 +509,7 @@ public class PropertiesPanel : MonoBehaviour
|
|||
|
||||
void InspectChildrenInternal()
|
||||
{
|
||||
Clear();
|
||||
foreach (var child in entity.Children)
|
||||
{
|
||||
var childEntity = Context.Cache.Get<Entity>(child);
|
||||
|
|
|
|||
Loading…
Reference in a new issue