mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 20:15:47 +01:00
Id computer mostly complete
Various fixes and improvements.
This commit is contained in:
@@ -511,7 +511,7 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
|
||||
// NTNet transfer speeds, used when downloading/uploading a file/program.
|
||||
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
|
||||
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
|
||||
#define NTNETSPEED_ETHERNET 3 // GQ/s transfer speed when the device is using wired connection
|
||||
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
|
||||
|
||||
|
||||
// Program bitflags
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
idle_power_usage = 4
|
||||
active_power_usage = 250
|
||||
var/obj/item/weapon/charging = null
|
||||
var/list/allowed_devices = list(/obj/item/weapon/gun/energy,/obj/item/weapon/melee/baton,/obj/item/ammo_box/magazine/recharge,/obj/item/weapon/computer_hardware/battery_module,/obj/item/laptop,/obj/item/modular_computer/)
|
||||
var/recharge_coeff = 1
|
||||
|
||||
/obj/machinery/recharger/New()
|
||||
@@ -36,7 +37,11 @@
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
return
|
||||
|
||||
if(istype(G, /obj/item/weapon/gun/energy) || istype(G, /obj/item/weapon/melee/baton) || istype(G, /obj/item/ammo_box/magazine/recharge) || istype(G, /obj/item/weapon/computer_hardware/battery_module))
|
||||
var/allowed = 0
|
||||
for (var/allowed_type in allowed_devices)
|
||||
if (istype(G, allowed_type)) allowed = 1
|
||||
|
||||
if(allowed)
|
||||
if(anchored)
|
||||
if(charging || panel_open)
|
||||
return 1
|
||||
@@ -127,7 +132,17 @@
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
if(istype(charging, /obj/item/weapon/gun/energy))
|
||||
if(istype(charging, /obj/item/laptop))
|
||||
var/obj/item/laptop/L = charging
|
||||
if(L.stored_computer.cpu.battery_module)
|
||||
var/obj/item/weapon/computer_hardware/battery_module/B = L.stored_computer.cpu.battery_module
|
||||
if(B.battery)
|
||||
if(B.battery.charge < B.battery.maxcharge)
|
||||
B.battery.give(B.battery.chargerate * recharge_coeff)
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
if(istype(charging, /obj/item/weapon/computer_hardware/battery_module))
|
||||
var/obj/item/weapon/computer_hardware/battery_module/B = charging
|
||||
if(B.battery)
|
||||
if(B.battery.charge < B.battery.maxcharge)
|
||||
@@ -135,6 +150,16 @@
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
if(istype(charging, /obj/item/modular_computer))
|
||||
var/obj/item/modular_computer/C = charging
|
||||
if(C.battery_module)
|
||||
var/obj/item/weapon/computer_hardware/battery_module/B = C.battery_module
|
||||
if(B.battery)
|
||||
if(B.battery.charge < B.battery.maxcharge)
|
||||
B.battery.give(B.battery.chargerate * recharge_coeff)
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
update_icon(using_power)
|
||||
|
||||
/obj/machinery/recharger/power_change()
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
if(3) //medbay
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_virology, access_surgery, access_cmo)
|
||||
if(4) //research
|
||||
return list(access_research, access_tox, access_tox_storage, access_genetics, access_robotics, access_xenobiology, access_minisat, access_rd)
|
||||
return list(access_research, access_tox, access_tox_storage, access_genetics, access_robotics, access_xenobiology, access_minisat, access_rd, access_network)
|
||||
if(5) //engineering and maintenance
|
||||
return list(access_construction, access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_tcomsat, access_minisat, access_ce)
|
||||
if(6) //supply
|
||||
|
||||
@@ -20,12 +20,12 @@ Research Director
|
||||
access_tox_storage, access_teleporter, access_sec_doors,
|
||||
access_research, access_robotics, access_xenobiology, access_ai_upload,
|
||||
access_RC_announce, access_keycard_auth, access_gateway, access_mineral_storeroom,
|
||||
access_tech_storage, access_minisat, access_maint_tunnels)
|
||||
access_tech_storage, access_minisat, access_maint_tunnels, access_network)
|
||||
minimal_access = list(access_rd, access_heads, access_tox, access_genetics, access_morgue,
|
||||
access_tox_storage, access_teleporter, access_sec_doors,
|
||||
access_research, access_robotics, access_xenobiology, access_ai_upload,
|
||||
access_RC_announce, access_keycard_auth, access_gateway, access_mineral_storeroom,
|
||||
access_tech_storage, access_minisat, access_maint_tunnels)
|
||||
access_tech_storage, access_minisat, access_maint_tunnels, access_network)
|
||||
|
||||
/datum/outfit/job/rd
|
||||
name = "Research Director"
|
||||
|
||||
@@ -90,7 +90,6 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/ntnet_relay/attack_hand(mob/living/user)
|
||||
ui_interact(user)
|
||||
|
||||
@@ -98,8 +97,8 @@
|
||||
uid = gl_uid
|
||||
gl_uid++
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/stack/cable_coil(src,15)
|
||||
// component_parts += new /obj/item/weapon/circuitboard/ntnet_relay(src)
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/ntnet_relay(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
if(ntnet_global)
|
||||
ntnet_global.relays.Add(src)
|
||||
@@ -119,22 +118,10 @@
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
panel_open = !panel_open
|
||||
user << "You [panel_open ? "open" : "close"] the maintenance hatch"
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(!panel_open)
|
||||
user << "Open the maintenance panel first."
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "You disassemble \the [src]!"
|
||||
|
||||
for(var/atom/movable/A in component_parts)
|
||||
A.forceMove(src.loc)
|
||||
new/obj/structure/frame/machine(src.loc)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
/obj/item/weapon/circuitboard/machine/ntnet_relay
|
||||
name = "circuit board (NTNet Relay)"
|
||||
build_path = /obj/machinery/ntnet_relay
|
||||
origin_tech = "programming=3;bluespace=3;magnets=2"
|
||||
req_components = list(
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 1)
|
||||
@@ -141,7 +141,6 @@
|
||||
user << "It is damaged."
|
||||
|
||||
/obj/item/modular_computer/New()
|
||||
machines += src
|
||||
START_PROCESSING(SSmachine, src)
|
||||
update_icon()
|
||||
if(!physical)
|
||||
@@ -150,9 +149,8 @@
|
||||
|
||||
/obj/item/modular_computer/Destroy()
|
||||
kill_program(1)
|
||||
machines.Remove(src)
|
||||
STOP_PROCESSING(SSmachine, src)
|
||||
for(var/H in src.get_all_components())
|
||||
for(var/H in get_all_components())
|
||||
var/obj/item/weapon/computer_hardware/CH = H
|
||||
uninstall_component(null, CH)
|
||||
qdel(CH)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
/obj/machinery/modular_computer/console/preset/command/install_programs()
|
||||
cpu.hard_drive.store_file(new/datum/computer_file/program/chatclient())
|
||||
// cpu.hard_drive.store_file(new/datum/computer_file/program/card_mod())
|
||||
cpu.hard_drive.store_file(new/datum/computer_file/program/card_mod())
|
||||
|
||||
// ===== CIVILIAN CONSOLE =====
|
||||
/obj/machinery/modular_computer/console/preset/civilian
|
||||
|
||||
@@ -9,129 +9,91 @@
|
||||
var/mod_mode = 1
|
||||
var/is_centcom = 0
|
||||
var/show_assignments = 0
|
||||
var/list/region_access = null
|
||||
var/list/head_subordinates = null
|
||||
var/target_dept = 0 //Which department this computer has access to. 0=all departments
|
||||
var/change_position_cooldown = 60
|
||||
//Jobs you cannot open new positions for
|
||||
var/list/blacklisted = list(
|
||||
"AI",
|
||||
"Assistant",
|
||||
"Cyborg",
|
||||
"Captain",
|
||||
"Head of Personnel",
|
||||
"Head of Security",
|
||||
"Chief Engineer",
|
||||
"Research Director",
|
||||
"Chief Medical Officer",
|
||||
"Chaplain")
|
||||
|
||||
/datum/computer_file/program/card_mod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
|
||||
var/list/data = get_header_data()
|
||||
//The scaling factor of max total positions in relation to the total amount of people on board the station in %
|
||||
var/max_relative_positions = 30 //30%: Seems reasonable, limit of 6 @ 20 players
|
||||
|
||||
data["src"] = "\ref[src]"
|
||||
data["station_name"] = station_name()
|
||||
data["manifest"] = data_core ? data_core.get_manifest(0) : null
|
||||
data["assignments"] = show_assignments
|
||||
if(program && program.computer)
|
||||
data["have_id_slot"] = !!program.computer.card_slot
|
||||
data["have_printer"] = !!program.computer.nano_printer
|
||||
data["authenticated"] = program.can_run(user)
|
||||
if(!program.computer.card_slot)
|
||||
mod_mode = 0 //We can't modify IDs when there is no card reader
|
||||
else
|
||||
data["have_id_slot"] = 0
|
||||
data["have_printer"] = 0
|
||||
data["authenticated"] = 0
|
||||
data["mmode"] = mod_mode
|
||||
data["centcom_access"] = is_centcom
|
||||
|
||||
if(program && program.computer && program.computer.card_slot)
|
||||
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
|
||||
data["has_id"] = !!id_card
|
||||
data["id_account_number"] = id_card ? id_card.associated_account_number : null
|
||||
data["id_rank"] = id_card && id_card.assignment ? id_card.assignment : "Unassigned"
|
||||
data["id_owner"] = id_card && id_card.registered_name ? id_card.registered_name : "-----"
|
||||
data["id_name"] = id_card ? id_card.name : "-----"
|
||||
//This is used to keep track of opened positions for jobs to allow instant closing
|
||||
//Assoc array: "JobName" = (int)<Opened Positions>
|
||||
var/list/opened_positions = list();
|
||||
|
||||
|
||||
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["cargo_jobs"] = format_jobs(cargo_positions)
|
||||
data["civilian_jobs"] = format_jobs(civilian_positions)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
|
||||
/datum/computer_file/program/card_mod/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
|
||||
data["all_centcom_access"] = is_centcom ? get_accesses(1) : null
|
||||
data["regions"] = get_accesses()
|
||||
|
||||
if(program.computer.card_slot.stored_card)
|
||||
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
|
||||
if(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 id_card.access) ? 1 : 0)))
|
||||
data["all_centcom_access"] = all_centcom_access
|
||||
else
|
||||
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 id_card.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)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "identification_computer.tmpl", name, 600, 700, state = state)
|
||||
ui.auto_update_layout = 1
|
||||
ui.set_initial_data(data)
|
||||
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
|
||||
assets.send(user)
|
||||
|
||||
ui = new(user, src, ui_key, "identification_computer", "ID card modification program", 600, 700, state = state)
|
||||
ui.open()
|
||||
ui.set_autoupdate(state = 1)
|
||||
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/format_jobs(list/jobs)
|
||||
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
|
||||
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
|
||||
var/list/formatted = list()
|
||||
for(var/job in jobs)
|
||||
formatted.Add(list(list(
|
||||
"display_name" = replacetext(job, " ", " "),
|
||||
"display_name" = replacetext(job, " ", " "),
|
||||
"target_rank" = id_card && id_card.assignment ? id_card.assignment : "Unassigned",
|
||||
"job" = job)))
|
||||
|
||||
return formatted
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/get_accesses(var/is_centcom = 0)
|
||||
return null
|
||||
|
||||
|
||||
/datum/computer_file/program/card_mod/ui_act(action params)
|
||||
/datum/computer_file/program/card_mod/ui_act(action, params)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
var/obj/item/weapon/card/id/user_id_card = null
|
||||
var/mob/user = usr
|
||||
var/obj/item/weapon/card/id/user_id_card = user.GetIdCard()
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/h = user
|
||||
user_id_card = h.get_idcard()
|
||||
|
||||
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
|
||||
var/datum/nano_module/program/card_mod/module = NM
|
||||
switch(href_list["action"])
|
||||
if("switchm")
|
||||
if(href_list["target"] == "mod")
|
||||
module.mod_mode = 1
|
||||
else if (href_list["target"] == "manifest")
|
||||
module.mod_mode = 0
|
||||
if("togglea")
|
||||
if(module.show_assignments)
|
||||
module.show_assignments = 0
|
||||
switch(action)
|
||||
if("PRG_switchm")
|
||||
if(params["target"] == "mod")
|
||||
mod_mode = 1
|
||||
else if (params["target"] == "manifest")
|
||||
mod_mode = 0
|
||||
if("PRG_togglea")
|
||||
if(show_assignments)
|
||||
show_assignments = 0
|
||||
else
|
||||
module.show_assignments = 1
|
||||
if("print")
|
||||
show_assignments = 1
|
||||
if("PRG_print")
|
||||
if(computer && computer.nano_printer) //This option should never be called if there is no printer
|
||||
if(module.mod_mode)
|
||||
if(mod_mode)
|
||||
if(can_run(user, 1))
|
||||
var/contents = {"<h4>Access Report</h4>
|
||||
<u>Prepared By:</u> [user_id_card.registered_name ? user_id_card.registered_name : "Unknown"]<br>
|
||||
<u>For:</u> [id_card.registered_name ? id_card.registered_name : "Unregistered"]<br>
|
||||
<hr>
|
||||
<u>Assignment:</u> [id_card.assignment]<br>
|
||||
<u>Account Number:</u> #[id_card.associated_account_number]<br>
|
||||
<u>Blood Type:</u> [id_card.blood_type]<br><br>
|
||||
<u>Access:</u><br>
|
||||
"}
|
||||
|
||||
var/known_access_rights = get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM)
|
||||
var/known_access_rights = get_all_accesses()
|
||||
for(var/A in id_card.access)
|
||||
if(A in known_access_rights)
|
||||
contents += " [get_access_desc(A)]"
|
||||
@@ -146,43 +108,43 @@
|
||||
<br>
|
||||
[data_core ? data_core.get_manifest(0) : ""]
|
||||
"}
|
||||
if(!computer.nano_printer.print_text(contents,text("crew manifest ([])", stationtime2text())))
|
||||
if(!computer.nano_printer.print_text(contents,text("crew manifest ([])", worldtime2text())))
|
||||
usr << "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>"
|
||||
return
|
||||
else
|
||||
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
|
||||
if("eject")
|
||||
if("PRG_eject")
|
||||
if(computer && computer.card_slot)
|
||||
if(id_card)
|
||||
data_core.manifest_modify(id_card.registered_name, id_card.assignment)
|
||||
computer.proc_eject_id(user)
|
||||
if("terminate")
|
||||
if("PRG_terminate")
|
||||
if(computer && can_run(user, 1))
|
||||
id_card.assignment = "Terminated"
|
||||
remove_nt_access(id_card)
|
||||
callHook("terminate_employee", list(id_card))
|
||||
if("edit")
|
||||
|
||||
if("PRG_edit")
|
||||
if(computer && can_run(user, 1))
|
||||
if(href_list["name"])
|
||||
var/temp_name = sanitizeName(input("Enter name.", "Name", id_card.registered_name))
|
||||
if(params["name"])
|
||||
var/temp_name = reject_bad_name(input("Enter name.", "Name", id_card.registered_name))
|
||||
if(temp_name)
|
||||
id_card.registered_name = temp_name
|
||||
else
|
||||
computer.visible_message("<span class='notice'>[computer] buzzes rudely.</span>")
|
||||
else if(href_list["account"])
|
||||
var/account_num = text2num(input("Enter account number.", "Account", id_card.associated_account_number))
|
||||
id_card.associated_account_number = account_num
|
||||
if("assign")
|
||||
//else if(params["account"])
|
||||
// var/account_num = text2num(input("Enter account number.", "Account", id_card.associated_account_number))
|
||||
// id_card.associated_account_number = account_num
|
||||
if("PRG_assign")
|
||||
if(computer && can_run(user, 1) && id_card)
|
||||
var/t1 = href_list["assign_target"]
|
||||
var/t1 = params["assign_target"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment", id_card.assignment), 45)
|
||||
var/temp_t = reject_bad_text(input("Enter a custom job assignment.","Assignment", id_card.assignment), 45)
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
if(temp_t)
|
||||
id_card.assignment = temp_t
|
||||
else
|
||||
var/list/access = list()
|
||||
if(module.is_centcom)
|
||||
if(is_centcom)
|
||||
access = get_centcom_access(t1)
|
||||
else
|
||||
var/datum/job/jobdatum
|
||||
@@ -200,25 +162,26 @@
|
||||
remove_nt_access(id_card)
|
||||
apply_access(id_card, access)
|
||||
id_card.assignment = t1
|
||||
id_card.rank = t1
|
||||
|
||||
callHook("reassign_employee", list(id_card))
|
||||
if("access")
|
||||
if(href_list["allowed"] && computer && can_run(user, 1))
|
||||
var/access_type = text2num(href_list["access_target"])
|
||||
var/access_allowed = text2num(href_list["allowed"])
|
||||
if(access_type in get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM))
|
||||
if("PRG_access")
|
||||
if(params["allowed"] && computer && can_run(user, 1))
|
||||
var/access_type = text2num(params["access_target"])
|
||||
var/access_allowed = text2num(params["allowed"])
|
||||
world << "type [access_type]"
|
||||
world << "allow [access_allowed]"
|
||||
if(access_type in (is_centcom ? get_all_centcom_access() : get_all_accesses()))
|
||||
world << "yes"
|
||||
id_card.access -= access_type
|
||||
if(!access_allowed)
|
||||
world << "check"
|
||||
id_card.access += access_type
|
||||
if(id_card)
|
||||
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
|
||||
|
||||
nanomanager.update_uis(NM)
|
||||
return 1
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/remove_nt_access(var/obj/item/weapon/card/id/id_card)
|
||||
id_card.access -= get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM)
|
||||
id_card.access -= get_all_accesses()
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/apply_access(var/obj/item/weapon/card/id/id_card, var/list/accesses)
|
||||
id_card.access |= accesses
|
||||
@@ -231,11 +194,11 @@
|
||||
data["station_name"] = station_name()
|
||||
data["manifest"] = data_core ? data_core.get_manifest(0) : null
|
||||
data["assignments"] = show_assignments
|
||||
if(program && program.computer)
|
||||
data["have_id_slot"] = !!program.computer.card_slot
|
||||
data["have_printer"] = !!program.computer.nano_printer
|
||||
data["authenticated"] = program.can_run(user)
|
||||
if(!program.computer.card_slot)
|
||||
if(computer)
|
||||
data["have_id_slot"] = !!computer.card_slot
|
||||
data["have_printer"] = !!computer.nano_printer
|
||||
data["authenticated"] = can_run(user)
|
||||
if(!computer.card_slot)
|
||||
mod_mode = 0 //We can't modify IDs when there is no card reader
|
||||
else
|
||||
data["have_id_slot"] = 0
|
||||
@@ -244,33 +207,29 @@
|
||||
data["mmode"] = mod_mode
|
||||
data["centcom_access"] = is_centcom
|
||||
|
||||
if(program && program.computer && program.computer.card_slot)
|
||||
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
|
||||
if(computer && computer.card_slot)
|
||||
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
|
||||
data["has_id"] = !!id_card
|
||||
data["id_account_number"] = id_card ? id_card.associated_account_number : null
|
||||
data["id_rank"] = id_card && id_card.assignment ? id_card.assignment : "Unassigned"
|
||||
data["id_owner"] = id_card && id_card.registered_name ? id_card.registered_name : "-----"
|
||||
data["id_name"] = id_card ? id_card.name : "-----"
|
||||
data["id_rank"] = id_card && id_card.assignment ? html_encode(id_card.assignment) : "Unassigned"
|
||||
data["id_owner"] = id_card && id_card.registered_name ? html_encode(id_card.registered_name) : "-----"
|
||||
data["id_name"] = id_card ? strip_html_simple(id_card.name) : "-----"
|
||||
|
||||
|
||||
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["cargo_jobs"] = format_jobs(cargo_positions)
|
||||
data["civilian_jobs"] = format_jobs(civilian_positions)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
|
||||
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["cargo_jobs"] = format_jobs(supply_positions)
|
||||
data["civilian_jobs"] = format_jobs(supply_positions)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
|
||||
|
||||
data["all_centcom_access"] = is_centcom ? get_accesses(1) : null
|
||||
data["regions"] = get_accesses()
|
||||
|
||||
if(program.computer.card_slot.stored_card)
|
||||
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
|
||||
if(computer.card_slot.stored_card)
|
||||
var/obj/item/weapon/card/id/id_card = computer.card_slot.stored_card
|
||||
if(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), " ", " "),
|
||||
"desc" = replacetext(get_centcom_access_desc(access), " ", " "),
|
||||
"ref" = access,
|
||||
"allowed" = (access in id_card.access) ? 1 : 0)))
|
||||
data["all_centcom_access"] = all_centcom_access
|
||||
@@ -281,7 +240,7 @@
|
||||
for(var/access in get_region_accesses(i))
|
||||
if (get_access_desc(access))
|
||||
accesses.Add(list(list(
|
||||
"desc" = replacetext(get_access_desc(access), " ", " "),
|
||||
"desc" = replacetext(get_access_desc(access), " ", " "),
|
||||
"ref" = access,
|
||||
"allowed" = (access in id_card.access) ? 1 : 0)))
|
||||
|
||||
|
||||
@@ -386,3 +386,11 @@
|
||||
req_tech = list("programming" = 4, "biotech" = 3)
|
||||
build_path = /obj/item/weapon/circuitboard/machine/plantgenes
|
||||
category = list ("Misc. Machinery")
|
||||
|
||||
/datum/design/board/ntnet_relay
|
||||
name = "Machine Design (NTNet Relay Board)"
|
||||
desc = "The circuit board for a wireless network relay."
|
||||
id = "ntnet_relay"
|
||||
req_tech = list("programming" = 2, "engineering" = 2, "bluespace" = 2)
|
||||
build_path = /obj/item/weapon/circuitboard/machine/ntnet_relay
|
||||
category = list("Subspace Telecomms")
|
||||
@@ -1533,6 +1533,7 @@
|
||||
#include "code\modules\modular_computers\file_system\program.dm"
|
||||
#include "code\modules\modular_computers\file_system\program_events.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\alarm.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\card.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\configurator.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\file_browser.dm"
|
||||
#include "code\modules\modular_computers\file_system\programs\ntdownloader.dm"
|
||||
|
||||
File diff suppressed because one or more lines are too long
+15
-15
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
component.exports = {
|
||||
computed: {
|
||||
clickable () {
|
||||
if (this.get('enabled') && !this.get('state')) {
|
||||
if (this.get('enabled') && (!this.get('state') || this.get('state') == "toggle")) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -27,6 +27,7 @@ span.button
|
||||
buttoncolor(normal, button-color-normal)
|
||||
buttoncolor(disabled, button-color-disabled)
|
||||
buttoncolor(selected, button-color-selected)
|
||||
buttoncolor(toggle, button-color-selected)
|
||||
buttoncolor(caution, button-color-caution)
|
||||
buttoncolor(danger, button-color-danger)
|
||||
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
|
||||
|
||||
|
||||
|
||||
{{#if data.have_id_slot}}
|
||||
<ui-button action='PRG_switchm' icon='home' params='{"target" : "mod"}' state='{{data.mmode ? "disabled" : null}}'>Access Modification</ui-button>
|
||||
{{/if}}
|
||||
<ui-button action='PRG_switchm' icon='folder-open' params='{"target" : "manifest"}' state='{{!data.mmode ? "disabled" : null}}'>Crew Manifest</ui-button>
|
||||
{{#if data.have_printer}}
|
||||
<ui-button action='PRG_print' icon='print' state='{{!data.mmode || data.has_id ? null : "disabled"}}'>Print</ui-button>
|
||||
{{/if}}
|
||||
|
||||
{{#if !data.mmode}}
|
||||
<div class='item'>
|
||||
<h2>Crew Manifest</h2>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{data.manifest}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='item'>
|
||||
<h2>Access Modification</h2>
|
||||
</div>
|
||||
|
||||
{{#if !data.has_id}}
|
||||
<span class='alert'><i>Please insert the ID into the terminal to proceed.</i></span><br>
|
||||
{{/if}}
|
||||
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
Target Identity:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<ui-button icon='eject' action='PRG_eject'>{{data.id_name}}</ui-button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
{{#if data.authenticated}}
|
||||
{{#if data.has_id}}
|
||||
<div class='item'>
|
||||
<h2>Details</h2>
|
||||
</div>
|
||||
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
Registered Name:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<ui-button action='PRG_edit' icon='pencil' params='{"name" : "1"}'>{{data.id_owner}}</ui-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if data.demote}}
|
||||
<div class='item'>
|
||||
<div class='itemLabel'>
|
||||
Terminations:
|
||||
</div>
|
||||
<div class='itemContent'>
|
||||
<ui-button action='PRG_terminate' icon='gear' state='{{data.id_rank == "Unassigned" ? "disabled" : null}}'>Demote {{data.id_owner}}</ui-button>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class='item'>
|
||||
<h2>Assignment</h2>
|
||||
</div>
|
||||
<ui-button action='PRG_togglea' icon='gear'>{{data.assignments ? "Hide assignments" : "Show assignments"}}</ui-button>
|
||||
<div class='item'>
|
||||
<span id='allvalue.jobsslot'>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
<div class='item'>
|
||||
{{#if data.assignments}}
|
||||
<div id="all-value.jobs">
|
||||
<table>
|
||||
<tr>
|
||||
<th></th><th>Command</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Special</th>
|
||||
<td>
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "Captain"}' state='{{data.id_rank == "Captain" ? "selected" : null}}'>Captain</ui-button>
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "Custom"}'>Custom</ui-button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="color: '#FFA500';">Engineering</th>
|
||||
<td>
|
||||
{{#each data.engineering_jobs}}
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="color: '#008000';">Medical</th>
|
||||
<td>
|
||||
{{#each data.medical_jobs}}
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="color: '#800080';">Science</th>
|
||||
<td>
|
||||
{{#each data.science_jobs}}
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="color: '#DD0000';">Security</th>
|
||||
<td>
|
||||
{{#each data.security_jobs}}
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="color: '#cc6600';">Cargo</th>
|
||||
<td>
|
||||
{{#each data.cargo_jobs}}
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="color: '#808080';">Civilian</th>
|
||||
<td>
|
||||
{{#each data.civilian_jobs}}
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
{{#if data.centcom_access}}
|
||||
<tr>
|
||||
<th style="color: '#A52A2A';">CentCom</th>
|
||||
<td>
|
||||
{{#each data.centcom_jobs}}
|
||||
|
||||
<ui-button action='PRG_assign' params='{"assign_target" : "{{job}}"}' state='{{data.id_rank == job ? "selected" : null}}'>{{display_name}}</ui-button>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
</table>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if data.centcom_access}}
|
||||
<div class='item'>
|
||||
<h2>Central Command</h2>
|
||||
</div>
|
||||
<div class='item' style='width: 100%'>
|
||||
{{#each data.all_centcom_access}}
|
||||
<div class='itemContentWide'>
|
||||
<ui-button action='PRG_access' params='{"access_target" : "{{ref}}", "allowed" : "{{allowed}}"}' state='{{allowed ? "selected" : null}}'>{{desc}}</ui-button>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='item'>
|
||||
<h2>{{data.station_name}}</h2>
|
||||
</div>
|
||||
<div class='item' style='width: 100%'>
|
||||
{{#each data.regions}}
|
||||
<div style='float: left; width: 175px; min-height: 250px'>
|
||||
<div class='average'><b>{{name}}</b></div>
|
||||
{{#each accesses}}
|
||||
<div class='itemContentWide'>
|
||||
<ui-button action='PRG_access' params='{"access_target" : "{{ref}}", "allowed" : "{{allowed}}"}' state='{{allowed ? "toggle" : null}}'>{{desc}}</ui-button>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class='itemContent'>
|
||||
<table>
|
||||
<tr><td><ui-button action='PRG_obfuscate'>OBFUSCATE PROGRAM NAME</ui-button>
|
||||
<tr><td><ui-button action='PRG_arm'>{{data.armed ? "DISARM" : "ARM"}}</ui-button>
|
||||
<tr><td><ui-button action='PRG_arm' state='{{data.armed ? "danger" : null}}'>{{data.armed ? "DISARM" : "ARM"}}</ui-button>
|
||||
<ui-button icon='radiation' state='{{data.armed ? null : "disabled"}}' action='PRG_activate'>ACTIVATE</ui-button>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user