Overhaul prefixes / message colors

This commit is contained in:
MSWS
2024-12-18 18:40:59 -08:00
parent a883d032c0
commit 92a163fa40
15 changed files with 106 additions and 114 deletions

View File

@@ -11,8 +11,7 @@ namespace Jailbreak.English.Generic;
public class GenericCmdLocale : IGenericCmdLocale,
ILanguage<Formatting.Languages.English> {
private static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.DarkRed}[{ChatColors.LightRed}JB{ChatColors.DarkRed}]") {
new HiddenFormatObject($" {ChatColors.LightBlue}Server>") {
// Hide in panorama and center text
Plain = false, Panorama = false, Chat = true
};
@@ -20,14 +19,14 @@ public class GenericCmdLocale : IGenericCmdLocale,
public IView PlayerNotFound(string query) {
return new SimpleView {
PREFIX,
$"{ChatColors.Red}Player '{ChatColors.LightBlue}{query}{ChatColors.Red}' not found."
$"Player '{ChatColors.BlueGrey}{query}{ChatColors.Grey}' not found."
};
}
public IView PlayerFoundMultiple(string query) {
return new SimpleView {
PREFIX,
$"{ChatColors.Red}Multiple players found for '{ChatColors.LightBlue}{query}{ChatColors.Red}'."
$"Multiple players found for '{ChatColors.BlueGrey}{query}{ChatColors.Grey}'."
};
}
@@ -35,31 +34,31 @@ public class GenericCmdLocale : IGenericCmdLocale,
var seconds = (int)(cooldownEndsAt - DateTime.Now).TotalSeconds;
return new SimpleView {
PREFIX,
$"{ChatColors.Grey}Command is on cooldown for",
"Command is on cooldown for",
seconds,
$"{ChatColors.Grey}second" + (seconds == 1 ? "" : "s") + "."
"second" + (seconds == 1 ? "" : "s") + "."
};
}
public IView InvalidParameter(string parameter, string expected) {
return new SimpleView {
PREFIX,
$"{ChatColors.Red}Invalid parameter '{ChatColors.LightBlue}{parameter}{ChatColors.Red}',",
$"Invalid parameter '{ChatColors.BlueGrey}{parameter}{ChatColors.Grey}',",
"expected a" + (expected[0].IsVowel() ? "n" : ""),
$"{ChatColors.White}{expected}{ChatColors.Red}."
$"{ChatColors.BlueGrey}{expected}{ChatColors.Grey}."
};
}
public IView NoPermissionMessage(string permission) {
return new SimpleView {
PREFIX,
$"{ChatColors.DarkRed}This requires the {ChatColors.White}{permission}{ChatColors.Red} permission."
$"This requires the {ChatColors.BlueGrey}{permission}{ChatColors.Grey} permission."
};
}
public IView Error(string message) {
return new SimpleView {
PREFIX, $"{ChatColors.Red}An error occurred: {ChatColors.White}{message}"
PREFIX, $"An error occurred: {ChatColors.Red}{message}{ChatColors.Grey}."
};
}
}

View File

@@ -10,8 +10,7 @@ namespace Jailbreak.English.LastGuard;
public class LGLocale : ILGLocale, ILanguage<Formatting.Languages.English> {
private static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.DarkRed}[{ChatColors.LightRed}Last Guard{ChatColors.DarkRed}]") {
new HiddenFormatObject($" {ChatColors.LightBlue}Guard>") {
// Hide in panorama and center text
Plain = false, Panorama = false, Chat = true
};
@@ -21,12 +20,12 @@ public class LGLocale : ILGLocale, ILanguage<Formatting.Languages.English> {
return new SimpleView {
SimpleView.NEWLINE, {
PREFIX,
$"{ChatColors.Red}All Ts are rebels! {ChatColors.DarkRed}LAST GUARD{ChatColors.Red} must kill until two prisoners alive (LR)."
$"{ChatColors.Grey}All Ts are rebels! {ChatColors.DarkRed}LAST GUARD{ChatColors.Grey} must kill until two prisoners alive ({ChatColors.BlueGrey}LR{ChatColors.Grey})."
},
SimpleView.NEWLINE, {
PREFIX, lastGuard, ChatColors.Red + "has", ctHealth,
$"{ChatColors.Red}health and Ts have", tHealth,
$"{ChatColors.Red}health."
lastGuard, ChatColors.Grey + "has", ctHealth,
$"{ChatColors.Grey}health, Ts have", tHealth,
$"{ChatColors.Grey}health total."
}
};
}

