[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:
CHOMPStation2
2024-10-04 06:00:17 -07:00
committed by GitHub
parent 43ee646816
commit ab154b48b2
1511 changed files with 12497 additions and 12357 deletions

View File

@@ -191,7 +191,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 [prog]\" warning.</span>")
to_chat(user, span_danger("\The [src]'s screen shows \"I/O ERROR - Unable to run [prog]\" warning."))
return
P.computer = src
@@ -206,11 +206,11 @@
return
if(idle_threads.len >= processor_unit.max_idle_programs+1)
to_chat(user, "<span class='notice'>\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error</span>")
to_chat(user, span_notice("\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 \"NETWORK ERROR - 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 \"NETWORK ERROR - Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning."))
return
if(active_program)

View File

@@ -1,7 +1,7 @@
/obj/item/modular_computer/examine(var/mob/user)
. = ..()
if(damage > broken_damage)
. += "<span class='danger'>It is heavily damaged!</span>"
. += span_danger("It is heavily damaged!")
else if(damage)
. += "It is damaged."
@@ -52,4 +52,4 @@
if(HALLOSS)
take_damage(Proj.damage, Proj.damage / 3, 0)
if(BURN)
take_damage(Proj.damage, Proj.damage / 1.5)
take_damage(Proj.damage, Proj.damage / 1.5)

View File

@@ -92,7 +92,7 @@
update_verbs()
if(critical && enabled)
if(user)
to_chat(user, "<span class='danger'>\The [src]'s screen freezes for few seconds and then displays an \"HARDWARE ERROR: Critical component disconnected. Please verify component connection and reboot the device. If the problem persists contact technical support for assistance.\" warning.</span>")
to_chat(user, span_danger("\The [src]'s screen freezes for few seconds and then displays an \"HARDWARE ERROR: Critical component disconnected. Please verify component connection and reboot the device. If the problem persists contact technical support for assistance.\" warning."))
shutdown_computer()
update_icon()
@@ -136,4 +136,4 @@
all_components.Add(processor_unit)
if(tesla_link)
all_components.Add(tesla_link)
return all_components
return all_components

View File

@@ -13,11 +13,11 @@
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living) || istype(usr, /mob/living/simple_mob)) //CHOMPEdit - Preventing simple_mobs from interacting
to_chat(usr, "<span class='warning'>You can't do that.</span>")
to_chat(usr, span_warning("You can't do that."))
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
to_chat(usr, span_warning("You can't reach it."))
return
if(enabled)
@@ -37,11 +37,11 @@
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living) || istype(usr, /mob/living/simple_mob)) //CHOMPEdit - Preventing simple_mobs from interacting
to_chat(usr, "<span class='warning'>You can't do that.</span>")
to_chat(usr, span_warning("You can't do that."))
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
to_chat(usr, span_warning("You can't reach it."))
return
proc_eject_id(usr)
@@ -53,11 +53,11 @@
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living) || istype(usr, /mob/living/simple_mob)) //CHOMPEdit - Preventing simple_mobs from interacting
to_chat(usr, "<span class='warning'>You can't do that.</span>")
to_chat(usr, span_warning("You can't do that."))
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
to_chat(usr, span_warning("You can't reach it."))
return
proc_eject_usb(usr)
@@ -197,4 +197,4 @@
return
..()
..()

View File

@@ -1,6 +1,6 @@
/obj/item/modular_computer/proc/power_failure(var/malfunction = 0)
if(enabled) // Shut down the computer
visible_message("<span class='danger'>\The [src]'s screen flickers briefly and then goes dark.</span>")
visible_message(span_danger("\The [src]'s screen flickers briefly and then goes dark."))
if(active_program)
active_program.event_powerfailure(0)
for(var/datum/computer_file/program/PRG in idle_threads)
@@ -54,4 +54,4 @@
return
if(battery_power(power_usage))
return
power_failure()
power_failure()

View File

@@ -102,7 +102,7 @@
return
P.kill_program(1)
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."))
return TRUE
if("PC_runprogram")
return run_program(params["name"])

View File

