Files
Bubberstation/code/modules/modular_computers/computers/machinery/console_presets.dm
T
MrMelbertandGitHub a73b77b3bb [MDB Ignore] Combines Cargobus consoles with Dept. Order Consoles, freeing all departments of 1 whole tile of space (#82210)
## About The Pull Request

- Departmental orders are now an NTOS app
   - To download, they require `ACCESS_COMMAND`.
   - To use, they require one access from the department.
- This means you cannot order things from not-your-department unless you
have an ID.
- When newly downloading the app, it will prompt a head of staff to
insert an ID, to determine which department to be linked to.

- Changes chat room overlay from the kind that AI uploads use to a new
icon.

- Minor refactors to department order in general. 


![image](https://github.com/tgstation/tgstation/assets/51863163/605c2499-e5e9-4f91-aa2a-aa8af8b05a9f)


![image-1](https://github.com/tgstation/tgstation/assets/51863163/089d3fe1-787c-4f5a-bc3d-edb9611dfbb2)

## Why It's Good For The Game

These two computers are surprising waste spacers for two things which
are tied together.
So why not combine them?

The lesser used cargobus chat is still there, and departmental orders
are front and center.

This gives mappers a ton more leeway when mapping departments out and is
overall less clutter.

## Changelog

🆑 Melbert
qol: Cargobus chat console and Departmental Order console are now
combined into one.
qol: Mod PCs active on the "chat client" apps no longer look like AI
uploads (and now have their own sprite)
refactor: Departmental order consoles were refactored a bit, report any
oddities.
/🆑
2024-03-27 16:00:47 +00:00

159 lines
6.3 KiB
Plaintext

/obj/machinery/modular_computer/preset
///List of programs the computer starts with, given on Initialize.
var/list/datum/computer_file/starting_programs = list()
/obj/machinery/modular_computer/preset/Initialize(mapload)
. = ..()
if(!cpu)
return
for(var/programs in starting_programs)
var/datum/computer_file/program_type = new programs
cpu.store_file(program_type)
// ===== ENGINEERING CONSOLE =====
/obj/machinery/modular_computer/preset/engineering
name = "engineering console"
desc = "A stationary computer. This one comes preloaded with engineering programs."
starting_programs = list(
/datum/computer_file/program/power_monitor,
/datum/computer_file/program/alarm_monitor,
/datum/computer_file/program/supermatter_monitor,
)
// ===== RESEARCH CONSOLE =====
/obj/machinery/modular_computer/preset/research
name = "research director's console"
desc = "A stationary computer. This one comes preloaded with research programs."
starting_programs = list(
/datum/computer_file/program/ntnetmonitor,
/datum/computer_file/program/chatclient,
/datum/computer_file/program/ai_restorer,
/datum/computer_file/program/robocontrol,
/datum/computer_file/program/scipaper_program,
)
// ===== COMMAND CONSOLE =====
/obj/machinery/modular_computer/preset/command
name = "command console"
desc = "A stationary computer. This one comes preloaded with command programs."
starting_programs = list(
/datum/computer_file/program/chatclient,
/datum/computer_file/program/card_mod,
)
// ===== IDENTIFICATION CONSOLE =====
/obj/machinery/modular_computer/preset/id
name = "identification console"
desc = "A stationary computer. This one comes preloaded with identification modification programs."
starting_programs = list(
/datum/computer_file/program/chatclient,
/datum/computer_file/program/card_mod,
/datum/computer_file/program/job_management,
/datum/computer_file/program/crew_manifest,
)
/obj/machinery/modular_computer/preset/id/centcom
desc = "A stationary computer. This one comes preloaded with CentCom identification modification programs."
/obj/machinery/modular_computer/preset/id/centcom/Initialize(mapload)
. = ..()
var/datum/computer_file/program/card_mod/card_mod_centcom = cpu.find_file_by_name("plexagonidwriter")
card_mod_centcom.is_centcom = TRUE
// ===== CIVILIAN CONSOLE =====
/obj/machinery/modular_computer/preset/civilian
name = "civilian console"
desc = "A stationary computer. This one comes preloaded with generic programs."
starting_programs = list(
/datum/computer_file/program/chatclient,
/datum/computer_file/program/arcade,
)
// curator
/obj/machinery/modular_computer/preset/curator
name = "curator console"
desc = "A stationary computer. This one comes preloaded with art programs."
starting_programs = list(
/datum/computer_file/program/portrait_printer,
)
// ===== CARGO CHAT CONSOLES =====
/obj/machinery/modular_computer/preset/cargochat
name = "cargo interfacing console"
desc = "A stationary computer that comes pre-loaded with software to interface with the cargo department."
starting_programs = list(
/datum/computer_file/program/chatclient,
)
/// What department type is assigned to this console?
var/datum/job_department/department_type
/obj/machinery/modular_computer/preset/cargochat/Initialize(mapload)
add_starting_software()
. = ..()
setup_starting_software()
REGISTER_REQUIRED_MAP_ITEM(1, 1)
if(department_type)
name = "[lowertext(initial(department_type.department_name))] [name]"
cpu.name = name
/obj/machinery/modular_computer/preset/cargochat/proc/add_starting_software()
starting_programs += /datum/computer_file/program/department_order
/obj/machinery/modular_computer/preset/cargochat/proc/setup_starting_software()
if(!department_type)
return
var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client")
chatprogram.username = "[lowertext(initial(department_type.department_name))]_department"
cpu.idle_threads += chatprogram
var/datum/computer_file/program/department_order/orderprogram = cpu.find_file_by_name("dept_order")
orderprogram.set_linked_department(department_type)
cpu.active_program = orderprogram
update_appearance(UPDATE_ICON)
/obj/machinery/modular_computer/preset/cargochat/service
department_type = /datum/job_department/service
/obj/machinery/modular_computer/preset/cargochat/engineering
department_type = /datum/job_department/engineering
/obj/machinery/modular_computer/preset/cargochat/science
department_type = /datum/job_department/science
/obj/machinery/modular_computer/preset/cargochat/security
department_type = /datum/job_department/security
/obj/machinery/modular_computer/preset/cargochat/medical
department_type = /datum/job_department/medical
/obj/machinery/modular_computer/preset/cargochat/cargo
department_type = /datum/job_department/cargo
name = "departmental interfacing console"
desc = "A stationary computer that comes pre-loaded with software to interface with incoming departmental cargo requests."
/obj/machinery/modular_computer/preset/cargochat/cargo/add_starting_software()
starting_programs += /datum/computer_file/program/bounty_board
starting_programs += /datum/computer_file/program/budgetorders
starting_programs += /datum/computer_file/program/shipping
/obj/machinery/modular_computer/preset/cargochat/cargo/setup_starting_software()
var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client")
cpu.active_program = chatprogram
update_appearance(UPDATE_ICON)
// Rest of the chat program setup is done in LateInit
/obj/machinery/modular_computer/preset/cargochat/cargo/LateInitialize()
. = ..()
var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client")
chatprogram.username = "cargo_requests_operator"
var/datum/ntnet_conversation/cargochat = chatprogram.create_new_channel("#cargobus", strong = TRUE)
for(var/obj/machinery/modular_computer/preset/cargochat/cargochat_console as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/modular_computer/preset/cargochat))
if(cargochat_console == src)
continue
var/datum/computer_file/program/chatclient/other_chatprograms = cargochat_console.cpu.find_file_by_name("ntnrc_client")
other_chatprograms.active_channel = chatprogram.active_channel
cargochat.add_client(other_chatprograms, silent = TRUE)