View File

@@ -14,8 +14,7 @@ namespace Jailbreak.English.LastRequest;
public class LastRequestLocale : ILRLocale,
ILanguage<Formatting.Languages.English> {
public static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.Green}[{ChatColors.Lime}LR{ChatColors.Green}]") {
new HiddenFormatObject($" {ChatColors.LightBlue}LR>") {
// Hide in panorama and center text
Plain = false, Panorama = false, Chat = true
};
@@ -24,24 +23,19 @@ public class LastRequestLocale : ILRLocale,
return new SimpleView {
{
PREFIX,
$"Last Request activated. {ChatColors.Grey}Type {ChatColors.LightBlue}!lr{ChatColors.Grey} to start a last request."
$"Last Request activated. Type {ChatColors.BlueGrey}!lr{ChatColors.Grey} to start a last request."
}
};
}
public IView LastRequestDisabled() {
return new SimpleView {
{
PREFIX,
$"{ChatColors.Grey}Last Request {ChatColors.Red}disabled{ChatColors.Grey}."
}
{ PREFIX, $"Last Request {ChatColors.Red}disabled{ChatColors.Grey}." }
};
}
public IView LastRequestNotEnabled() {
return new SimpleView {
{ PREFIX, $"{ChatColors.Red}Last Request is not enabled." }
};
return new SimpleView { { PREFIX, $"Last Request is not enabled." } };
}
public IView InvalidLastRequest(string query) {
@@ -52,22 +46,16 @@ public class LastRequestLocale : ILRLocale,
return new SimpleView {
PREFIX,
lr.Prisoner,
ChatColors.Grey + "is starting a",
"is starting a",
ChatColors.White + lr.Type.ToFriendlyString(),
ChatColors.Grey + "LR against",
lr.Guard
"LR against",
lr.Guard,
"."
};
}
public IView AnnounceLastRequest(AbstractLastRequest lr) {
return new SimpleView {
PREFIX,
lr.Prisoner,
"is doing a",
lr.Type.ToFriendlyString(),
"Last Request against",
lr.Guard
};
return InformLastRequest(lr);
}
public IView LastRequestDecided(AbstractLastRequest lr, LRResult result) {
@@ -102,16 +90,16 @@ public class LastRequestLocale : ILRLocale,
public IView CannotLR(string reason) {
return new SimpleView {
PREFIX,
$"{ChatColors.Red}You cannot LR: {ChatColors.White + reason + ChatColors.Red}."
$"You cannot LR, {ChatColors.BlueGrey + reason + ChatColors.Grey}."
};
}
public IView CannotLR(CCSPlayerController player, string reason) {
return new SimpleView {
PREFIX,
ChatColors.Red + "You cannot LR",
"You cannot LR",
player,
": " + ChatColors.White + reason + ChatColors.Red + "."
", " + ChatColors.BlueGrey + reason + ChatColors.Red + "."
};
}

View File

@@ -10,15 +10,14 @@ namespace Jailbreak.English.Mute;
public class WardenPeaceLocale : IWardenPeaceLocale,
ILanguage<Formatting.Languages.English> {
private static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.DarkBlue}[{ChatColors.LightBlue}Voice{ChatColors.DarkBlue}]{ChatColors.Grey} ") {
new HiddenFormatObject($" {ChatColors.LightBlue}Voice>") {
Plain = false, Panorama = false, Chat = true
};
public IView PeaceEnactedByAdmin(int seconds) {
return new SimpleView {
PREFIX,
$"{ChatColors.Red}An admin {ChatColors.White}enacted peace for",
"An admin enacted peace for",
seconds,
"second" + (seconds == 1 ? "" : "s") + "."
};
@@ -26,10 +25,7 @@ public class WardenPeaceLocale : IWardenPeaceLocale,
public IView WardenEnactedPeace(int seconds) {
return new SimpleView {
PREFIX,
$"{ChatColors.Blue}The warden {ChatColors.White}enacted peace for",
seconds,
"seconds."
PREFIX, $"The warden enacted peace for", seconds, "seconds."
};
}
@@ -56,7 +52,7 @@ public class WardenPeaceLocale : IWardenPeaceLocale,
public IView MuteReminder
=> new SimpleView {
{ PREFIX, ChatColors.Red + "You are currently muted!" }
{ PREFIX, ChatColors.Red + "You are currently muted." }
};
public IView PeaceReminder
@@ -81,5 +77,5 @@ public class WardenPeaceLocale : IWardenPeaceLocale,
};
public IView PeaceActive
=> new SimpleView { { PREFIX, "Peace is currently active." } };
=> new SimpleView { PREFIX, "Peace is currently active." };
}

