From e79763d20faba98cf2a075746cba772884cd90dd Mon Sep 17 00:00:00 2001 From: VigersRay Date: Tue, 8 Oct 2024 08:53:40 +0300 Subject: [PATCH] =?UTF-8?q?=D1=86=D0=B2=D0=B0=D1=80=D1=8B=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=81=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B3=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D1=81=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Voting/Managers/VoteManager.DefaultVotes.cs | 13 +++++++++---- .../_Sunrise/SunriseCCVars/SunriseCCVars.cs | 10 ++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs index accebdd4a8..d1ebfa6634 100644 --- a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs +++ b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs @@ -9,6 +9,7 @@ using Content.Server.GameTicking.Presets; using Content.Server.Maps; using Content.Server.Roles; using Content.Server.RoundEnd; +using Content.Shared._Sunrise.SunriseCCVars; using Content.Shared.CCVar; using Content.Shared.Chat; using Content.Shared.Database; @@ -86,9 +87,13 @@ namespace Content.Server.Voting.Managers var ghostVotePercentageRequirement = _cfg.GetCVar(CCVars.VoteRestartGhostPercentage); var ghostVoterPercentage = CalculateEligibleVoterPercentage(VoterEligibility.Ghost); + // Sunrise-Start + var showRestartVotes = _cfg.GetCVar(SunriseCCVars.ShowRestartVotes); + // Sunrise-End + if (totalPlayers <= playerVoteMaximum || ghostVoterPercentage >= ghostVotePercentageRequirement) { - StartVote(initiator, false); + StartVote(initiator, showRestartVotes); } else { @@ -136,7 +141,7 @@ namespace Content.Server.Voting.Managers return eligibleCount; } - private void StartVote(ICommonSession? initiator, bool displayVotes = true) + private void StartVote(ICommonSession? initiator, bool displayVotes) { var alone = _playerManager.PlayerCount == 1 && initiator != null; var options = new VoteOptions @@ -227,7 +232,7 @@ namespace Content.Server.Voting.Managers Duration = alone ? TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerAlone)) : TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerPreset)), - DisplayVotes = false // Sunrise-Edit + DisplayVotes = _cfg.GetCVar(SunriseCCVars.ShowPresetVotes), // Sunrise-Edit }; if (alone) @@ -280,7 +285,7 @@ namespace Content.Server.Voting.Managers Duration = alone ? TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerAlone)) : TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.VoteTimerMap)), - DisplayVotes = false // Sunrise-Edit + DisplayVotes = _cfg.GetCVar(SunriseCCVars.ShowMapVotes), // Sunrise-Edit }; if (alone) diff --git a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs index f68365e05f..f528ed4971 100644 --- a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs +++ b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs @@ -241,4 +241,14 @@ public sealed class SunriseCCVars public static readonly CVarDef NPCDisableWithoutPlayers = CVarDef.Create("npc.disable_without_players", true); public static readonly CVarDef NPCDisableDistance = CVarDef.Create("npc.disable_distance", 15f); + + /* + * Vote + */ + + public static readonly CVarDef ShowRestartVotes = CVarDef.Create("vote.show_restart_votes", true); + + public static readonly CVarDef ShowPresetVotes = CVarDef.Create("vote.show_preset_votes", true); + + public static readonly CVarDef ShowMapVotes = CVarDef.Create("vote.show_map_votes", true); }