mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] refactors most spans (#9139)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
@@ -360,7 +360,7 @@
|
||||
|
||||
if("dial")
|
||||
if(!get_connection_to_tcomms())
|
||||
to_chat(usr, "<span class='danger'>Error: Cannot connect to Exonet node.</span>")
|
||||
to_chat(usr, span_danger("Error: Cannot connect to Exonet node."))
|
||||
return FALSE
|
||||
var/their_address = params["dial"]
|
||||
exonet.send_message(their_address, "voice")
|
||||
@@ -373,7 +373,7 @@
|
||||
|
||||
if("message")
|
||||
if(!get_connection_to_tcomms())
|
||||
to_chat(usr, "<span class='danger'>Error: Cannot connect to Exonet node.</span>")
|
||||
to_chat(usr, span_danger("Error: Cannot connect to Exonet node."))
|
||||
return FALSE
|
||||
var/their_address = params["message"]
|
||||
var/text = sanitizeSafe(tgui_input_text(usr,"Enter your message.","Text Message"))
|
||||
@@ -382,7 +382,7 @@
|
||||
im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text))
|
||||
log_pda("(COMM: [src]) sent \"[text]\" to [exonet.get_atom_from_address(their_address)]", usr)
|
||||
var/obj/item/communicator/comm = exonet.get_atom_from_address(their_address)
|
||||
to_chat(usr, "<span class='notice'>[icon2html(src, usr.client)] Sent message to [istype(comm, /obj/item/communicator) ? comm.owner : comm.name], <b>\"[text]\"</b> (<a href='?src=\ref[src];action=Reply;target=\ref[exonet.get_atom_from_address(comm.exonet.address)]'>Reply</a>)</span>")
|
||||
to_chat(usr, span_notice("[icon2html(src, usr.client)] Sent message to [istype(comm, /obj/item/communicator) ? comm.owner : comm.name], <b>\"[text]\"</b> (<a href='?src=\ref[src];action=Reply;target=\ref[exonet.get_atom_from_address(comm.exonet.address)]'>Reply</a>)"))
|
||||
for(var/mob/M in player_list)
|
||||
if(M.stat == DEAD && M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears))
|
||||
if(istype(M, /mob/new_player) || M.forbid_seeing_deadchat)
|
||||
|
||||
@@ -229,19 +229,19 @@ var/global/list/obj/item/communicator/all_communicators = list()
|
||||
. = ..()
|
||||
|
||||
for(var/mob/living/voice/voice in contents)
|
||||
. += "<span class='notice'>On the screen, you can see a image feed of [voice].</span>"
|
||||
. += span_notice("On the screen, you can see a image feed of [voice].")
|
||||
|
||||
if(voice && voice.key)
|
||||
switch(voice.stat)
|
||||
if(CONSCIOUS)
|
||||
if(!voice.client)
|
||||
. += "<span class='warning'>[voice] appears to be asleep.</span>" //afk
|
||||
. += span_warning("[voice] appears to be asleep.") //afk
|
||||
if(UNCONSCIOUS)
|
||||
. += "<span class='warning'>[voice] doesn't appear to be conscious.</span>"
|
||||
. += span_warning("[voice] doesn't appear to be conscious.")
|
||||
if(DEAD)
|
||||
. += "<span class='deadsay'>[voice] appears to have died...</span>" //Hopefully this never has to be used.
|
||||
. += span_deadsay("[voice] appears to have died...") //Hopefully this never has to be used.
|
||||
else
|
||||
. += "<span class='notice'>The device doesn't appear to be transmitting any data.</span>"
|
||||
. += span_notice("The device doesn't appear to be transmitting any data.")
|
||||
|
||||
// Proc: emp_act()
|
||||
// Parameters: None
|
||||
@@ -307,16 +307,16 @@ var/global/list/obj/item/communicator/all_communicators = list()
|
||||
if(istype(C, /obj/item/card/id))
|
||||
var/obj/item/card/id/idcard = C
|
||||
if(!idcard.registered_name || !idcard.assignment)
|
||||
to_chat(user, "<span class='notice'>\The [src] rejects the ID.</span>")
|
||||
to_chat(user, span_notice("\The [src] rejects the ID."))
|
||||
else if(!owner)
|
||||
to_chat(user, "<span class='notice'>\The [src] rejects the ID.</span>")
|
||||
to_chat(user, span_notice("\The [src] rejects the ID."))
|
||||
else if(owner == idcard.registered_name && occupation != idcard.assignment) //CHMPEDIT only edit assigment if different
|
||||
occupation = idcard.assignment
|
||||
to_chat(user, "<span class='notice'>Occupation updated.</span>")
|
||||
to_chat(user, span_notice(">Occupation updated."))
|
||||
//CHOMPADDITION START Communicator ID slotting if we have an ID thats also already scanned
|
||||
else if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) )
|
||||
if(id_check(user, 2))
|
||||
to_chat(user, "<span class='notice'>You put the ID into \the [src]'s slot.</span>")
|
||||
to_chat(user, span_notice("You put the ID into \the [src]'s slot."))
|
||||
add_overlay("pda-id")
|
||||
updateSelfDialog()//Update self dialog on success.
|
||||
return //Return in case of failed check or when successful.
|
||||
@@ -402,7 +402,7 @@ var/global/list/obj/item/communicator/all_communicators = list()
|
||||
//CHOMPADDITION END
|
||||
for(var/mob/living/voice/voice in contents)
|
||||
voice_mobs.Remove(voice)
|
||||
to_chat(voice, "<span class='danger'>[icon2html(src, voice.client)] Connection timed out with remote host.</span>")
|
||||
to_chat(voice, span_danger("[icon2html(src, voice.client)] Connection timed out with remote host."))
|
||||
qdel(voice)
|
||||
close_connection(reason = "Connection timed out")
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
random = random / 10
|
||||
exonet.send_message(origin_address, "64 bytes received from [exonet.address] ecmp_seq=1 ttl=51 time=[random] ms")
|
||||
if(message == "text")
|
||||
to_chat(src, "<span class='notice'>[icon2html(origin_atom,src.client)] Received text message from [origin_atom]: <b>\"[text]\"</b></span>")
|
||||
to_chat(src, span_notice("[icon2html(origin_atom,src.client)] Received text message from [origin_atom]: <b>\"[text]\"</b>"))
|
||||
src << 'sound/machines/defib_safetyOff.ogg'
|
||||
exonet_messages.Add("<b>From [origin_atom]:</b><br>[text]")
|
||||
return
|
||||
@@ -95,7 +95,7 @@
|
||||
L = loc
|
||||
|
||||
if(L)
|
||||
to_chat(L, "<span class='notice'>[icon2html(src,L.client)] Message from [who]: <b>\"[text]\"</b> (<a href='?src=\ref[src];action=Reply;target=\ref[candidate]'>Reply</a>)</span>")
|
||||
to_chat(L, span_notice("[icon2html(src,L.client)] Message from [who]: <b>\"[text]\"</b> (<a href='?src=\ref[src];action=Reply;target=\ref[candidate]'>Reply</a>)"))
|
||||
|
||||
// This is the only Topic the communicators really uses
|
||||
/obj/item/communicator/Topic(href, href_list)
|
||||
@@ -108,7 +108,7 @@
|
||||
exonet.send_message(comm.exonet.address, "text", message)
|
||||
im_list += list(list("address" = exonet.address, "to_address" = comm.exonet.address, "im" = message))
|
||||
log_pda("(COMM: [src]) sent \"[message]\" to [exonet.get_atom_from_address(comm.exonet.address)]", usr)
|
||||
to_chat(usr, "<span class='notice'>[icon2html(src,usr.client)] Sent message to [istype(comm, /obj/item/communicator) ? comm.owner : comm.name], <b>\"[message]\"</b> (<a href='?src=\ref[src];action=Reply;target=\ref[exonet.get_atom_from_address(comm.exonet.address)]'>Reply</a>)</span>")
|
||||
to_chat(usr, span_notice("[icon2html(src,usr.client)] Sent message to [istype(comm, /obj/item/communicator) ? comm.owner : comm.name], <b>\"[message]\"</b> (<a href='?src=\ref[src];action=Reply;target=\ref[exonet.get_atom_from_address(comm.exonet.address)]'>Reply</a>)"))
|
||||
|
||||
// Verb: text_communicator()
|
||||
// Parameters: None
|
||||
@@ -119,7 +119,7 @@
|
||||
set desc = "If there is a communicator available, send a text message to it."
|
||||
|
||||
if(ticker.current_state < GAME_STATE_PLAYING)
|
||||
to_chat(src, "<span class='danger'>The game hasn't started yet!</span>")
|
||||
to_chat(src, span_danger("The game hasn't started yet!"))
|
||||
return
|
||||
|
||||
if (!src.stat)
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
for(var/mob/living/L in mob_list) //Simple check so you don't have dead people calling.
|
||||
if(src.client.prefs.real_name == L.real_name)
|
||||
to_chat(src, "<span class='danger'>Your identity is already present in the game world. Please load in a different character first.</span>")
|
||||
to_chat(src, span_danger("Your identity is already present in the game world. Please load in a different character first."))
|
||||
return
|
||||
|
||||
var/obj/machinery/exonet_node/E = get_exonet_node()
|
||||
@@ -146,7 +146,7 @@
|
||||
choices.Add(comm)
|
||||
|
||||
if(!choices.len)
|
||||
to_chat(src, "<span class='danger'>There are no available communicators, sorry.</span>")
|
||||
to_chat(src, span_danger("There are no available communicators, sorry."))
|
||||
return
|
||||
|
||||
var/choice = tgui_input_list(src,"Send a text message to whom?", "Recipient Choice", choices)
|
||||
@@ -157,7 +157,7 @@
|
||||
if(text_message && O.exonet)
|
||||
O.exonet.send_message(chosen_communicator.exonet.address, "text", text_message)
|
||||
|
||||
to_chat(src, "<span class='notice'>You have sent '[text_message]' to [chosen_communicator].</span>")
|
||||
to_chat(src, span_notice("You have sent '[text_message]' to [chosen_communicator]."))
|
||||
exonet_messages.Add("<b>To [chosen_communicator]:</b><br>[text_message]")
|
||||
log_pda("(DCOMM: [src]) sent \"[text_message]\" to [chosen_communicator]", src)
|
||||
for(var/mob/M in player_list)
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
comm.voice_requests.Remove(src)
|
||||
|
||||
if(user)
|
||||
comm.visible_message("<span class='notice'>[icon2html(src,viewers(src))] Connecting to [src].</span>")
|
||||
to_chat(user, "<span class='notice'>[icon2html(src,user.client)] Attempting to call [comm].</span>")
|
||||
comm.visible_message(span_notice("[icon2html(src,viewers(src))] Connecting to [src]."))
|
||||
to_chat(user, span_notice("[icon2html(src,user.client)] Attempting to call [comm]."))
|
||||
sleep(10)
|
||||
to_chat(user, "<span class='notice'>[icon2html(src,user.client)] Dialing internally from [station_name()], [system_name()].</span>")
|
||||
to_chat(user, span_notice("[icon2html(src,user.client)] Dialing internally from [station_name()], [system_name()]."))
|
||||
sleep(20) //If they don't have an exonet something is very wrong and we want a runtime.
|
||||
to_chat(user, "<span class='notice'>[icon2html(src,user.client)] Connection re-routed to [comm] at [comm.exonet.address].</span>")
|
||||
to_chat(user, span_notice("[icon2html(src,user.client)] Connection re-routed to [comm] at [comm.exonet.address]."))
|
||||
sleep(40)
|
||||
to_chat(user, "<span class='notice'>[icon2html(src,user.client)] Connection to [comm] at [comm.exonet.address] established.</span>")
|
||||
comm.visible_message("<span class='notice'>[icon2html(src,viewers(src))] Connection to [src] at [exonet.address] established.</span>")
|
||||
to_chat(user, span_notice("[icon2html(src,user.client)] Connection to [comm] at [comm.exonet.address] established."))
|
||||
comm.visible_message(span_notice("[icon2html(src,viewers(src))] Connection to [src] at [exonet.address] established."))
|
||||
sleep(20)
|
||||
|
||||
src.add_communicating(comm)
|
||||
@@ -86,28 +86,28 @@
|
||||
|
||||
//Now for some connection fluff.
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>[icon2html(src,user.client)] Connecting to [candidate].</span>")
|
||||
to_chat(new_voice, "<span class='notice'>[icon2html(src,new_voice.client)] Attempting to call [src].</span>")
|
||||
to_chat(user, span_notice("[icon2html(src,user.client)] Connecting to [candidate]."))
|
||||
to_chat(new_voice, span_notice("[icon2html(src,new_voice.client)] Attempting to call [src]."))
|
||||
sleep(10)
|
||||
to_chat(new_voice, "<span class='notice'>[icon2html(src,new_voice.client)] Dialing to [station_name()], Kara Subsystem, [system_name()].</span>")
|
||||
to_chat(new_voice, span_notice("[icon2html(src,new_voice.client)] Dialing to [station_name()], Kara Subsystem, [system_name()]."))
|
||||
sleep(20)
|
||||
to_chat(new_voice, "<span class='notice'>[icon2html(src,new_voice.client)] Connecting to [station_name()] telecommunications array.</span>")
|
||||
to_chat(new_voice, span_notice("[icon2html(src,new_voice.client)] Connecting to [station_name()] telecommunications array."))
|
||||
sleep(40)
|
||||
to_chat(new_voice, "<span class='notice'>[icon2html(src,new_voice.client)] Connection to [station_name()] telecommunications array established. Redirecting signal to [src].</span>")
|
||||
to_chat(new_voice, span_notice("[icon2html(src,new_voice.client)] Connection to [station_name()] telecommunications array established. Redirecting signal to [src]."))
|
||||
sleep(20)
|
||||
|
||||
//We're connected, no need to hide everything.
|
||||
new_voice.client.screen.Remove(blackness)
|
||||
qdel(blackness)
|
||||
|
||||
to_chat(new_voice, "<span class='notice'>[icon2html(src,new_voice.client)] Connection to [src] established.</span>")
|
||||
to_chat(new_voice, span_notice("[icon2html(src,new_voice.client)] Connection to [src] established."))
|
||||
to_chat(new_voice, "<b>To talk to the person on the other end of the call, just talk normally.</b>")
|
||||
to_chat(new_voice, "<b>If you want to end the call, use the 'Hang Up' verb. The other person can also hang up at any time.</b>")
|
||||
to_chat(new_voice, "<b>Remember, your character does not know anything you've learned from observing!</b>")
|
||||
if(new_voice.mind)
|
||||
new_voice.mind.assigned_role = JOB_DISEMBODIED_VOICE
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>[icon2html(src,new_voice.client)] Your communicator is now connected to [candidate]'s communicator.</span>")
|
||||
to_chat(user, span_notice("[icon2html(src,new_voice.client)] Your communicator is now connected to [candidate]'s communicator."))
|
||||
|
||||
// Proc: close_connection()
|
||||
// Parameters: 3 (user - the user who initiated the disconnect, target - the mob or device being disconnected, reason - string shown when disconnected)
|
||||
@@ -120,8 +120,8 @@
|
||||
for(var/mob/living/voice/voice in voice_mobs) //Handle ghost-callers
|
||||
if(target && voice != target) //If no target is inputted, it deletes all of them.
|
||||
continue
|
||||
to_chat(voice, "<span class='danger'>[icon2html(src,voice.client)] [reason].</span>")
|
||||
visible_message("<span class='danger'>[icon2html(src,viewers(src))] [reason].</span>")
|
||||
to_chat(voice, span_danger("[icon2html(src,voice.client)] [reason]."))
|
||||
visible_message(span_danger("[icon2html(src,viewers(src))] [reason]."))
|
||||
voice_mobs.Remove(voice)
|
||||
qdel(voice)
|
||||
update_icon()
|
||||
@@ -131,8 +131,8 @@
|
||||
continue
|
||||
src.del_communicating(comm)
|
||||
comm.del_communicating(src)
|
||||
comm.visible_message("<span class='danger'>[icon2html(src,viewers(src))] [reason].</span>")
|
||||
visible_message("<span class='danger'>[icon2html(src,viewers(src))] [reason].</span>")
|
||||
comm.visible_message(span_danger("[icon2html(src,viewers(src))] [reason]."))
|
||||
visible_message(span_danger("[icon2html(src,viewers(src))] [reason]."))
|
||||
if(comm.camera && video_source == comm.camera) //We hung up on the person on video
|
||||
end_video()
|
||||
if(camera && comm.video_source == camera) //We hung up on them while they were watching us
|
||||
@@ -174,7 +174,7 @@
|
||||
L = loc
|
||||
|
||||
if(L)
|
||||
to_chat(L, "<span class='notice'>[icon2html(src,L.client)] Communications request from [who].</span>")
|
||||
to_chat(L, span_notice("[icon2html(src,L.client)] Communications request from [who]."))
|
||||
|
||||
// Proc: del_request()
|
||||
// Parameters: 1 (candidate - the ghost or communicator to be declined)
|
||||
@@ -184,7 +184,7 @@
|
||||
return
|
||||
|
||||
if(isobserver(candidate))
|
||||
to_chat(candidate, "<span class='warning'>Your communicator call request was declined.</span>")
|
||||
to_chat(candidate, span_warning("Your communicator call request was declined."))
|
||||
else if(istype(candidate, /obj/item/communicator))
|
||||
var/obj/item/communicator/comm = candidate
|
||||
comm.voice_invites -= src
|
||||
@@ -197,7 +197,7 @@
|
||||
us = loc
|
||||
|
||||
if(us)
|
||||
to_chat(us, "<span class='notice'>[icon2html(src,us.client)] Declined request.</span>")
|
||||
to_chat(us, span_notice("[icon2html(src,us.client)] Declined request."))
|
||||
|
||||
// Proc: see_emote()
|
||||
// Parameters: 2 (M - the mob the emote originated from, text - the emote's contents)
|
||||
@@ -250,7 +250,7 @@
|
||||
var/message = combined["formatted"]
|
||||
var/name_used = M.GetVoice()
|
||||
var/rendered = null
|
||||
rendered = "<span class='game say'>[icon2html(src,mobs_to_relay)] <span class='name'>[name_used]</span> [message]</span>"
|
||||
rendered = span_game(span_say("[icon2html(src,mobs_to_relay)] [span_name(name_used)] [message]"))
|
||||
mob.show_message(rendered, 2)
|
||||
|
||||
// Proc: show_message()
|
||||
@@ -277,7 +277,7 @@
|
||||
set desc = "If there is a communicator available, send a request to speak through it. This will reset your respawn timer, if someone picks up."
|
||||
|
||||
if(ticker.current_state < GAME_STATE_PLAYING)
|
||||
to_chat(src, "<span class='danger'>The game hasn't started yet!</span>")
|
||||
to_chat(src, span_danger("The game hasn't started yet!"))
|
||||
return
|
||||
|
||||
if (!src.stat)
|
||||
@@ -291,12 +291,12 @@
|
||||
return
|
||||
|
||||
if(CONFIG_GET(flag/antag_hud_restricted) && has_enabled_antagHUD == 1) // CHOMPEdit
|
||||
to_chat(src, "<span class='danger'>You have used the antagHUD and cannot respawn or use communicators!</span>")
|
||||
to_chat(src, span_danger("You have used the antagHUD and cannot respawn or use communicators!"))
|
||||
return
|
||||
|
||||
for(var/mob/living/L in mob_list) //Simple check so you don't have dead people calling.
|
||||
if(src.client.prefs.real_name == L.real_name)
|
||||
to_chat(src, "<span class='danger'>Your identity is already present in the game world. Please load in a different character first.</span>")
|
||||
to_chat(src, span_danger("Your identity is already present in the game world. Please load in a different character first."))
|
||||
return
|
||||
|
||||
var/obj/machinery/exonet_node/E = get_exonet_node()
|
||||
@@ -312,7 +312,7 @@
|
||||
choices.Add(comm)
|
||||
|
||||
if(!choices.len)
|
||||
to_chat(src , "<span class='danger'>There are no available communicators, sorry.</span>")
|
||||
to_chat(src , span_danger("There are no available communicators, sorry."))
|
||||
return
|
||||
|
||||
var/choice = tgui_input_list(src,"Send a voice request to whom?", "Recipient Choice", choices)
|
||||
@@ -331,23 +331,23 @@
|
||||
if((!user) || (!comm) || user.stat) return //KO or dead, or already in a video
|
||||
|
||||
if(video_source) //Already in a video
|
||||
to_chat(user, "<span class='danger'>You are already connected to a video call!</span>")
|
||||
to_chat(user, span_danger("You are already connected to a video call!"))
|
||||
return
|
||||
|
||||
if(user.blinded) //User is blinded
|
||||
to_chat(user, "<span class='danger'>You cannot see well enough to do that!</span>")
|
||||
to_chat(user, span_danger("You cannot see well enough to do that!"))
|
||||
return
|
||||
|
||||
if(!(src in comm.communicating) || !comm.camera) //You called someone with a broken communicator or one that's fake or yourself or something
|
||||
to_chat(user, "<span class='danger'>[icon2html(src, user.client)]ERROR: Video failed. Either bandwidth is too low, or the other communicator is malfunctioning.</span>")
|
||||
to_chat(user, span_danger("[icon2html(src, user.client)]ERROR: Video failed. Either bandwidth is too low, or the other communicator is malfunctioning."))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>[icon2html(src, user.client)] Attempting to start video over existing call.</span>")
|
||||
to_chat(user, span_notice("[icon2html(src, user.client)] Attempting to start video over existing call."))
|
||||
sleep(30)
|
||||
to_chat(user, "<span class='notice'>[icon2html(src, user.client)] Please wait...</span>")
|
||||
to_chat(user, span_notice("[icon2html(src, user.client)] Please wait..."))
|
||||
|
||||
video_source = comm.camera
|
||||
comm.visible_message("<span class='danger'>[icon2html(src,viewers(src))] New video connection from [comm].</span>")
|
||||
comm.visible_message(span_danger("[icon2html(src,viewers(src))] New video connection from [comm]."))
|
||||
update_active_camera_screen()
|
||||
RegisterSignal(video_source, COMSIG_OBSERVER_MOVED, PROC_REF(update_active_camera_screen))
|
||||
video_source.AddComponent(/datum/component/recursive_move)
|
||||
@@ -361,7 +361,7 @@
|
||||
show_static()
|
||||
video_source = null
|
||||
|
||||
. = "<span class='danger'>[bicon(src)] [reason ? reason : "Video session ended"].</span>"
|
||||
. = span_danger("[bicon(src)] [reason ? reason : "Video session ended"].")
|
||||
|
||||
visible_message(.)
|
||||
update_icon()
|
||||
|
||||
Reference in New Issue
Block a user