Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion code/__DEFINES/computer4_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,38 @@
// Well-Known Directories
#define THINKDOS_BIN_DIRECTORY "/bin"
// Constants
#define THINKDOS_MAX_COMMANDS 3 //! The maximum amount of commands
#define THINKDOS_MAX_COMMANDS 10 //! The maximum amount of commands
// Symbols
#define THINKDOS_SYMBOL_SEPARATOR ";" //! Lets you split stdin into distinct commands

//ANSI color helpers.

/// ANSI CSI seq `ESC [`
#define ANSI_CSI "\x1b\x5B"

/// Generate an ANSI SGR escape code dynamically.
#define ANSI_SGR(ID) "[ANSI_CSI][ID]m"
/// Internal only, Variant of `ANSI_SGR` that can const fold and stringifies literally.
#define _ANSI_SGR_CONSTFOLD(ID) (ANSI_CSI + #ID + "m")

#define ANSI_FULL_RESET _ANSI_SGR_CONSTFOLD(0)

#define ANSI_BOLD _ANSI_SGR_CONSTFOLD(1)
#define ANSI_UNBOLD _ANSI_SGR_CONSTFOLD(22)


#define ANSI_FG_RED _ANSI_SGR_CONSTFOLD(31)
#define ANSI_FG_GREEN _ANSI_SGR_CONSTFOLD(32)
#define ANSI_FG_YELLOW _ANSI_SGR_CONSTFOLD(33)
#define ANSI_FG_BLUE _ANSI_SGR_CONSTFOLD(34)
#define ANSI_FG_MAGENTA _ANSI_SGR_CONSTFOLD(35)
#define ANSI_FG_CYAN _ANSI_SGR_CONSTFOLD(36)
#define ANSI_FG_WHITE _ANSI_SGR_CONSTFOLD(37)

#define ANSI_FG_RESET _ANSI_SGR_CONSTFOLD(39)

// ANSI wrapper helpers.

// Please understand that these might have unexpected styling side effects, as ANSI isn't inherently closed like HTML.

#define ANSI_WRAP_BOLD(bolded_text) (ANSI_BOLD+bolded_text+ANSI_UNBOLD)
9 changes: 9 additions & 0 deletions code/modules/asset_cache/assets/webfonts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@
parents = list(
"Yrsa.css" = file("fonts/Yrsa.css"),
)

/datum/asset/simple/namespaced/ibm_vga9x16
assets = list(
"WebPlus_IBM_VGA_9x16.woff" = file("fonts/oldschool_pc_fonts/WebPlus_IBM_VGA_9x16.woff"),
)

parents = list(
"WebPlus_IBM_VGA_9x16.css" = file("fonts/oldschool_pc_fonts/WebPlus_IBM_VGA_9x16.css"),
)
16 changes: 8 additions & 8 deletions code/modules/computer4/computer4.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ TYPEINFO_DEF(/obj/machinery/computer4)
/obj/machinery/computer4/proc/post_system()
text_buffer = ""

text_buffer += "Initializing system...<br>"
text_buffer += "Initializing system...\n"

if(!internal_disk)
text_buffer = "<font color=red>1701 - NO FIXED DISK</font><br>"
text_buffer = "1701 - NO FIXED DISK\n"

// Os already known.
if(operating_system)
Expand All @@ -387,25 +387,25 @@ TYPEINFO_DEF(/obj/machinery/computer4)
var/datum/c4_file/terminal_program/operating_system/new_os = locate() in inserted_disk?.root.contents

if(new_os)
text_buffer += "Booting from inserted drive...<br>"
text_buffer += "Booting from inserted drive...\n"
set_operating_system(new_os)
else
text_buffer += "<font color=red>Non-system disk or disk error.</font><br>"
text_buffer += "Non-system disk or disk error.\n"

// Okay how about the internal drive?
if(!operating_system && internal_disk)
var/datum/c4_file/terminal_program/operating_system/new_os = locate() in internal_disk?.root.contents

if(new_os)
text_buffer += "Booting from fixed drive...<br>"
text_buffer += "Booting from fixed drive...\n"
set_operating_system(new_os)
else
text_buffer += "<font color=red>Unable to boot from fixed drive.</font><br>"
text_buffer += "Unable to boot from fixed drive.\n"


// Fuck.
if(!operating_system)
text_buffer += "<font color=red>ERR - BOOT FAILURE</font><br>"
text_buffer += "ERR - BOOT FAILURE\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldnt you want to color these red


SStgui.update_uis(src)

Expand All @@ -416,7 +416,7 @@ TYPEINFO_DEF(/obj/machinery/computer4)
if(operating_system)
set_operating_system(null)

text_buffer = "Rebooting system...<br>"
text_buffer = "Rebooting system...\n"

tgui_input_history = list()
tgui_input_index = list()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/computer4/data/terminal/_terminal_program.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
return TRUE

if(!system.current_user)
system.println("<b>Error:</b> Unable to locate credentials.")
system.println("[ANSI_WRAP_BOLD("Error:")] Unable to locate credentials.")
return FALSE

if(length(req_access & system.current_user.access) != length(req_access))
system.println("<b>Error:</b> User '[html_encode(system.current_user.registered_name)]' does not have the required access credentials.")
system.println("[ANSI_WRAP_BOLD("Error:")] User '[html_encode(system.current_user.registered_name)]' does not have the required access credentials.")
return FALSE

return TRUE
Expand Down
48 changes: 24 additions & 24 deletions code/modules/computer4/data/terminal/directive/directman.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
. = ..()

