if (_protoManager.TryIndex(proto, out var loadProto))
{
- var ent = _entManager.System<LoadoutSystem>().GetFirstOrNull(loadProto);
+ var ent = loadProto.DummyEntity ?? _entManager.System<LoadoutSystem>().GetFirstOrNull(loadProto);
- if (ent != null)
- {
- _entity = _entManager.SpawnEntity(ent, MapCoordinates.Nullspace);
- Sprite.SetEntity(_entity);
+ if (ent == null)
+ return;
- var spriteTooltip = new Tooltip();
- spriteTooltip.SetMessage(FormattedMessage.FromUnformatted(_entManager.GetComponent<MetaDataComponent>(_entity.Value).EntityDescription));
- TooltipSupplier = _ => spriteTooltip;
- }
+ _entity = _entManager.SpawnEntity(ent, MapCoordinates.Nullspace);
+ Sprite.SetEntity(_entity);
+
+ var spriteTooltip = new Tooltip();
+ spriteTooltip.SetMessage(FormattedMessage.FromUnformatted(_entManager.GetComponent<MetaDataComponent>(_entity.Value).EntityDescription));
+
+ TooltipSupplier = _ => spriteTooltip;
}
}
public string GetName(LoadoutPrototype loadout)
{
+ if (loadout.DummyEntity is not null && _protoMan.TryIndex<EntityPrototype>(loadout.DummyEntity, out var proto))
+ return proto.Name;
+
if (_protoMan.TryIndex(loadout.StartingGear, out var gear))
{
return GetName(gear);
* You can either use an existing StartingGearPrototype or specify it inline to avoid bloating yaml.
*/
+ /// <summary>
+ /// An entity whose sprite, name and description is used for display in the interface. If null, tries to get the proto of the item from gear (if it is a single item).
+ /// </summary>
+ [DataField]
+ public EntProtoId? DummyEntity;
+
[DataField]
public ProtoId<StartingGearPrototype>? StartingGear;
--- /dev/null
+- type: entity
+ id: LoadoutDummyCandles
+ categories: [ HideSpawnMenu ]
+ name: three candles
+ description: A set of three colorful candles for secret rituals!
+ components:
+ - type: Sprite
+ sprite: Objects/Misc/candles.rsi
+ state: loadout
\ No newline at end of file