This commit is contained in:
LetterN
2021-10-28 17:34:52 +08:00
parent 49940c373e
commit f7b898a2a9
346 changed files with 13714 additions and 8493 deletions
@@ -13,6 +13,10 @@
ui.close()
return
// if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS))
// 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.
if(!screen_on && !issilicon(user))
if(ui)
@@ -30,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)
@@ -111,7 +115,7 @@
active_program.program_state = PROGRAM_STATE_BACKGROUND // Should close any existing UIs
active_program = null
update_icon()
update_appearance()
if(user && istype(user))
ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
if("eject_pen")
@@ -132,7 +136,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"]
@@ -142,7 +146,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
@@ -156,22 +160,22 @@
active_program = P
P.alert_pending = FALSE
idle_threads.Remove(P)
update_icon()
update_appearance()
return
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
P.alert_pending = FALSE
update_icon()
update_appearance()
return 1
if("PC_toggle_light")
@@ -185,7 +189,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)