Fix in-game voting (#12932)

* Fix in-game voting

* Add comment

* Re-enable vote.restart_enabled by default
This commit is contained in:
Kevin Zheng
2022-12-18 17:13:37 -08:00
committed by GitHub
parent 0147003036
commit 72e1a5e109
3 changed files with 5 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ namespace Content.Client.Voting
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IClientConsoleHost _console = default!;
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
private readonly Dictionary<StandardVoteType, TimeSpan> _standardVoteTimeouts = new();
private readonly Dictionary<int, ActiveVote> _votes = new();
@@ -120,6 +121,9 @@ namespace Content.Client.Voting
@new = true;
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AudioSystem>()
.PlayGlobal("/Audio/Effects/voteding.ogg", Filter.Local(), false);
// TODO: It would be better if this used a per-state container, i.e. a container
// for the lobby and each HUD layout.
SetPopupContainer(_userInterfaceManager.WindowRoot);
// New vote from the server.
var vote = new ActiveVote(voteId)