Merge pull request #16383 from TheCaramelion/TGUI-Vote

TGUI Vote Panel
This commit is contained in:
Heroman3003
2024-10-04 06:49:44 +10:00
committed by GitHub
11 changed files with 349 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
SUBSYSTEM_DEF(vote)
name = "Vote"
wait = 10
priority = FIRE_PRIORITY_VOTE
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
flags = SS_KEEP_TIMING | SS_NO_INIT
var/datum/vote/active_vote
/datum/controller/subsystem/vote/fire()
if(active_vote)
active_vote.tick()
/datum/controller/subsystem/vote/proc/start_vote(datum/vote/V)
active_vote = V
active_vote.start()
+5 -5
View File
@@ -85,7 +85,7 @@ var/global/datum/controller/subsystem/ticker/ticker
if(start_immediately)
pregame_timeleft = 0
else if(SSvote.time_remaining)
else if(SSvote.active_vote)
return // vote still going, wait for it.
// Time to start the game!
@@ -96,15 +96,15 @@ var/global/datum/controller/subsystem/ticker/ticker
fire() // Don't wait for next tick, do it now!
return
if(pregame_timeleft <= config.vote_autogamemode_timeleft && !SSvote.gamemode_vote_called)
SSvote.autogamemode() // Start the game mode vote (if we haven't had one already)
//if(pregame_timeleft <= config.vote_autogamemode_timeleft && !SSvote.gamemode_vote_called)
//.autogamemode() // Start the game mode vote (if we haven't had one already)
// Called during GAME_STATE_SETTING_UP (RUNLEVEL_SETUP)
/datum/controller/subsystem/ticker/proc/setup_tick(resumed = FALSE)
if(!setup_choose_gamemode())
// It failed, go back to lobby state and re-send the welcome message
pregame_timeleft = config.pregame_time
SSvote.gamemode_vote_called = FALSE // Allow another autogamemode vote
// SSvote.gamemode_vote_called = FALSE // Allow another autogamemode vote
current_state = GAME_STATE_PREGAME
Master.SetRunLevel(RUNLEVEL_LOBBY)
pregame_welcome()
@@ -226,7 +226,7 @@ var/global/datum/controller/subsystem/ticker/ticker
mode.cleanup()
//call a transfer shuttle vote
to_world("<span class='danger'>The round has ended!</span>")
SSvote.autotransfer()
new /datum/vote/crew_transfer
// Called during GAME_STATE_FINISHED (RUNLEVEL_POSTGAME)
/datum/controller/subsystem/ticker/proc/post_game_tick()
+2
View File
@@ -1,3 +1,4 @@
/*
SUBSYSTEM_DEF(vote)
name = "Vote"
wait = 10
@@ -396,3 +397,4 @@ SUBSYSTEM_DEF(vote)
if(SSvote)
src << browse(SSvote.interface(src), "window=vote;size=500x[300 + SSvote.choices.len * 25]")
*/