Skip to content

Commit

Permalink
merge join and ready button
Browse files Browse the repository at this point in the history
  • Loading branch information
Helg2 committed Nov 14, 2024
1 parent 3feb010 commit 964572c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

#define COMSIG_GLOB_SHIP_SELF_DESTRUCT_ACTIVATED "!ship_self_destruct_activated"

///Gamemode has successfully loaded
#define COMSIG_GLOB_GAMEMODE_LOADED "!gamemode_loaded"

/// from /obj/machinery/setAnchored(): (machine, anchoredstate)
#define COMSIG_GLOB_MACHINERY_ANCHORED_CHANGE "!machinery_anchored_change"

Expand Down
28 changes: 13 additions & 15 deletions code/_onclick/hud/screen_objects/menu_text_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,24 @@
maptext = "<span class='maptext' style=font-size:8px>ПРИСОЕДИНИТЬСЯ</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/Click()
. = ..()
var/mob/new_player/player = hud.mymob
player.attempt_late_join()

/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>ПРИСОЕДИНИТЬСЯ</span>"
icon_state = "join"
return
maptext = "<span class='maptext' style=font-size:8px>ВЫ: [player.ready ? "" : "НЕ "]ГОТОВЫ</span>"
icon_state = player.ready ? "ready" : "unready"

/atom/movable/screen/text/lobby/clickable/observe
maptext = "<span class='maptext' style=font-size:8px>НАБЛЮДАТЬ</span>"
Expand All @@ -88,21 +101,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>ВЫ: НЕ ГОТОВЫ</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>ВЫ: [player.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>МАНИФЕСТ</span>"
icon_state = "manifest"
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ SUBSYSTEM_DEF(ticker)

CHECK_TICK
PostSetup()
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_GAMEMODE_LOADED)
return TRUE


/datum/controller/subsystem/ticker/proc/PostSetup()
set waitfor = FALSE
mode.post_setup()
Expand Down
Binary file modified icons/UI_Icons/lobby_button.dmi
Binary file not shown.

0 comments on commit 964572c

Please sign in to comment.