mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-10 00:08:19 +00:00
## About The Pull Request Currently in the escape menu we have ``/atom/movable/screen/escape_menu/home_button`` (not to be confused with ``/atom/movable/screen/escape_menu/lobby_button`` which is an entirely separate thing) which itself contains a ``/atom/movable/screen/escape_menu/home_button_text`` that holds the maptext displayed to players. This is a little confusing and convoluted for nothing, so let's simplify it a bit ``/atom/movable/screen/escape_menu/text`` for text ``/atom/movable/screen/escape_menu/text/clickable`` for clickable text ``/atom/movable/screen/escape_menu/lobby_button`` for buttons This also fixes issues with maptext height/width, which was causing me issues when I was adding a player list button (not in this PR). This hopes to make adding things to the escape menu easier in the future. Slightly different offsets for UI buttons now, too  ## Why It's Good For The Game Easier to understand code for escape menu, making it easier to contribute to, and helps mitigate future issues with maptext. ## Changelog 🆑 code: The escape menu has a slightly different UI, again. /🆑
23 lines
563 B
Plaintext
23 lines
563 B
Plaintext
/atom/movable/screen/escape_menu/text/clickable/leave_body/Initialize(
|
|
mapload,
|
|
datum/hud/hud_owner,
|
|
datum/escape_menu/escape_menu,
|
|
button_text,
|
|
list/offset,
|
|
font_size = 24,
|
|
on_click_callback,
|
|
)
|
|
. = ..()
|
|
RegisterSignal(escape_menu.client, COMSIG_CLIENT_MOB_LOGIN, PROC_REF(on_client_mob_login))
|
|
|
|
/atom/movable/screen/escape_menu/text/clickable/leave_body/enabled()
|
|
if (!..())
|
|
return FALSE
|
|
|
|
return isliving(escape_menu.client?.mob)
|
|
|
|
/atom/movable/screen/escape_menu/text/clickable/leave_body/proc/on_client_mob_login()
|
|
SIGNAL_HANDLER
|
|
|
|
update_text()
|