Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
No [color] for discord (new-frontiers-14#2326)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 authored Oct 25, 2024
1 parent 27db1b9 commit 78644c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
18 changes: 9 additions & 9 deletions Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ protected override void AppendRoundEndText(EntityUid uid, AdventureRuleComponent
string summaryText;
if (profit < 0)
{
summaryText = Loc.GetString("adventure-mode-list-loss", ("amount", BankSystemExtensions.ToSpesoString(-profit)));
summaryText = Loc.GetString("adventure-list-loss", ("amount", BankSystemExtensions.ToSpesoString(-profit)));
}
else
{
summaryText = Loc.GetString("adventure-mode-list-profit", ("amount", BankSystemExtensions.ToSpesoString(profit)));
summaryText = Loc.GetString("adventure-list-profit", ("amount", BankSystemExtensions.ToSpesoString(profit)));
}
ev.AddLine($"- {playerInfo.Name} {summaryText}");
allScore.Add(new Tuple<string, int>(playerInfo.Name, profit));
Expand All @@ -136,28 +136,28 @@ protected override void AppendRoundEndText(EntityUid uid, AdventureRuleComponent
if (!(allScore.Count >= 1))
return;

var relayText = Loc.GetString("adventure-list-high");
var relayText = Loc.GetString("adventure-webhook-list-high");
relayText += '\n';
var highScore = allScore.OrderByDescending(h => h.Item2).ToList();

for (var i = 0; i < 10 && highScore.Count > 0; i++)
{
if (highScore.First().Item2 < 0)
break;
var profitText = Loc.GetString("adventure-mode-top-profit", ("amount", BankSystemExtensions.ToSpesoString(highScore.First().Item2)));
var profitText = Loc.GetString("adventure-webhook-top-profit", ("amount", BankSystemExtensions.ToSpesoString(highScore.First().Item2)));
relayText += $"{highScore.First().Item1} {profitText}";
relayText += '\n';
highScore.RemoveAt(0);
}
relayText += '\n'; // Extra line separating the
relayText += Loc.GetString("adventure-list-low");
relayText += '\n'; // Extra line separating the highest and lowest scores
relayText += Loc.GetString("adventure-webhook-list-low");
relayText += '\n';
highScore.Reverse();
for (var i = 0; i < 10 && highScore.Count > 0; i++)
{
if (highScore.First().Item2 > 0)
break;
var lossText = Loc.GetString("adventure-mode-top-loss", ("amount", BankSystemExtensions.ToSpesoString(-highScore.First().Item2)));
var lossText = Loc.GetString("adventure-webhook-top-loss", ("amount", BankSystemExtensions.ToSpesoString(-highScore.First().Item2)));
relayText += $"{highScore.First().Item1} {lossText}";
relayText += '\n';
highScore.RemoveAt(0);
Expand Down Expand Up @@ -535,7 +535,7 @@ private void AddStationCoordsToSet(Vector2 coords)
_stationCoords.Add(coords);
}

private async Task ReportRound(String message, int color = 0x77DDE7)
private async Task ReportRound(string message, int color = 0x77DDE7)
{
Logger.InfoS("discord", message);
String webhookUrl = _configurationManager.GetCVar(CCVars.DiscordLeaderboardWebhook);
Expand All @@ -548,7 +548,7 @@ private async Task ReportRound(String message, int color = 0x77DDE7)
{
new()
{
Title = Loc.GetString("adventure-list-start"),
Title = Loc.GetString("adventure-webhook-list-start"),
Description = message,
Color = color,
},
Expand Down
15 changes: 9 additions & 6 deletions Resources/Locale/en-US/_NF/adventure/adventure.ftl
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
## UI
adventure-list-start = [color=gold]NT Galactic Bank[/color]
adventure-mode-list-profit = made a total profit of [color=#d19e5e]{$amount}[/color].
adventure-mode-list-loss = lost a total of [color=#659cc9]{$amount}[/color].
adventure-mode-top-profit = made a total profit of {$amount}.
adventure-mode-top-loss = lost a total of {$amount}.
adventure-list-high = This Shift's Top Earners:
adventure-list-low = This Shift's Biggest Spenders:
adventure-list-profit = made a total profit of [color=#d19e5e]{$amount}[/color].
adventure-list-loss = lost a total of [color=#659cc9]{$amount}[/color].
adventure-webhook-list-start = NT Galactic Bank
adventure-webhook-list-high = This Shift's Top Earners:
adventure-webhook-list-low = This Shift's Biggest Spenders:
adventure-webhook-top-profit = made a total profit of {$amount}.
adventure-webhook-top-loss = lost a total of {$amount}.
adventure-title = New Frontier Adventure Mode
adventure-description = Join a ship crew or buy your own and explore, research, salvage, or haul your way to riches!
currency = Spesos
Expand Down

0 comments on commit 78644c9

Please sign in to comment.