Skip to content

Commit

Permalink
Merge pull request #299 from Lan2Play/feature/ReadyTag
Browse files Browse the repository at this point in the history
Fix ReadTag + Add Voting Tag
  • Loading branch information
TheR00st3r authored Jan 8, 2025
2 parents 350af39 + d038299 commit ed68c47
Show file tree
Hide file tree
Showing 11 changed files with 804 additions and 336 deletions.
13 changes: 12 additions & 1 deletion PugSharp.Match/Match.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ private void StopReadyReminder()
{
_Logger.LogInformation("Stop ReadyReminder");
_ReadyReminderTimer.Stop();
foreach(var player in AllMatchPlayers)
{
player.Player.Clan = string.Empty;
}
}

private void UnpauseMatch()
Expand Down Expand Up @@ -759,6 +763,9 @@ private void SendRemainingMapsToVotingTeam()

ShowMenuToTeam(_CurrentMatchTeamToVote!, _TextHelper.GetText(nameof(Resources.PugSharp_Match_VoteMapMenuHeader)), mapOptions);

DoForAll(_CurrentMatchTeamToVote!.Players.Select(x => x.Player), p => p.Clan = _TextHelper.GetText(nameof(Resources.PugSharp_Match_VotingTag)));
DoForAll(GetOtherTeam(_CurrentMatchTeamToVote).Players.Select(x => x.Player), p => p.Clan = string.Empty);

GetOtherTeam(_CurrentMatchTeamToVote!).PrintToChat(_TextHelper.GetText(nameof(Resources.PugSharp_Match_WaitForOtherTeam)));

_VoteTimer.Start();
Expand Down Expand Up @@ -810,6 +817,9 @@ private void SendTeamVoteToVotingTeam()
ShowMenuToTeam(_CurrentMatchTeamToVote!, _TextHelper.GetText(nameof(Resources.PugSharp_Match_VoteTeamMenuHeader)), mapOptions);
GetOtherTeam(_CurrentMatchTeamToVote!).PrintToChat(_TextHelper.GetText(nameof(Resources.PugSharp_Match_WaitForOtherTeam)));

DoForAll(_CurrentMatchTeamToVote!.Players.Select(x => x.Player), p => p.Clan = _TextHelper.GetText(nameof(Resources.PugSharp_Match_VotingTag)));
DoForAll(GetOtherTeam(_CurrentMatchTeamToVote).Players.Select(x => x.Player), p => p.Clan = string.Empty);

_VoteTimer.Start();
}

Expand Down Expand Up @@ -1035,7 +1045,6 @@ public bool TryAddPlayer(IPlayer player)
return false;
}

