Skip to content

Commit

Permalink
s (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg authored Oct 16, 2024
1 parent f23a37d commit 7749f00
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
27 changes: 13 additions & 14 deletions Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,7 @@ private void SendOOC(ICommonSession player, string message)
return;
}

Color? colorOverride = null;
var wrappedMessage = Loc.GetString("chat-manager-send-ooc-wrap-message", ("playerName",player.Name), ("message", FormattedMessage.EscapeText(message)));
if (_adminManager.HasAdminFlag(player, AdminFlags.Admin))
{
var prefs = _preferencesManager.GetPreferences(player.UserId);
colorOverride = prefs.AdminOOCColor;
}
if (_netConfigManager.GetClientCVar(player.Channel, CCVars.ShowOocPatronColor) && player.Channel.UserData.PatronTier is { } patron && PatronOocColors.TryGetValue(patron, out var patronColor))
{
wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", patronColor),("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
Expand All @@ -258,24 +252,29 @@ private void SendOOC(ICommonSession player, string message)
#if LPP_Sponsors // _LostParadise-Sponsors
if (_sponsorsManager.TryGetInfo(player.UserId, out var sponsorData) && sponsorData.OOCColor != null)
{
wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", sponsorData.OOCColor),("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", sponsorData.OOCColor), ("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
}
#endif

// c4llv07e fix admins OOC names {{
var adminData = _adminManager.GetAdminData(player);
if (adminData != null)
{
var title = adminData.Title ?? "Admin";
// We don't use admin color here because it will be overrided anyway
var prefs = _preferencesManager.GetPreferences(player.UserId);
wrappedMessage = Loc.GetString(
"chat-manager-send-ooc-admin-wrap-message", ("adminTitle", title), ("adminColor", prefs.AdminOOCColor), ("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
}

if (adminData != null && _sponsorsManager.TryGetInfo(player.UserId, out var sponsorData1) && sponsorData1.OOCColor != null)
{
var title = adminData.Title ?? "Admin";
var prefs = _preferencesManager.GetPreferences(player.UserId);
wrappedMessage = Loc.GetString(
"chat-manager-send-ooc-admin-wrap-message", ("adminTitle", title),
("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
"chat-manager-send-ooc-admin-sponsor-wrap-message", ("adminColor", prefs.AdminOOCColor), ("adminTitle", title), ("patronColor", sponsorData1.OOCColor), ("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
}
// c4llv07e }}
#endif

//TODO: player.Name color, this will need to change the structure of the MsgChatMessage
ChatMessageToAll(ChatChannel.OOC, message, wrappedMessage, EntityUid.Invalid, hideChat: false, recordReplay: true, colorOverride: colorOverride, author: player.UserId);
ChatMessageToAll(ChatChannel.OOC, message, wrappedMessage, EntityUid.Invalid, hideChat: false, recordReplay: true, author: player.UserId);
_mommiLink.SendOOCMessage(player.Name, message);
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"OOC from {player:Player}: {message}");
}
Expand Down
3 changes: 2 additions & 1 deletion Resources/Locale/ru-RU/_LostParadise/update20.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ department-CentralCommand = Центральное командование
reagent-name-red-bool = Ред Булеан
reagent-desc-red-bool = Окрыляет!
id-card-access-level-expeditor = Исследователь
chat-manager-send-ooc-admin-wrap-message = OOC: [bold]\[{ $adminTitle }\] { $playerName }:[/bold] { $message }
chat-manager-send-ooc-admin-wrap-message = OOC: [bold][color={ $adminColor }]\[{ $adminTitle }\][/color]{ $playerName }:[/bold] { $message }
chat-manager-send-ooc-admin-sponsor-wrap-message = OOC: [bold][color={ $adminColor }]\[{ $adminTitle }\][/color] [color={ $patronColor }]{ $playerName }:[/color][/bold] { $message }
ui-options-function-lpp-smart-equip-neck = Умная экипировка на шею
species-name-shark = Акулоид
reagent-effect-status-effect-Forceddead = Смерть
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Stations/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
- /Maps/Shuttles/cargo_core.yml
mining:
paths:
- /Maps/Shuttles/pathfinder.yml
- /Maps/Shuttles/mining.yml
ruins:
hide: true
nameGrid: true
Expand Down

0 comments on commit 7749f00

Please sign in to comment.