Port fancy speech bubbles (#29349)

This commit is contained in:
lzk
2025-05-06 19:49:42 +02:00
committed by GitHub
parent a6f2172d05
commit 740ce0e8ad
26 changed files with 273 additions and 39 deletions

View File

@@ -45,7 +45,7 @@ public abstract class SharedTypingIndicatorSystem : EntitySystem
private void OnPlayerDetached(EntityUid uid, TypingIndicatorComponent component, PlayerDetachedEvent args)
{
// player left entity body - hide typing indicator
SetTypingIndicatorEnabled(uid, false);
SetTypingIndicatorState(uid, TypingIndicatorState.None);
}
private void OnGotEquipped(Entity<TypingIndicatorClothingComponent> entity, ref ClothingGotEquippedEvent args)
@@ -76,18 +76,18 @@ public abstract class SharedTypingIndicatorSystem : EntitySystem
if (!_actionBlocker.CanEmote(uid.Value) && !_actionBlocker.CanSpeak(uid.Value))
{
// nah, make sure that typing indicator is disabled
SetTypingIndicatorEnabled(uid.Value, false);
SetTypingIndicatorState(uid.Value, TypingIndicatorState.None);
return;
}
SetTypingIndicatorEnabled(uid.Value, ev.IsTyping);
SetTypingIndicatorState(uid.Value, ev.State);
}
private void SetTypingIndicatorEnabled(EntityUid uid, bool isEnabled, AppearanceComponent? appearance = null)
private void SetTypingIndicatorState(EntityUid uid, TypingIndicatorState state, AppearanceComponent? appearance = null)
{
if (!Resolve(uid, ref appearance, false))
return;
_appearance.SetData(uid, TypingIndicatorVisuals.IsTyping, isEnabled, appearance);
_appearance.SetData(uid, TypingIndicatorVisuals.State, state, appearance);
}
}