Fix in-game voting (#12932)
* Fix in-game voting * Add comment * Re-enable vote.restart_enabled by default
This commit is contained in:
@@ -71,7 +71,6 @@ namespace Content.Client.Lobby
|
||||
};
|
||||
|
||||
LayoutContainer.SetAnchorPreset(_lobby, LayoutContainer.LayoutPreset.Wide);
|
||||
_voteManager.SetPopupContainer(_lobby.VoteContainer);
|
||||
_lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you...
|
||||
UpdateLobbyUi();
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -911,12 +911,11 @@ namespace Content.Shared.CCVar
|
||||
public static readonly CVarDef<bool> VoteEnabled =
|
||||
CVarDef.Create("vote.enabled", true, CVar.SERVERONLY);
|
||||
|
||||
// TODO HUD REFACTOR REENABLE
|
||||
/// <summary>
|
||||
/// See vote.enabled, but specific to restart votes
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> VoteRestartEnabled =
|
||||
CVarDef.Create("vote.restart_enabled", false, CVar.SERVERONLY);
|
||||
CVarDef.Create("vote.restart_enabled", true, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// See vote.enabled, but specific to preset votes
|
||||
|
||||
Reference in New Issue
Block a user