mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 08:56:49 +01:00
Rock the UI Away - Removes VueUI and adds TGUI (#16509)
* tgui the beginning * binaries and the like * Bring in the last of it * Example radio UI * delete example * NTOS Main Menu, start on manifest, tgui states * tasks.json * gunnery ui pt 1 * okay * fix everything * scss update * oops * manifest gigablast * downloader part 1 * download prt 2 * NTOSDownloader final * mfw committing to_worlds * gunnery console pt2 * i cooked * targeting (finished) * one vueui down * voting ui almost done * MY MIND FEELS LIKE AN ARCH ENEMYYYY * voting ui down * photocopier * ntos config + download fixes * photocopier 2 * refactor define * NTOS client manager + fixes * fax machine final (it also uses toner now) * marching forwards... left behind... * ntnrc part 1 * canister * add quotes * portable pumps pt1 + more backgrounds * oops * finish the portable pump * freezers so I'll keep on pushing forward... you haven't seen the last of me... oooooooh... * doors ui pt1 * finish doors UI (forgive me wildkins it's a bit of shitcode) * vitals monitor, make things use labeled lists, new backgrounds * mais j'envoyé aucun mayday... * maglock pt1 * pour ça je me suis perdu... * infrared * fix that * prox sensor pt1 * prox sensor * signaler (this was actually pretty hard) * atmos control pt1 * atmos control pt1.1 * atmos pt 2 * fuel injector * multitool UI * jammer * list viewer * APC * portgen * targeting console updates + SMES ui * new themes, shield generator * supermatter * Add ore detector and (shitty) NTNet Relay * orderterminal pt1 * orderterminal pt2 * smartfridge * Add (air-)tank GUI update ore detector size * Adds Transfer Valves * Add AtmoScrubber * analyzer pt1 * weapons analyzer pt2 * bodyscanner pt1 * bodyscanner pt2 * fix this shitcode * seed storage * appearance changer * appearance changer final * sleeper pt1 * sleeper * gps * vehicles * chem dispenser * lily request * holopad * tgui modules pt1 * ppanel * damage menu * fixes * im here too now * follow menu, search bars * quikpay * quikpay fixes * circuit printer * ppanel * ppanel updates * pai * turret controls (i want to kill myself) * tweak * remove the boardgame * guntracker * implant tracker * penal mechs come close to me, come close to me * chem codex * pai radio * doorjack * pai directives * signaler removal, sensors * ghost spawner * spawnpoint * fixes * teleporter * one more to the chopping block * account database * remove divider * scanner, atmos * latejoin ui pt1 * latejoin * records pt1 * RECORDS UI DONE * delete interpreter & records * CHAT FUCKING CLIENT * data updates * fix some things * final UI, log * basic nanoui fix * antag panel * remove vueui * atm update * vending update * warrants, cameras * ntmonitor * time comes for all * preserve this legacy * bring that back (oops) * rcon, ui auto update for computer UIs, remove rcon computers * alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles) * A LIKE SUPREME * a * power monitor * lights on * fuck this code, fuck nanoui modules, and fuck nanoui * LEAVE IT OH SO FAR BEHIND * fix alarm monitoring for synths * I SAW IN YOU WHAT LIFE WAS MISSING * comms console * idcard and record updates * turn the light on * arcade * pt2 * news browser * static * crusher * f * COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO * codeowners & suit sensors * html ui style removal * make lint happy * resist and disorder * i slowly get up and turn off the noise, already fed up... * pleaseeeeeeeeeeeeeee * THE CREDIT LARP IS NECESSARY * i hold the keys * RISE UP * fix that? * harry's suggestions xoxo * runtime fix pt2 * You are the only thing that I still care about * adds build workflow * Update update_tgui.yml * adds some needed steps * ATM * misc fixes and tweaks * fixes 2 * make newscasters usable and fix use power on freezers * turret control is clearer --------- Co-authored-by: John Wildkins <john.wildkins@gmail.com> Co-authored-by: Matt Atlas <liermattia@gmail.com> Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> Co-authored-by: Werner <Arrow768@users.noreply.github.com> Co-authored-by: Geeves <ggrobler447@gmail.com> Co-authored-by: harryob <me@harryob.live>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
size = 4 // primarily cloud computing
|
||||
usage_flags = PROGRAM_CONSOLE
|
||||
color = LIGHT_COLOR_BLUE
|
||||
tgui_id = "AccountDatabase"
|
||||
|
||||
var/machine_id = ""
|
||||
var/centcomm_db = FALSE
|
||||
@@ -58,19 +59,8 @@
|
||||
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
|
||||
"}
|
||||
|
||||
/datum/computer_file/program/account_db/ui_interact(mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
if(!ui)
|
||||
ui = new /datum/vueui/modularcomputer(user, src, "mcomputer-command-accountdb", 400, 640, filedesc)
|
||||
ui.open()
|
||||
|
||||
/datum/computer_file/program/account_db/vueui_transfer(oldobj)
|
||||
SSvueui.transfer_uis(oldobj, src, "mcomputer-command-accountdb", 400, 640, filedesc)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/account_db/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
|
||||
. = ..()
|
||||
data = . || data || list()
|
||||
/datum/computer_file/program/account_db/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
// Gather data for computer header
|
||||
var/headerdata = get_header_data(data["_PC"])
|
||||
@@ -81,10 +71,11 @@
|
||||
var/obj/item/card/id/held_card = get_held_card()
|
||||
|
||||
data["has_printer"] = !!computer.nano_printer
|
||||
data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : FALSE
|
||||
data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : null
|
||||
data["access_level"] = get_access_level()
|
||||
data["machine_id"] = machine_id
|
||||
data["station_account_number"] = SSeconomy.station_account.account_number
|
||||
data["station_account_number"] = "[SSeconomy.station_account.account_number]"
|
||||
data["station_account_money"] = SSeconomy.station_account.money
|
||||
|
||||
data["accounts"] = list()
|
||||
if(get_access_level())
|
||||
@@ -92,175 +83,182 @@
|
||||
for(var/M in SSeconomy_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
var/account_number = "[M]"
|
||||
data["accounts"][account_number] = list()
|
||||
data["accounts"][account_number]["no"] = D.account_number
|
||||
data["accounts"][account_number]["owner"] = D.owner_name
|
||||
data["accounts"][account_number]["sus"] = D.suspended
|
||||
data["accounts"][account_number]["money"] = D.money
|
||||
var/list/transactions = list()
|
||||
data["accounts"][account_number]["transactions"] = transactions
|
||||
for(var/datum/transaction/T in D.transactions)
|
||||
var/Tref = ref(T)
|
||||
transactions[Tref] = list()
|
||||
transactions[Tref]["d"] = T.date
|
||||
transactions[Tref]["t"] = T.time
|
||||
transactions[Tref]["tar"] = T.target_name
|
||||
transactions[Tref]["purp"] = T.purpose
|
||||
transactions[Tref]["am"] = T.amount
|
||||
transactions[Tref]["src"] = T.source_terminal
|
||||
transactions += list(list(
|
||||
"ref" = Tref,
|
||||
"date" = T.date,
|
||||
"time" = T.time,
|
||||
"target_name" = T.target_name,
|
||||
"purpose" = T.purpose,
|
||||
"amount" = T.amount,
|
||||
"source_terminal" = T.source_terminal
|
||||
))
|
||||
var/account = list(
|
||||
"account_number" = account_number,
|
||||
"owner" = D.owner_name,
|
||||
"suspended" = D.suspended,
|
||||
"money" = D.money,
|
||||
"transactions" = transactions
|
||||
)
|
||||
data["accounts"] += list(account)
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/account_db/Topic(href, href_list)
|
||||
if(..())
|
||||
return TRUE
|
||||
/datum/computer_file/program/account_db/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
var/access_level = get_access_level()
|
||||
|
||||
if(!access_level)
|
||||
return
|
||||
|
||||
if(href_list["create_account"])
|
||||
var/account_name = href_list["create_account"]["name"]
|
||||
var/starting_funds = max(href_list["create_account"]["funds"], 0)
|
||||
switch(action)
|
||||
if("create_account")
|
||||
var/account_name = params["name"]
|
||||
var/starting_funds = max(params["funds"], 0)
|
||||
|
||||
starting_funds = Clamp(starting_funds, 0, SSeconomy.station_account.money) // Not authorized to put the station in debt.
|
||||
starting_funds = min(starting_funds, FUND_CAP) // Not authorized to give more than the fund cap.
|
||||
starting_funds = Clamp(starting_funds, 0, SSeconomy.station_account.money) // Not authorized to put the station in debt.
|
||||
starting_funds = min(starting_funds, FUND_CAP) // Not authorized to give more than the fund cap.
|
||||
|
||||
SSeconomy.create_account(account_name, starting_funds, src)
|
||||
SSeconomy.create_account(account_name, starting_funds, src)
|
||||
|
||||
if(starting_funds > 0)
|
||||
//subtract the money
|
||||
SSeconomy.station_account.money -= starting_funds
|
||||
if(starting_funds > 0)
|
||||
//subtract the money
|
||||
SSeconomy.station_account.money -= starting_funds
|
||||
|
||||
//create a transaction log entry
|
||||
var/datum/transaction/trx = create_transation(account_name, "New account activation", "([starting_funds])")
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,trx)
|
||||
//create a transaction log entry
|
||||
var/datum/transaction/trx = create_transation(account_name, "New account activation", "([starting_funds])")
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,trx)
|
||||
|
||||
if(href_list["suspend"])
|
||||
var/account = href_list["suspend"]["account"]
|
||||
if("suspend")
|
||||
var/account = params["account"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
Acc.suspended = !Acc.suspended
|
||||
callHook("change_account_status", list(Acc))
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
Acc.suspended = !Acc.suspended
|
||||
callHook("change_account_status", list(Acc))
|
||||
|
||||
|
||||
if(href_list["add_funds"] && access_level == 2)
|
||||
var/account = href_list["add_funds"]["account"]
|
||||
var/amount = href_list["add_funds"]["amount"]
|
||||
if("add_funds")
|
||||
if(access_level != 2)
|
||||
return
|
||||
var/account = params["account"]
|
||||
var/amount = params["amount"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
log_and_message_admins("Added [amount] credits to the [Acc.owner_name] account.")
|
||||
Acc.money = min(Acc.money + amount, FUND_CAP)
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
log_and_message_admins("added [amount] credits to the [Acc.owner_name] account.")
|
||||
Acc.money = min(Acc.money + amount, FUND_CAP)
|
||||
|
||||
if(href_list["remove_funds"] && access_level == 2)
|
||||
var/account = href_list["remove_funds"]["account"]
|
||||
var/amount = href_list["remove_funds"]["amount"]
|
||||
if("remove_funds")
|
||||
if(access_level != 2)
|
||||
return
|
||||
var/account = params["account"]
|
||||
var/amount = params["amount"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
log_and_message_admins("Removed [amount] credits to the [Acc.owner_name] account.")
|
||||
Acc.money = max(Acc.money - amount, -FUND_CAP)
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
log_and_message_admins("removed [amount] credits from the [Acc.owner_name] account.")
|
||||
Acc.money = max(Acc.money - amount, -FUND_CAP)
|
||||
|
||||
if(href_list["revoke_payroll"])
|
||||
var/account = href_list["revoke_payroll"]["account"]
|
||||
if("revoke_payroll")
|
||||
var/account = params["account"]
|
||||
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
var/funds = Acc.money
|
||||
var/account_trx = create_transation(SSeconomy.station_account.owner_name, "Revoke payroll", "[funds]")
|
||||
var/station_trx = create_transation(Acc.owner_name, "Revoke payroll", funds)
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(account)
|
||||
if(Acc)
|
||||
var/funds = Acc.money
|
||||
var/account_trx = create_transation(SSeconomy.station_account.owner_name, "Revoke payroll", "[funds]")
|
||||
var/station_trx = create_transation(Acc.owner_name, "Revoke payroll", funds)
|
||||
|
||||
SSeconomy.station_account.money += funds
|
||||
Acc.money = 0
|
||||
SSeconomy.station_account.money += funds
|
||||
Acc.money = 0
|
||||
|
||||
SSeconomy.add_transaction_log(Acc,account_trx)
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,station_trx)
|
||||
SSeconomy.add_transaction_log(Acc,account_trx)
|
||||
SSeconomy.add_transaction_log(SSeconomy.station_account,station_trx)
|
||||
|
||||
callHook("revoke_payroll", list(Acc))
|
||||
callHook("revoke_payroll", list(Acc))
|
||||
|
||||
if("print")
|
||||
|
||||
if(href_list["print"])
|
||||
var/text
|
||||
var/pname
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(params["print"])
|
||||
if(Acc)
|
||||
pname = "account #[Acc.account_number] details"
|
||||
var/title = "Account #[Acc.account_number] Details"
|
||||
text = {"
|
||||
[accounting_letterhead(title)]
|
||||
<u>Holder:</u> [Acc.owner_name]<br>
|
||||
<u>Balance:</u> [Acc.money]电<br>
|
||||
<u>Status:</u> [Acc.suspended ? "Suspended" : "Active"]<br>
|
||||
<u>Transactions:</u> ([Acc.transactions.len])<br>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Timestamp</td>
|
||||
<td>Target</td>
|
||||
<td>Reason</td>
|
||||
<td>Value</td>
|
||||
<td>Terminal</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
var/text
|
||||
var/pname
|
||||
var/datum/money_account/Acc = SSeconomy.get_account(href_list["print"])
|
||||
if(Acc)
|
||||
pname = "account #[Acc.account_number] details"
|
||||
var/title = "Account #[Acc.account_number] Details"
|
||||
text = {"
|
||||
[accounting_letterhead(title)]
|
||||
<u>Holder:</u> [Acc.owner_name]<br>
|
||||
<u>Balance:</u> [Acc.money]电<br>
|
||||
<u>Status:</u> [Acc.suspended ? "Suspended" : "Active"]<br>
|
||||
<u>Transactions:</u> ([Acc.transactions.len])<br>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Timestamp</td>
|
||||
<td>Target</td>
|
||||
<td>Reason</td>
|
||||
<td>Value</td>
|
||||
<td>Terminal</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
for (var/datum/transaction/T in Acc.transactions)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>[T.date] [T.time]</td>
|
||||
<td>[T.target_name]</td>
|
||||
<td>[T.purpose]</td>
|
||||
<td>[T.amount]</td>
|
||||
<td>[T.source_terminal]</td>
|
||||
</tr>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
else
|
||||
pname = "financial account list"
|
||||
text = {"
|
||||
[accounting_letterhead("Financial Account List")]
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Account Number</td>
|
||||
<td>Holder</td>
|
||||
<td>Balance</td>
|
||||
<td>Status</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
for (var/datum/transaction/T in Acc.transactions)
|
||||
text += {"
|
||||
var/list/SSeconomy_accounts = centcomm_db ? SSeconomy.all_money_accounts : SSeconomy.get_public_accounts()
|
||||
for(var/M in SSeconomy_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>[T.date] [T.time]</td>
|
||||
<td>[T.target_name]</td>
|
||||
<td>[T.purpose]</td>
|
||||
<td>[T.amount]</td>
|
||||
<td>[T.source_terminal]</td>
|
||||
<td>#[D.account_number]</td>
|
||||
<td>[D.owner_name]</td>
|
||||
<td>[D.money]电</td>
|
||||
<td>[D.suspended ? "Suspended" : "Active"]</td>
|
||||
</tr>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
else
|
||||
pname = "financial account list"
|
||||
text = {"
|
||||
[accounting_letterhead("Financial Account List")]
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Account Number</td>
|
||||
<td>Holder</td>
|
||||
<td>Balance</td>
|
||||
<td>Status</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"}
|
||||
|
||||
var/list/SSeconomy_accounts = centcomm_db ? SSeconomy.all_money_accounts : SSeconomy.get_public_accounts()
|
||||
for(var/M in SSeconomy_accounts)
|
||||
var/datum/money_account/D = SSeconomy.get_account(M)
|
||||
text += {"
|
||||
<tr>
|
||||
<td>#[D.account_number]</td>
|
||||
<td>[D.owner_name]</td>
|
||||
<td>[D.money]电</td>
|
||||
<td>[D.suspended ? "Suspended" : "Active"]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
text += {"
|
||||
</tbody>
|
||||
</table>
|
||||
"}
|
||||
|
||||
var/obj/item/paper/P = computer.nano_printer.print_text("", pname, "#deebff")
|
||||
P.set_content_unsafe(pname, text)
|
||||
|
||||
SSvueui.check_uis_for_change(src)
|
||||
var/obj/item/paper/P = computer.nano_printer.print_text("", pname, "#deebff")
|
||||
P.set_content_unsafe(pname, text)
|
||||
|
||||
#undef FUND_CAP
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/datum/computer_file/program/card_mod
|
||||
filename = "cardmod"
|
||||
filedesc = "ID Card Modification Program"
|
||||
nanomodule_path = /datum/nano_module/program/card_mod
|
||||
program_icon_state = "id"
|
||||
program_key_icon_state = "lightblue_key"
|
||||
extended_desc = "Program for programming employee ID cards to access parts of the station."
|
||||
@@ -11,36 +10,57 @@
|
||||
requires_ntnet = FALSE
|
||||
size = 8
|
||||
color = LIGHT_COLOR_BLUE
|
||||
|
||||
/datum/nano_module/program/card_mod
|
||||
name = "ID card modification program"
|
||||
tgui_id = "IDCardModification"
|
||||
ui_auto_update = FALSE
|
||||
var/is_centcom = FALSE
|
||||
var/show_assignments = FALSE
|
||||
|
||||
/datum/nano_module/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 = host.initial_data()
|
||||
/datum/computer_file/program/card_mod/ui_data(mob/user)
|
||||
var/list/data = initial_data()
|
||||
|
||||
data["src"] = "\ref[src]"
|
||||
data["station_name"] = station_name()
|
||||
data["assignments"] = show_assignments
|
||||
if(program?.computer)
|
||||
data["have_id_slot"] = !!program.computer.card_slot
|
||||
data["have_printer"] = !!program.computer.nano_printer
|
||||
data["authenticated"] = program.can_run(user)
|
||||
else
|
||||
data["have_id_slot"] = 0
|
||||
data["have_printer"] = 0
|
||||
data["authenticated"] = 0
|
||||
data["have_id_slot"] = !!computer.card_slot
|
||||
data["have_printer"] = !!computer.nano_printer
|
||||
data["authenticated"] = can_run(user)
|
||||
data["centcom_access"] = is_centcom
|
||||
|
||||
if(program && program.computer && program.computer.card_slot)
|
||||
var/obj/item/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 : "-----"
|
||||
var/obj/item/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 : "-----"
|
||||
|
||||
if(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" = get_centcom_access_desc(access),
|
||||
"ref" = access,
|
||||
"allowed" = (access in id_card.access) ? TRUE : FALSE)))
|
||||
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" = get_access_desc(access),
|
||||
"ref" = access,
|
||||
"allowed" = (access in id_card.access) ? TRUE : FALSE)))
|
||||
|
||||
regions.Add(list(list(
|
||||
"name" = get_region_accesses_name(i),
|
||||
"accesses" = accesses)))
|
||||
data["regions"] = regions
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/card_mod/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["command_support_jobs"] = format_jobs(command_support_positions)
|
||||
data["engineering_jobs"] = format_jobs(engineering_positions)
|
||||
data["medical_jobs"] = format_jobs(medical_positions)
|
||||
@@ -50,73 +70,33 @@
|
||||
data["service_jobs"] = format_jobs(service_positions)
|
||||
data["civilian_jobs"] = format_jobs(civilian_positions)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
|
||||
return data
|
||||
|
||||
data["all_centcom_access"] = is_centcom ? get_accesses(1) : null
|
||||
data["regions"] = get_accesses()
|
||||
|
||||
if(program.computer.card_slot.stored_card)
|
||||
var/obj/item/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 = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "identification_computer.tmpl", name, 600, 700, state = state)
|
||||
ui.auto_update_layout = TRUE
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/datum/nano_module/program/card_mod/proc/format_jobs(list/jobs)
|
||||
var/obj/item/card/id/id_card = program.computer.card_slot.stored_card
|
||||
/datum/computer_file/program/card_mod/proc/format_jobs(list/jobs)
|
||||
var/obj/item/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, " ", " "),
|
||||
"target_rank" = id_card && id_card.assignment ? id_card.assignment : "Unassigned",
|
||||
"job" = job)))
|
||||
|
||||
return formatted
|
||||
|
||||
/datum/nano_module/program/card_mod/proc/get_accesses(var/is_centcom = 0)
|
||||
return null
|
||||
|
||||
|
||||
/datum/computer_file/program/card_mod/Topic(href, href_list)
|
||||
/datum/computer_file/program/card_mod/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
return
|
||||
|
||||
var/mob/user = usr
|
||||
var/obj/item/card/id/user_id_card = user.GetIdCard()
|
||||
var/obj/item/card/id/id_card = computer.card_slot.stored_card
|
||||
var/datum/nano_module/program/card_mod/module = NM
|
||||
switch(href_list["action"])
|
||||
|
||||
switch(action)
|
||||
if("togglea")
|
||||
if(module.show_assignments)
|
||||
module.show_assignments = FALSE
|
||||
if(show_assignments)
|
||||
show_assignments = FALSE
|
||||
else
|
||||
module.show_assignments = TRUE
|
||||
show_assignments = TRUE
|
||||
. = TRUE
|
||||
|
||||
if("print")
|
||||
if(computer?.nano_printer && can_run(user, 1)) //This option should never be called if there is no printer
|
||||
var/contents = {"<h4>Access Report</h4>
|
||||
@@ -139,6 +119,8 @@
|
||||
return
|
||||
else
|
||||
computer.visible_message(SPAN_NOTICE("\The [computer] prints out paper."))
|
||||
. = TRUE
|
||||
|
||||
if("eject")
|
||||
if(computer && computer.card_slot)
|
||||
if(id_card)
|
||||
@@ -155,25 +137,31 @@
|
||||
R.rank = id_card.assignment
|
||||
R.real_rank = real_title
|
||||
computer.eject_id()
|
||||
. = TRUE
|
||||
|
||||
if("suspend")
|
||||
if(computer && can_run(user, 1))
|
||||
id_card.assignment = "Suspended"
|
||||
remove_nt_access(id_card)
|
||||
callHook("suspend_employee", list(id_card))
|
||||
. = TRUE
|
||||
|
||||
if("edit")
|
||||
if(computer && can_run(user, 1))
|
||||
if(href_list["name"])
|
||||
if(params["name"])
|
||||
var/temp_name = sanitizeName(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"])
|
||||
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
|
||||
. = TRUE
|
||||
|
||||
if("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)
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
@@ -181,7 +169,7 @@
|
||||
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
|
||||
@@ -203,19 +191,20 @@
|
||||
|
||||
SSrecords.reset_manifest()
|
||||
callHook("reassign_employee", list(id_card))
|
||||
. = TRUE
|
||||
|
||||
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(isnum(params["allowed"]) && computer && can_run(user, 1))
|
||||
var/access_type = text2num(params["access_target"])
|
||||
var/access_allowed = text2num(params["allowed"])
|
||||
if(access_type in get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM))
|
||||
id_card.access -= access_type
|
||||
if(!access_allowed)
|
||||
id_card.access += access_type
|
||||
. = TRUE
|
||||
if(id_card)
|
||||
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
|
||||
|
||||
SSnanoui.update_uis(NM)
|
||||
return TRUE
|
||||
. = TRUE
|
||||
|
||||
/datum/computer_file/program/card_mod/proc/remove_nt_access(var/obj/item/card/id/id_card)
|
||||
id_card.access -= get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM)
|
||||
|
||||
+68
-147
@@ -1,15 +1,8 @@
|
||||
#define STATE_DEFAULT 1
|
||||
#define STATE_MESSAGELIST 2
|
||||
#define STATE_VIEWMESSAGE 3
|
||||
#define STATE_STATUSDISPLAY 4
|
||||
#define STATE_ALERT_LEVEL 5
|
||||
|
||||
/datum/computer_file/program/comm
|
||||
filename = "comm"
|
||||
filedesc = "Command and Communications Program"
|
||||
program_icon_state = "comm"
|
||||
program_key_icon_state = "lightblue_key"
|
||||
nanomodule_path = /datum/nano_module/program/comm
|
||||
extended_desc = "Used to command and control the station. Can relay long-range communications."
|
||||
required_access_run = access_heads
|
||||
required_access_download = access_heads
|
||||
@@ -17,16 +10,22 @@
|
||||
size = 12
|
||||
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
|
||||
network_destination = "station long-range communication array"
|
||||
color = LIGHT_COLOR_BLUE
|
||||
tgui_id = "CommandCommunications"
|
||||
ui_auto_update = FALSE
|
||||
var/datum/comm_message_listener/message_core
|
||||
var/intercept = FALSE
|
||||
var/can_call_shuttle = FALSE //If calling the shuttle should be available from this console
|
||||
color = LIGHT_COLOR_BLUE
|
||||
var/centcomm_message_cooldown = 0
|
||||
var/announcement_cooldown = 0
|
||||
var/datum/announcement/priority/crew_announcement = new
|
||||
|
||||
/datum/computer_file/program/comm/New(obj/item/modular_computer/comp, intercept_printing = FALSE, shuttle_call = FALSE)
|
||||
..()
|
||||
intercept = intercept_printing
|
||||
can_call_shuttle = shuttle_call
|
||||
message_core = new
|
||||
crew_announcement.newscast = TRUE
|
||||
|
||||
/datum/computer_file/program/comm/clone()
|
||||
var/datum/computer_file/program/comm/temp = ..()
|
||||
@@ -34,46 +33,19 @@
|
||||
temp.message_core.messages = message_core.messages.Copy()
|
||||
return temp
|
||||
|
||||
/datum/nano_module/program/comm
|
||||
name = "Command and communications program"
|
||||
available_to_ai = TRUE
|
||||
var/current_status = STATE_DEFAULT
|
||||
var/msg_line1 = ""
|
||||
var/msg_line2 = ""
|
||||
var/centcomm_message_cooldown = 0
|
||||
var/announcement_cooldown = 0
|
||||
var/datum/announcement/priority/crew_announcement = new
|
||||
var/current_viewing_message_id = 0
|
||||
var/current_viewing_message = null
|
||||
/datum/computer_file/program/comm/ui_data(mob/user)
|
||||
var/list/data = initial_data()
|
||||
|
||||
/datum/nano_module/program/comm/New()
|
||||
..()
|
||||
crew_announcement.newscast = TRUE
|
||||
|
||||
/datum/nano_module/program/comm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = TRUE, var/datum/topic_state/state = default_state)
|
||||
var/list/data = host.initial_data()
|
||||
|
||||
if(program)
|
||||
data["emagged"] = program.computer_emagged
|
||||
data["net_comms"] = !!program.get_signal(NTNET_COMMUNICATION) //Double !! is needed to get 1 or 0 answer
|
||||
data["net_syscont"] = !!program.get_signal(NTNET_SYSTEMCONTROL)
|
||||
var/datum/computer_file/program/comm/P = program
|
||||
data["message_printing_intercepts"] = P.intercept
|
||||
if(program.computer)
|
||||
data["have_printer"] = !!program.computer.nano_printer
|
||||
else
|
||||
data["have_printer"] = FALSE
|
||||
data["emagged"] = computer_emagged
|
||||
data["net_comms"] = !!get_signal(NTNET_COMMUNICATION) //Double !! is needed to get 1 or 0 answer
|
||||
data["net_syscont"] = !!get_signal(NTNET_SYSTEMCONTROL)
|
||||
data["message_printing_intercepts"] = intercept
|
||||
if(computer)
|
||||
data["have_printer"] = !!computer.nano_printer
|
||||
else
|
||||
data["emagged"] = FALSE
|
||||
data["net_comms"] = TRUE
|
||||
data["net_syscont"] = TRUE
|
||||
data["have_printer"] = FALSE
|
||||
data["message_printing_intercepts"] = FALSE
|
||||
|
||||
data["can_call_shuttle"] = can_call_shuttle()
|
||||
data["message_line1"] = msg_line1
|
||||
data["message_line2"] = msg_line2
|
||||
data["state"] = current_status
|
||||
data["isAI"] = issilicon(usr)
|
||||
data["authenticated"] = is_authenticated(user)
|
||||
data["boss_short"] = current_map.boss_short
|
||||
@@ -89,9 +61,6 @@
|
||||
var/datum/comm_message_listener/l = obtain_message_listener()
|
||||
data["messages"] = l.messages
|
||||
data["message_deletion_allowed"] = l != global_message_listener
|
||||
data["message_current_id"] = current_viewing_message_id
|
||||
if(current_viewing_message)
|
||||
data["message_current"] = current_viewing_message
|
||||
|
||||
var/list/processed_evac_options = list()
|
||||
if(!isnull(evacuation_controller))
|
||||
@@ -103,50 +72,34 @@
|
||||
option["option_target"] = EO.option_target
|
||||
option["needs_syscontrol"] = EO.needs_syscontrol
|
||||
option["silicon_allowed"] = EO.silicon_allowed
|
||||
processed_evac_options[++processed_evac_options.len] = option
|
||||
processed_evac_options += list(option)
|
||||
data["evac_options"] = processed_evac_options
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "communication.tmpl", name, 550, 420, state = state)
|
||||
ui.auto_update_layout = TRUE
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
return data
|
||||
|
||||
/datum/nano_module/program/comm/proc/is_authenticated(var/mob/user)
|
||||
if(program)
|
||||
return program.can_run(user)
|
||||
return TRUE
|
||||
/datum/computer_file/program/comm/proc/is_authenticated(var/mob/user)
|
||||
return can_run(user)
|
||||
|
||||
/datum/nano_module/program/comm/proc/obtain_message_listener()
|
||||
if(program)
|
||||
var/datum/computer_file/program/comm/P = program
|
||||
return P.message_core
|
||||
/datum/computer_file/program/comm/proc/obtain_message_listener()
|
||||
return global_message_listener
|
||||
|
||||
/datum/nano_module/program/comm/proc/can_call_shuttle()
|
||||
if(program)
|
||||
var/datum/computer_file/program/comm/P = program
|
||||
return P.can_call_shuttle
|
||||
else
|
||||
return FALSE
|
||||
/datum/computer_file/program/comm/proc/can_call_shuttle()
|
||||
return can_call_shuttle
|
||||
|
||||
/datum/nano_module/program/comm/proc/set_announcement_cooldown(var/cooldown)
|
||||
/datum/computer_file/program/comm/proc/set_announcement_cooldown(var/cooldown)
|
||||
announcement_cooldown = cooldown
|
||||
|
||||
/datum/nano_module/program/comm/proc/set_centcomm_message_cooldown(var/cooldown)
|
||||
/datum/computer_file/program/comm/proc/set_centcomm_message_cooldown(var/cooldown)
|
||||
centcomm_message_cooldown = cooldown
|
||||
|
||||
/datum/nano_module/program/comm/Topic(href, href_list)
|
||||
/datum/computer_file/program/comm/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
return
|
||||
var/mob/user = usr
|
||||
var/ntn_comm = !!program.get_signal(NTNET_COMMUNICATION)
|
||||
var/ntn_cont = !!program.get_signal(NTNET_SYSTEMCONTROL)
|
||||
var/ntn_comm = !!get_signal(NTNET_COMMUNICATION)
|
||||
var/ntn_cont = !!get_signal(NTNET_SYSTEMCONTROL)
|
||||
var/datum/comm_message_listener/l = obtain_message_listener()
|
||||
switch(href_list["action"])
|
||||
if("sw_menu")
|
||||
current_status = text2num(href_list["target"])
|
||||
switch(action)
|
||||
if("emergencymaint")
|
||||
if(is_authenticated(user) && !issilicon(user))
|
||||
if(maint_all_access)
|
||||
@@ -166,52 +119,44 @@
|
||||
crew_announcement.announcer = "Unknown"
|
||||
if(announcement_cooldown)
|
||||
to_chat(usr, "Please allow at least one minute to pass between announcements")
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|message
|
||||
if(!input || !can_still_topic())
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
var/was_hearing = HAS_TRAIT(program.computer, TRAIT_HEARING_SENSITIVE)
|
||||
if(!input || computer.use_check_and_message(usr))
|
||||
return FALSE
|
||||
var/was_hearing = HAS_TRAIT(computer, TRAIT_HEARING_SENSITIVE)
|
||||
if(!was_hearing)
|
||||
program.computer.become_hearing_sensitive()
|
||||
computer.become_hearing_sensitive()
|
||||
usr.say(input)
|
||||
if(!was_hearing)
|
||||
program.computer.lose_hearing_sensitivity()
|
||||
var/affected_zlevels = GetConnectedZlevels(GET_Z(program.computer))
|
||||
crew_announcement.Announce(program.computer.registered_message, zlevels = affected_zlevels)
|
||||
computer.lose_hearing_sensitivity()
|
||||
var/affected_zlevels = GetConnectedZlevels(GET_Z(computer))
|
||||
crew_announcement.Announce(computer.registered_message, zlevels = affected_zlevels)
|
||||
set_announcement_cooldown(TRUE)
|
||||
addtimer(CALLBACK(src, PROC_REF(set_announcement_cooldown), FALSE), 600) //One minute cooldown
|
||||
if("message")
|
||||
if(href_list["target"] == "emagged")
|
||||
if(program)
|
||||
if(is_authenticated(user) && program.computer_emagged && !issilicon(usr) && ntn_comm)
|
||||
if(centcomm_message_cooldown)
|
||||
to_chat(usr, SPAN_WARNING("Arrays recycling. Please stand by."))
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
|
||||
if(!input || !can_still_topic())
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
Syndicate_announce(input, usr)
|
||||
to_chat(usr, SPAN_NOTICE("Message successfully transmitted."))
|
||||
log_say("[key_name(usr)] has sent a message to the syndicate: [input]", ckey = key_name(usr))
|
||||
centcomm_message_cooldown = TRUE
|
||||
addtimer(CALLBACK(src, PROC_REF(set_centcomm_message_cooldown), FALSE), 300) // thirty second cooldown
|
||||
else if(href_list["target"] == "regular")
|
||||
if(params["target"] == "emagged")
|
||||
if(is_authenticated(user) && computer_emagged && !issilicon(usr) && ntn_comm)
|
||||
if(centcomm_message_cooldown)
|
||||
to_chat(usr, SPAN_WARNING("Arrays recycling. Please stand by."))
|
||||
return TRUE
|
||||
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
|
||||
if(!input || computer.use_check_and_message(usr))
|
||||
return FALSE
|
||||
Syndicate_announce(input, usr)
|
||||
to_chat(usr, SPAN_NOTICE("Message successfully transmitted."))
|
||||
log_say("[key_name(usr)] has sent a message to the syndicate: [input]", ckey = key_name(usr))
|
||||
centcomm_message_cooldown = TRUE
|
||||
addtimer(CALLBACK(src, PROC_REF(set_centcomm_message_cooldown), FALSE), 300) // thirty second cooldown
|
||||
else if(params["target"] == "regular")
|
||||
if(is_authenticated(user) && !issilicon(usr) && ntn_comm)
|
||||
if(centcomm_message_cooldown)
|
||||
to_chat(usr, SPAN_WARNING("Arrays recycling. Please stand by."))
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
if(!is_relay_online())//Contact Centcom has a check, Syndie doesn't to allow for Traitor funs.
|
||||
to_chat(usr, SPAN_WARNING("No Emergency Bluespace Relay detected. Unable to transmit message."))
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
var/input = sanitize(input("Please choose a message to transmit to [current_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
|
||||
if(!input || !can_still_topic())
|
||||
SSnanoui.update_uis(src)
|
||||
if(!input || computer.use_check_and_message(usr))
|
||||
return
|
||||
Centcomm_announce(input, usr)
|
||||
to_chat(usr, SPAN_NOTICE("Message successfully transmitted."))
|
||||
@@ -220,39 +165,31 @@
|
||||
addtimer(CALLBACK(src, PROC_REF(set_centcomm_message_cooldown), FALSE), 300) // thirty second cooldown
|
||||
if("evac")
|
||||
if(is_authenticated(user))
|
||||
var/datum/evacuation_option/selected_evac_option = evacuation_controller.evacuation_options[href_list["target"]]
|
||||
var/datum/evacuation_option/selected_evac_option = evacuation_controller.evacuation_options[params["target"]]
|
||||
if (isnull(selected_evac_option) || !istype(selected_evac_option))
|
||||
return
|
||||
if (!selected_evac_option.silicon_allowed && issilicon(user))
|
||||
return
|
||||
if (selected_evac_option.needs_syscontrol && !ntn_cont)
|
||||
return
|
||||
var/confirm = alert("Are you sure you want to [selected_evac_option.option_desc]?", name, "No", "Yes")
|
||||
if (confirm == "Yes" && can_still_topic())
|
||||
var/confirm = alert("Are you sure you want to [selected_evac_option.option_desc]?", filedesc, "No", "Yes")
|
||||
if (confirm == "Yes" && !computer.use_check_and_message(usr))
|
||||
evacuation_controller.handle_evac_option(selected_evac_option.option_target, user)
|
||||
if("setstatus")
|
||||
if(is_authenticated(user) && ntn_cont)
|
||||
switch(href_list["target"])
|
||||
if("line1")
|
||||
var/linput = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", msg_line1) as text|null, 40), 40)
|
||||
if(can_still_topic())
|
||||
msg_line1 = linput
|
||||
if("line2")
|
||||
var/linput = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", msg_line2) as text|null, 40), 40)
|
||||
if(can_still_topic())
|
||||
msg_line2 = linput
|
||||
switch(params["target"])
|
||||
if("message")
|
||||
post_display_status("message", msg_line1, msg_line2)
|
||||
post_display_status("message", params["line1"], params["line2"])
|
||||
if("alert")
|
||||
post_display_status("alert", href_list["alert"])
|
||||
post_display_status("alert", params["alert"])
|
||||
else
|
||||
post_display_status(href_list["target"])
|
||||
post_display_status(params["target"])
|
||||
|
||||
if("setalert")
|
||||
if(is_authenticated(user) && (!issilicon(usr) || isAI(usr)) && ntn_cont && ntn_comm)
|
||||
var/current_level = text2num(href_list["target"])
|
||||
var/confirm = alert("Are you sure you want to change alert level to [num2seclevel(current_level)]?", name, "No", "Yes")
|
||||
if(confirm == "Yes" && can_still_topic())
|
||||
var/current_level = text2num(params["target"])
|
||||
var/confirm = alert("Are you sure you want to change alert level to [num2seclevel(current_level)]?", filedesc, "No", "Yes")
|
||||
if(confirm == "Yes" && !computer.use_check_and_message(usr))
|
||||
var/old_level = security_level
|
||||
if(!current_level)
|
||||
current_level = SEC_LEVEL_GREEN
|
||||
@@ -273,38 +210,22 @@
|
||||
feedback_inc("alert_comms_yellow",1)
|
||||
else
|
||||
to_chat(usr, SPAN_WARNING("You press the button, but a red light flashes and nothing happens.")) //This should never happen
|
||||
current_status = STATE_DEFAULT
|
||||
if("viewmessage")
|
||||
if(is_authenticated(user) && ntn_comm)
|
||||
current_viewing_message_id = text2num(href_list["target"])
|
||||
for(var/list/m in l.messages)
|
||||
if(m["id"] == current_viewing_message_id)
|
||||
current_viewing_message = m
|
||||
current_status = STATE_VIEWMESSAGE
|
||||
if("delmessage")
|
||||
if(is_authenticated(user) && ntn_comm && l != global_message_listener)
|
||||
l.Remove(current_viewing_message)
|
||||
current_status = STATE_MESSAGELIST
|
||||
l.Remove(params["messageid"])
|
||||
if("printmessage")
|
||||
if(is_authenticated(user) && ntn_comm)
|
||||
if(program && program.computer && program.computer.nano_printer)
|
||||
if(!program.computer.nano_printer.print_text(current_viewing_message["contents"],current_viewing_message["title"]))
|
||||
if(computer && computer.nano_printer)
|
||||
if(!computer.nano_printer.print_text(params["contents"], params["title"]))
|
||||
to_chat(usr, SPAN_WARNING("Hardware error: Printer was unable to print the file. It may be out of paper."))
|
||||
else
|
||||
program.computer.visible_message(SPAN_NOTICE("\The [program.computer] prints out paper."))
|
||||
computer.visible_message(SPAN_NOTICE("\The [computer] prints out paper."))
|
||||
if("toggleintercept")
|
||||
if(is_authenticated(user) && ntn_comm)
|
||||
if(program?.computer?.nano_printer)
|
||||
var/datum/computer_file/program/comm/P = program
|
||||
P.intercept = !P.intercept
|
||||
if(computer?.nano_printer)
|
||||
intercept = !intercept
|
||||
|
||||
SSnanoui.update_uis(src)
|
||||
|
||||
#undef STATE_DEFAULT
|
||||
#undef STATE_MESSAGELIST
|
||||
#undef STATE_VIEWMESSAGE
|
||||
#undef STATE_STATUSDISPLAY
|
||||
#undef STATE_ALERT_LEVEL
|
||||
return TRUE
|
||||
|
||||
/*
|
||||
General message handling stuff
|
||||
@@ -10,30 +10,11 @@
|
||||
available_on_ntnet = FALSE
|
||||
required_access_run = access_heads
|
||||
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
|
||||
tgui_id = "Teleporter"
|
||||
var/datum/weakref/pad_ref
|
||||
|
||||
/datum/computer_file/program/teleporter/ui_interact(var/mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
if(!ui)
|
||||
ui = new /datum/vueui/modularcomputer(user, src, "mcomputer-command-teleporter", 600, 400, "Teleporter Control System")
|
||||
ui.auto_update_content = TRUE
|
||||
ui.open()
|
||||
|
||||
/datum/computer_file/program/teleporter/vueui_transfer(oldobj)
|
||||
. = FALSE
|
||||
var/uis = SSvueui.transfer_uis(oldobj, src, "mcomputer-command-teleporter", 600, 400, "Teleporter Control System")
|
||||
for(var/tui in uis)
|
||||
var/datum/vueui/ui = tui
|
||||
ui.auto_update_content = TRUE
|
||||
. = TRUE
|
||||
|
||||
/datum/computer_file/program/teleporter/vueui_on_transfer(datum/vueui/ui)
|
||||
. = ..()
|
||||
ui.auto_update_content = FALSE
|
||||
|
||||
/datum/computer_file/program/teleporter/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
|
||||
. = ..()
|
||||
data = . || data || list()
|
||||
/datum/computer_file/program/teleporter/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
// Gather data for computer header
|
||||
var/headerdata = get_header_data(data["_PC"])
|
||||
@@ -50,9 +31,9 @@
|
||||
|
||||
// block of root level data
|
||||
data["has_linked_pad"] = !!linked_pad
|
||||
LAZYINITLIST(data["nearby_pads"])
|
||||
LAZYINITLIST(data["teleport_beacons"])
|
||||
LAZYINITLIST(data["teleport_implants"])
|
||||
data["nearby_pads"] = list()
|
||||
data["teleport_beacons"] = list()
|
||||
data["teleport_implants"] = list()
|
||||
data["calibration"] = 0
|
||||
data["selected_target"] = null
|
||||
data["selected_target_name"] = "None"
|
||||
@@ -61,10 +42,10 @@
|
||||
var/list/near_pads_info = list()
|
||||
for(var/obj/machinery/teleport/pad/S in range(3, T))
|
||||
var/list/pad_info = list(
|
||||
"pad_name" = "[S.name] ([S.x]-[S.y][S.z])",
|
||||
"name" = "[S.name] ([S.x]-[S.y][S.z])",
|
||||
"ref" = "\ref[S]"
|
||||
)
|
||||
near_pads_info[++near_pads_info.len] = pad_info
|
||||
near_pads_info += list(pad_info)
|
||||
data["nearby_pads"] = near_pads_info
|
||||
else
|
||||
var/atom/selected_atom = linked_pad.locked_obj ? linked_pad.locked_obj.resolve() : null
|
||||
@@ -89,10 +70,10 @@
|
||||
else
|
||||
area_index[tmpname] = 1
|
||||
var/list/teleporter_info = list(
|
||||
"beacon_name" = tmpname,
|
||||
"name" = tmpname,
|
||||
"ref" = "\ref[R]"
|
||||
)
|
||||
teleport_beacon_info[++teleport_beacon_info.len] = teleporter_info
|
||||
teleport_beacon_info += list(teleporter_info)
|
||||
data["teleport_beacons"] = teleport_beacon_info
|
||||
|
||||
var/list/teleport_implant_info = list()
|
||||
@@ -117,54 +98,61 @@
|
||||
else
|
||||
area_index[tmpname] = 1
|
||||
var/list/implant_info = list(
|
||||
"implant_name" = tmpname,
|
||||
"name" = tmpname,
|
||||
"ref" = "\ref[I]"
|
||||
)
|
||||
teleport_implant_info[++teleport_implant_info.len] = implant_info
|
||||
teleport_implant_info += list(implant_info)
|
||||
data["teleport_implants"] = teleport_implant_info
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/teleporter/Topic(href, href_list)
|
||||
if(..())
|
||||
return TRUE
|
||||
/datum/computer_file/program/teleporter/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
if(href_list["pad"])
|
||||
var/obj/machinery/teleport/pad/linked_pad = locate(href_list["pad"]) in range(3, get_turf(computer.loc))
|
||||
pad_ref = WEAKREF(linked_pad)
|
||||
else if(href_list["recalibrate"])
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
linked_pad.start_recalibration()
|
||||
else if(href_list["beacon"])
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(href_list["beacon"]) in teleportbeacons
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
if(LO == O)
|
||||
linked_pad.disengage()
|
||||
return
|
||||
linked_pad.locked_obj = WEAKREF(O)
|
||||
linked_pad.locked_obj_name = href_list["name"]
|
||||
if(!linked_pad.engaged)
|
||||
linked_pad.engage()
|
||||
linked_pad.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
else if(href_list["implant"])
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(href_list["implant"]) in implants
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
if(LO == O)
|
||||
linked_pad.disengage()
|
||||
return
|
||||
linked_pad.locked_obj = WEAKREF(O)
|
||||
linked_pad.locked_obj_name = href_list["name"]
|
||||
if(!linked_pad.engaged)
|
||||
linked_pad.engage()
|
||||
linked_pad.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
switch(action)
|
||||
if("pad")
|
||||
var/obj/machinery/teleport/pad/linked_pad = locate(params["pad"]) in range(3, get_turf(computer.loc))
|
||||
pad_ref = WEAKREF(linked_pad)
|
||||
. = TRUE
|
||||
|
||||
SSvueui.check_uis_for_change(src)
|
||||
if("recalibrate")
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
linked_pad.start_recalibration()
|
||||
. = TRUE
|
||||
|
||||
if("beacon")
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(params["beacon"]) in teleportbeacons
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
if(LO == O)
|
||||
linked_pad.disengage()
|
||||
return
|
||||
linked_pad.locked_obj = WEAKREF(O)
|
||||
linked_pad.locked_obj_name = params["name"]
|
||||
if(!linked_pad.engaged)
|
||||
linked_pad.engage()
|
||||
linked_pad.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
. = TRUE
|
||||
|
||||
if("implant")
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(params["implant"]) in implants
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
if(LO == O)
|
||||
linked_pad.disengage()
|
||||
return
|
||||
linked_pad.locked_obj = WEAKREF(O)
|
||||
linked_pad.locked_obj_name = params["name"]
|
||||
if(!linked_pad.engaged)
|
||||
linked_pad.engage()
|
||||
linked_pad.visible_message(SPAN_NOTICE("Locked in."), range = 2)
|
||||
. = TRUE
|
||||
|
||||
/datum/computer_file/program/teleporter/ninja
|
||||
required_access_run = list()
|
||||
requires_ntnet = FALSE
|
||||
requires_access_to_run = FALSE
|
||||
requires_access_to_run = FALSE
|
||||
|
||||
Reference in New Issue
Block a user