Skip to content

Commit

Permalink
Apply typing state to holopad
Browse files Browse the repository at this point in the history
  • Loading branch information
Morb0 committed Dec 25, 2024
1 parent 6106783 commit 78143b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Holopad/HolopadSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void OnTypingChanged(TypingChangedEvent ev, EntitySessionEventArgs args)
if (!HasComp<HolopadUserComponent>(uid))
return;

var netEv = new HolopadUserTypingChangedEvent(GetNetEntity(uid.Value), ev.IsTyping);
var netEv = new HolopadUserTypingChangedEvent(GetNetEntity(uid.Value), ev.State);
RaiseNetworkEvent(netEv);
}

Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Holopad/HolopadSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private void OnTypingChanged(HolopadUserTypingChangedEvent ev, EntitySessionEven
if (receiverHolopad.Comp.Hologram == null)
continue;

_appearanceSystem.SetData(receiverHolopad.Comp.Hologram.Value.Owner, TypingIndicatorVisuals.IsTyping, ev.IsTyping);
_appearanceSystem.SetData(receiverHolopad.Comp.Hologram.Value.Owner, TypingIndicatorVisuals.State, ev.TypingState);
}
}
}
Expand Down Expand Up @@ -577,7 +577,7 @@ private void UnlinkHolopadFromUser(Entity<HolopadComponent> entity, Entity<Holop
{
if (linkedHolopad.Comp.Hologram != null)
{
_appearanceSystem.SetData(linkedHolopad.Comp.Hologram.Value.Owner, TypingIndicatorVisuals.IsTyping, false);
_appearanceSystem.SetData(linkedHolopad.Comp.Hologram.Value.Owner, TypingIndicatorVisuals.State, false);

// Send message with no sprite data to the client
// This will set the holgram sprite to a generic icon
Expand Down
7 changes: 4 additions & 3 deletions Content.Shared/Holopad/HolopadUserComponent.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Chat.TypingIndicator;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;

Expand Down Expand Up @@ -57,12 +58,12 @@ public sealed class HolopadUserTypingChangedEvent : EntityEventArgs
/// <summary>
/// The typing indicator state
/// </summary>
public readonly bool IsTyping;
public readonly TypingIndicatorState TypingState;

public HolopadUserTypingChangedEvent(NetEntity user, bool isTyping)
public HolopadUserTypingChangedEvent(NetEntity user, TypingIndicatorState state)
{
User = user;
IsTyping = isTyping;
TypingState = state;
}
}

Expand Down

0 comments on commit 78143b1

Please sign in to comment.