Merge pull request #15990 from SandPoot/lobby-collapse

Collapsible lobby buttons
This commit is contained in:
Lin
2023-07-20 11:55:29 -05:00
committed by GitHub
10 changed files with 220 additions and 31 deletions
+37 -7
View File
@@ -1,6 +1,9 @@
///Cooldown for the Reset Lobby Menu HUD verb
#define RESET_HUD_INTERVAL 15 SECONDS
/mob/dead/new_player
var/ready = 0
var/spawning = 0//Referenced when you want to delete the new_player later on in the code.
///Referenced when you want to delete the new_player later on in the code.
var/spawning = 0
flags_1 = NONE
@@ -11,13 +14,16 @@
hud_type = /datum/hud/new_player
hud_possible = list()
var/mob/living/new_character //for instant transfer once the round is set up
///For instant transfer once the round is set up
var/mob/living/new_character
//Used to make sure someone doesn't get spammed with messages if they're ineligible for roles
///Used to make sure someone doesn't get spammed with messages if they're ineligible for roles
var/ineligible_for_roles = FALSE
//is there a result we want to read from the age gate
///Is there a result we want to read from the age gate
var/age_gate_result
///Cooldown for the Reset Lobby Menu HUD verb
COOLDOWN_DECLARE(reset_hud_cooldown)
/mob/dead/new_player/Initialize(mapload)
if(client && SSticker.state == GAME_STATE_STARTUP)
@@ -34,6 +40,7 @@
. = ..()
GLOB.new_player_list += src
add_verb(src, /mob/dead/new_player/proc/reset_menu_hud)
/mob/dead/new_player/Destroy()
GLOB.new_player_list -= src
@@ -351,6 +358,11 @@
return
to_chat(src, "<span class='notice'>Vote successful.</span>")
/mob/dead/new_player/get_status_tab_items()
. = ..()
if(!SSticker.HasRoundStarted()) //only show this when the round hasn't started yet
. += "Readiness status: [ready ? "" : "Not "]Readied Up!"
//When you cop out of the round (NB: this HAS A SLEEP FOR PLAYER INPUT IN IT)
/mob/dead/new_player/proc/make_me_an_observer()
if(QDELETED(src) || !src.client)
@@ -579,14 +591,14 @@
if(job_datum && IsJobUnavailable(job_datum.title, TRUE) == JOB_AVAILABLE)
// Get currently occupied slots
var/num_positions_current = job_datum.current_positions
// Get total slots that can be occupied
var/num_positions_total = job_datum.total_positions
// Change to lemniscate for infinite-slot jobs
// This variable should only used to display text!
num_positions_total = (num_positions_total == -1 ? "∞" : num_positions_total)
var/command_bold = ""
if(job in GLOB.command_positions)
command_bold = " command"
@@ -752,3 +764,21 @@
return FALSE //This is the only case someone should actually be completely blocked from antag rolling as well
return TRUE
///Resets the Lobby Menu HUD, recreating and reassigning it to the new player
/mob/dead/new_player/proc/reset_menu_hud()
set name = "Reset Lobby Menu HUD"
set category = "OOC"
var/mob/dead/new_player/new_player = usr
if(!COOLDOWN_FINISHED(new_player, reset_hud_cooldown))
to_chat(new_player, span_warning("You must wait <b>[DisplayTimeText(COOLDOWN_TIMELEFT(new_player, reset_hud_cooldown))]</b> before resetting the Lobby Menu HUD again!"))
return
if(!new_player?.client)
return
COOLDOWN_START(new_player, reset_hud_cooldown, RESET_HUD_INTERVAL)
qdel(new_player.hud_used)
create_mob_hud()
to_chat(new_player, span_info("Lobby Menu HUD reset. You may reset the HUD again in <b>[DisplayTimeText(RESET_HUD_INTERVAL)]</b>."))
hud_used.show_hud(hud_used.hud_version)
#undef RESET_HUD_INTERVAL