mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Radio examine qol (#89028)
## About The Pull Request Add `span_class` macro to use instead of <span class='class'> (now only used for changes I made to radio examine). Make radio channel tokens info from headset examine more readable by color coding and displaying it in list format. Currently set broadcast frequence is also color coded and bold. ## Why It's Good For The Game It's now easier to understand headset examine info :D <details> <summary> Before </summary>   </details> <details> <summary> After </summary>   </details> ## Changelog 🆑 qol: tokens and channel names in radio headset examine are now color coded and display in list format qol: broadcast frequency in examine is also color coded code: add new `span_class` macro /🆑
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// Just a generic span with class
|
||||
#define span_class(class, str) ("<span class='[class]'>" + str + "</span>")
|
||||
|
||||
// Sorted alphabetically
|
||||
#define span_abductor(str) ("<span class='abductor'>" + str + "</span>")
|
||||
#define span_admin(str) ("<span class='admin'>" + str + "</span>")
|
||||
|
||||
@@ -47,23 +47,31 @@ GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
/obj/item/radio/headset/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
if(item_flags & IN_INVENTORY && loc == user)
|
||||
// construction of frequency description
|
||||
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
|
||||
if(special_channels & RADIO_SPECIAL_BINARY)
|
||||
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
|
||||
if(length(channels))
|
||||
for(var/i in 1 to length(channels))
|
||||
if(i == 1)
|
||||
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [LOWER_TEXT(channels[i])]"
|
||||
else
|
||||
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [LOWER_TEXT(channels[i])]"
|
||||
. += span_notice("A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)].")
|
||||
|
||||
if(command)
|
||||
. += span_info("Alt-click to toggle the high-volume mode.")
|
||||
else
|
||||
if(!(item_flags & IN_INVENTORY) || loc != user)
|
||||
. += span_notice("A small screen on the headset flashes, it's too small to read without holding or wearing the headset.")
|
||||
return
|
||||
|
||||
// construction of frequency description
|
||||
var/list/available_channels = list()
|
||||
available_channels += "<li><b>[span_radio(RADIO_KEY_COMMON)]</b> for the currently tuned frequency</li>"
|
||||
if(special_channels & RADIO_SPECIAL_BINARY)
|
||||
available_channels += "<li><b>[span_binarysay(MODE_TOKEN_BINARY)] for [span_binarysay(capitalize(MODE_BINARY))]</b></li>"
|
||||
|
||||
for(var/i in 1 to length(channels))
|
||||
var/channel_name = channels[i]
|
||||
var/channel_token = GLOB.channel_tokens[channel_name]
|
||||
var/channel_span_class = get_radio_span(GLOB.radiochannels[channel_name])
|
||||
|
||||
if(i == 1)
|
||||
available_channels += "<li><b>[span_class(channel_span_class, MODE_TOKEN_DEPARTMENT)]</b> or <b>[span_class(channel_span_class, channel_token)]</b> for <b>[span_class(channel_span_class, channel_name)]</b></li>"
|
||||
else
|
||||
available_channels += "<li><b>[span_class(channel_span_class, channel_token)]</b> for <b>[span_class(channel_span_class, channel_name)]</b></li>"
|
||||
|
||||
. += span_notice("A small screen on the headset displays the following available frequencies:")
|
||||
. += span_notice("<ul style='display:inline-block; margin: 0; list-style: square;'>[available_channels.Join()]</ul>")
|
||||
|
||||
if(command)
|
||||
. += span_info("<b>Alt-click</b> to toggle the high-volume mode.")
|
||||
|
||||
/obj/item/radio/headset/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -528,7 +528,7 @@
|
||||
/obj/item/radio/examine(mob/user)
|
||||
. = ..()
|
||||
if (frequency && in_range(src, user))
|
||||
. += span_notice("It is set to broadcast over the [frequency/10] frequency.")
|
||||
. += span_notice("It is set to broadcast over the [span_radio("[frequency/10]")] frequency.")
|
||||
if (unscrewed)
|
||||
. += span_notice("It can be attached and modified.")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user