if(!system.get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
system.println("<b>Error:</b> Unable to locate wireless adapter.")
system.println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")

system.clear_screen(TRUE)
view_home()
Expand Down Expand Up @@ -81,7 +81,7 @@
system.clear_screen(TRUE)
if(!system.get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
view_home()
system.println("<b>Error:</b> Unable to locate wireless adapter.")
system.println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return
view_new()
return TRUE
Expand All @@ -90,7 +90,7 @@
if(lowertext(parsed_cmdline.raw) == "s")
if(!system.get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
view_home()
system.println("<b>Error:</b> Unable to locate wireless adapter.")
system.println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

addtimer(CALLBACK(SSdirectives, TYPE_PROC_REF(/datum/controller/subsystem/directives, enact_directive), viewing_directive), rand(3, 10) SECONDS)
Expand All @@ -103,23 +103,23 @@
current_menu = DIRECTMAN_MENU_HOME

var/list/out = list(
@"<pre style='margin: 0px'> ┌┬┐┬┬─┐┌─┐┌─┐┌┬┐╔╦╗╔═╗╔╗╔</pre>",
@"<pre style='margin: 0px'> │││├┬┘├┤ │ │ ║║║╠═╣║║║</pre>",
@"<pre style='margin: 0px'> ─┴┘┴┴└─└─┘└─┘ ┴ ╩ ╩╩ ╩╝╚╝</pre>",
"Commands:<br>",
"\[1\] View Current Directives<br>",
@" ┌┬┐┬┬─┐┌─┐┌─┐┌┬┐╔╦╗╔═╗╔╗╔",
@" │││├┬┘├┤ │ │ ║║║╠═╣║║║",
@" ─┴┘┴┴└─└─┘└─┘ ┴ ╩ ╩╩ ╩╝╚╝",
"Commands:",
"\[1\] View Current Directives",
)

if(SSdirectives.get_directives_for_selection())
out += "\[2\] View New Directives<br>"
out += "\[2\] View New Directives"

out += "<br>\[R\] Refresh"
out += "\[R\] Refresh"

get_os().println(jointext(out, null))
get_os().println(jointext(out, "\n"))

/datum/c4_file/terminal_program/directman/proc/view_current()
if(!get_os().get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
get_os().println("<b>Error:</b> Unable to locate wireless adapter.")
get_os().println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

current_menu = DIRECTMAN_MENU_CURRENT
Expand All @@ -130,13 +130,13 @@
for(var/datum/directive/directive as anything in SSdirectives.get_active_directives())
i++
out += "\[[fit_with_zeros("[i]", 2)]\] [directive.name]"
out += "<br>\[B\] Return"
out += "\n\[B\] Return"

get_os().println(jointext(out, "<br>"))
get_os().println(jointext(out, "\n"))

/datum/c4_file/terminal_program/directman/proc/view_directive(index)
if(!get_os().get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
get_os().println("<b>Error:</b> Unable to locate wireless adapter.")
get_os().println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

current_menu = DIRECTMAN_MENU_ACTIVE_DIRECTIVE
Expand All @@ -148,18 +148,18 @@
"Description: [directive.desc]",
"Severity: [directive.severity]",
"Time Given: [active_directives[directive]]",
"<br>\[B\] Return",
"\n\[B\] Return",
)

get_os().println(jointext(out, "<br>"))
get_os().println(jointext(out, "\n"))

/datum/c4_file/terminal_program/directman/proc/view_new()
if(!get_os().get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
get_os().println("<b>Error:</b> Unable to locate wireless adapter.")
get_os().println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

if(!SSdirectives.get_directives_for_selection())
get_os().println("<b>Error:</b> No new directives to display.")
get_os().println("[ANSI_WRAP_BOLD("Error:")] No new directives to display.")
return

current_menu = DIRECTMAN_MENU_NEW_DIRECTIVES
Expand All @@ -170,14 +170,14 @@
for(var/datum/directive/directive as anything in SSdirectives.get_directives_for_selection())
i++
out += "\[[fit_with_zeros("[i]", 2)]\] [directive.name]"
out += "<br>\[B\] Return"
out += "\n\[B\] Return"

get_os().println(jointext(out, "<br>"))
get_os().println(jointext(out, "\n"))

/datum/c4_file/terminal_program/directman/proc/view_new_directive(index)
if(!get_os().get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
view_home()
get_os().println("<b>Error:</b> Unable to locate wireless adapter.")
get_os().println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

get_os().clear_screen(TRUE)
Expand All @@ -190,7 +190,7 @@
"Description: [viewing_directive.desc]",
"Payout: [viewing_directive.reward] mark\s",
"Severity: [viewing_directive.severity]",
"<br>\[B\] Return | \[S\] Select"
"\n\[B\] Return | \[S\] Select"
)

get_os().println(jointext(out, "<br>"))
get_os().println(jointext(out, "\n"))
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
system.clear_screen(TRUE)
if(!system.get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
directman.view_home()
system.println("<b>Error:</b> Unable to locate wireless adapter.")
system.println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

directman.view_current()
Expand All @@ -42,7 +42,7 @@
system.clear_screen(TRUE)
if(!system.get_computer().get_peripheral(PERIPHERAL_TYPE_WIRELESS_CARD))
directman.view_home()
system.println("<b>Error:</b> Unable to locate wireless adapter.")
system.println("[ANSI_WRAP_BOLD("Error:")] Unable to locate wireless adapter.")
return

directman.view_new()
Expand Down
Loading
Loading