Some uplink component GetComponent cleanup

This commit is contained in:
ninjanomnom
2018-06-23 01:41:34 -04:00
parent 1f50c38aa6
commit bbb4147aa2
15 changed files with 308 additions and 238 deletions
+3 -8
View File
@@ -519,16 +519,11 @@ GLOBAL_LIST_EMPTY(PDAs)
if("Ringtone")
var/t = input(U, "Please enter new ringtone", name, ttone) as text
if(in_range(src, U) && loc == U && t)
GET_COMPONENT(hidden_uplink, /datum/component/uplink)
if(hidden_uplink && (trim(lowertext(t)) == trim(lowertext(lock_code))))
hidden_uplink.locked = FALSE
hidden_uplink.interact(U)
to_chat(U, "The PDA softly beeps.")
if(SEND_SIGNAL(src, COMSIG_PDA_CHANGE_RINGTONE, U, t) & COMPONENT_STOP_RINGTONE_CHANGE)
U << browse(null, "window=pda")
src.mode = 0
return
else
t = copytext(sanitize(t), 1, 20)
ttone = t
ttone = copytext(sanitize(t), 1, 20)
else
U << browse(null, "window=pda")
return
@@ -47,6 +47,7 @@
return BRUTELOSS
/obj/item/radio/proc/set_frequency(new_frequency)
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
remove_radio(src, frequency)
frequency = add_radio(src, new_frequency)
@@ -159,13 +160,7 @@
tune = tune * 10
. = TRUE
if(.)
frequency = sanitize_frequency(tune, freerange)
set_frequency(frequency)
GET_COMPONENT(hidden_uplink, /datum/component/uplink)
if(hidden_uplink && (frequency == traitor_frequency))
hidden_uplink.locked = FALSE
hidden_uplink.interact(usr)
ui.close()
set_frequency(sanitize_frequency(tune, freerange))
if("listen")
listening = !listening
. = TRUE