player.Clan = _TextHelper.GetText(nameof(Resources.PugSharp_Match_NotReadyTag));
if (MatchInfo.Config.TeamMode == Config.TeamMode.PlayerSelect)
{
// Quicker to just remove them and add them back, rather than check whether they are already in the match
Expand Down Expand Up @@ -1229,6 +1238,7 @@ public bool BanMap(IPlayer player, int mapNumber)
mapToSelect.Votes.Add(player);

player.PrintToChat(_TextHelper.GetText(nameof(Resources.PugSharp_Match_VotedToBanMap), mapToSelect.Name));
player.Clan = string.Empty;

if (_MapsToSelect.Sum(x => x.Votes.Count) >= MatchInfo.Config.PlayersPerTeam)
{
Expand Down Expand Up @@ -1280,6 +1290,7 @@ public bool VoteTeam(IPlayer player, string teamName)

// Successful vote
player.PrintToChat(_TextHelper.GetText(nameof(Resources.PugSharp_Match_VotedForTeam), teamToVote.Name));
player.Clan = string.Empty;

if (_TeamVotes.Sum(x => x.Votes.Count) >= MatchInfo.Config.PlayersPerTeam)
{
Expand Down
9 changes: 9 additions & 0 deletions PugSharp.Translation/Properties/Resources.Designer.cs

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

65 changes: 64 additions & 1 deletion PugSharp.Translation/Properties/Resources.br.resx
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
Expand Down Expand Up @@ -268,4 +327,8 @@
<data name="PugSharp.PoweredBy" xml:space="preserve">
<value>distribuído por **PugSharp** (https://github.com/Lan2Play/PugSharp/)</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="PugSharp.Match.VotingTag" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
</root>
97 changes: 80 additions & 17 deletions PugSharp.Translation/Properties/Resources.da.resx
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
Expand Down Expand Up @@ -58,37 +117,41 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="PugSharp.Command.CreatingMatchMaxRounds" xml:space="preserve">
<value>`!maxrunder &lt;rounds&gt;` for at sætte max kamp runder!</value>
<data name="PugSharp.Command.ChangedMaxOvertimeRounds" xml:space="preserve">
<value>Ændret Max overtids runder fra {0:oldMaxRounds} til {1:maxOvertimeRounds}</value>
</data>
<data name="PugSharp.Command.ChangedMaxRounds" xml:space="preserve">
<value>Ændret Max runder fra {0:oldMaxRounds} til {1:maxRounds}</value>
</data>
<data name="PugSharp.Command.CreatingMatchRemoveMap" xml:space="preserve">
<value>`!fjernkort &lt;mapname&gt;` for at fjerne et kort!</value>
<data name="PugSharp.Command.ChangedTeamMode" xml:space="preserve">
<value>Ændret Holdmode fra {0:oldTeamMode} til {1:newTeamMode}</value>
</data>
<data name="PugSharp.Command.ConfigLoaded" xml:space="preserve">
<value>Kampconfig loadet!</value>
</data>
<data name="PugSharp.Match.TeamReminder" xml:space="preserve">
<value>Je zit momenteel in Team: **{0:teamName}**.</value>
</data>
<data name="PugSharp.Command.CreatingMatchPlayersPerTeam" xml:space="preserve">
<value>`!spillereperteam &lt;players&gt;` for at sætte antal spillere per hold!</value>
</data>
<data name="PugSharp.Command.CreatingMatchAddMap" xml:space="preserve">
<value>`!tilføjkort&lt;mapname&gt; for at tilføje et kort!</value>
</data>
<data name="PugSharp.Command.CreatingMatchMatchInfo" xml:space="preserve">
<value>`!kampinfo` for at vise den nuværende kamp configuration!</value>
</data>
<data name="PugSharp.Command.CreatingMatchMaxOvertimeRounds" xml:space="preserve">
<value>`!maxovertidrunder &lt;rounds&gt;` for at sætte max overtids runder!</value>
</data>
<data name="PugSharp.Command.ChangedMaxOvertimeRounds" xml:space="preserve">
<value>Ændret Max overtids runder fra {0:oldMaxRounds} til {1:maxOvertimeRounds}</value>
<data name="PugSharp.Command.CreatingMatchMaxRounds" xml:space="preserve">
<value>`!maxrunder &lt;rounds&gt;` for at sætte max kamp runder!</value>
</data>
<data name="PugSharp.Command.CreatingMatchMatchInfo" xml:space="preserve">
<value>`!kampinfo` for at vise den nuværende kamp configuration!</value>
<data name="PugSharp.Command.CreatingMatchPlayersPerTeam" xml:space="preserve">
<value>`!spillereperteam &lt;players&gt;` for at sætte antal spillere per hold!</value>
</data>
<data name="PugSharp.Command.ChangedTeamMode" xml:space="preserve">
<value>Ændret Holdmode fra {0:oldTeamMode} til {1:newTeamMode}</value>
<data name="PugSharp.Command.CreatingMatchRemoveMap" xml:space="preserve">
<value>`!fjernkort &lt;mapname&gt;` for at fjerne et kort!</value>
</data>
<data name="PugSharp.Match.TeamReminder" xml:space="preserve">
<value>Je zit momenteel in Team: **{0:teamName}**.</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="PugSharp.Match.VotingTag" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
</root>
Loading

0 comments on commit ed68c47

Please sign in to comment.