Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Feb 27, 2024
1 parent 6a2d27c commit 398f466
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 82 deletions.
33 changes: 0 additions & 33 deletions Content.Client/Backmen/Chat/ShadowkinChatUpdateSystem.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Content.Client/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ public void SendMessage(string text, ChatSelectChannel channel)
_consoleHost.ExecuteCommand($"tsay \"{CommandParsing.Escape(str)}\"");
break;

// Parkstation-Shadowkin chat start
case ChatSelectChannel.Empathy:
_consoleHost.ExecuteCommand($"esay \"{CommandParsing.Escape(str)}\"");
break;
// Parkstation-Shadowkin chat end

default:
throw new ArgumentOutOfRangeException(nameof(channel), channel, null);
}
Expand Down
13 changes: 0 additions & 13 deletions Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public sealed class ChatUIController : UIController
[UISystemDependency] private readonly TypingIndicatorSystem? _typingIndicator = default;
[UISystemDependency] private readonly ChatSystem? _chatSys = default;
[UISystemDependency] private readonly PsionicChatUpdateSystem? _psionic = default!; // backmen: psionic
[UISystemDependency] private readonly ShadowkinChatUpdateSystem? _shadowkin = default!; //backmen: shadowkin
[UISystemDependency] private readonly SharedTransformSystem? _xformSystem = default!;

[ValidatePrototypeId<ColorPalettePrototype>]
Expand Down Expand Up @@ -527,7 +526,6 @@ private void UpdateChannelPermissions()
FilterableChannels |= ChatChannel.AdminChat;
CanSendChannels |= ChatSelectChannel.Admin;
FilterableChannels |= ChatChannel.Telepathic;
FilterableChannels |= ChatChannel.Empathy;
}

// psionics
Expand All @@ -541,17 +539,6 @@ private void UpdateChannelPermissions()
FilterableChannels |= ChatChannel.Telepathic;
}

// Shadowkin
if (_shadowkin != null && _shadowkin.IsShadowkin)
{
FilterableChannels |= ChatChannel.Empathy;
CanSendChannels |= ChatSelectChannel.Empathy;
}
else if (_ghost is { IsGhost: true })
{
FilterableChannels |= ChatChannel.Empathy;
}

SelectableChannels = CanSendChannels;

// Necessary so that we always have a channel to fall back to.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Content.Server.CartridgeLoader;
using Content.Server.Chat.Managers;
using Content.Server.PDA.Ringer;
using Content.Server.Popups;
using Content.Shared.Backmen.CartridgeLoader.Cartridges;
using Content.Shared.Backmen.Economy;
using Content.Shared.CartridgeLoader;
using Content.Shared.Chat;
using Content.Shared.Popups;
using Content.Shared.Store;
using Robust.Server.Containers;
Expand All @@ -19,7 +21,7 @@ public sealed class BankCartridgeSystem : EntitySystem
[Dependency] private readonly CartridgeLoaderSystem? _cartridgeLoaderSystem = default!;
[Dependency] private readonly RingerSystem _ringerSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly IChatManager _chatManager = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -95,17 +97,17 @@ private void OnChangeBankBalance(EntityUid uid, BankAccountComponent component,

if (TryComp<RingerComponent>(parent, out var ringerComponent))
{
_ringerSystem.RingerPlayRingtone(parent, ringerComponent);
_ringerSystem.RingerPlayRingtone((parent, ringerComponent));
_cartridgeLoaderSystem?.UpdateCartridgeUiState(parent, new BankUiState(component.Balance));

var player = Transform(parent).ParentUid;
if (player.IsValid() && HasComp<ActorComponent>(player))
if (player.IsValid() && TryComp<ActorComponent>(player, out var actor))
{
var currencySymbol = "";
if (_prototypeManager.TryIndex(component.CurrencyType, out CurrencyPrototype? p))
currencySymbol = Loc.GetString(p.CurrencySymbol);

var change = (double)(args.ChangeAmount ?? 0);
var change = (double) (args.ChangeAmount ?? 0);
var changeAmount = $"{change}";
switch (change)
{
Expand All @@ -121,17 +123,27 @@ private void OnChangeBankBalance(EntityUid uid, BankAccountComponent component,
}
}

var wrappedMessage = Loc.GetString(
"bank-program-change-balance-notification",
("balance", component.Balance), ("change", changeAmount),
("currencySymbol", currencySymbol)
);

_popupSystem.PopupEntity(
Loc.GetString(
"bank-program-change-balance-notification",
("balance", component.Balance), ("change", changeAmount),
( "currencySymbol", currencySymbol )
),
wrappedMessage,
parent,
Filter.Entities(player),
true,
PopupType.Medium
);

_chatManager.ChatMessageToOne(
ChatChannel.Notifications,
wrappedMessage,
wrappedMessage,
EntityUid.Invalid,
false,
actor.PlayerSession.Channel);
}
}
//UpdateUiState(uid, parent, component);
Expand Down
6 changes: 4 additions & 2 deletions Content.Server/Backmen/Chat/SimpleStationChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Content.Server.Backmen.Chat;
/// <summary>
/// Extensions for parkstation's chat stuff
/// </summary>
/*
public sealed class SimpleStationChatSystem : EntitySystem
{
[Dependency] private readonly IAdminManager _adminManager = default!;
Expand Down Expand Up @@ -57,7 +58,8 @@ public void SendEmpathyChat(EntityUid source, string message, bool hideChat)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Empathy chat from {ToPrettyString(source):Player}: {message}");
_chatSystem.TrySendInGameICMessage(source, localMessage, InGameICChatType.Speak, hideChat);
_chatManager.ChatMessageToMany(ChatChannel.Empathy, message, messageWrap, source, hideChat, true, clients.ToList(), Color.PaleVioletRed);
_chatManager.ChatMessageToMany(ChatChannel.Empathy, message, adminMessageWrap, source, hideChat, true, admins, Color.PaleVioletRed);
//_chatManager.ChatMessageToMany(ChatChannel.Empathy, message, messageWrap, source, hideChat, true, clients.ToList(), Color.PaleVioletRed);
//_chatManager.ChatMessageToMany(ChatChannel.Empathy, message, adminMessageWrap, source, hideChat, true, admins, Color.PaleVioletRed);
}
}
*/

This file was deleted.

4 changes: 0 additions & 4 deletions Content.Shared/Chat/ChatChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ public enum ChatChannel : ushort
/// </summary>
Telepathic = 1 << 15,

/// <summary>
/// Empathy channel for Shadowkin.
/// </summary>
Empathy = 1 << 16,

/// <summary>
/// Channels considered to be IC.
Expand Down
5 changes: 0 additions & 5 deletions Content.Shared/Chat/ChatSelectChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public enum ChatSelectChannel : ushort
/// </summary>
Telepathic = ChatChannel.Telepathic,

/// <summary>
/// Empathy
/// </summary>
Empathy = ChatChannel.Empathy,

/// <summary>
/// Deadchat
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
Blunt: 2
Slash: 3
Piercing: 1
- type: EmpathyChat
#- type: EmpathyChat
- type: Shadowkin
- type: ShadowkinDarkSwapPower
- type: ShadowkinRestPower
Expand Down

0 comments on commit 398f466

Please sign in to comment.