Skip to content

Commit

Permalink
ChatChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxoTrystan committed Jul 7, 2024
1 parent 90dfe8b commit 537a118
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Content.Client/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public void SendMessage(string text, ChatSelectChannel channel)
_consoleHost.ExecuteCommand($"me \"{CommandParsing.Escape(str)}\"");
break;

case ChatSelectChannel.Subtle: // Floofstation
_consoleHost.ExecuteCommand($"subtle \"{CommandParsing.Escape(str)}\"");
break;

case ChatSelectChannel.Dead:
if (_systems.GetEntitySystemOrNull<GhostSystem>() is {IsGhost: true})
goto case ChatSelectChannel.Local;
Expand Down Expand Up @@ -76,7 +80,7 @@ public void SendMessage(string text, ChatSelectChannel channel)
throw new ArgumentOutOfRangeException(nameof(channel), channel, null);
}
}
//Nyano - Summary: fires off the update permissions script.
//Nyano - Summary: fires off the update permissions script.
public void UpdatePermissions()
{
PermissionsUpdated?.Invoke();
Expand Down
4 changes: 4 additions & 0 deletions Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public sealed class ChatUIController : UIController
{SharedChatSystem.OOCPrefix, ChatSelectChannel.OOC},
{SharedChatSystem.EmotesPrefix, ChatSelectChannel.Emotes},
{SharedChatSystem.EmotesAltPrefix, ChatSelectChannel.Emotes},
{SharedChatSystem.SubtlePrefix, ChatSelectChannel.Subtle}, // Floofstation
{SharedChatSystem.AdminPrefix, ChatSelectChannel.Admin},
{SharedChatSystem.RadioCommonPrefix, ChatSelectChannel.Radio},
{SharedChatSystem.DeadPrefix, ChatSelectChannel.Dead},
Expand All @@ -92,6 +93,7 @@ public sealed class ChatUIController : UIController
{ChatSelectChannel.LOOC, SharedChatSystem.LOOCPrefix},
{ChatSelectChannel.OOC, SharedChatSystem.OOCPrefix},
{ChatSelectChannel.Emotes, SharedChatSystem.EmotesPrefix},
{ChatSelectChannel.Subtle, SharedChatSystem.SubtlePrefix}, // Floofstation
{ChatSelectChannel.Admin, SharedChatSystem.AdminPrefix},
{ChatSelectChannel.Radio, SharedChatSystem.RadioCommonPrefix},
{ChatSelectChannel.Dead, SharedChatSystem.DeadPrefix},
Expand Down Expand Up @@ -496,6 +498,7 @@ private void UpdateChannelPermissions()
FilterableChannels |= ChatChannel.Whisper;
FilterableChannels |= ChatChannel.Radio;
FilterableChannels |= ChatChannel.Emotes;
FilterableChannels |= ChatChannel.Subtle; // Floofstation
FilterableChannels |= ChatChannel.Notifications;

// Can only send local / radio / emote when attached to a non-ghost entity.
Expand All @@ -506,6 +509,7 @@ private void UpdateChannelPermissions()
CanSendChannels |= ChatSelectChannel.Whisper;
CanSendChannels |= ChatSelectChannel.Radio;
CanSendChannels |= ChatSelectChannel.Emotes;
CanSendChannels |= ChatSelectChannel.Subtle; // Floofstation
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public sealed class ChannelSelectorPopup : Popup
ChatSelectChannel.Local,
ChatSelectChannel.Whisper,
ChatSelectChannel.Emotes,
ChatSelectChannel.Subtle, // Floofstation
ChatSelectChannel.Radio,
ChatSelectChannel.Telepathic, //Nyano - Summary: determines the order in which telepathic shows.
ChatSelectChannel.Telepathic, //Nyano - Summary: determines the order in which telepathic shows.
ChatSelectChannel.LOOC,
ChatSelectChannel.OOC,
ChatSelectChannel.Dead,
Expand Down
9 changes: 7 additions & 2 deletions Content.Shared/Chat/ChatChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Content.Shared.Chat
/// Represents chat channels that the player can filter chat tabs by.
/// </summary>
[Flags]
public enum ChatChannel : ushort
public enum ChatChannel : UInt32
{
None = 0,

Expand Down Expand Up @@ -90,10 +90,15 @@ public enum ChatChannel : ushort
/// </summary>
Telepathic = 1 << 15,

/// <summary>
/// Subtle - Floofstation
/// </summary>
Subtle = 1 << 16,

/// <summary>
/// Channels considered to be IC.
/// </summary>
IC = Local | Whisper | Radio | Dead | Emotes | Damage | Visual | Telepathic | Notifications, //Nyano - Summary: Adds telepathic as an 'IC' labelled chat..
IC = Local | Whisper | Radio | Dead | Emotes | Subtle | Damage | Visual | Telepathic | Notifications, //Nyano - Summary: Adds telepathic as an 'IC' labelled chat..

AdminRelated = Admin | AdminAlert | AdminChat,
}
Expand Down
9 changes: 7 additions & 2 deletions Content.Shared/Chat/ChatSelectChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// Maps to <see cref="ChatChannel"/>, giving better names.
/// </remarks>
[Flags]
public enum ChatSelectChannel : ushort
public enum ChatSelectChannel : UInt32
{
None = 0,

Expand Down Expand Up @@ -41,6 +41,11 @@ public enum ChatSelectChannel : ushort
/// </summary>
Emotes = ChatChannel.Emotes,

/// <summary>
/// Subtle - Floofstation
/// </summary>
Subtle = ChatChannel.Subtle,

/// <summary>
/// Deadchat
/// </summary>
Expand All @@ -52,7 +57,7 @@ public enum ChatSelectChannel : ushort
Admin = ChatChannel.AdminChat,

/// <summary>
/// Nyano - Summary:. Telepathic channel for all psionic entities.
/// Nyano - Summary:. Telepathic channel for all psionic entities.
/// </summary>
Telepathic = ChatChannel.Telepathic,

Expand Down
3 changes: 2 additions & 1 deletion Content.Shared/Chat/SharedChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ public abstract class SharedChatSystem : EntitySystem
public const char OOCPrefix = '[';
public const char EmotesPrefix = '@';
public const char EmotesAltPrefix = '*';
public const char SubtlePrefix = '-';
public const char AdminPrefix = ']';
public const char WhisperPrefix = ',';
public const char TelepathicPrefix = '='; //Nyano - Summary: Adds the telepathic channel's prefix.
public const char TelepathicPrefix = '='; //Nyano - Summary: Adds the telepathic channel's prefix.
public const char DefaultChannelKey = 'h';

[ValidatePrototypeId<RadioChannelPrototype>]
Expand Down
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/Floof/chat/ui/chat-box.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hud-chatbox-channel-Subtle = Subtle
hud-chatbox-select-channel-Subtle = Subtle

0 comments on commit 537a118

Please sign in to comment.