From c7335a3826634a35db5bbbc6916a6c4d489f3b6b Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Sat, 11 Jan 2025 16:50:20 -0500 Subject: [PATCH] Add Skip_Confirm --- Classic/scripts/DMGame.cs | 4 ++++ Classic/scripts/LakRabbitGame.cs | 6 ++++- Classic/scripts/autoexec/VoteMenu.cs | 33 ++++++++++++++++++++-------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/Classic/scripts/DMGame.cs b/Classic/scripts/DMGame.cs index bb55248..8b85265 100644 --- a/Classic/scripts/DMGame.cs +++ b/Classic/scripts/DMGame.cs @@ -838,6 +838,10 @@ function DMGame::sendGameVoteMenu(%game, %client, %key) if(%game.scheduleVote $= "") { + //echo(%client.ForceVote); + if(%client.ForceVote $= "skip_confirm") + return; + if(!%isAdmin || (%isAdmin && %client.ForceVote)) { if(!$Host::DMSLOnlyMode) diff --git a/Classic/scripts/LakRabbitGame.cs b/Classic/scripts/LakRabbitGame.cs index f54785b..10d050d 100644 --- a/Classic/scripts/LakRabbitGame.cs +++ b/Classic/scripts/LakRabbitGame.cs @@ -1170,10 +1170,14 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key ) %isAdmin = ( %client.isAdmin || %client.isSuperAdmin ); if(!%client.canVote && !%isAdmin) - return; + return; if( %game.scheduleVote $= "" ) { + //echo(%client.ForceVote); + if(%client.ForceVote $= "skip_confirm") + return; + if(!%isAdmin || (%isAdmin && %client.ForceVote)) { if(!Game.duelMode) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 6140c5f..b101845 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -49,10 +49,10 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) { if(!$Host::TournamentMode) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); if(%multipleTeams) { if($teamDamage) @@ -63,6 +63,12 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) messageClient(%client, 'MsgVoteItem',"", %key, 'ForceVote', 'Cancel Force Vote', "Cancel 'Vote To...'"); return; } + else if (%client.ForceVote $= "skip_confirm") //Skip mission Confirm cuz its so annoying + { + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipConfirm', 'Are you sure you want to Skip the Mission?','Are you sure you want to Skip the Mission?'); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'Yes, Skip the Mission', 'Yes, Skip the Mission' ); + return; + } //Pass Stop Menu if(%client.isAdmin && %game.scheduleVote !$= "") @@ -79,7 +85,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) { switch$($CurrentMissionType) { - case CTF or SCtF: + case CTF or SCtF or LCTF: if($Host::TournamentMode) %showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes"; if($voteNext) @@ -191,7 +197,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key) messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); } else - messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' ); + messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipConfirm', 'skip the mission to', 'Skip the Mission' ); //Admin Vote Menu if(%client.isAdmin && $Host::AllowAdminVotes) messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); @@ -547,6 +553,15 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % %msg = %client.nameBase @ " initiated a vote to " @ ($FairTeams == 0 ? "enable" : "disable") @ " fair teams."; } + case "VoteSkipConfirm": + if(%isAdmin && %client.ForceVote !$= "skip_confirm") + { + %client.ForceVote = "skip_confirm"; + return; + } + else + %client.ForceVote = 0; + case "VoteSkipMission": if((!%isAdmin && $Host::AllowPlayerVoteSkipMission) || (%isAdmin && %client.ForceVote)) { @@ -840,12 +855,12 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % %msg = %client.nameBase @ " initiated a vote to " @ (Game.DMSLOnlyMode == 0 ? "enable" : "disable") @ " shocklance only mode."; //LCTF Stuff - case "SCtFProMode": - if(!$CurrentMissionType $= "sctf") + case "LCTFProMode": + if(!$CurrentMissionType $= "LCTF") return; if(!%isAdmin || (%isAdmin && %client.ForceVote)) - %msg = %client.nameBase @ " initiated a vote to " @ (Game.SCtFProMode == 0 ? "enable" : "disable") @ " pro mode."; + %msg = %client.nameBase @ " initiated a vote to " @ (Game.LCTFProMode == 0 ? "enable" : "disable") @ " pro mode."; case "showServerRules": if (($Host::ServerRules[1] !$= "") && (!%client.CantView))