Restart vote improvements, voting localization.

Restart votes now need 80% majority to succeed.
Restart votes now have a 3 minute cooldown on the caller.
Voting stuff has been localized.
This commit is contained in:
Pieter-Jan Briers
2021-02-28 22:11:45 +01:00
parent 0c059fc699
commit 245f276f35
11 changed files with 145 additions and 31 deletions

View File

@@ -6,7 +6,7 @@
<VBoxContainer>
<HBoxContainer>
<MarginContainer MarginLeftOverride="8" HorizontalExpand="True">
<Label Text="{Loc 'Call Vote'}" VAlign="Center" StyleClasses="LabelHeading" />
<Label Text="{Loc 'ui-vote-create-title'}" VAlign="Center" StyleClasses="LabelHeading" />
</MarginContainer>
<MarginContainer MarginRightOverride="8">
<TextureButton Name="CloseButton" StyleClasses="windowCloseButton"
@@ -27,12 +27,12 @@
<MarginContainer SizeFlagsHorizontal="Fill"
MarginLeftOverride="8" MarginRightOverride="8" MarginBottomOverride="2">
<Button Name="CreateButton" Text="{Loc 'Call Vote'}" />
<Button Name="CreateButton" Text="{Loc 'ui-vote-create-button'}" />
</MarginContainer>
<PanelContainer StyleClasses="LowDivider" />
<MarginContainer MarginLeftOverride="12">
<Label StyleClasses="LabelSubText" Text="{Loc 'Powered by Robust™ Anti-Tamper Technology'}" />
<Label StyleClasses="LabelSubText" Text="{Loc 'ui-vote-fluff'}" />
</MarginContainer>
</VBoxContainer>

View File

@@ -20,8 +20,8 @@ namespace Content.Client.Voting
public static readonly (string name, string id, (string name, string id)[]? secondaries)[] AvailableVoteTypes =
{
("Restart round", "restart", null),
("Next gamemode", "preset", null)
("ui-vote-type-restart", "restart", null),
("ui-vote-type-gamemode", "preset", null)
};
public VoteCallMenu()

View File

@@ -16,7 +16,7 @@ namespace Content.Client.Voting
{
IoCManager.InjectDependencies(this);
Text = Loc.GetString("Call vote");
Text = Loc.GetString("ui-vote-menu-button");
OnPressed += OnOnPressed;
}

View File

@@ -50,12 +50,12 @@ namespace Content.Client.Voting
public void UpdateData()
{
VoteTitle.Text = _vote.Title;
VoteCaller.Text = Loc.GetString("{0} called a vote:", _vote.Initiator);
VoteCaller.Text = Loc.GetString("ui-vote-created", ("initiator", _vote.Initiator));
for (var i = 0; i < _voteButtons.Length; i++)
{
var entry = _vote.Entries[i];
_voteButtons[i].Text = Loc.GetString("{0} ({1})", entry.Text, entry.Votes);
_voteButtons[i].Text = Loc.GetString("ui-vote-button", ("text", entry.Text), ("votes", entry.Votes));
if (_vote.OurVote == i)
_voteButtons[i].Pressed = true;