Skip to content

Commit

Permalink
Merges Join game and ready up lobby buttons (#16729)
Browse files Browse the repository at this point in the history
Co-authored-by: TiviPlus <[email protected]>
  • Loading branch information
TiviPlus and TiviPlus authored Nov 15, 2024
1 parent 58a01af commit 1afcb82
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions code/_onclick/hud/screen_objects/menu_text_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,28 @@
maptext = "<span class='maptext' style=font-size:8px>JOIN GAME</span>"
icon_state = "join"

/atom/movable/screen/text/lobby/clickable/join_game/Initialize(mapload, datum/hud/hud_owner)
. = ..()
update_text()
RegisterSignal(SSdcs, COMSIG_GLOB_GAMEMODE_LOADED, TYPE_PROC_REF(/atom/movable/screen/text/lobby, update_text))

/atom/movable/screen/text/lobby/clickable/join_game/update_text()
var/mob/new_player/player = hud.mymob
if(SSticker?.current_state > GAME_STATE_PREGAME)
maptext = "<span class='maptext' style=font-size:8px>JOIN GAME</span>"
icon_state = "join"
return
maptext = "<span class='maptext' style=font-size:8px>YOU ARE: [player.ready ? "" : "NOT "]READY</span>"
icon_state = player.ready ? "ready" : "unready"

/atom/movable/screen/text/lobby/clickable/join_game/Click()
. = ..()
var/mob/new_player/player = hud.mymob
player.attempt_late_join()
if(SSticker?.current_state > GAME_STATE_PREGAME)
player.attempt_late_join()
return
player.toggle_ready()
update_text()


/atom/movable/screen/text/lobby/clickable/observe
Expand All @@ -88,21 +106,6 @@
var/mob/new_player/player = hud.mymob
player.try_to_observe()

/atom/movable/screen/text/lobby/clickable/ready
maptext = "<span class='maptext' style=font-size:8px>YOU ARE: NOT READY</span>"
icon_state = "unready"

/atom/movable/screen/text/lobby/clickable/ready/update_text()
var/mob/new_player/player = hud.mymob
maptext = "<span class='maptext' style=font-size:8px>YOU ARE: [player.ready ? "" : "NOT "]READY</span>"

/atom/movable/screen/text/lobby/clickable/ready/Click()
. = ..()
var/mob/new_player/player = hud.mymob
player.toggle_ready()
icon_state = player.ready ? "ready" : "unready"
update_text()

/atom/movable/screen/text/lobby/clickable/manifest
maptext = "<span class='maptext' style=font-size:8px>VIEW MANIFEST</span>"
icon_state = "manifest"
Expand Down

0 comments on commit 1afcb82

Please sign in to comment.