Skip to content

Commit df01944

Browse files
committed
Add ReadyTag #31
1 parent 4f1e391 commit df01944

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

PugSharp.Match.Contract/IPlayer.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public interface IPlayer
99
string PlayerName { get; }
1010

1111
Team Team { get; }
12+
string Clan { get; set; }
1213

1314
void PrintToChat(string message);
1415

PugSharp.Match/Match.cs

+3
Original file line numberDiff line numberDiff line change
@@ -873,13 +873,16 @@ public async Task TogglePlayerIsReadyAsync(IPlayer player)
873873

874874
if (matchPlayer.IsReady)
875875
{
876+
player.Clan = _TextHelper.GetText(nameof(Resources.PugSharp_Match_ReadyTag));
876877
_MatchCallback.SendMessage(_TextHelper.GetText(nameof(Resources.PugSharp_Match_Info_Ready), player.PlayerName, readyPlayers, requiredPlayers));
877878
await TryFireStateAsync(MatchCommand.PlayerReady).ConfigureAwait(false);
878879
}
879880
else
880881
{
882+
player.Clan = _TextHelper.GetText(nameof(Resources.PugSharp_Match_NotReadyTag));
881883
_MatchCallback.SendMessage(_TextHelper.GetText(nameof(Resources.PugSharp_Match_Info_NotReady), player.PlayerName, readyPlayers, requiredPlayers));
882884
}
885+
883886
}
884887

885888
public Team GetPlayerTeam(ulong steamID)

PugSharp.Translation/Properties/Resources.Designer.cs

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PugSharp.Translation/Properties/Resources.resx

+6
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@
171171
<data name="PugSharp.Match.Info.WaitingForAllPlayers" xml:space="preserve">
172172
<value>Waiting for all players to be ready.</value>
173173
</data>
174+
<data name="PugSharp.Match.NotReadyTag" xml:space="preserve">
175+
<value>Not Ready</value>
176+
</data>
177+
<data name="PugSharp.Match.ReadyTag" xml:space="preserve">
178+
<value>Ready</value>
179+
</data>
174180
<data name="PugSharp.Match.RemindReady" xml:space="preserve">
175181
<value>You are !!not!! ready! Type `!ready` if you are ready.</value>
176182
</data>

PugSharp/Models/Player.cs

+13
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ public int? Money
8383
}
8484
}
8585

86+
public string Clan
87+
{
88+
get => DefaultIfInvalid(() => _PlayerController.Clan, string.Empty);
89+
set
90+
{
91+
if (_PlayerController.IsValid)
92+
{
93+
_PlayerController.Clan = value;
94+
}
95+
}
96+
}
97+
8698
public void PrintToChat(string message)
8799
{
88100
_PlayerController.PrintToChat(message);
@@ -118,6 +130,7 @@ public void Kick()
118130
CounterStrikeSharp.API.Server.ExecuteCommand(string.Create(CultureInfo.InvariantCulture, $"kickid {UserId!.Value} \"You are not part of the current match!\""));
119131
}
120132

133+
121134
private void ResetScoreboard()
122135
{
123136
var matchStats = _PlayerController.ActionTrackingServices?.MatchStats;

0 commit comments

Comments
 (0)