[MIRROR] TGUI Vote Panel (#9131)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
CHOMPStation2
2024-10-03 16:09:08 -07:00
committed by GitHub
parent 2c66cfa704
commit 0f5272e622
12 changed files with 352 additions and 9 deletions

View File

@@ -19,13 +19,13 @@ var/datum/controller/transfer_controller/transfer_controller
currenttick = currenttick + 1
//VOREStation Edit START
if (round_duration_in_ds >= shift_last_vote - 2 MINUTES)
shift_last_vote = 1000000000000 //Setting to a stupidly high number since it'll be not used again.
shift_last_vote = 1000000000000 //Setting to a stupidly high number since it'll be not used again. //CHOMPEdit
to_world("<b>Warning: This upcoming round-extend vote will be your last chance to vote for shift extension. Wrap up your scenes in the next 60 minutes if the round is extended.</b>") //CHOMPStation Edit
if (round_duration_in_ds >= shift_hard_end - 1 MINUTE)
init_shift_change(null, 1)
shift_hard_end = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //If shuttle somehow gets recalled, let's force it to call again next time a vote would occur. // CHOMPEdit
timerbuffer = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) //Just to make sure a vote doesn't occur immediately afterwords. // CHOMPEdit
else if (round_duration_in_ds >= timerbuffer - 1 MINUTE)
SSvote.autotransfer()
new /datum/vote/crew_transfer
//VOREStation Edit END
timerbuffer = timerbuffer + CONFIG_GET(number/vote_autotransfer_interval) // CHOMPEdit

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()

View File

@@ -87,7 +87,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!
@@ -98,8 +98,8 @@ var/global/datum/controller/subsystem/ticker/ticker
fire() // Don't wait for next tick, do it now!
return
if(pregame_timeleft <= CONFIG_GET(number/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_GET(number/vote_autogamemode_timeleft) && !SSvote.gamemode_vote_called) //CHOMPEdit
//SSvote.autogamemode() // Start the game mode vote (if we haven't had one already) //CHOMPEdit
// Called during GAME_STATE_SETTING_UP (RUNLEVEL_SETUP)
/datum/controller/subsystem/ticker/proc/setup_tick(resumed = FALSE)
@@ -107,7 +107,7 @@ var/global/datum/controller/subsystem/ticker/ticker
if(!setup_choose_gamemode())
// It failed, go back to lobby state and re-send the welcome message
pregame_timeleft = CONFIG_GET(number/pregame_time) // CHOMPEdit
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()
@@ -229,7 +229,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()

View File

@@ -1,3 +1,4 @@
/*
SUBSYSTEM_DEF(vote)
name = "Vote"
wait = 10
@@ -404,3 +405,4 @@ SUBSYSTEM_DEF(vote)
if(SSvote)
src << browse(SSvote.interface(src), "window=vote;size=500x[300 + SSvote.choices.len * 25]")
*/

View File

@@ -1,3 +1,4 @@
/*
SUBSYSTEM_DEF(vote)
name = "Vote"
wait = 10
@@ -391,3 +392,4 @@ SUBSYSTEM_DEF(vote)
if(SSvote)
src << browse(SSvote.interface(src), "window=vote;size=500x[300 + SSvote.choices.len * 25]")
*/