View File

@@ -1,4 +1,5 @@
using CounterStrikeSharp.API.Modules.Utils;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Utils;
using Jailbreak.Formatting.Base;
using Jailbreak.Formatting.Logistics;
using Jailbreak.Formatting.Views.RTD;
@@ -7,14 +8,12 @@ using Jailbreak.Public.Mod.RTD;
namespace Jailbreak.English.RTD;
public class RTDLocale : IRTDLocale, ILanguage<Formatting.Languages.English> {
public static readonly string PREFIX =
$" {ChatColors.Purple}[{ChatColors.LightPurple}RTD{ChatColors.Purple}]";
public static readonly string PREFIX = $" {ChatColors.LightBlue}RTD>";
public IView RewardSelected(IRTDReward reward) {
var view = new SimpleView {
PREFIX,
ChatColors.Grey + "You rolled " + ChatColors.White + reward.Name
+ ChatColors.Grey + "."
"You rolled " + ChatColors.BlueGrey + reward.Name + ChatColors.Grey + "."
};
if (reward.Description == null) return view;
@@ -29,19 +28,28 @@ public class RTDLocale : IRTDLocale, ILanguage<Formatting.Languages.English> {
public IView AlreadyRolled(IRTDReward reward) {
return new SimpleView {
PREFIX,
ChatColors.Red + "You already rolled " + ChatColors.DarkRed + reward.Name
+ ChatColors.Red + "."
"You already rolled " + ChatColors.Red + reward.Name + ChatColors.Grey
+ "."
};
}
public IView CannotRollYet() {
return new SimpleView {
PREFIX,
ChatColors.Red + "You can only roll when round ends or while dead."
PREFIX, "You can only roll when round ends or while dead."
};
}
public IView RollingDisabled() {
return new SimpleView { PREFIX, ChatColors.Red + "Rolling is disabled." };
return new SimpleView { PREFIX, "Rolling is disabled." };
}
public IView JackpotReward(CCSPlayerController winner, int credits) {
return new SimpleView {
PREFIX,
winner,
"won the jackpot of ",
credits,
" credits!"
};
}
}

View File

@@ -10,8 +10,7 @@ namespace Jailbreak.English.Rebel;
public class RebelLocale : IRebelLocale,
ILanguage<Formatting.Languages.English> {
public static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.DarkRed}[{ChatColors.LightRed}Rebel{ChatColors.DarkRed}]") {
new HiddenFormatObject($" {ChatColors.LightBlue}Game>") {
// Hide in panorama and center text
Plain = false, Panorama = false, Chat = true
};

View File

@@ -9,8 +9,7 @@ namespace Jailbreak.English.SpecialDay;
public class SDLocale : ISDLocale, ILanguage<Formatting.Languages.English> {
public static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.BlueGrey}[{ChatColors.Green}S{ChatColors.Blue}D{ChatColors.BlueGrey}]") {
new HiddenFormatObject($" {ChatColors.LightBlue}Game>") {
// Hide in panorama and center text
Plain = false, Panorama = false, Chat = true
};
@@ -18,16 +17,16 @@ public class SDLocale : ISDLocale, ILanguage<Formatting.Languages.English> {
public IView SpecialDayRunning(string name) {
return new SimpleView {
PREFIX,
ChatColors.Grey + "The current special day is",
ChatColors.Gold + name
"The current day is",
ChatColors.BlueGrey + name + ChatColors.Grey + "."
};
}
public IView InvalidSpecialDay(string name) {
return new SimpleView {
PREFIX,
ChatColors.DarkRed + name,
ChatColors.Red + "is not a valid special day."
ChatColors.Red + name,
ChatColors.Grey + "is not a valid special day."
};
}
@@ -46,7 +45,7 @@ public class SDLocale : ISDLocale, ILanguage<Formatting.Languages.English> {
PREFIX,
"You must start a special day within",
maxTime,
"second" + (maxTime == 1 ? "" : "s") + " of the round start."
"second" + (maxTime == 1 ? "" : "s") + " of round start."
};
}
}

View File

@@ -11,52 +11,50 @@ namespace Jailbreak.English.Warden;
public class WardenLocale : IWardenLocale,
ILanguage<Formatting.Languages.English> {
public static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.Green}[{ChatColors.Olive}WARDEN{ChatColors.Green}]") {
new HiddenFormatObject($" {ChatColors.LightBlue}Guard>") {
// Hide in panorama and center text
Plain = false, Panorama = false, Chat = true
};
public IView PickingShortly
=> new SimpleView {
{ PREFIX, $"{ChatColors.Grey}Picking a warden shortly..." },
{ PREFIX, $"Picking a warden shortly..." },
SimpleView.NEWLINE, {
PREFIX,
$"{ChatColors.Grey}To enter the warden queue, type {ChatColors.Blue}!warden{ChatColors.Grey} in chat."
$"To enter the queue, type {ChatColors.BlueGrey}!warden{ChatColors.Grey}."
}
};
public IView NoWardens
=> new SimpleView {
PREFIX,
$"No wardens in queue! The next player to run {ChatColors.Blue}!warden{ChatColors.White} will become a warden."
$"No wardens in queue. Next player to {ChatColors.BlueGrey}!warden{ChatColors.White} will become warden."
};
public IView WardenLeft
=> new SimpleView { PREFIX, "The warden has left the game." };
=> new SimpleView { PREFIX, "The warden left the game." };
public IView WardenDied
=> new SimpleView {
PREFIX,
$"{ChatColors.Red}The warden has {ChatColors.DarkRed}died{ChatColors.Red}! CTs must pursue {ChatColors.Blue}!warden{ChatColors.Red}."
$"The warden {ChatColors.Red}died{ChatColors.Grey}. CTs must pursue {ChatColors.BlueGrey}!warden{ChatColors.Grey}."
};
public IView BecomeNextWarden
=> new SimpleView {
PREFIX,
$"{ChatColors.Grey}Type {ChatColors.Blue}!warden{ChatColors.Grey} to become the next warden"
$"Type {ChatColors.BlueGrey}!warden{ChatColors.Grey} to become the warden."
};
public IView JoinRaffle
=> new SimpleView {
PREFIX,
$"{ChatColors.Grey}You've {ChatColors.Green}joined {ChatColors.Grey}the warden raffle."
$"You {ChatColors.White}joined {ChatColors.Grey}the warden raffle."
};
public IView LeaveRaffle
=> new SimpleView {
PREFIX,
$"{ChatColors.Grey}You've {ChatColors.Red}left {ChatColors.Grey}the warden raffle."
PREFIX, $"You {ChatColors.Red}left {ChatColors.Grey}the warden raffle."
};
public IView NotWarden
@@ -66,15 +64,15 @@ public class WardenLocale : IWardenLocale,
public IView FireCommandFailed
=> new SimpleView {
PREFIX, "The fire command has failed to work for some unknown reason..."
PREFIX, "The fire command failed for some unknown reason..."
};
public IView PassWarden(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "resigned from being warden." };
return new SimpleView { PREFIX, player, "resigned from warden." };
}
public IView FireWarden(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "was fired from being warden." };
return new SimpleView { PREFIX, player, "was fired from warden." };
}
public IView
@@ -84,12 +82,12 @@ public class WardenLocale : IWardenLocale,
admin,
"fired",
player,
"from being warden."
"from warden."
};
}
public IView NewWarden(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "is now the warden!" };
return new SimpleView { PREFIX, player, "is now the warden." };
}
public IView CurrentWarden(CCSPlayerController? player) {

View File

@@ -29,9 +29,9 @@ public class MuteSystem(IServiceProvider provider)
public void PeaceMute(MuteReason reason) {
var duration = getPeaceDuration(reason);
var ctDuration = Math.Min(10, duration);
foreach (var player in Utilities.GetPlayers())
if (!warden!.IsWarden(player))
mute(player);
foreach (var player in Utilities.GetPlayers()
.Where(player => !warden!.IsWarden(player)))
mute(player);
switch (reason) {
case MuteReason.ADMIN:
@@ -101,7 +101,7 @@ public class MuteSystem(IServiceProvider provider)
}))
unmute(player);
messages!.UnmutedGuards.ToAllChat();
if (guardTimer != null) messages!.UnmutedGuards.ToAllChat();
guardTimer = null;
}
@@ -110,7 +110,7 @@ public class MuteSystem(IServiceProvider provider)
.Where(player => player is { Team: CsTeam.Terrorist, PawnIsAlive: true }))
unmute(player);
messages!.UnmutedPrisoners.ToAllChat();
if (prisonerTimer != null) messages!.UnmutedPrisoners.ToAllChat();
prisonerTimer = null;
}

