Dice tweaks (#13514)

This commit is contained in:
Leon Friedrich
2023-01-21 12:51:26 +13:00
committed by GitHub
parent a0b6e052a1
commit 2904a368f7
92 changed files with 274 additions and 181 deletions

View File

@@ -0,0 +1,21 @@
using Content.Shared.Dice;
using Robust.Client.GameObjects;
namespace Content.Client.Dice;
public sealed class DiceSystem : SharedDiceSystem
{
protected override void UpdateVisuals(EntityUid uid, DiceComponent? die = null)
{
if (!Resolve(uid, ref die) || !TryComp(uid, out SpriteComponent? sprite))
return;
// TODO maybe just move each diue to its own RSI?
var state = sprite.LayerGetState(0).Name;
if (state == null)
return;
var prefix = state.Substring(0, state.IndexOf('_'));
sprite.LayerSetState(0, $"{prefix}_{die.CurrentValue}");
}
}