Refactors most spans into span procs (#59645)

Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
This commit is contained in:
Watermelon914
2021-06-14 21:03:53 +01:00
committed by GitHub
parent b9982f6970
commit 375a20e49b
1676 changed files with 15455 additions and 15226 deletions
@@ -39,7 +39,7 @@
. += "It has a slot installed for an intelliCard which contains: [ai_slot.stored_card.name]"
else
. += "It has a slot installed for an intelliCard, which appears to be occupied."
. += "<span class='info'>Alt-click to eject the intelliCard.</span>"
. += span_info("Alt-click to eject the intelliCard.")
else
. += "It has a slot installed for an intelliCard."
@@ -55,7 +55,7 @@
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
else
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
. += "<span class='info'>Alt-click [src] to eject the identification card[multiple_cards ? "s":""].</span>"
. += span_info("Alt-click [src] to eject the identification card[multiple_cards ? "s":""].")
else
. += "It has [multiple_slots ? "two slots" : "a slot"] installed for identification cards."
@@ -215,7 +215,7 @@
/obj/item/modular_computer/emag_act(mob/user)
if(!enabled)
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
to_chat(user, span_warning("You'd need to turn the [src] on first."))
return FALSE
obj_flags |= EMAGGED //Mostly for consistancy purposes; the programs will do their own emag handling
var/newemag = FALSE
@@ -226,17 +226,17 @@
if(app.run_emag())
newemag = TRUE
if(newemag)
to_chat(user, "<span class='notice'>You swipe \the [src]. A console window momentarily fills the screen, with white text rapidly scrolling past.</span>")
to_chat(user, span_notice("You swipe \the [src]. A console window momentarily fills the screen, with white text rapidly scrolling past."))
return TRUE
to_chat(user, "<span class='notice'>You swipe \the [src]. A console window fills the screen, but it quickly closes itself after only a few lines are written to it.</span>")
to_chat(user, span_notice("You swipe \the [src]. A console window fills the screen, but it quickly closes itself after only a few lines are written to it."))
return FALSE
/obj/item/modular_computer/examine(mob/user)
. = ..()
if(obj_integrity <= integrity_failure * max_integrity)
. += "<span class='danger'>It is heavily damaged!</span>"
. += span_danger("It is heavily damaged!")
else if(obj_integrity < max_integrity)
. += "<span class='warning'>It is damaged.</span>"
. += span_warning("It is damaged.")
. += get_modular_computer_parts_examine(user)
@@ -267,9 +267,9 @@
var/issynth = issilicon(user) // Robots and AIs get different activation messages.
if(obj_integrity <= integrity_failure * max_integrity)
if(issynth)
to_chat(user, "<span class='warning'>You send an activation signal to \the [src], but it responds with an error code. It must be damaged.</span>")
to_chat(user, span_warning("You send an activation signal to \the [src], but it responds with an error code. It must be damaged."))
else
to_chat(user, "<span class='warning'>You press the power button, but the computer fails to boot up, displaying variety of errors before shutting down again.</span>")
to_chat(user, span_warning("You press the power button, but the computer fails to boot up, displaying variety of errors before shutting down again."))
return FALSE
// If we have a recharger, enable it automatically. Lets computer without a battery work.
@@ -279,9 +279,9 @@
if(all_components[MC_CPU] && use_power()) // use_power() checks if the PC is powered
if(issynth)
to_chat(user, "<span class='notice'>You send an activation signal to \the [src], turning it on.</span>")
to_chat(user, span_notice("You send an activation signal to \the [src], turning it on."))
else
to_chat(user, "<span class='notice'>You press the power button and start up \the [src].</span>")
to_chat(user, span_notice("You press the power button and start up \the [src]."))
if(looping_sound)
soundloop.start()
enabled = 1
@@ -290,9 +290,9 @@
return TRUE
else // Unpowered
if(issynth)
to_chat(user, "<span class='warning'>You send an activation signal to \the [src] but it does not respond.</span>")
to_chat(user, span_warning("You send an activation signal to \the [src] but it does not respond."))
else
to_chat(user, "<span class='warning'>You press the power button but \the [src] does not respond.</span>")
to_chat(user, span_warning("You press the power button but \the [src] does not respond."))
return FALSE
// Process currently calls handle_power(), may be expanded in future if more things are added.
@@ -348,10 +348,10 @@
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
return
playsound(src, sound, 50, TRUE)
visible_message("<span class='notice'>The [src] displays a [caller.filedesc] notification: [alerttext]</span>")
visible_message(span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
var/mob/living/holder = loc
if(istype(holder))
to_chat(holder, "[icon2html(src)] <span class='notice'>The [src] displays a [caller.filedesc] notification: [alerttext]</span>")
to_chat(holder, "[icon2html(src)] [span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]")]")
// Function used by NanoUI's to obtain data for header. All relevant entries begin with "PC_"
/obj/item/modular_computer/proc/get_header_data()
@@ -446,7 +446,7 @@
if(looping_sound)
soundloop.stop()
if(loud)
physical.visible_message("<span class='notice'>\The [src] shuts down.</span>")
physical.visible_message(span_notice("\The [src] shuts down."))
enabled = 0
update_appearance()
@@ -484,7 +484,7 @@
/obj/item/modular_computer/screwdriver_act(mob/user, obj/item/tool)
if(!all_components.len)
to_chat(user, "<span class='warning'>This device doesn't have any components installed.</span>")
to_chat(user, span_warning("This device doesn't have any components installed."))
return
var/list/component_names = list()
for(var/h in all_components)
@@ -526,26 +526,26 @@
if(W.tool_behaviour == TOOL_WRENCH)
if(all_components.len)
to_chat(user, "<span class='warning'>Remove all components from \the [src] before disassembling it.</span>")
to_chat(user, span_warning("Remove all components from \the [src] before disassembling it."))
return
new /obj/item/stack/sheet/iron( get_turf(src.loc), steel_sheet_cost )
physical.visible_message("<span class='notice'>\The [src] is disassembled by [user].</span>")
physical.visible_message(span_notice("\The [src] is disassembled by [user]."))
relay_qdel()
qdel(src)
return
if(W.tool_behaviour == TOOL_WELDER)
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>\The [src] does not require repairs.</span>")
to_chat(user, span_warning("\The [src] does not require repairs."))
return
if(!W.tool_start_check(user, amount=1))
return
to_chat(user, "<span class='notice'>You begin repairing damage to \the [src]...</span>")
to_chat(user, span_notice("You begin repairing damage to \the [src]..."))
if(W.use_tool(src, user, 20, volume=50, amount=1))
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair \the [src].</span>")
to_chat(user, span_notice("You repair \the [src]."))
return
var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD]
@@ -3,19 +3,19 @@
return FALSE
if(H.w_class > max_hardware_size)
to_chat(user, "<span class='warning'>This component is too large for \the [src]!</span>")
to_chat(user, span_warning("This component is too large for \the [src]!"))
return FALSE
if(H.expansion_hw)
if(LAZYLEN(expansion_bays) >= max_bays)
to_chat(user, "<span class='warning'>All of the computer's expansion bays are filled.</span>")
to_chat(user, span_warning("All of the computer's expansion bays are filled."))
return FALSE
if(LAZYACCESS(expansion_bays, H.device_type))
to_chat(user, "<span class='warning'>The computer immediately ejects /the [H] and flashes an error: \"Hardware Address Conflict\".</span>")
to_chat(user, span_warning("The computer immediately ejects /the [H] and flashes an error: \"Hardware Address Conflict\"."))
return FALSE
if(all_components[H.device_type])
to_chat(user, "<span class='warning'>This computer's hardware slot is already occupied by \the [all_components[H.device_type]].</span>")
to_chat(user, span_warning("This computer's hardware slot is already occupied by \the [all_components[H.device_type]]."))
return FALSE
return TRUE
@@ -32,7 +32,7 @@
LAZYSET(expansion_bays, H.device_type, H)
all_components[H.device_type] = H
to_chat(user, "<span class='notice'>You install \the [H] into \the [src].</span>")
to_chat(user, span_notice("You install \the [H] into \the [src]."))
H.holder = src
H.forceMove(src)
H.on_install(src, user)
@@ -47,7 +47,7 @@
LAZYREMOVE(expansion_bays, H.device_type)
all_components.Remove(H.device_type)
to_chat(user, "<span class='notice'>You remove \the [H] from \the [src].</span>")
to_chat(user, span_notice("You remove \the [H] from \the [src]."))
H.forceMove(get_turf(src))
H.holder = null
@@ -18,7 +18,7 @@
/obj/item/modular_computer/proc/break_apart()
if(!(flags_1 & NODECONSTRUCT_1))
physical.visible_message("<span class='notice'>\The [src] breaks apart!</span>")
physical.visible_message(span_notice("\The [src] breaks apart!"))
var/turf/newloc = get_turf(src)
new /obj/item/stack/sheet/iron(newloc, round(steel_sheet_cost/2))
for(var/C in all_components)
@@ -14,7 +14,7 @@
return
if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS))
to_chat(user, "<span class='warning'>Your fingers are too big to use this right now!</span>")
to_chat(user, span_warning("Your fingers are too big to use this right now!"))
return
// Robots don't really need to see the screen, their wireless connection works as long as computer is on.
@@ -34,7 +34,7 @@
// This screen simply lists available programs and user may select them.
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
if(!hard_drive || !hard_drive.stored_files || !hard_drive.stored_files.len)
to_chat(user, "<span class='danger'>\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning.</span>")
to_chat(user, span_danger("\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning."))
return // No HDD, No HDD files list or no stored files. Something is very broken.
ui = SStgui.try_update_ui(user, src, ui)
@@ -130,7 +130,7 @@
return
P.kill_program(forced = TRUE)
to_chat(user, "<span class='notice'>Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed.</span>")
to_chat(user, span_notice("Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed."))
if("PC_runprogram")
var/prog = params["name"]
@@ -140,7 +140,7 @@
P = hard_drive.find_file_by_name(prog)
if(!P || !istype(P)) // Program not found or it's not executable program.
to_chat(user, "<span class='danger'>\The [src]'s screen shows \"I/O ERROR - Unable to run program\" warning.</span>")
to_chat(user, span_danger("\The [src]'s screen shows \"I/O ERROR - Unable to run program\" warning."))
return
P.computer = src
@@ -160,11 +160,11 @@
var/obj/item/computer_hardware/processor_unit/PU = all_components[MC_CPU]
if(idle_threads.len > PU.max_idle_programs)
to_chat(user, "<span class='danger'>\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error.</span>")
to_chat(user, span_danger("\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error."))
return
if(P.requires_ntnet && !get_ntnet_status(P.requires_ntnet_feature)) // The program requires NTNet connection, but we are not connected to NTNet.
to_chat(user, "<span class='danger'>\The [src]'s screen shows \"Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.</span>")
to_chat(user, span_danger("\The [src]'s screen shows \"Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning."))
return
if(P.run_program(user))
active_program = P
@@ -183,7 +183,7 @@
if(!new_color)
return
if(color_hex2num(new_color) < 200) //Colors too dark are rejected
to_chat(user, "<span class='warning'>That color is too dark! Choose a lighter one.</span>")
to_chat(user, span_warning("That color is too dark! Choose a lighter one."))
new_color = null
return set_flashlight_color(new_color)
@@ -26,7 +26,7 @@
/obj/item/modular_computer/laptop/examine(mob/user)
. = ..()
if(screen_on)
. += "<span class='notice'>Alt-click to close it.</span>"
. += span_notice("Alt-click to close it.")
/obj/item/modular_computer/laptop/Initialize()
. = ..()
@@ -100,11 +100,11 @@
/obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null)
if(screen_on)
to_chat(user, "<span class='notice'>You close \the [src].</span>")
to_chat(user, span_notice("You close \the [src]."))
slowdown = initial(slowdown)
w_class = initial(w_class)
else
to_chat(user, "<span class='notice'>You open \the [src].</span>")
to_chat(user, span_notice("You open \the [src]."))
slowdown = slowdown_open
w_class = w_class_open
@@ -57,4 +57,4 @@
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext)
return
playsound(src, 'sound/machines/twobeep_high.ogg', 50, TRUE)
machinery_computer.visible_message("<span class='notice'>The [src] displays a [caller.filedesc] notification: [alerttext]</span>")
machinery_computer.visible_message(span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
@@ -50,9 +50,9 @@
/obj/item/modular_computer/tablet/nukeops/emag_act(mob/user)
if(!enabled)
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
to_chat(user, span_warning("You'd need to turn the [src] on first."))
return FALSE
to_chat(user, "<span class='notice'>You swipe \the [src]. It's screen briefly shows a message reading \"MEMORY CODE INJECTION DETECTED AND SUCCESSFULLY QUARANTINED\".</span>")
to_chat(user, span_notice("You swipe \the [src]. It's screen briefly shows a message reading \"MEMORY CODE INJECTION DETECTED AND SUCCESSFULLY QUARANTINED\"."))
return FALSE
/// Borg Built-in tablet interface
@@ -141,7 +141,7 @@
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
return
borgo.playsound_local(src, sound, 50, TRUE)
to_chat(borgo, "<span class='notice'>The [src] displays a [caller.filedesc] notification: [alerttext]</span>")
to_chat(borgo, span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
/obj/item/modular_computer/tablet/integrated/syndicate
@@ -62,7 +62,7 @@
/obj/machinery/modular_computer/emag_act(mob/user)
if(!cpu)
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
to_chat(user, span_warning("You'd need to turn the [src] on first."))
return FALSE
return (cpu.emag_act(user))
@@ -114,7 +114,7 @@
/obj/machinery/modular_computer/proc/power_failure(malfunction = 0)
var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL]
if(cpu?.enabled) // Shut down the computer
visible_message("<span class='danger'>\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly.</span>")
visible_message(span_danger("\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly."))
if(cpu)
cpu.shutdown_computer(0)
set_machine_stat(machine_stat | NOPOWER)
@@ -92,7 +92,7 @@
/datum/computer_file/program/proc/is_supported_by_hardware(hardware_flag = 0, loud = 0, mob/user = null)
if(!(hardware_flag & usage_flags))
if(loud && computer && user)
to_chat(user, "<span class='danger'>\The [computer] flashes a \"Hardware Error - Incompatible software\" warning.</span>")
to_chat(user, span_danger("\The [computer] flashes a \"Hardware Error - Incompatible software\" warning."))
return FALSE
return TRUE
@@ -144,14 +144,14 @@
if(!D)
if(loud)
to_chat(user, "<span class='danger'>\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.</span>")
to_chat(user, span_danger("\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning."))
return FALSE
access = D.GetAccess()
if(access_to_check in access)
return TRUE
if(loud)
to_chat(user, "<span class='danger'>\The [computer] flashes an \"Access Denied\" warning.</span>")
to_chat(user, span_danger("\The [computer] flashes an \"Access Denied\" warning."))
return FALSE
// This attempts to retrieve header data for UIs. If implementing completely new device of different type than existing ones
@@ -13,6 +13,6 @@
/datum/computer_file/program/proc/event_networkfailure(background)
kill_program(forced = TRUE)
if(background)
computer.visible_message("<span class='danger'>\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error</span>")
computer.visible_message(span_danger("\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error"))
else
computer.visible_message("<span class='danger'>\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error.</span>")
computer.visible_message(span_danger("\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error."))
@@ -92,9 +92,9 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.put_in_hands(crystals))
to_chat(H, "<span class='notice'>Your payment materializes into your hands!</span>")
to_chat(H, span_notice("Your payment materializes into your hands!"))
else
to_chat(user, "<span class='notice'>Your payment materializes onto the floor.</span>")
to_chat(user, span_notice("Your payment materializes onto the floor."))
hard_drive.traitor_data.contractor_hub.contract_TC_payed_out += hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem
hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem = 0
@@ -21,11 +21,11 @@
if(computer)
if(istype(computer, /obj/item/modular_computer/tablet/integrated)) //If this is a borg's integrated tablet
var/obj/item/modular_computer/tablet/integrated/modularInterface = computer
to_chat(modularInterface.borgo,"<span class='userdanger'>SYSTEM PURGE DETECTED/</span>")
to_chat(modularInterface.borgo,span_userdanger("SYSTEM PURGE DETECTED/"))
addtimer(CALLBACK(modularInterface.borgo, /mob/living/silicon/robot/.proc/death), 2 SECONDS, TIMER_UNIQUE)
return
computer.visible_message("<span class='notice'>\The [computer]'s screen brightly flashes and loud electrical buzzing is heard.</span>")
computer.visible_message(span_notice("\The [computer]'s screen brightly flashes and loud electrical buzzing is heard."))
computer.enabled = FALSE
computer.update_appearance()
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
@@ -35,13 +35,13 @@
computer.take_damage(25, BRUTE, 0, 0)
if(battery_module && prob(25))
qdel(battery_module)
computer.visible_message("<span class='notice'>\The [computer]'s battery explodes in rain of sparks.</span>")
computer.visible_message(span_notice("\The [computer]'s battery explodes in rain of sparks."))
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
spark_system.start()
if(recharger && prob(50))
qdel(recharger)
computer.visible_message("<span class='notice'>\The [computer]'s recharger explodes in rain of sparks.</span>")
computer.visible_message(span_notice("\The [computer]'s recharger explodes in rain of sparks."))
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
spark_system.start()
@@ -150,20 +150,20 @@
return TRUE
if("Dispense_Tickets")
if(!printer)
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to redeem tickets.</span>")
to_chat(usr, span_notice("Hardware error: A printer is required to redeem tickets."))
return
if(printer.stored_paper <= 0)
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer is out of paper."))
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
computer.visible_message(span_notice("\The [computer] prints out paper."))
if(ticket_count >= 1)
new /obj/item/stack/arcadeticket((get_turf(computer)), 1)
to_chat(usr, "<span class='notice'>[computer] dispenses a ticket!</span>")
to_chat(usr, span_notice("[computer] dispenses a ticket!"))
ticket_count -= 1
printer.stored_paper -= 1
else
to_chat(usr, "<span class='notice'>You don't have any stored tickets!</span>")
to_chat(usr, span_notice("You don't have any stored tickets!"))
return TRUE
if("Start_Game")
game_active = TRUE
@@ -13,7 +13,7 @@
if (!.)
return
if(!computer?.get_modular_computer_part(MC_SENSORS)) //Giving a clue to users why the program is spitting out zeros.
to_chat(user, "<span class='warning'>\The [computer] flashes an error: \"hardware\\sensorpackage\\startup.bin -- file not found\".</span>")
to_chat(user, span_warning("\The [computer] flashes an error: \"hardware\\sensorpackage\\startup.bin -- file not found\"."))
/datum/computer_file/program/atmosscan/ui_data(mob/user)
@@ -43,7 +43,7 @@
var/obj/item/card/id/stored_card = computer.GetID()
if(istype(stored_card) && stored_card.registered_name)
username = "user [stored_card.registered_name]"
to_chat(borgo, "<span class='userdanger'>Request received from [username] for the system log file. Upload in progress.</span>")//Damning evidence may be contained, so warn the borg
to_chat(borgo, span_userdanger("Request received from [username] for the system log file. Upload in progress."))//Damning evidence may be contained, so warn the borg
borgo.logevent("File request by [username]: /var/logs/syslog")
return TRUE
@@ -55,7 +55,7 @@
var/turf/here = get_turf(computer)
var/turf/there = get_turf(DL_source)
if(!here.Adjacent(there))//If someone walked away, cancel the download
to_chat(DL_source, "<span class='danger'>Log upload failed: general connection error.</span>")//Let the borg know the upload stopped
to_chat(DL_source, span_danger("Log upload failed: general connection error."))//Let the borg know the upload stopped
DL_source = null
DL_progress = -1
return
@@ -129,16 +129,16 @@
if(!ID)
return
if(R.stat == DEAD) //Dead borgs will listen to you no longer
to_chat(usr, "<span class='warn'>Error -- Could not open a connection to unit:[R]</span>")
to_chat(usr, span_warning("Error -- Could not open a connection to unit:[R]"))
var/message = stripped_input(usr, message = "Enter message to be sent to remote cyborg.", title = "Send Message")
if(!message)
return
to_chat(R, "<br><br><span class='notice'>Message from [ID] -- \"[message]\"</span><br>")
to_chat(R, "<br><br>[span_notice("Message from [ID] -- \"[message]\"")]<br>")
to_chat(usr, "Message sent to [R]: [message]")
R.logevent("Message from [ID] -- \"[message]\"")
SEND_SOUND(R, 'sound/machines/twobeep_high.ogg')
if(R.connected_ai)
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID] to [R] -- \"[message]\"</span><br>")
to_chat(R.connected_ai, "<br><br>[span_notice("Message from [ID] to [R] -- \"[message]\"")]<br>")
SEND_SOUND(R.connected_ai, 'sound/machines/twobeep_high.ogg')
usr.log_talk(message, LOG_PDA, tag="Cyborg Monitor Program: ID name \"[ID]\" to [R]")
@@ -123,11 +123,11 @@
contents += " [SSid_access.get_access_desc(A)]"
if(!printer.print_text(contents,"access report"))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer was unable to print the file. It may be out of paper."))
return TRUE
else
playsound(computer, 'sound/machines/terminal_on.ogg', 50, FALSE)
computer.visible_message("<span class='notice'>\The [computer] prints out a paper.</span>")
computer.visible_message(span_notice("\The [computer] prints out a paper."))
return TRUE
// Eject the ID used to log on to the ID app.
if("PRG_ejectauthid")
@@ -157,7 +157,7 @@
return TRUE
if(minor)
if(!(target_id_card.trim?.type in job_templates))
to_chat(usr, "<span class='notice'>Software error: You do not have the necessary permissions to demote this card.</span>")
to_chat(usr, span_notice("Software error: You do not have the necessary permissions to demote this card."))
return TRUE
// Set the new assignment then remove the trim.
@@ -190,7 +190,7 @@
new_name = reject_bad_name(new_name, allow_numbers = TRUE)
if(!new_name)
to_chat(usr, "<span class='notice'>Software error: The ID card rejected the new name as it contains prohibited characters.</span>")
to_chat(usr, span_notice("Software error: The ID card rejected the new name as it contains prohibited characters."))
return TRUE
target_id_card.registered_name = new_name
@@ -239,7 +239,7 @@
return TRUE
if(!target_id_card.add_access(list(access_type), try_wildcard))
to_chat(usr, "<span class='notice'>ID error: ID card rejected your attempted access modification.</span>")
to_chat(usr, span_notice("ID error: ID card rejected your attempted access modification."))
LOG_ID_ACCESS_CHANGE(user, target_id_card, "failed to add [SSid_access.get_access_desc(access_type)][try_wildcard ? " with wildcard [try_wildcard]" : ""]")
return TRUE
@@ -63,16 +63,16 @@
cut_multiplier = potential_cut ? clamp(round(potential_cut/100, cut_min), cut_min, cut_max) : initial(cut_multiplier)
if("print")
if(!printer)
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to print barcodes.</span>")
to_chat(usr, span_notice("Hardware error: A printer is required to print barcodes."))
return
if(printer.stored_paper <= 0)
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer is out of paper."))
return
if(!payments_acc)
to_chat(usr, "<span class='notice'>Software error: Please set a current user first.</span>")
to_chat(usr, span_notice("Software error: Please set a current user first."))
return
var/obj/item/barcode/barcode = new /obj/item/barcode(get_turf(ui_host()))
barcode.payments_acc = payments_acc
barcode.cut_multiplier = cut_multiplier
printer.stored_paper--
to_chat(usr, "<span class='notice'>The computer prints out a barcode.</span>")
to_chat(usr, span_notice("The computer prints out a barcode."))
@@ -45,7 +45,7 @@
[GLOB.data_core ? GLOB.data_core.get_manifest_html(0) : ""]
"}
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out a paper.</span>")
computer.visible_message(span_notice("\The [computer] prints out a paper."))
@@ -128,9 +128,9 @@
// This program shouldn't even be runnable without computer.
CRASH("Var computer is null!")
if(!hard_drive)
computer.visible_message("<span class='warning'>\The [computer] shows an \"I/O Error - Hard drive connection error\" warning.</span>")
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive connection error\" warning."))
else // In 99.9% cases this will mean our HDD is full
computer.visible_message("<span class='warning'>\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning.</span>")
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning."))
return TRUE
if("PRG_renamechannel")
if(!authed)
@@ -45,10 +45,10 @@
if(computer)
printer = computer.all_components[MC_PRINT]
if(!printer)
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to print a canvas.</span>")
to_chat(usr, span_notice("Hardware error: A printer is required to print a canvas."))
return
if(printer.stored_paper < CANVAS_PAPER_COST)
to_chat(usr, "<span class='notice'>Printing error: Your printer needs at least [CANVAS_PAPER_COST] paper to print a canvas.</span>")
to_chat(usr, span_notice("Printing error: Your printer needs at least [CANVAS_PAPER_COST] paper to print a canvas."))
return
printer.stored_paper -= CANVAS_PAPER_COST
@@ -79,5 +79,5 @@
///this is a copy of something that is already in the database- it should not be able to be saved.
printed_canvas.no_save = TRUE
printed_canvas.update_icon()
to_chat(usr, "<span class='notice'>You have printed [title] onto a new canvas.</span>")
to_chat(usr, span_notice("You have printed [title] onto a new canvas."))
playsound(computer.physical, 'sound/items/poster_being_created.ogg', 100, TRUE)
@@ -23,7 +23,7 @@
/datum/computer_file/program/robotact/run_program(mob/living/user)
if(!istype(computer, /obj/item/modular_computer/tablet/integrated))
to_chat(user, "<span class='warning'>A warning flashes across \the [computer]: Device Incompatible.</span>")
to_chat(user, span_warning("A warning flashes across \the [computer]: Device Incompatible."))
return FALSE
. = ..()
if(.)
@@ -111,7 +111,7 @@
if("alertPower")
if(borgo.stat == CONSCIOUS)
if(!borgo.cell || !borgo.cell.charge)
borgo.visible_message("<span class='notice'>The power warning light on <span class='name'>[borgo]</span> flashes urgently.</span>", \
borgo.visible_message(span_notice("The power warning light on [span_name("[borgo]")] flashes urgently."), \
"You announce you are operating in low power mode.")
playsound(borgo, 'sound/machines/buzz-two.ogg', 50, FALSE)
@@ -20,7 +20,7 @@
if (!.)
return
if(!computer?.get_modular_computer_part(MC_SIGNALER)) //Giving a clue to users why the program is spitting out zeros.
to_chat(user, "<span class='warning'>\The [computer] flashes an error: \"hardware\\signal_hardware\\startup.bin -- file not found\".</span>")
to_chat(user, span_warning("\The [computer] flashes an error: \"hardware\\signal_hardware\\startup.bin -- file not found\"."))
/datum/computer_file/program/signaler/ui_data(mob/user)
@@ -91,12 +91,12 @@
switch (action)
if ("toggleLock")
if(computer.obj_flags & EMAGGED)
to_chat(usr, "<span class='boldwarning'>Security protocol error: Unable to access locking protocols.</span>")
to_chat(usr, span_boldwarning("Security protocol error: Unable to access locking protocols."))
return TRUE
if(ACCESS_RND in user_id_card?.access)
locked = !locked
else
to_chat(usr, "<span class='boldwarning'>Unauthorized Access. Please insert research ID card.</span>")
to_chat(usr, span_boldwarning("Unauthorized Access. Please insert research ID card."))
return TRUE
if ("researchNode")
if(!SSresearch.science_tech.available_nodes[params["node_id"]])
@@ -50,10 +50,10 @@
if(istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/S = I
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>\The [src] doesn't seem to require repairs.</span>")
to_chat(user, span_warning("\The [src] doesn't seem to require repairs."))
return 1
if(S.use(1))
to_chat(user, "<span class='notice'>You patch up \the [src] with a bit of \the [I].</span>")
to_chat(user, span_notice("You patch up \the [src] with a bit of \the [I]."))
obj_integrity = min(obj_integrity + 10, max_integrity)
return 1
@@ -90,11 +90,11 @@
/obj/item/computer_hardware/examine(mob/user)
. = ..()
if(damage > damage_failure)
. += "<span class='danger'>It seems to be severely damaged!</span>"
. += span_danger("It seems to be severely damaged!")
else if(damage > damage_malfunction)
. += "<span class='warning'>It seems to be damaged!</span>"
. += span_warning("It seems to be damaged!")
else if(damage)
. += "<span class='notice'>It seems to be slightly damaged.</span>"
. += span_notice("It seems to be slightly damaged.")
// Component-side compatibility check.
/obj/item/computer_hardware/proc/can_install(obj/item/modular_computer/M, mob/living/user = null)
@@ -29,28 +29,28 @@
return FALSE
if(stored_card)
to_chat(user, "<span class='warning'>You try to insert \the [I] into \the [src], but the slot is occupied.</span>")
to_chat(user, span_warning("You try to insert \the [I] into \the [src], but the slot is occupied."))
return FALSE
if(user && !user.transferItemToLoc(I, src))
return FALSE
stored_card = I
to_chat(user, "<span class='notice'>You insert \the [I] into \the [src].</span>")
to_chat(user, span_notice("You insert \the [I] into \the [src]."))
return TRUE
/obj/item/computer_hardware/ai_slot/try_eject(mob/living/user = null, forced = FALSE)
if(!stored_card)
to_chat(user, "<span class='warning'>There is no card in \the [src].</span>")
to_chat(user, span_warning("There is no card in \the [src]."))
return FALSE
if(locked && !forced)
to_chat(user, "<span class='warning'>Safeties prevent you from removing the card until reconstruction is complete...</span>")
to_chat(user, span_warning("Safeties prevent you from removing the card until reconstruction is complete..."))
return FALSE
if(stored_card)
to_chat(user, "<span class='notice'>You remove [stored_card] from [src].</span>")
to_chat(user, span_notice("You remove [stored_card] from [src]."))
locked = FALSE
if(user)
user.put_in_hands(stored_card)
@@ -64,6 +64,6 @@
if(..())
return
if(I.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
to_chat(user, span_notice("You press down on the manual eject button with \the [I]."))
try_eject(user, TRUE)
return
@@ -35,29 +35,29 @@
return FALSE
if(battery)
to_chat(user, "<span class='warning'>You try to connect \the [I] to \the [src], but its connectors are occupied.</span>")
to_chat(user, span_warning("You try to connect \the [I] to \the [src], but its connectors are occupied."))
return FALSE
if(I.w_class > holder.max_hardware_size)
to_chat(user, "<span class='warning'>This power cell is too large for \the [holder]!</span>")
to_chat(user, span_warning("This power cell is too large for \the [holder]!"))
return FALSE
if(user && !user.transferItemToLoc(I, src))
return FALSE
battery = I
to_chat(user, "<span class='notice'>You connect \the [I] to \the [src].</span>")
to_chat(user, span_notice("You connect \the [I] to \the [src]."))
return TRUE
/obj/item/computer_hardware/battery/try_eject(mob/living/user, forced = FALSE)
if(!battery)
to_chat(user, "<span class='warning'>There is no power cell connected to \the [src].</span>")
to_chat(user, span_warning("There is no power cell connected to \the [src]."))
return FALSE
else
if(user)
user.put_in_hands(battery)
to_chat(user, "<span class='notice'>You detach \the [battery] from \the [src].</span>")
to_chat(user, span_notice("You detach \the [battery] from \the [src]."))
else
battery.forceMove(drop_location())
return TRUE
@@ -73,7 +73,7 @@
I.forceMove(src)
stored_card = I
to_chat(user, "<span class='notice'>You insert \the [I] into \the [expansion_hw ? "secondary":"primary"] [src].</span>")
to_chat(user, span_notice("You insert \the [I] into \the [expansion_hw ? "secondary":"primary"] [src]."))
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
var/holder_loc = holder.loc
@@ -88,7 +88,7 @@
/obj/item/computer_hardware/card_slot/try_eject(mob/living/user = null, forced = FALSE)
if(!stored_card)
to_chat(user, "<span class='warning'>There are no cards in \the [src].</span>")
to_chat(user, span_warning("There are no cards in \the [src]."))
return FALSE
if(user && !issilicon(user) && in_range(src, user))
@@ -96,7 +96,7 @@
else
stored_card.forceMove(drop_location())
to_chat(user, "<span class='notice'>You remove the card from \the [src].</span>")
to_chat(user, span_notice("You remove the card from \the [src]."))
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
return TRUE
@@ -106,11 +106,11 @@
return
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(stored_card)
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
to_chat(user, span_notice("You press down on the manual eject button with \the [I]."))
try_eject(user)
return
swap_slot()
to_chat(user, "<span class='notice'>You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"].</span>")
to_chat(user, span_notice("You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"]."))
/**
*Swaps the card_slot hardware between using the dedicated card slot bay on a computer, and using an expansion bay.
@@ -20,7 +20,7 @@
/obj/item/computer_hardware/hard_drive/examine(user)
. = ..()
. += "<span class='notice'>It has [max_capacity] GQ of storage capacity.</span>"
. += span_notice("It has [max_capacity] GQ of storage capacity.")
/obj/item/computer_hardware/hard_drive/diagnostics(mob/user)
..()
@@ -11,11 +11,11 @@
/obj/item/computer_hardware/printer/diagnostics(mob/living/user)
..()
to_chat(user, "<span class='notice'>Paper level: [stored_paper]/[max_paper].</span>")
to_chat(user, span_notice("Paper level: [stored_paper]/[max_paper]."))
/obj/item/computer_hardware/printer/examine(mob/user)
. = ..()
. += "<span class='notice'>Paper level: [stored_paper]/[max_paper].</span>"
. += span_notice("Paper level: [stored_paper]/[max_paper].")
/obj/item/computer_hardware/printer/proc/print_text(text_to_print, paper_title = "")
@@ -41,12 +41,12 @@
/obj/item/computer_hardware/printer/try_insert(obj/item/I, mob/living/user = null)
if(istype(I, /obj/item/paper))
if(stored_paper >= max_paper)
to_chat(user, "<span class='warning'>You try to add \the [I] into [src], but its paper bin is full!</span>")
to_chat(user, span_warning("You try to add \the [I] into [src], but its paper bin is full!"))
return FALSE
if(user && !user.temporarilyRemoveItemFromInventory(I))
return FALSE
to_chat(user, "<span class='notice'>You insert \the [I] into [src]'s paper recycler.</span>")
to_chat(user, span_notice("You insert \the [I] into [src]'s paper recycler."))
qdel(I)
stored_paper++
return TRUE
@@ -55,7 +55,7 @@
/obj/item/computer_hardware/recharger/wired/can_install(obj/item/modular_computer/M, mob/living/user = null)
if(ismachinery(M.physical) && M.physical.anchored)
return ..()
to_chat(user, "<span class='warning'>\The [src] is incompatible with portable computers!</span>")
to_chat(user, span_warning("\The [src] is incompatible with portable computers!"))
return FALSE
/obj/item/computer_hardware/recharger/wired/use_power(amount, charging=0)
@@ -241,13 +241,13 @@
if(!user.temporarilyRemoveItemFromInventory(c))
return
credits += c.value
visible_message("<span class='info'><span class='name'>[user]</span> inserts [c.value] cr into [src].</span>")
visible_message(span_info("[span_name("[user]")] inserts [c.value] cr into [src]."))
qdel(c)
return
else if(istype(I, /obj/item/holochip))
var/obj/item/holochip/HC = I
credits += HC.credits
visible_message("<span class='info'>[user] inserts a [HC.credits] cr holocredit chip into [src].</span>")
visible_message(span_info("[user] inserts a [HC.credits] cr holocredit chip into [src]."))
qdel(HC)
return
else if(istype(I, /obj/item/card/id))