Files
Bubberstation/code/modules/escape_menu/title.dm
SkyratBot daba1d93ae [MIRROR] Hud screens now set hud owner in Initialize. [MDB IGNORE] (#22501)
* Hud screens now set hud owner in Initialize.

* Merge conflicts

* modular adjustments

* Missed one

* Make this easier to spot

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Giz <vinylspiders@gmail.com>
2023-07-18 16:41:01 -04:00

44 lines
1.3 KiB
Plaintext

// This doesn't instantiate right away, since we rely on other GLOBs
GLOBAL_DATUM(escape_menu_title, /atom/movable/screen/escape_menu/title)
/// Provides a singleton for the escape menu details screen.
/proc/give_escape_menu_title()
if (isnull(GLOB.escape_menu_title))
GLOB.escape_menu_title = new
return GLOB.escape_menu_title
/atom/movable/screen/escape_menu/title
screen_loc = "NORTH:-100,WEST:32"
maptext_height = 100
maptext_width = 500
/atom/movable/screen/escape_menu/title/Initialize(mapload, datum/hud/hud_owner)
. = ..()
update_text()
RegisterSignal(SSdcs, COMSIG_GLOB_STATION_NAME_CHANGED, PROC_REF(on_station_name_changed))
/atom/movable/screen/escape_menu/title/Destroy()
if (GLOB.escape_menu_title == src)
stack_trace("Something tried to delete the escape menu details screen")
return QDEL_HINT_LETMELIVE
return ..()
/atom/movable/screen/escape_menu/title/proc/update_text()
var/subtitle_text = MAPTEXT("<span style='font-size: 8px'>Another day on...</span>")
var/title_text = {"
<span style='font-weight: bolder; font-size: 24px'>
[station_name()]
</span>
"}
maptext = "<font align='top'>" + subtitle_text + MAPTEXT_VCR_OSD_MONO(title_text) + "</font>"
/atom/movable/screen/escape_menu/title/proc/on_station_name_changed()
SIGNAL_HANDLER
update_text()