* Transform the Cloning Pod visualizer into a generic enum visualizer for simple cases like it ...I find it helpful at times like these to remind myself that our true enemy is code. Code is what makes our programs run and generally is required for all of these machinations to function in any way at all... * Give the kitchen/meat spike a visualizer * GenericEnumVisualizer: Byteify enums, switch to TryGetComponent for sprite
This commit is contained in:
@@ -55,10 +55,7 @@ namespace Content.Server.Kitchen.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Owner.TryGetComponent(out sprite))
|
||||
{
|
||||
sprite.LayerSetState(0, "spike");
|
||||
}
|
||||
UpdateAppearance();
|
||||
|
||||
eventArgs.User.PopupMessage(_meatSource0);
|
||||
}
|
||||
@@ -73,6 +70,14 @@ namespace Content.Server.Kitchen.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
private void UpdateAppearance()
|
||||
{
|
||||
if (Owner.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(KitchenSpikeVisuals.Status, (_meatParts > 0) ? KitchenSpikeStatus.Bloody : KitchenSpikeStatus.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private bool Spikeable(IEntity user, IEntity victim, [NotNullWhen(true)] out SharedButcherableComponent? butcherable)
|
||||
{
|
||||
butcherable = null;
|
||||
@@ -150,10 +155,7 @@ namespace Content.Server.Kitchen.Components
|
||||
_meatName = Loc.GetString("comp-kitchen-spike-meat-name", ("victim", victim));
|
||||
|
||||
// TODO: Visualizer
|
||||
if (Owner.TryGetComponent<SpriteComponent>(out var sprite))
|
||||
{
|
||||
sprite.LayerSetState(0, "spikebloody");
|
||||
}
|
||||
UpdateAppearance();
|
||||
|
||||
Owner.PopupMessageEveryone(Loc.GetString("comp-kitchen-spike-kill", ("user", user), ("victim", victim)));
|
||||
// TODO: Need to be able to leave them on the spike to do DoT, see ss13.
|
||||
|
||||
Reference in New Issue
Block a user