@@ -74,7 +74,7 @@
/datum/computer_file/program/proc/is_supported_by_hardware(var/hardware_flag = 0, var/loud = 0, var/mob/user = null)
if(!(hardware_flag & usage_flags))
if(loud && computer && user)
to_chat(user, "<span class='warning'>\The [computer] flashes: \"Hardware Error - Incompatible software\".</span>")
to_chat(user, span_warning("\The [computer] flashes: \"Hardware Error - Incompatible software\"."))
return 0
return 1
@@ -118,13 +118,13 @@
var/obj/item/card/id/I = user.GetIdCard()
if(!I)
if(loud)
to_chat(user, "<span class='notice'>\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.</span>")
to_chat(user, span_notice("\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning."))
return 0
if(access_to_check in I.GetAccess())
return 1
else if(loud)
to_chat(user, "<span class='notice'>\The [computer] flashes an \"Access Denied\" warning.</span>")
to_chat(user, span_notice("\The [computer] flashes an \"Access Denied\" warning."))
// This attempts to retrieve header data for NanoUIs. If implementing completely new device of different type than existing ones
// always include the device here in this proc. This proc basically relays the request to whatever is running the program.

View File

@@ -13,6 +13,6 @@
/datum/computer_file/program/proc/event_networkfailure(var/background)
kill_program(1)
if(background)
computer.visible_message("<span class='warning'>\The [computer]'s screen displays an error: \"Network connectivity lost - process [filename].[filetype] (PID [rand(100,999)]) terminated.\"</span>")
computer.visible_message(span_warning("\The [computer]'s screen displays an error: \"Network connectivity lost - process [filename].[filetype] (PID [rand(100,999)]) terminated.\""))
else
computer.visible_message("<span class='warning'>\The [computer]'s screen briefly freezes and then shows: \"FATAL NETWORK ERROR - NTNet connection lost. Please try again later. If problem persists, please contact your system administrator.\"</span>")
computer.visible_message(span_warning("\The [computer]'s screen briefly freezes and then shows: \"FATAL NETWORK ERROR - NTNet connection lost. Please try again later. If problem persists, please contact your system administrator.\""))

View File

@@ -21,7 +21,7 @@
if(!computer)
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 = 0
computer.update_icon()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
@@ -64,4 +64,4 @@
data["armed"] = armed
return data
return data

View File

@@ -40,7 +40,7 @@
/datum/computer_file/program/email_client/proc/new_mail_notify()
var/turf/T = get_turf(computer) // Because visible_message is being a butt
if(T)
T.visible_message("<span class='notice'>[computer] beeps softly, indicating a new email has been received.</span>")
T.visible_message(span_notice("[computer] beeps softly, indicating a new email has been received."))
playsound(computer, 'sound/misc/server-ready.ogg', 100, 0)
/datum/computer_file/program/email_client/process_tick()

View File

@@ -162,20 +162,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("<b>\The [computer]</b> prints out paper.")
if(ticket_count >= 1)
new /obj/item/stack/arcadeticket((get_turf(computer)), 1)
to_chat(usr, "<span class='notice'>[src] dispenses a ticket!</span>")
to_chat(usr, span_notice("[src] 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

View File

@@ -119,9 +119,9 @@
// This program shouldn't even be runnable without computer.
CRASH("Var computer is null!")
if(!computer.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)

View File

@@ -78,7 +78,7 @@
return TRUE
if("PRG_taghelp")
to_chat(usr, "<span class='notice'>The hologram of a googly-eyed paper clip helpfully tells you:</span>")
to_chat(usr, span_notice("The hologram of a googly-eyed paper clip helpfully tells you:"))
var/help = {"
\[br\] : Creates a linebreak.
\[center\] - \[/center\] : Centers the text.

View File

@@ -137,6 +137,6 @@ var/warrant_uid = 0
if("editwarrantauth")
. = TRUE
if(!(access_hos in I.GetAccess())) // VOREStation edit begin
to_chat(usr, "<span class='warning'>You don't have the access to do this!</span>")
to_chat(usr, span_warning("You don't have the access to do this!"))
return // VOREStation edit end
activewarrant.fields["auth"] = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"

View File

@@ -88,9 +88,9 @@
/obj/item/computer_hardware/examine(var/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='notice'>It seems to be damaged!</span>"
. += span_notice("It seems to be damaged!")
else if(damage)
. += "It seems to be slightly damaged."

View File

@@ -276,9 +276,9 @@
// Simplified payment processing, returns 1 on success.
/obj/machinery/lapvend/proc/process_payment(var/obj/item/card/id/I, var/obj/item/ID_container)
if(I==ID_container || ID_container == null)
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>")
visible_message(span_info("\The [usr] swipes \the [I] through \the [src]."))
else
visible_message("<span class='info'>\The [usr] swipes \the [ID_container] through \the [src].</span>")
visible_message(span_info("\The [usr] swipes \the [ID_container] through \the [src]."))
var/datum/money_account/customer_account = get_account(I.associated_account_number)
if (!customer_account || customer_account.suspended)
ping("Connection error. Unable to connect to account.")