Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Application/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Application/Messages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
<value>You already have that skin</value>
</data>
<data name="OnFlagAtBasePosition" xml:space="preserve">
<value>~n~~n~~n~{GameText}Defend this flag from enemy capture!</value>
<value>~n~~n~~n~{GameTextColor}Defend this flag from enemy capture!</value>
</data>
<data name="OnFlagCaptured" xml:space="preserve">
<value>{PlayerName} has captured the {TeamName} team's {ColorName} flag! Keep an eye on the score!</value>
Expand Down Expand Up @@ -572,7 +572,7 @@ Capture the Flag is about to begin.</value>
<value>You cannot perform this action on the server owner.</value>
</data>
<data name="Winner" xml:space="preserve">
<value>{GameTextStyle} Winner: {TeamName}</value>
<value>{GameTextColor} Winner: {TeamName}</value>
</data>
<data name="Tie" xml:space="preserve">
<value>~w~Tie!</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/Events/OnFlagAtBasePosition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/Events/OnFlagCaptured.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/Events/OnFlagDropped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/Events/OnFlagReturned.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/Events/OnFlagScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/Events/OnFlagTaken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Application/Teams/Flags/FlagSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Application/Teams/Matches/MatchResultAnnouncer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Announce()
Messages.Winner,
new
{
GameTextStyle = result.Winner.GameText,
result.Winner.GameTextColor,
TeamName = result.Winner.Name
});

Expand Down
82 changes: 46 additions & 36 deletions src/Application/Teams/Team.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};
Expand All @@ -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;
Expand All @@ -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; }

/// <summary>
/// Gets the text color used by open.mp <c>GameText</c>.
/// </summary>
/// <remarks>
/// See the <see href="https://open.mp/docs/scripting/resources/gametextstyles#text-colors">
/// open.mp GameText text colors documentation
/// </see>.
/// </remarks>
public string GameTextColor { get; private set; }

public Color ColorHex { get; private set; }
public TeamSounds Sounds { get; private set; }
public Flag Flag { get; private set; }
Expand Down
Loading