mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
Adds new modular ID modification console and
removes old console. This commit won't compile.
This commit is contained in:
+1
-1
@@ -443,7 +443,6 @@
|
||||
#include "code\game\machinery\computer\atmos_control.dm"
|
||||
#include "code\game\machinery\computer\buildandrepair.dm"
|
||||
#include "code\game\machinery\computer\camera.dm"
|
||||
#include "code\game\machinery\computer\card.dm"
|
||||
#include "code\game\machinery\computer\cloning.dm"
|
||||
#include "code\game\machinery\computer\communications.dm"
|
||||
#include "code\game\machinery\computer\computer.dm"
|
||||
@@ -1449,6 +1448,7 @@
|
||||
#include "code\modules\modular_computers\computers\machinery\modular_computer.dm"
|
||||
#include "code\modules\modular_computers\computers\machinery\modular_console.dm"
|
||||
#include "code\modules\modular_computers\computers\machinery\modular_laptop.dm"
|
||||
#include "code\modules\modular_computers\computers\machinery\preloaded_consoles\card.dm"
|
||||
#include "code\modules\modular_computers\file_system\computer_file.dm"
|
||||
#include "code\modules\modular_computers\file_system\data.dm"
|
||||
#include "code\modules\modular_computers\file_system\program.dm"
|
||||
|
||||
@@ -1,290 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer/card
|
||||
name = "\improper ID card modification console"
|
||||
desc = "Terminal for programming employee ID cards to access parts of the station."
|
||||
icon_keyboard = "id_key"
|
||||
icon_screen = "id"
|
||||
light_color = "#0099ff"
|
||||
req_access = list(access_change_ids)
|
||||
circuit = /obj/item/weapon/circuitboard/card
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/obj/item/weapon/card/id/modify = null
|
||||
var/mode = 0.0
|
||||
var/printing = null
|
||||
|
||||
/obj/machinery/computer/card/proc/is_centcom()
|
||||
return 0
|
||||
|
||||
/obj/machinery/computer/card/proc/is_authenticated()
|
||||
return scan ? check_access(scan) : 0
|
||||
|
||||
/obj/machinery/computer/card/proc/get_target_rank()
|
||||
return modify && modify.assignment ? modify.assignment : "Unassigned"
|
||||
|
||||
/obj/machinery/computer/card/proc/format_jobs(list/jobs)
|
||||
var/list/formatted = list()
|
||||
for(var/job in jobs)
|
||||
formatted.Add(list(list(
|
||||
"display_name" = replacetext(job, " ", " "),
|
||||
"target_rank" = get_target_rank(),
|
||||
"job" = job)))
|
||||
|
||||
return formatted
|
||||
|
||||
/obj/machinery/computer/card/verb/eject_id()
|
||||
set category = "Object"
|
||||
set name = "Eject ID Card"
|
||||
set src in oview(1)
|
||||
|
||||
if(!usr || usr.stat || usr.lying) return
|
||||
|
||||
if(scan)
|
||||
usr << "You remove \the [scan] from \the [src]."
|
||||
scan.loc = get_turf(src)
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
usr.put_in_hands(scan)
|
||||
scan = null
|
||||
else if(modify)
|
||||
usr << "You remove \the [modify] from \the [src]."
|
||||
modify.loc = get_turf(src)
|
||||
if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human))
|
||||
usr.put_in_hands(modify)
|
||||
modify = null
|
||||
else
|
||||
usr << "There is nothing to remove from the console."
|
||||
return
|
||||
|
||||
/obj/machinery/computer/card/attackby(obj/item/weapon/card/id/id_card, mob/user)
|
||||
if(!istype(id_card))
|
||||
return ..()
|
||||
|
||||
if(!scan && (access_change_ids in id_card.access) && user.unEquip(id_card))
|
||||
id_card.loc = src
|
||||
scan = id_card
|
||||
else if(!modify)
|
||||
id_card.loc = src
|
||||
modify = id_card
|
||||
|
||||
nanomanager.update_uis(src)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/card/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/card/attack_hand(mob/user as mob)
|
||||
if(..()) return
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/card/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
data["src"] = "\ref[src]"
|
||||
data["station_name"] = station_name()
|
||||
data["mode"] = mode
|
||||
data["printing"] = printing
|
||||
data["manifest"] = data_core ? data_core.get_manifest(0) : null
|
||||
data["target_name"] = modify ? modify.name : "-----"
|
||||
data["target_owner"] = modify && modify.registered_name ? modify.registered_name : "-----"
|
||||
data["target_rank"] = get_target_rank()
|
||||
data["scan_name"] = scan ? scan.name : "-----"
|
||||
data["authenticated"] = is_authenticated()
|
||||
data["has_modify"] = !!modify
|
||||
data["account_number"] = modify ? modify.associated_account_number : null
|
||||
data["centcom_access"] = is_centcom()
|
||||
data["all_centcom_access"] = null
|
||||
data["regions"] = null
|
||||
|
||||
data["engineering_jobs"] = format_jobs(engineering_positions)
|
||||
data["medical_jobs"] = format_jobs(medical_positions)
|
||||
data["science_jobs"] = format_jobs(science_positions)
|
||||
data["security_jobs"] = format_jobs(security_positions)
|
||||
data["civilian_jobs"] = format_jobs(civilian_positions)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
|
||||
|
||||
if (modify && is_centcom())
|
||||
var/list/all_centcom_access = list()
|
||||
for(var/access in get_all_centcom_access())
|
||||
all_centcom_access.Add(list(list(
|
||||
"desc" = replacetext(get_centcom_access_desc(access), " ", " "),
|
||||
"ref" = access,
|
||||
"allowed" = (access in modify.access) ? 1 : 0)))
|
||||
|
||||
data["all_centcom_access"] = all_centcom_access
|
||||
else if (modify)
|
||||
var/list/regions = list()
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
var/list/accesses = list()
|
||||
for(var/access in get_region_accesses(i))
|
||||
if (get_access_desc(access))
|
||||
accesses.Add(list(list(
|
||||
"desc" = replacetext(get_access_desc(access), " ", " "),
|
||||
"ref" = access,
|
||||
"allowed" = (access in modify.access) ? 1 : 0)))
|
||||
|
||||
regions.Add(list(list(
|
||||
"name" = get_region_accesses_name(i),
|
||||
"accesses" = accesses)))
|
||||
|
||||
data["regions"] = regions
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 600, 700)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/card/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
switch(href_list["choice"])
|
||||
if ("modify")
|
||||
if (modify)
|
||||
data_core.manifest_modify(modify.registered_name, modify.assignment)
|
||||
modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])")
|
||||
if(ishuman(usr))
|
||||
modify.loc = usr.loc
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(modify)
|
||||
modify = null
|
||||
else
|
||||
modify.loc = loc
|
||||
modify = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id) && usr.unEquip(I))
|
||||
I.loc = src
|
||||
modify = I
|
||||
|
||||
if ("scan")
|
||||
if (scan)
|
||||
if(ishuman(usr))
|
||||
scan.loc = usr.loc
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
scan.loc = src.loc
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
scan = I
|
||||
|
||||
if("access")
|
||||
if(href_list["allowed"])
|
||||
if(is_authenticated())
|
||||
var/access_type = text2num(href_list["access_target"])
|
||||
var/access_allowed = text2num(href_list["allowed"])
|
||||
if(access_type in (is_centcom() ? get_all_centcom_access() : get_all_station_access()))
|
||||
modify.access -= access_type
|
||||
if(!access_allowed)
|
||||
modify.access += access_type
|
||||
|
||||
if ("assign")
|
||||
if (is_authenticated() && modify)
|
||||
var/t1 = href_list["assign_target"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"), 45)
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
if(temp_t && modify)
|
||||
modify.assignment = temp_t
|
||||
else
|
||||
var/list/access = list()
|
||||
if(is_centcom())
|
||||
access = get_centcom_access(t1)
|
||||
else
|
||||
var/datum/job/jobdatum
|
||||
for(var/jobtype in typesof(/datum/job))
|
||||
var/datum/job/J = new jobtype
|
||||
if(ckey(J.title) == ckey(t1))
|
||||
jobdatum = J
|
||||
break
|
||||
if(!jobdatum)
|
||||
usr << "<span class='warning'>No log exists for this job: [t1]</span>"
|
||||
return
|
||||
|
||||
access = jobdatum.get_access()
|
||||
|
||||
modify.access = access
|
||||
modify.assignment = t1
|
||||
modify.rank = t1
|
||||
|
||||
callHook("reassign_employee", list(modify))
|
||||
|
||||
if ("reg")
|
||||
if (is_authenticated())
|
||||
var/t2 = modify
|
||||
if ((modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
|
||||
var/temp_name = sanitizeName(href_list["reg"])
|
||||
if(temp_name)
|
||||
modify.registered_name = temp_name
|
||||
else
|
||||
src.visible_message("<span class='notice'>[src] buzzes rudely.</span>")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
if ("account")
|
||||
if (is_authenticated())
|
||||
var/t2 = modify
|
||||
if ((modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
|
||||
var/account_num = text2num(href_list["account"])
|
||||
modify.associated_account_number = account_num
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
if ("mode")
|
||||
mode = text2num(href_list["mode_target"])
|
||||
|
||||
if ("print")
|
||||
if (!printing)
|
||||
printing = 1
|
||||
spawn(50)
|
||||
printing = null
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
var/obj/item/weapon/paper/P = new(loc)
|
||||
if (mode)
|
||||
P.name = text("crew manifest ([])", worldtime2text())
|
||||
P.info = {"<h4>Crew Manifest</h4>
|
||||
<br>
|
||||
[data_core ? data_core.get_manifest(0) : ""]
|
||||
"}
|
||||
else if (modify)
|
||||
P.name = "access report"
|
||||
P.info = {"<h4>Access Report</h4>
|
||||
<u>Prepared By:</u> [scan.registered_name ? scan.registered_name : "Unknown"]<br>
|
||||
<u>For:</u> [modify.registered_name ? modify.registered_name : "Unregistered"]<br>
|
||||
<hr>
|
||||
<u>Assignment:</u> [modify.assignment]<br>
|
||||
<u>Account Number:</u> #[modify.associated_account_number]<br>
|
||||
<u>Blood Type:</u> [modify.blood_type]<br><br>
|
||||
<u>Access:</u><br>
|
||||
"}
|
||||
|
||||
for(var/A in modify.access)
|
||||
P.info += " [get_access_desc(A)]"
|
||||
|
||||
if ("terminate")
|
||||
if (is_authenticated())
|
||||
modify.assignment = "Terminated"
|
||||
modify.access = list()
|
||||
|
||||
callHook("terminate_employee", list(modify))
|
||||
|
||||
if (modify)
|
||||
modify.name = text("[modify.registered_name]'s ID Card ([modify.assignment])")
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/card/centcom
|
||||
name = "\improper CentCom ID card modification console"
|
||||
circuit = /obj/item/weapon/circuitboard/card/centcom
|
||||
req_access = list(access_cent_captain)
|
||||
|
||||
|
||||
/obj/machinery/computer/card/centcom/is_centcom()
|
||||
return 1
|
||||
@@ -36,14 +36,6 @@
|
||||
build_path = /obj/machinery/computer/communications
|
||||
origin_tech = list(TECH_DATA = 2, TECH_MAGNET = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/card
|
||||
name = T_BOARD("ID card modification console")
|
||||
build_path = /obj/machinery/computer/card
|
||||
|
||||
/obj/item/weapon/circuitboard/card/centcom
|
||||
name = T_BOARD("CentCom ID card modification console")
|
||||
build_path = /obj/machinery/computer/card/centcom
|
||||
|
||||
/obj/item/weapon/circuitboard/teleporter
|
||||
name = T_BOARD("teleporter control console")
|
||||
build_path = /obj/machinery/computer/teleporter
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/obj/machinery/modular_computer/console/card
|
||||
console_department = "command"
|
||||
|
||||
/obj/machinery/modular_computer/console/card/New()
|
||||
..()
|
||||
var/obj/item/weapon/computer_hardware/hard_drive/HDD = cpu.hard_drive
|
||||
var/datum/computer_file/program/prog = ntnet_global.find_ntnet_file_by_name("cardmod")
|
||||
HDD.store_file(prog.clone())
|
||||
cpu.card_slot = new/obj/item/weapon/computer_hardware/card_slot(src)
|
||||
@@ -1285,12 +1285,6 @@ CIRCUITS BELOW
|
||||
build_path = /obj/item/weapon/circuitboard/communications
|
||||
sort_string = "LAAAA"
|
||||
|
||||
/datum/design/circuit/idcardconsole
|
||||
name = "ID card modification console"
|
||||
id = "idcardconsole"
|
||||
build_path = /obj/item/weapon/circuitboard/card
|
||||
sort_string = "LAAAB"
|
||||
|
||||
/datum/design/circuit/emp_data
|
||||
name = "employment records console"
|
||||
id = "emp_data"
|
||||
|
||||
Reference in New Issue
Block a user