From 3f4679cde742cfcf90b216395ddce1a1810467ab Mon Sep 17 00:00:00 2001 From: MrDave1999 Date: Sun, 9 Aug 2026 14:38:04 -0500 Subject: [PATCH] refactor: clarify GameText color terminology * Rename the Team.GameText property to GameTextColor to clarify that it stores an open.mp GameText text color. * Update related message resources and usages to consistently use GameTextColor terminology, and document the supported text colors. --- src/Application/Messages.Designer.cs | 4 +- src/Application/Messages.resx | 4 +- .../Flags/AutoReturn/FlagAutoReturnTimer.cs | 2 +- .../Flags/Carriers/FlagCarrierPauseSystem.cs | 2 +- .../Flags/Events/OnFlagAtBasePosition.cs | 2 +- .../Teams/Flags/Events/OnFlagCaptured.cs | 2 +- .../Teams/Flags/Events/OnFlagDropped.cs | 2 +- .../Teams/Flags/Events/OnFlagReturned.cs | 2 +- .../Teams/Flags/Events/OnFlagScore.cs | 2 +- .../Teams/Flags/Events/OnFlagTaken.cs | 2 +- src/Application/Teams/Flags/FlagSystem.cs | 2 +- .../Teams/Matches/MatchResultAnnouncer.cs | 2 +- src/Application/Teams/Team.cs | 82 +++++++++++-------- 13 files changed, 60 insertions(+), 50 deletions(-) diff --git a/src/Application/Messages.Designer.cs b/src/Application/Messages.Designer.cs index deafd6cd..33972e1a 100644 --- a/src/Application/Messages.Designer.cs +++ b/src/Application/Messages.Designer.cs @@ -709,7 +709,7 @@ internal static string OldSkinIsEqualsToNewSkin { } /// - /// Looks up a localized string similar to ~n~~n~~n~{GameText}Defend this flag from enemy capture!. + /// Looks up a localized string similar to ~n~~n~~n~{GameTextColor}Defend this flag from enemy capture!. /// internal static string OnFlagAtBasePosition { get { @@ -1412,7 +1412,7 @@ internal static string Welcome3 { } /// - /// Looks up a localized string similar to {GameTextStyle} Winner: {TeamName}. + /// Looks up a localized string similar to {GameTextColor} Winner: {TeamName}. /// internal static string Winner { get { diff --git a/src/Application/Messages.resx b/src/Application/Messages.resx index 8b1032e4..dc51aec5 100644 --- a/src/Application/Messages.resx +++ b/src/Application/Messages.resx @@ -319,7 +319,7 @@ You already have that skin - ~n~~n~~n~{GameText}Defend this flag from enemy capture! + ~n~~n~~n~{GameTextColor}Defend this flag from enemy capture! {PlayerName} has captured the {TeamName} team's {ColorName} flag! Keep an eye on the score! @@ -572,7 +572,7 @@ Capture the Flag is about to begin. You cannot perform this action on the server owner. - {GameTextStyle} Winner: {TeamName} + {GameTextColor} Winner: {TeamName} ~w~Tie! diff --git a/src/Application/Teams/Flags/AutoReturn/FlagAutoReturnTimer.cs b/src/Application/Teams/Flags/AutoReturn/FlagAutoReturnTimer.cs index 477f7d24..d99e0e46 100644 --- a/src/Application/Teams/Flags/AutoReturn/FlagAutoReturnTimer.cs +++ b/src/Application/Teams/Flags/AutoReturn/FlagAutoReturnTimer.cs @@ -26,7 +26,7 @@ void OnComplete(IServiceProvider serviceProvider) team.ColorName }); worldService.SendClientMessage(team.ColorHex, message); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); Stop(team); } diff --git a/src/Application/Teams/Flags/Carriers/FlagCarrierPauseSystem.cs b/src/Application/Teams/Flags/Carriers/FlagCarrierPauseSystem.cs index 27ba8661..93a76814 100644 --- a/src/Application/Teams/Flags/Carriers/FlagCarrierPauseSystem.cs +++ b/src/Application/Teams/Flags/Carriers/FlagCarrierPauseSystem.cs @@ -67,7 +67,7 @@ void OnComplete(IServiceProvider serviceProvider) Seconds = flagCarrierSettings.PauseTime }); worldService.SendClientMessage(rivalTeam.ColorHex, message); - worldService.GameText($"~n~~n~~n~{rivalTeam.GameText}{rivalTeam.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{rivalTeam.GameTextColor}{rivalTeam.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); } } diff --git a/src/Application/Teams/Flags/Events/OnFlagAtBasePosition.cs b/src/Application/Teams/Flags/Events/OnFlagAtBasePosition.cs index 4bc52eee..e4edf281 100644 --- a/src/Application/Teams/Flags/Events/OnFlagAtBasePosition.cs +++ b/src/Application/Teams/Flags/Events/OnFlagAtBasePosition.cs @@ -9,7 +9,7 @@ public class OnFlagAtBasePosition : IFlagEvent public void Handle(Team team, Player player) { - var text = Smart.Format(Messages.OnFlagAtBasePosition, new { team.GameText }); + var text = Smart.Format(Messages.OnFlagAtBasePosition, new { team.GameTextColor }); player.GameText(text, TimeSpan.FromSeconds(5), GameTextStyle.Style3); } } diff --git a/src/Application/Teams/Flags/Events/OnFlagCaptured.cs b/src/Application/Teams/Flags/Events/OnFlagCaptured.cs index 06c6fb54..8f50c1f7 100644 --- a/src/Application/Teams/Flags/Events/OnFlagCaptured.cs +++ b/src/Application/Teams/Flags/Events/OnFlagCaptured.cs @@ -27,7 +27,7 @@ public void Handle(Team team, Player player) team.ColorName }); worldService.SendClientMessage(team.ColorHex, message); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} flag captured!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} flag captured!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); PlayerInfo playerInfo = player.GetRequiredInfo(); playerInfo.StatsPerRound.AddCoins(EarnedCoins); diff --git a/src/Application/Teams/Flags/Events/OnFlagDropped.cs b/src/Application/Teams/Flags/Events/OnFlagDropped.cs index 63591387..9423330a 100644 --- a/src/Application/Teams/Flags/Events/OnFlagDropped.cs +++ b/src/Application/Teams/Flags/Events/OnFlagDropped.cs @@ -24,7 +24,7 @@ public void Handle(Team team, Player player) team.ColorName }); worldService.SendClientMessage(team.ColorHex, message); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} flag dropped!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} flag dropped!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); PlayerInfo playerInfo = player.GetRequiredInfo(); playerInfo.AddDroppedFlags(); diff --git a/src/Application/Teams/Flags/Events/OnFlagReturned.cs b/src/Application/Teams/Flags/Events/OnFlagReturned.cs index 58144c82..6b1aa0ce 100644 --- a/src/Application/Teams/Flags/Events/OnFlagReturned.cs +++ b/src/Application/Teams/Flags/Events/OnFlagReturned.cs @@ -28,7 +28,7 @@ public void Handle(Team team, Player player) team.ColorName }); worldService.SendClientMessage(team.ColorHex, message); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); PlayerInfo playerInfo = player.GetRequiredInfo(); playerInfo.StatsPerRound.AddCoins(EarnedCoins); diff --git a/src/Application/Teams/Flags/Events/OnFlagScore.cs b/src/Application/Teams/Flags/Events/OnFlagScore.cs index 972b102d..22c0b372 100644 --- a/src/Application/Teams/Flags/Events/OnFlagScore.cs +++ b/src/Application/Teams/Flags/Events/OnFlagScore.cs @@ -32,7 +32,7 @@ public void Handle(Team team, Player player) team.RivalTeam.ColorName }); worldService.SendClientMessage(team.ColorHex, message); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} team scores!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} team scores!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); PlayerInfo playerInfo = player.GetRequiredInfo(); playerInfo.StatsPerRound.AddCoins(CarrierEarnedCoins); diff --git a/src/Application/Teams/Flags/Events/OnFlagTaken.cs b/src/Application/Teams/Flags/Events/OnFlagTaken.cs index 97c7ebba..987a9c61 100644 --- a/src/Application/Teams/Flags/Events/OnFlagTaken.cs +++ b/src/Application/Teams/Flags/Events/OnFlagTaken.cs @@ -23,7 +23,7 @@ public void Handle(Team team, Player player) team.ColorName }); worldService.SendClientMessage(team.ColorHex, message); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} flag taken!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} flag taken!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); if (flagCarrierSettings.ShowOnRadarMap) { player.ShowOnRadarMap(); diff --git a/src/Application/Teams/Flags/FlagSystem.cs b/src/Application/Teams/Flags/FlagSystem.cs index d75cf38d..27c9b9e3 100644 --- a/src/Application/Teams/Flags/FlagSystem.cs +++ b/src/Application/Teams/Flags/FlagSystem.cs @@ -113,7 +113,7 @@ public void ReturnToBasePosition( teamPickupService.DestroyExteriorMarker(team); team.Sounds.PlayFlagReturnedSound(); flagAutoReturnTimer.Stop(team); - worldService.GameText($"~n~~n~~n~{team.GameText}{team.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); + worldService.GameText($"~n~~n~~n~{team.GameTextColor}{team.ColorName} flag returned!", TimeSpan.FromSeconds(5), GameTextStyle.Style3); worldService.SendClientMessage(Color.Yellow, message); } } diff --git a/src/Application/Teams/Matches/MatchResultAnnouncer.cs b/src/Application/Teams/Matches/MatchResultAnnouncer.cs index 320b9aed..5700e7a1 100644 --- a/src/Application/Teams/Matches/MatchResultAnnouncer.cs +++ b/src/Application/Teams/Matches/MatchResultAnnouncer.cs @@ -18,7 +18,7 @@ public void Announce() Messages.Winner, new { - GameTextStyle = result.Winner.GameText, + result.Winner.GameTextColor, TeamName = result.Winner.Name }); diff --git a/src/Application/Teams/Team.cs b/src/Application/Teams/Team.cs index 773f93d5..a35058aa 100644 --- a/src/Application/Teams/Team.cs +++ b/src/Application/Teams/Team.cs @@ -10,36 +10,36 @@ static Team() { Alpha = new Team { - Id = TeamId.Alpha, - SkinId = SkinTeamId.Alpha, - Name = "Alpha", - ColorName = "red", - GameText = "~r~", - ColorHex = new Color(255, 32, 64, 00), - Sounds = TeamSounds.Alpha, - Flag = new Flag + Id = TeamId.Alpha, + SkinId = SkinTeamId.Alpha, + Name = "Alpha", + ColorName = "red", + GameTextColor = "~r~", + ColorHex = new Color(255, 32, 64, 00), + Sounds = TeamSounds.Alpha, + Flag = new Flag { - Model = FlagModel.Red, - Icon = FlagIcon.Red, - Name = "Red", - ColorHex = Color.Red + Model = FlagModel.Red, + Icon = FlagIcon.Red, + Name = "Red", + ColorHex = Color.Red } }; Beta = new Team { - Id = TeamId.Beta, - SkinId = SkinTeamId.Beta, - Name = "Beta", - ColorName = "blue", - GameText = "~b~", - ColorHex = new Color(0, 136, 255, 00), - Sounds = TeamSounds.Beta, - Flag = new Flag + Id = TeamId.Beta, + SkinId = SkinTeamId.Beta, + Name = "Beta", + ColorName = "blue", + GameTextColor = "~b~", + ColorHex = new Color(0, 136, 255, 00), + Sounds = TeamSounds.Beta, + Flag = new Flag { - Model = FlagModel.Blue, - Icon = FlagIcon.Blue, - Name = "Blue", + Model = FlagModel.Blue, + Icon = FlagIcon.Blue, + Name = "Blue", ColorHex = Color.Blue } }; @@ -48,19 +48,19 @@ static Team() Beta.RivalTeam = Alpha; None = new NoTeam { - Id = TeamId.NoTeam, - SkinId = SkinTeamId.NoTeam, - Name = "NoTeam", - ColorName = "white", - GameText = "~w~", - ColorHex = new Color(255, 255, 255, 00), - Sounds = TeamSounds.None, - Flag = new Flag + Id = TeamId.NoTeam, + SkinId = SkinTeamId.NoTeam, + Name = "NoTeam", + ColorName = "white", + GameTextColor = "~w~", + ColorHex = new Color(255, 255, 255, 00), + Sounds = TeamSounds.None, + Flag = new Flag { - Model = FlagModel.None, - Icon = FlagIcon.White, - Name = "NoTeam", - ColorHex = Color.White + Model = FlagModel.None, + Icon = FlagIcon.White, + Name = "NoTeam", + ColorHex = Color.White }, }; None.RivalTeam = None; @@ -70,7 +70,17 @@ static Team() public SkinTeamId SkinId { get; private set; } public string Name { get; private set; } public string ColorName { get; private set; } - public string GameText { get; private set; } + + /// + /// Gets the text color used by open.mp GameText. + /// + /// + /// See the + /// open.mp GameText text colors documentation + /// . + /// + public string GameTextColor { get; private set; } + public Color ColorHex { get; private set; } public TeamSounds Sounds { get; private set; } public Flag Flag { get; private set; }