View File

@@ -7,6 +7,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\lang\Jailbreak.English\Jailbreak.English.csproj" />
<ProjectReference Include="..\..\public\Jailbreak.Formatting\Jailbreak.Formatting.csproj"/>
<ProjectReference Include="..\..\public\Jailbreak.Public\Jailbreak.Public.csproj"/>
<ProjectReference Include="..\..\public\Jailbreak.Validator\Jailbreak.Validator.csproj"/>

View File

@@ -2,6 +2,7 @@
using System.Drawing;
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Utils;
using Jailbreak.Formatting.Views.RTD;
using Jailbreak.Public.Behaviors;
using Jailbreak.Public.Mod.Rebel;
using Jailbreak.Public.Mod.RTD;
@@ -12,7 +13,8 @@ using Jailbreak.RTD.Rewards;
namespace Jailbreak.RTD;
public class RewardGenerator(IZoneManager mgr, IC4Service bomb,
IWardenSelectionService warden) : IPluginBehavior, IRewardGenerator {
IWardenSelectionService warden, IRTDLocale locale)
: IPluginBehavior, IRewardGenerator {
private const float PROB_LOTTERY = 1 / 3000f;
private const float PROB_EXTREMELY_LOW = 1 / 800f;
private const float PROB_VERY_LOW = 1 / 100f;
@@ -32,18 +34,19 @@ public class RewardGenerator(IZoneManager mgr, IC4Service bomb,
rewards.AddRange([
// Very often
(new NothingReward(), PROB_VERY_OFTEN),
(new CreditReward(1), PROB_VERY_OFTEN),
(new CreditReward(-1), PROB_VERY_OFTEN),
(new CreditReward(1, locale), PROB_VERY_OFTEN),
(new CreditReward(-1, locale), PROB_VERY_OFTEN),
// Often
(new WeaponReward("weapon_healthshot"), PROB_OFTEN),
(new WeaponReward("weapon_decoy"), PROB_OFTEN),
(new HPReward(110), PROB_OFTEN), (new ArmorReward(15), PROB_OFTEN),
(new CreditReward(-10), PROB_VERY_OFTEN),
(new CreditReward(-10, locale), PROB_VERY_OFTEN),
// Medium
(new CreditReward(1), PROB_MEDIUM), (new CreditReward(2), PROB_MEDIUM),
(new CreditReward(3), PROB_MEDIUM),
(new CreditReward(1, locale), PROB_MEDIUM),
(new CreditReward(2, locale), PROB_MEDIUM),
(new CreditReward(3, locale), PROB_MEDIUM),
(new WeaponReward("weapon_flashbang"), PROB_MEDIUM),
(new WeaponReward("weapon_hegrenade"), PROB_MEDIUM),
(new WeaponReward("weapon_smokegrenade"), PROB_MEDIUM),
@@ -53,7 +56,7 @@ public class RewardGenerator(IZoneManager mgr, IC4Service bomb,
(new ArmorReward(150), PROB_MEDIUM),
(new GuaranteedWardenReward(warden), PROB_MEDIUM),
(new WeaponReward("weapon_g3sg1", CsTeam.CounterTerrorist), PROB_MEDIUM),
(new CreditReward(5), PROB_MEDIUM),
(new CreditReward(5, locale), PROB_MEDIUM),
// Low
(new ChatSpyReward(basePlugin), PROB_LOW),
@@ -67,7 +70,7 @@ public class RewardGenerator(IZoneManager mgr, IC4Service bomb,
(new AmmoWeaponReward("weapon_negev", 0, 5), PROB_LOW),
(new CannotUseReward(basePlugin, WeaponType.SNIPERS), PROB_LOW),
(new CannotUseReward(basePlugin, WeaponType.HEAVY), PROB_LOW),
(new CreditReward(50), PROB_LOW), (new HPReward(1), PROB_LOW / 2),
(new CreditReward(50, locale), PROB_LOW), (new HPReward(1), PROB_LOW / 2),
// Very low
(new FakeBombReward(), PROB_VERY_LOW * 2),
@@ -79,19 +82,19 @@ public class RewardGenerator(IZoneManager mgr, IC4Service bomb,
(new RandomTeleportReward(mgr), PROB_VERY_LOW),
(new BombReward(bomb), PROB_VERY_LOW),
(new CannotUseReward(basePlugin, WeaponType.UTILITY), PROB_VERY_LOW),
(new CreditReward(-100), PROB_VERY_LOW),
(new CreditReward(500), PROB_VERY_LOW),
(new CreditReward(-100, locale), PROB_VERY_LOW),
(new CreditReward(500, locale), PROB_VERY_LOW),
(new AmmoWeaponReward("weapon_awp", 1, 0), PROB_VERY_LOW / 2),
// Extremely low
(new AmmoWeaponReward("weapon_awp", 3, 0), PROB_EXTREMELY_LOW),
(new WeaponReward("weapon_glock"), PROB_EXTREMELY_LOW),
(new CannotUseReward(basePlugin, WeaponType.GUNS), PROB_EXTREMELY_LOW),
(new CreditReward(1000), PROB_EXTREMELY_LOW),
(new CreditReward(-5000), PROB_EXTREMELY_LOW / 2),
(new CreditReward(1000, locale), PROB_EXTREMELY_LOW),
(new CreditReward(-5000, locale), PROB_EXTREMELY_LOW / 2),
// Lottery
(new CreditReward(10000), PROB_LOTTERY)
(new CreditReward(10000, locale), PROB_LOTTERY)
]);
}

View File

@@ -3,16 +3,16 @@ using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Utils;
using GangsAPI.Data;
using GangsAPI.Services;
using Jailbreak.English.RTD;
using Jailbreak.Formatting.Extensions;
using Jailbreak.Formatting.Views.RTD;
using Jailbreak.Public;
using Jailbreak.Public.Mod.RTD;
using Microsoft.Extensions.DependencyInjection;
namespace Jailbreak.RTD.Rewards;
public class CreditReward(int credits) : IRTDReward {
public static readonly string PREFIX =
$" {ChatColors.Purple}[{ChatColors.LightPurple}RTD{ChatColors.Purple}]";
public class CreditReward(int credits, IRTDLocale locale) : IRTDReward {
public string Name => $"{credits} credit{(credits == 1 ? "" : "s")}";
public string Description => $"You won {Name}{(credits > 500 ? "!" : ".")}";
@@ -26,8 +26,7 @@ public class CreditReward(int credits) : IRTDReward {
Task.Run(async () => await eco.Grant(wrapper, credits, true, "RTD"));
if (Math.Abs(credits) >= 5000)
Server.PrintToChatAll(
$"{PREFIX} {ChatColors.Yellow}{wrapper.Name} {ChatColors.Default}won the jackpot of {ChatColors.Green}{credits} {ChatColors.Default}credits!");
locale.JackpotReward(player, credits).ToAllChat();
return true;
}

View File

@@ -24,7 +24,7 @@ public class SimpleView : IView, IEnumerable<IList<FormatObject>> {
/// </summary>
/// <param name="item"></param>
public void Add(FormatObject item) {
if (lines.Count == 0) lines.Add(new List<FormatObject>());
if (lines.Count == 0) lines.Add([]);
lines[lines.Count - 1].Add(item);
}
@@ -34,7 +34,7 @@ public class SimpleView : IView, IEnumerable<IList<FormatObject>> {
/// </summary>
/// <param name="line"></param>
public void Add(params FormatObject[] line) {
if (lines.Count == 0) lines.Add(new List<FormatObject>());
if (lines.Count == 0) lines.Add([]);
lines[lines.Count - 1].AddRange(line);
}
@@ -43,7 +43,7 @@ public class SimpleView : IView, IEnumerable<IList<FormatObject>> {
/// Add a new line to this SimpleView
/// </summary>
/// <param name="newline"></param>
public void Add(Newline newline) { lines.Add(new List<FormatObject>()); }
public void Add(Newline newline) { lines.Add([]); }
public struct Newline { }
}

View File

@@ -1,8 +1,9 @@
using Jailbreak.Formatting.Core;
using CounterStrikeSharp.API.Modules.Utils;
using Jailbreak.Formatting.Core;
namespace Jailbreak.Formatting.Objects;
public class StringFormatObject(string value, char chatColor = '\x01')
public class StringFormatObject(string value, char chatColor = '\x08')
: FormatObject {
public string Value { get; } = value;

View File

@@ -1,4 +1,5 @@
using Jailbreak.Formatting.Base;
using CounterStrikeSharp.API.Core;
using Jailbreak.Formatting.Base;
using Jailbreak.Public.Mod.RTD;
namespace Jailbreak.Formatting.Views.RTD;
@@ -8,4 +9,5 @@ public interface IRTDLocale {
public IView AlreadyRolled(IRTDReward reward);
public IView CannotRollYet();
public IView RollingDisabled();
public IView JackpotReward(CCSPlayerController winner, int credits);
}