Merge remote-tracking branch 'ParadiseSS13/master' into pr/warior4356/14493

This commit is contained in:
AffectedArc07
2020-10-24 09:51:04 +01:00
20 changed files with 1135 additions and 644 deletions
+31 -29
View File
@@ -30,7 +30,7 @@
var/lastused
var/iconrotation = 0 //Used to orient icons and pipes
var/mode = RPD_ATMOS_MODE //Disposals, atmospherics, etc.
var/pipe_category = RPD_ATMOS_PIPING//For nanoUI menus, this is a subtype of pipes e.g. scrubbers pipes, devices
var/pipe_category = RPD_ATMOS_PIPING //For TGUI menus, this is a subtype of pipes e.g. scrubbers pipes, devices
var/whatpipe = PIPE_SIMPLE_STRAIGHT //What kind of atmos pipe is it?
var/whatdpipe = PIPE_DISPOSALS_STRAIGHT //What kind of disposals pipe is it?
var/spawndelay = RPD_COOLDOWN_TIME
@@ -43,8 +43,8 @@
var/list/mainmenu = list(
list("category" = "Atmospherics", "mode" = RPD_ATMOS_MODE, "icon" = "wrench"),
list("category" = "Disposals", "mode" = RPD_DISPOSALS_MODE, "icon" = "recycle"),
list("category" = "Rotate", "mode" = RPD_ROTATE_MODE, "icon" = "rotate-right"),
list("category" = "Flip", "mode" = RPD_FLIP_MODE, "icon" = "exchange"),
list("category" = "Rotate", "mode" = RPD_ROTATE_MODE, "icon" = "sync-alt"),
list("category" = "Flip", "mode" = RPD_FLIP_MODE, "icon" = "arrows-alt-h"),
list("category" = "Recycle", "mode" = RPD_DELETE_MODE, "icon" = "trash"))
var/list/pipemenu = list(
list("category" = "Normal", "pipemode" = RPD_ATMOS_PIPING),
@@ -54,8 +54,8 @@
list("category" = "Heat exchange", "pipemode" = RPD_HEAT_PIPING))
/obj/item/rpd/New()
..()
/obj/item/rpd/Initialize(mapload)
. = ..()
spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(1, 0, src)
spark_system.attach(src)
@@ -165,23 +165,24 @@
QDEL_NULL(P)
activate_rpd()
//NanoUI stuff
// TGUI stuff
/obj/item/rpd/attack_self(mob/user)
ui_interact(user)
tgui_interact(user)
/obj/item/rpd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/item/rpd/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
user.set_machine(src)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "rpd.tmpl", "[name]", 400, 650, state = state)
ui = new(user, src, ui_key, "RPD", name, 450, 650, master_ui, state)
ui.open()
ui.set_auto_update(1)
/obj/item/rpd/AltClick(mob/user)
radial_menu(user)
/obj/item/rpd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state)
var/data[0]
/obj/item/rpd/tgui_data(mob/user)
var/list/data = list()
data["iconrotation"] = iconrotation
data["mainmenu"] = mainmenu
data["mode"] = mode
@@ -192,24 +193,25 @@
data["whatpipe"] = whatpipe
return data
/obj/item/rpd/Topic(href, href_list, nowindow, state)
..()
if(href_list["iconrotation"])
iconrotation = text2num(sanitize(href_list["iconrotation"]))
else if(href_list["whatpipe"])
whatpipe = text2num(sanitize(href_list["whatpipe"]))
else if(href_list["whatdpipe"])
whatdpipe = text2num(sanitize(href_list["whatdpipe"]))
else if(href_list["pipe_category"])
pipe_category = text2num(sanitize(href_list["pipe_category"]))
else if(href_list["mode"])
mode = text2num(sanitize(href_list["mode"]))
else
/obj/item/rpd/tgui_act(action, list/params)
if(..())
return
SSnanoui.update_uis(src)
. = TRUE
switch(action)
if("iconrotation")
iconrotation = text2num(sanitize(params["iconrotation"]))
if("whatpipe")
whatpipe = text2num(sanitize(params["whatpipe"]))
if("whatdpipe")
whatdpipe = text2num(sanitize(params["whatdpipe"]))
if("pipe_category")
pipe_category = text2num(sanitize(params["pipe_category"]))
if("mode")
mode = text2num(sanitize(params["mode"]))
//RPD radial menu
/obj/item/rpd/proc/check_menu(mob/living/user)
if(!istype(user))
return
@@ -233,7 +235,7 @@
if(!check_menu(user))
return
if(selected_mode == "UI")
ui_interact(user)
tgui_interact(user)
else
switch(selected_mode)
if(RPD_MENU_ROTATE)
+1 -1
View File
@@ -236,7 +236,7 @@
/obj/item/clothing/suit/armor/laserproof
name = "Ablative Armor Vest"
desc = "A vest that excels in protecting the wearer against energy projectiles. Projects an energy field arround the user, allowing a chance of energy projectile deflection no matter where on the user it would hit."
desc = "A vest that excels in protecting the wearer against energy projectiles. Projects an energy field around the user, allowing a chance of energy projectile deflection no matter where on the user it would hit."
icon_state = "armor_reflec"
item_state = "armor_reflec"
blood_overlay_type = "armor"
+45 -39
View File
@@ -297,25 +297,27 @@
Deletion.Cut(Deletion.len)
qdel(DL)
/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.not_incapacitated_turf_state)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/datum/personal_crafting/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_not_incapacitated_turf_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "personal_crafting.tmpl", "Crafting Menu", 700, 800, state = state)
ui = new(user, src, ui_key, "PersonalCrafting", "Crafting Menu", 700, 800, master_ui, state)
ui.open()
/datum/personal_crafting/proc/close(mob/user)
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/datum/nanoui/ui = SStgui.get_open_ui(user, src, "main")
if(ui)
ui.close()
/datum/personal_crafting/ui_data(mob/user)
/datum/personal_crafting/tgui_data(mob/user)
var/list/data = list()
var/list/subs = list()
var/cur_subcategory = CAT_NONE
var/cur_category = categories[viewing_category]
if(islist(subcategories[viewing_category]))
subs = subcategories[viewing_category]
cur_subcategory = subs[viewing_subcategory]
data["busy"] = busy
data["prev_cat"] = categories[prev_cat()]
data["prev_subcat"] = subs[prev_subcat()]
@@ -329,6 +331,7 @@
var/list/surroundings = get_surroundings(user)
var/list/can_craft = list()
var/list/cant_craft = list()
for(var/rec in GLOB.crafting_recipes)
var/datum/crafting_recipe/R = rec
@@ -341,49 +344,52 @@
can_craft += list(build_recipe_data(R))
else
cant_craft += list(build_recipe_data(R))
data["can_craft"] = can_craft
data["cant_craft"] = cant_craft
return data
/datum/personal_crafting/Topic(href, href_list)
/datum/personal_crafting/tgui_act(action, list/params)
if(..())
return
if(href_list["make"])
var/datum/crafting_recipe/TR = locate(href_list["make"]) in GLOB.crafting_recipes
busy = TRUE
SSnanoui.update_uis(src)
var/fail_msg = construct_item(usr, TR)
if(!fail_msg)
to_chat(usr, "<span class='notice'>[TR.name] constructed.</span>")
if(TR.alert_admins_on_craft)
message_admins("[key_name_admin(usr)] has created a [TR.name] at [ADMIN_COORDJMP(usr)]")
else
to_chat(usr, "<span class ='warning'>Construction failed[fail_msg]</span>")
busy = FALSE
SSnanoui.update_uis(src)
if(href_list["forwardCat"])
viewing_category = next_cat(FALSE)
. = TRUE
if(href_list["backwardCat"])
viewing_category = prev_cat(FALSE)
. = TRUE
if(href_list["forwardSubCat"])
viewing_subcategory = next_subcat()
. = TRUE
if(href_list["backwardSubCat"])
viewing_subcategory = prev_subcat()
. = TRUE
if(href_list["toggle_recipes"])
display_craftable_only = !display_craftable_only
. = TRUE
if(href_list["toggle_compact"])
display_compact = !display_compact
. = TRUE
. = TRUE
SSnanoui.update_uis(src)
switch(action)
if("make")
var/datum/crafting_recipe/TR = locate(params["make"]) in GLOB.crafting_recipes
if(!istype(TR))
return
busy = TRUE
SStgui.update_uis(src)
var/fail_msg = construct_item(usr, TR)
if(!fail_msg)
to_chat(usr, "<span class='notice'>[TR.name] constructed.</span>")
if(TR.alert_admins_on_craft)
message_admins("[key_name_admin(usr)] has created a [TR.name] at [ADMIN_COORDJMP(usr)]")
else
to_chat(usr, "<span class='warning'>Construction failed[fail_msg]</span>")
busy = FALSE
SStgui.update_uis(src)
if("forwardCat")
viewing_category = next_cat(FALSE)
if("backwardCat")
viewing_category = prev_cat(FALSE)
if("forwardSubCat")
viewing_subcategory = next_subcat()
if("backwardSubCat")
viewing_subcategory = prev_subcat()
if("toggle_recipes")
display_craftable_only = !display_craftable_only
if("toggle_compact")
display_compact = !display_compact
//Next works nicely with modular arithmetic
//Next works nicely with modular arithmetic
/datum/personal_crafting/proc/next_cat(readonly = TRUE)
if (!readonly)
+3 -2
View File
@@ -87,8 +87,9 @@ GLOBAL_LIST_EMPTY(all_money_accounts)
R.name = "Account information: [M.owner_name]"
var/overseer = "Unknown"
if(source_db.held_card)
overseer = source_db.held_card.registered_name
var/datum/tgui_login/L = source_db.tgui_login_get()
if(L.id)
overseer = L.id.registered_name
R.info = {"<b>Account details (confidential)</b><br><hr><br>
<i>Account holder:</i> [M.owner_name]<br>
<i>Account number:</i> [M.account_number]<br>
+175 -190
View File
@@ -1,22 +1,30 @@
GLOBAL_VAR(current_date_string)
#define AUT_ACCLST 1
#define AUT_ACCINF 2
#define AUT_ACCNEW 3
/obj/machinery/computer/account_database
name = "Accounts Uplink Terminal"
desc = "Access transaction logs, account data and all kinds of other financial records."
icon_screen = "accounts"
density = 1
req_one_access = list(ACCESS_HOP, ACCESS_CAPTAIN, ACCESS_CENT_COMMANDER)
light_color = LIGHT_COLOR_GREEN
var/receipt_num
var/machine_id = ""
var/obj/item/card/id/held_card
var/datum/money_account/detailed_account_view
var/creating_new_account = 0
var/activated = 1
var/activated = TRUE
var/const/fund_cap = 1000000
light_color = LIGHT_COLOR_GREEN
/// Current UI page
var/current_page = AUT_ACCLST
/// Next time a print can be made
var/next_print = 0
/obj/machinery/computer/account_database/New()
// Why the fuck are these not in a subsystem? They are global variables for fucks sake
// If someone ever makes a map without one of these consoles, the entire eco AND date system breaks
// This upsets me a lot
// AA Todo: SSeconomy
if(!GLOB.station_account)
create_station_account()
@@ -33,230 +41,207 @@ GLOBAL_VAR(current_date_string)
machine_id = "[station_name()] Acc. DB #[GLOB.num_financial_terminals++]"
..()
/obj/machinery/computer/account_database/proc/get_access_level(var/mob/user)
if(user.can_admin_interact())
return 2
if(!held_card)
return 0
if(ACCESS_CENT_COMMANDER in held_card.access)
return 2
else if((ACCESS_HOP in held_card.access) || (ACCESS_CAPTAIN in held_card.access))
return 1
/obj/machinery/computer/account_database/proc/accounting_letterhead(report_name)
var/datum/tgui_login/L = tgui_login_get()
return {"
<center><h1><b>[report_name]</b></h1></center>
<center><small><i>[station_name()] Accounting Report</i></small></center>
<u>Generated By:</u> [L?.id?.registered_name ? L.id.registered_name : "Unknown"], [L?.id?.assignment ? L.id.assignment : "Unknown"]<br>
<hr>
<u>Generated By:</u> [held_card.registered_name], [held_card.assignment]<br>
"}
/obj/machinery/computer/account_database/attackby(obj/O, mob/user, params)
if(!istype(O, /obj/item/card/id))
return ..()
if(tgui_login_attackby(O, user))
return
return ..()
if(!held_card)
user.drop_item()
O.loc = src
held_card = O
/obj/machinery/computer/account_database/attack_hand(mob/user)
tgui_interact(user)
SSnanoui.update_uis(src)
attack_hand(user)
/obj/machinery/computer/account_database/attack_hand(mob/user as mob)
ui_interact(user)
/obj/machinery/computer/account_database/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
/obj/machinery/computer/account_database/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640)
ui = new(user, src, ui_key, "AccountsUplinkTerminal", name, 800, 600, master_ui, state)
ui.open()
/obj/machinery/computer/account_database/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
/obj/machinery/computer/account_database/tgui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/list/data = list()
data["currentPage"] = current_page
data["is_printing"] = (next_print > world.time)
tgui_login_data(data, user)
if(data["loginState"]["logged_in"])
switch(current_page)
if(AUT_ACCLST)
var/list/accounts = list()
for(var/i in 1 to length(GLOB.all_money_accounts))
var/datum/money_account/D = GLOB.all_money_accounts[i]
accounts.Add(list(list(
"account_number" = D.account_number,
"owner_name" = D.owner_name,
"suspended" = D.suspended ? "SUSPENDED" : "Active",
"account_index" = i)))
data["src"] = UID()
data["id_inserted"] = !!held_card
data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : "-----"
data["access_level"] = get_access_level(user)
data["machine_id"] = machine_id
data["creating_new_account"] = creating_new_account
data["detailed_account_view"] = !!detailed_account_view
data["station_account_number"] = GLOB.station_account.account_number
data["transactions"] = null
data["accounts"] = null
data["accounts"] = accounts
if(detailed_account_view)
data["account_number"] = detailed_account_view.account_number
data["owner_name"] = detailed_account_view.owner_name
data["money"] = detailed_account_view.money
data["suspended"] = detailed_account_view.suspended
if(AUT_ACCINF)
data["account_number"] = detailed_account_view.account_number
data["owner_name"] = detailed_account_view.owner_name
data["money"] = detailed_account_view.money
data["suspended"] = detailed_account_view.suspended
var/list/trx[0]
for(var/datum/transaction/T in detailed_account_view.transaction_log)
trx.Add(list(list(\
"date" = T.date, \
"time" = T.time, \
"target_name" = T.target_name, \
"purpose" = T.purpose, \
"amount" = T.amount, \
"source_terminal" = T.source_terminal)))
if(trx.len > 0)
data["transactions"] = trx
var/list/accounts[0]
for(var/i=1, i<=GLOB.all_money_accounts.len, i++)
var/datum/money_account/D = GLOB.all_money_accounts[i]
accounts.Add(list(list(\
"account_number"=D.account_number,\
"owner_name"=D.owner_name,\
"suspended"=D.suspended ? "SUSPENDED" : "",\
"account_index"=i)))
if(accounts.len > 0)
data["accounts"] = accounts
var/list/transactions = list()
for(var/datum/transaction/T in detailed_account_view.transaction_log)
transactions.Add(list(list(
"date" = T.date,
"time" = T.time,
"target_name" = T.target_name,
"purpose" = T.purpose,
"amount" = T.amount,
"source_terminal" = T.source_terminal)))
data["transactions"] = transactions
return data
/obj/machinery/computer/account_database/Topic(href, href_list)
/obj/machinery/computer/account_database/tgui_act(action, list/params)
if(..())
return 1
return
if(href_list["insert_card"])
if(held_card)
held_card.forceMove(loc)
. = TRUE
if(ishuman(usr) && !usr.get_active_hand())
usr.put_in_hands(held_card)
held_card = null
if(tgui_login_act(action, params))
return
else
var/obj/item/I = usr.get_active_hand()
if(istype(I, /obj/item/card/id))
var/obj/item/card/id/C = I
usr.drop_item()
C.forceMove(src)
held_card = C
if(!tgui_login_get().logged_in)
return
if(!get_access_level(usr))
return 1
switch(action)
if("view_account_detail")
var/index = text2num(params["index"])
if(index && index > 0 && index <= length(GLOB.all_money_accounts))
detailed_account_view = GLOB.all_money_accounts[index]
current_page = AUT_ACCINF
var/datum/nanoui/ui = SSnanoui.get_open_ui(usr, src, "main")
if("back")
detailed_account_view = null
current_page = AUT_ACCLST
if(href_list["choice"])
switch(href_list["choice"])
if("create_account")
creating_new_account = 1
if("toggle_suspension")
if(detailed_account_view)
detailed_account_view.suspended = !detailed_account_view.suspended
if("toggle_suspension")
if(detailed_account_view)
detailed_account_view.suspended = !detailed_account_view.suspended
if("create_new_account")
current_page = AUT_ACCNEW
if("finalise_create_account")
var/account_name = href_list["holder_name"]
var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
if("finalise_create_account")
var/account_name = params["holder_name"]
var/starting_funds = max(text2num(params["starting_funds"]), 0)
if(!account_name || !starting_funds)
return
starting_funds = clamp(starting_funds, 0, GLOB.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, GLOB.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.
var/datum/money_account/M = create_account(account_name, starting_funds, src)
if(starting_funds > 0)
GLOB.station_account.charge(starting_funds, null, "New account activation",
"", "New account activation", M.owner_name)
var/datum/money_account/M = create_account(account_name, starting_funds, src)
if(starting_funds > 0)
GLOB.station_account.charge(starting_funds, null, "New account activation", "", "New account activation", M.owner_name)
creating_new_account = 0
ui.close()
current_page = AUT_ACCLST
creating_new_account = 0
if("view_account_detail")
var/index = text2num(href_list["account_index"])
if(index && index <= GLOB.all_money_accounts.len)
detailed_account_view = GLOB.all_money_accounts[index]
if("print_records")
// Anti spam measures
if(next_print > world.time)
to_chat(usr, "<span class='warning'>The printer is busy spooling. It will be ready in [(next_print - world.time) / 10] seconds.")
return
var/text
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
var/obj/item/paper/P = new(loc)
P.name = "financial account list"
text = {"
[accounting_letterhead("Financial Account List")]
if("view_accounts_list")
detailed_account_view = null
creating_new_account = 0
<table>
<thead>
<tr>
<td>Account Number</td>
<td>Holder</td>
<td>Balance</td>
<td>Status</td>
</tr>
</thead>
<tbody>
"}
if("print")
var/text
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
var/obj/item/paper/P = new(loc)
if(detailed_account_view)
P.name = "account #[detailed_account_view.account_number] details"
var/title = "Account #[detailed_account_view.account_number] Details"
text = {"
[accounting_letterhead(title)]
<u>Holder:</u> [detailed_account_view.owner_name]<br>
<u>Balance:</u> $[detailed_account_view.money]<br>
<u>Status:</u> [detailed_account_view.suspended ? "Suspended" : "Active"]<br>
<u>Transactions:</u> ([detailed_account_view.transaction_log.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/i in 1 to length(GLOB.all_money_accounts))
var/datum/money_account/D = GLOB.all_money_accounts[i]
text += {"
<tr>
<td>#[D.account_number]</td>
<td>[D.owner_name]</td>
<td>$[D.money]</td>
<td>[D.suspended ? "Suspended" : "Active"]</td>
</tr>
"}
for(var/datum/transaction/T in detailed_account_view.transaction_log)
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>
"}
text += {"
</tbody>
</table>
"}
P.info = text
visible_message("<span class='notice'>[src] prints out a report.</span>")
next_print = world.time + 30 SECONDS
else
P.name = "financial account list"
text = {"
[accounting_letterhead("Financial Account List")]
if("print_account_details")
// Anti spam measures
if(next_print > world.time)
to_chat(usr, "<span class='warning'>The printer is busy spooling. It will be ready in [(next_print - world.time) / 10] seconds.")
return
var/text
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
var/obj/item/paper/P = new(loc)
P.name = "account #[detailed_account_view.account_number] details"
var/title = "Account #[detailed_account_view.account_number] Details"
text = {"
[accounting_letterhead(title)]
<u>Holder:</u> [detailed_account_view.owner_name]<br>
<u>Balance:</u> $[detailed_account_view.money]<br>
<u>Status:</u> [detailed_account_view.suspended ? "Suspended" : "Active"]<br>
<u>Transactions:</u> ([detailed_account_view.transaction_log.len])<br>
<table>
<thead>
<tr>
<td>Timestamp</td>
<td>Target</td>
<td>Reason</td>
<td>Value</td>
<td>Terminal</td>
</tr>
</thead>
<tbody>
"}
<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 detailed_account_view.transaction_log)
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>
"}
for(var/i=1, i<=GLOB.all_money_accounts.len, i++)
var/datum/money_account/D = GLOB.all_money_accounts[i]
text += {"
<tr>
<td>#[D.account_number]</td>
<td>[D.owner_name]</td>
<td>$[D.money]</td>
<td>[D.suspended ? "Suspended" : "Active"]</td>
</tr>
"}
text += {"
</tbody>
</table>
"}
text += {"
</tbody>
</table>
"}
P.info = text
visible_message("<span class='notice'>[src] prints out a report.</span>")
next_print = world.time + 30 SECONDS
P.info = text
visible_message("<span class='notice'>[src] prints out a report.</span>")
return 1
#undef AUT_ACCLST
#undef AUT_ACCINF
#undef AUT_ACCNEW
@@ -41,7 +41,7 @@
GLOB.human_list += src
/mob/living/carbon/human/OpenCraftingMenu()
handcrafting.ui_interact(src)
handcrafting.tgui_interact(src)
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...
@@ -146,7 +146,7 @@
result_amount = 5
mix_message = "The mixture curdles up."
/datum/chemical_reaction/cheese/on_reaction(datum/reagents/holder)
/datum/chemical_reaction/fake_cheese/on_reaction(datum/reagents/holder)
var/turf/T = get_turf(holder.my_atom)
T.visible_message("<span class='notice'>A faint cheese-ish smell drifts through the air...</span>")
+3
View File
@@ -130,6 +130,9 @@ GLOBAL_LIST(tgui_logins)
state.name = state.id.registered_name
state.rank = state.id.assignment
state.access = state.id.access
else
to_chat(usr, "<span class='warning'>Access Denied</span>")
return
else if(login_type == LOGIN_TYPE_AI && isAI(usr))
state.name = usr.name
state.rank = "AI"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

-146
View File
@@ -1,146 +0,0 @@
<div class="item">
<div class="itemLabelNarrow">
<b>Machine</b>:
</div>
<div class="itemContent">
<span class="average">{{:data.machine_id}}</span>
</div>
</div>
<div class="item">
<div class="itemLabelNarrow">
<b>ID</b>:
</div>
<div class="itemContent">
{{:helper.link(data.id_card, 'eject', {'insert_card' : 1}, null, data.id_inserted ? 'fixedLeftWidest' : 'fixedLeft')}}
</div>
</div>
{{if data.access_level > 0}}
<div class='item'>
<h2>Menu</h2>
</div>
{{:helper.link('Home', 'home', {'choice' : 'view_accounts_list'}, !data.creating_new_account && !data.detailed_account_view ? 'disabled' : null, 'fixedLeft')}}
{{:helper.link('New Account', 'gear', {'choice' : 'create_account'}, data.creating_new_account ? 'disabled' : null, 'fixedLeft')}}
{{:helper.link('Print', 'print', {'choice' : 'print'}, data.creating_new_account ? 'disabled' : null, 'fixedLeft')}}
{{if data.creating_new_account}}
<div class='item'>
<h2>Create Account</h2>
</div>
<form name='create_account' action='?src={{:data.src}}' method='get'>
<input type='hidden' name='src' value='{{:data.src}}'>
<input type='hidden' name='choice' value='finalise_create_account'>
<div class='item'>
<div class='itemLabel'>
<b>Account Holder</b>:
</div>
<div class='itemContent'>
<input type='text' id='holder_name' name='holder_name'>
</div>
</div>
<div class='item'>
<div class='itemLabel'>
<b>Initial Deposit</b>:
</div>
<div class='itemContent'>
<input type='text' id='starting_funds' name='starting_funds'>
</div>
</div>
<div class='item'>
<input type='submit' value='Create'>
</div>
</form>
{{else data.detailed_account_view}}
<div class='item'>
<h2>Account Details</h2>
</div>
<div class='item'>
<div class="itemLabel">
<span class='average'><b>Account Number</b>:</span>
</div>
<div class="itemContent">
#{{:data.account_number}}
</div>
</div>
<div class='item'>
<div class="itemLabel">
<span class='average'><b>Holder</b>:</span>
</div>
<div class="itemContent">
{{:data.owner_name}}
</div>
</div>
<div class='item'>
<div class="itemLabel">
<span class='average'><b>Balance</b>:</span>
</div>
<div class="itemContent">
${{:helper.formatNumber(data.money)}}
</div>
</div>
<div class='item'>
<div class="itemLabel">
<span class='average'><b>Status</b>:</span>
</div>
<div class="itemContent">
<span class='{{:data.suspended ? "bad" : "good"}}'>
{{:data.suspended ? "Suspended" : "Active"}}
</span>
</div>
</div>
<div class='item'>
{{:helper.link(data.suspended ? "Unsuspend" : "Suspend", 'gear', {'choice' : 'toggle_suspension'})}}
</div>
<div class="statusDisplay" style="overflow: auto;">
{{if data.transactions}}
<table style='width: 100%'>
<thead>
<tr>
<th><b>Timestamp</b></th>
<th><b>Target</b></th>
<th><b>Reason</b></th>
<th><b>Value</b></th>
<th><b>Terminal</b></th>
</th>
</thead>
<tbody>
{{for data.transactions}}
<tr>
<td>{{:value.date}} {{:value.time}}</td>
<td>{{:value.target_name}}</td>
<td>{{:value.purpose}}</td>
<td>{{:value.amount}}</td>
<td>{{:value.source_terminal}}</td>
</tr>
{{/for}}
</tbody>
</table>
{{else}}
<span class='exclamation-triangle'>This account has no financial transactions on record for today.</span>
{{/if}}
</div>
{{else}}
<div class='item'>
<h2>Nanotrasen Accounts</h2>
</div>
{{if data.accounts}}
<table style="width: 100%">
{{for data.accounts}}
<tr class='{{:value.suspended ? "bad" : ""}}'>
<td><b>{{:helper.link('#' + value.account_number, '', {'choice' : 'view_account_detail', 'account_index' : value.account_index})}}</b></td>
<td>{{:value.owner_name}}</td>
<td>{{:value.suspended}}</td>
</tr>
{{/for}}
</table>
{{else}}
<span class='exclamation-triangle'>There are no accounts available.</span>
{{/if}}
{{/if}}
{{/if}}
-116
View File
@@ -1,116 +0,0 @@
<script>
{{var tooltiptext = function(req_text, catalyst_text, tool_text) { var text = ""; if(req_text){text += "REQUIREMENTS: " + req_text + " ";} if(catalyst_text){text += "CATALYSTS: " + catalyst_text + " ";} if(tool_text){text += "TOOLS: " + tool_text;}return text;};}}
</script>
<div class='display'>
<header><h3>{{:data.category}}{{if data.subcategory}} : {{:data.subcategory}}{{/if}}</h3></header>
<article>
<div class='item'>
{{:helper.link(data.prev_cat, 'arrow-left', {'backwardCat': 1})}}
{{:helper.link(data.next_cat, 'arrow-right', {'forwardCat': 1})}}
{{if data.display_craftable_only}}
{{:helper.link('Showing Craftable Recipes', 'lock', {'toggle_recipes': 1})}}
{{else}}
{{:helper.link('Showing All Recipes', 'unlock', {'toggle_recipes': 1})}}
{{/if}}
{{:helper.link('Compact', data.display_compact ? 'check-square-o' : 'square-o', {'toggle_compact': 1})}}
</div>
{{if data.subcategory}}
<div class='item'>
{{:helper.link(data.prev_subcat, 'arrow-left', {'backwardSubCat': 1})}}
{{:helper.link(data.next_subcat, 'arrow-right', {'forwardSubCat': 1})}}
</div>
{{/if}}
{{if data.display_compact}}
<div class='display'>
<article>
<table style='width: 50%;'>
{{for data.can_craft}}
<tr>
<td><div class='itemLabelWidest'>{{:value.name}}:</div></td>
<td><div class='floatLeft tooltipRight' data-tooltip='{{:tooltiptext(value.req_text, value.catalyst_text, value.tool_text)}}'>
{{:helper.link('Craft', 'gears', {'make': value.ref})}}
</div></td>
</tr>
{{/for}}
{{if !data.display_craftable_only}}
{{for data.cant_craft}}
<tr>
<td><div class='itemLabelWidest'>{{:value.name}}:</div></td>
<td><div class='floatLeft tooltipRight' data-tooltip='{{:tooltiptext(value.req_text, value.catalyst_text, value.tool_text)}}'>
{{:helper.link('Craft', 'gears', {'make': value.ref}, 'disabled')}}
</div></td>
</tr>
{{/for}}
{{/if}}
</table>
</article>
</div>
{{else}}
{{for data.can_craft}}
<div class='display'>
<header><h3>{{:value.name}}</h3></header>
<article>
{{if value.req_text}}
<div class='item'>
<div class='itemLabel'>Requirements:</div>
<div class='itemContent'>{{:value.req_text}}</div>
</div>
{{/if}}
{{if value.catalyst_text}}
<div class='item'>
<div class='itemLabel'>Catalysts:</div>
<div class='itemContent'>{{:value.catalyst_text}}</div>
</div>
{{/if}}
{{if value.tool_text}}
<div class='item'>
<div class='itemLabel'>Tools:</div>
<div class='itemContent'>{{:value.tool_text}}</div>
</div>
{{/if}}
<div class='item'>
{{:helper.link('Craft', 'gears', {'make': value.ref})}}
</div>
</article>
</div>
{{/for}}
{{if !data.display_craftable_only}}
{{for data.cant_craft}}
<div class="display">
<header><h3>{{:value.name}}</h3></header>
<article>
{{if value.req_text}}
<div class='item'>
<div class='itemLabel'>Requirements:</div>
<div class='itemContent'>{{:value.req_text}}</div>
</div>
{{/if}}
{{if value.catalyst_text}}
<div class='item'>
<div class='itemLabel'>Catalysts:</div>
<div class='itemContent'>{{:value.catalyst_text}}</div>
</div>
{{/if}}
{{if value.tool_text}}
<div class='item'>
<div class='itemLabel'>Tools:</div>
<div class='itemContent'>{{:value.tool_text}}</div>
</div>
{{/if}}
</article>
</div>
{{/for}}
{{/if}}
{{/if}}
</article>
</div>
{{if data.busy}}
<div class="mask">
<div class="maskContent">
<h1>Crafting...</h1>
</div>
</div>
{{/if}}
-115
View File
@@ -1,115 +0,0 @@
<!--
Used In File(s): /code/game/objects/items/weapons/rpd.dm
-->
<h3>Mode:</h3> <!-- We loop through the mode list and display all entries -->
<div class = "item">
{{for data.mainmenu}} <!--We loop through the pipe menu list (normal, scrubbers, etc.) and display all entries-->
{{:helper.link(value.category, value.icon, {mode: value.mode}, data.mode == value.mode ? "linkOn" : null)}}
{{/for}}
</div>
{{if data.mode == 1}}
<h3>Pipe type:</strong></h3>
<div>
{{for data.pipemenu}} <!--We loop through the pipe menu (normal, scrubbers, etc.) and display all entries-->
{{:helper.link(value.category, null, {pipe_category: value.pipemode}, data.pipe_category == value.pipemode ? "linkOn" : null)}}
{{/for}}
</div>
<h4>Available pipes:</h4>
<div style = "float:left;margin-right:30pt;">
{{for data.pipelist}} <!--Display all pipes that match the selected menu-->
{{if value.pipe_type == 1 && value.pipe_category == data.pipe_category}}
<div class = "item">{{:helper.link(value.pipe_name, "arrow-right", {whatpipe: value.pipe_id}, data.whatpipe == value.pipe_id ? "linkOn" : null)}}</div>
{{/if}}
{{/for}}
</div>
{{for data.pipelist}} <!-- For the selected pipe, we want to show a preview to allow the user to select a rotation-->
{{if value.pipe_type != 1 || value.pipe_id != data.whatpipe || value.orientations == 1}} <!--Skip all this icon nonsense if the pipe is: not an atmos pipe; not the pipe we selected; or pipe has one orientation-->
{{continue;}}
{{/if}}
<div style = "float:left;">
<div style = "margin-bottom:30pt;">
{{:helper.link("Orient automatically", null, {iconrotation: 0}, data.iconrotation == 0 ? "linkOn" : null)}}
</div>
{{if value.bendy}} <!--If the pipe is bendy-->
<div>
{{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-northeast.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-southeast.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-southwest.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-northwest.png">
</div>
{{else}}
<div>
{{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-north.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-east.png">
</div>
{{if value.orientations == 4}}
<div>
{{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-south.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-west.png">
</div>
{{/if}}
{{/if}}
</div>
{{/for}}
{{else data.mode == 2}}
<h4>Available pipes:</h4>
<div style = "float:left;margin-right:30pt;">
{{for data.pipelist}}
{{if value.pipe_type == 2}}
<div class = "item">{{:helper.link(value.pipe_name, "arrow-right", {whatdpipe: value.pipe_id}, data.whatdpipe == value.pipe_id ? "linkOn" : null)}}</div>
{{/if}}
{{/for}}
</div>
{{for data.pipelist}}
{{if value.pipe_type != 2 || value.pipe_id != data.whatdpipe || value.orientations == 1}} <!--Skip all this icon nonsense if the pipe is: not a disposals pipe; not the pipe we selected; or pipe has one orientation-->
{{continue;}}
{{/if}}
<div style = "float:left;">
<div style = "margin-bottom:30pt;">
{{:helper.link("Orient automatically", null, {iconrotation: 0}, data.iconrotation == 0 ? "linkOn" : null)}}
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-north.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-east.png">
</div>
{{if value.orientations == 4}}
<div>
{{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-south.png">
</div>
<div>
{{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}}
<img src = "{{:value.pipe_icon}}-west.png">
</div>
{{/if}}
</div>
{{/for}}
{{else data.mode == 3}}
<h3>Device ready to rotate loose pipes...</h3>
{{else data.mode == 4}}
<h3>Device ready to flip loose pipes...</h3>
{{else data.mode == 5}}
<h3>Device ready to eat loose pipes...</h3>
{{/if}}
@@ -0,0 +1,288 @@
import { createSearch, decodeHtmlEntities } from 'common/string';
import { Fragment } from 'inferno';
import { useBackend, useLocalState } from "../backend";
import { Box, Button, Flex, Icon, Input, LabeledList, NumberInput, Section, Table, Tabs } from '../components';
import { FlexItem } from '../components/Flex';
import { Window } from "../layouts";
import { ComplexModal, modalOpen } from './common/ComplexModal';
import { LoginInfo } from './common/LoginInfo';
import { LoginScreen } from './common/LoginScreen';
import { TemporaryNotice } from './common/TemporaryNotice';
export const AccountsUplinkTerminal = (properties, context) => {
const { act, data } = useBackend(context);
const {
loginState,
currentPage,
} = data;
let body;
if (!loginState.logged_in) {
return (
<Window resizable>
<Window.Content>
<LoginScreen />
</Window.Content>
</Window>
);
} else {
if (currentPage === 1) {
body = <AccountsRecordList />;
} else if (currentPage === 2) {
body = <DetailedAccountInfo />;
} else if (currentPage === 3) {
body = <CreateAccount />;
}
}
return (
<Window resizable>
<Window.Content scrollable>
<LoginInfo />
{body}
</Window.Content>
</Window>
);
};
const AccountsRecordList = (properties, context) => {
const { act, data } = useBackend(context);
const {
accounts,
} = data;
const [searchText, setSearchText] = useLocalState(context, "searchText", "");
const [sortId, _setSortId] = useLocalState(context, "sortId", "owner_name");
const [sortOrder, _setSortOrder] = useLocalState(context, "sortOrder", true);
return (
<Flex direction="column" height="100%">
<AccountsActions />
<Flex.Item flexGrow="1" mt="0.5rem">
<Section height="100%">
<Table className="AccountsUplinkTerminal__list">
<Table.Row bold>
<SortButton id="owner_name">Account Holder</SortButton>
<SortButton id="account_number">Account Number</SortButton>
<SortButton id="suspended">Account Status</SortButton>
</Table.Row>
{accounts
.filter(createSearch(searchText, account => {
return account.owner_name + "|"
+ account.account_number + "|"
+ account.suspended;
}))
.sort((a, b) => {
const i = sortOrder ? 1 : -1;
return a[sortId].localeCompare(b[sortId]) * i;
})
.map(account => (
<Table.Row
key={account.id}
onClick={
() => act('view_account_detail', { index: account.account_index })
}>
<Table.Cell><Icon name="user" /> {account.owner_name}</Table.Cell>
<Table.Cell>#{account.account_number}</Table.Cell>
<Table.Cell>{account.suspended}</Table.Cell>
</Table.Row>
))}
</Table>
</Section>
</Flex.Item>
</Flex>
);
};
const SortButton = (properties, context) => {
const [sortId, setSortId] = useLocalState(context, "sortId", "name");
const [sortOrder, setSortOrder] = useLocalState(context, "sortOrder", true);
const {
id,
children,
} = properties;
return (
<Table.Cell>
<Button
color={sortId !== id && "transparent"}
width="100%"
onClick={() => {
if (sortId === id) {
setSortOrder(!sortOrder);
} else {
setSortId(id);
setSortOrder(true);
}
}}>
{children}
{sortId === id && (
<Icon
name={sortOrder ? "sort-up" : "sort-down"}
ml="0.25rem;"
/>
)}
</Button>
</Table.Cell>
);
};
const AccountsActions = (properties, context) => {
const { act, data } = useBackend(context);
const {
is_printing,
} = data;
const [searchText, setSearchText] = useLocalState(context, "searchText", "");
return (
<Flex>
<FlexItem>
<Button
content="New Account"
icon="plus"
onClick={() => act('create_new_account')}
/>
<Button
icon="print"
content="Print Account List"
disabled={is_printing}
ml="0.25rem"
onClick={() => act('print_records')}
/>
</FlexItem>
<FlexItem grow="1" ml="0.5rem">
<Input
placeholder="Search by account holder, number, status"
width="100%"
onInput={(e, value) => setSearchText(value)}
/>
</FlexItem>
</Flex>
);
};
const DetailedAccountInfo = (properties, context) => {
const { act, data } = useBackend(context);
const {
is_printing,
account_number,
owner_name,
money,
suspended,
transactions,
} = data;
return (
<Fragment>
<Section title={"#" + account_number + " / " + owner_name} mt={1} buttons={
<Fragment>
<Button
icon="print"
content="Print Account Details"
disabled={is_printing}
onClick={
() => act('print_account_details')
} />
<Button
icon="arrow-left"
content="Back"
onClick={
() => act('back')
} />
</Fragment>
}>
<LabeledList>
<LabeledList.Item label="Account Number">
#{account_number}
</LabeledList.Item>
<LabeledList.Item label="Account Holder">
{owner_name}
</LabeledList.Item>
<LabeledList.Item label="Account Balnce">
{money}
</LabeledList.Item>
<LabeledList.Item label="Account Status" color={suspended ? "red" : "green"}>
{suspended ? "Suspended" : "Active"}
<Button
ml={1}
content={suspended ? "Unsuspend" : "Suspend"}
icon={suspended ? "unlock" : "lock"}
onClick={
() => act('toggle_suspension')
}
/>
</LabeledList.Item>
</LabeledList>
</Section>
<Section title="Transactions">
<Table>
<Table.Row header>
<Table.Cell>
Timestamp
</Table.Cell>
<Table.Cell>
Target
</Table.Cell>
<Table.Cell>
Reason
</Table.Cell>
<Table.Cell>
Value
</Table.Cell>
<Table.Cell>
Terminal
</Table.Cell>
</Table.Row>
{transactions.map(t => (
<Table.Row key={t}>
<Table.Cell>
{t.date} {t.time}
</Table.Cell>
<Table.Cell>
{t.target_name}
</Table.Cell>
<Table.Cell>
{t.purpose}
</Table.Cell>
<Table.Cell>
{t.amount}
</Table.Cell>
<Table.Cell>
{t.source_terminal}
</Table.Cell>
</Table.Row>
))}
</Table>
</Section>
</Fragment>
);
};
const CreateAccount = (properties, context) => {
const { act, data } = useBackend(context);
const [accName, setAccName] = useLocalState(context, 'accName', '');
const [accDeposit, setAccDeposit] = useLocalState(context, 'accDeposit', '');
return (
<Section title="Create Account" buttons={
<Button
icon="arrow-left"
content="Back"
onClick={
() => act('back')
} />
}>
<LabeledList>
<LabeledList.Item label="Account Holder">
<Input placeholder="Name Here" onChange={(e, value) => setAccName(value)} />
</LabeledList.Item>
<LabeledList.Item label="Initial Deposit">
<Input placeholder="0" onChange={(e, value) => setAccDeposit(value)} />
</LabeledList.Item>
</LabeledList>
<Button
mt={1}
fluid
content="Create Account"
onClick={
() => act('finalise_create_account', { holder_name: accName, starting_funds: accDeposit })
}
/>
</Section>
);
};
@@ -0,0 +1,201 @@
import { Fragment } from "inferno";
import { useBackend } from "../backend";
import { Button, LabeledList, Box, Section, Dimmer, Icon } from "../components";
import { Window } from "../layouts";
export const PersonalCrafting = (props, context) => {
const { act, data } = useBackend(context);
const {
busy,
category,
display_craftable_only,
display_compact,
prev_cat,
next_cat,
subcategory,
prev_subcat,
next_subcat,
} = data;
return (
<Window>
<Window.Content scrollable>
{!!busy && (
<Dimmer fontSize="32px">
<Icon name="cog" spin={1} />
{' Crafting...'}
</Dimmer>
)}
<Section title={category} buttons={
<Fragment>
<Button
content="Show Craftable Only"
icon={display_craftable_only ? "check-square-o" : "square-o"}
selected={display_craftable_only}
onClick={
() => act('toggle_recipes')
} />
<Button
content="Compact Mode"
icon={display_compact ? "check-square-o" : "square-o"}
selected={display_compact}
onClick={
() => act('toggle_compact')
} />
</Fragment>
}>
<Box>
<Button
content={prev_cat}
icon="arrow-left"
onClick={
() => act('backwardCat')
} />
<Button
content={next_cat}
icon="arrow-right"
onClick={
() => act('forwardCat')
} />
</Box>
{subcategory && (
<Box>
<Button
content={prev_subcat}
icon="arrow-left"
onClick={
() => act('backwardSubCat')
} />
<Button
content={next_subcat}
icon="arrow-right"
onClick={
() => act('forwardSubCat')
} />
</Box>
)}
{display_compact ? (
<CompactView />
) : (
<ExpandedView />
)}
</Section>
</Window.Content>
</Window>
);
};
const CompactView = (props, context) => {
const { act, data } = useBackend(context);
const {
display_craftable_only,
can_craft,
cant_craft,
} = data;
return (
<Box mt={1}>
<LabeledList>
{can_craft.map(r => (
<LabeledList.Item key={r.name} label={r.name}>
<Button
icon="hammer"
content="Craft"
onClick={
() => act('make', { make: r.ref })
} />
{r.catalyst_text && (
<Button tooltip={r.catalyst_text} content="Catalysts" color="transparent" />
)}
<Button tooltip={r.req_text} content="Requirements" color="transparent" />
{r.tool_text && (
<Button tooltip={r.tool_text} content="Tools" color="transparent" />
)}
</LabeledList.Item>
))}
{!display_craftable_only && (
cant_craft.map(r => (
<LabeledList.Item key={r.name} label={r.name}>
<Button
icon="hammer"
content="Craft"
disabled />
{r.catalyst_text && (
<Button tooltip={r.catalyst_text} content="Catalysts" color="transparent" />
)}
<Button tooltip={r.req_text} content="Requirements" color="transparent" />
{r.tool_text && (
<Button tooltip={r.tool_text} content="Tools" color="transparent" />
)}
</LabeledList.Item>
))
)}
</LabeledList>
</Box>
);
};
const ExpandedView = (props, context) => {
const { act, data } = useBackend(context);
const {
display_craftable_only,
can_craft,
cant_craft,
} = data;
return (
<Box mt={1}>
{can_craft.map(r => (
<Section key={r.name} title={r.name}
buttons={
<Button
icon="hammer"
content="Craft"
onClick={
() => act('make', { make: r.ref })
} />
}>
<LabeledList>
{r.catalyst_text && (
<LabeledList.Item label="Catalysts">
{r.catalyst_text}
</LabeledList.Item>
)}
<LabeledList.Item label="Requirements">
{r.req_text}
</LabeledList.Item>
{r.tool_text && (
<LabeledList.Item label="Tools">
{r.tool_text}
</LabeledList.Item>
)}
</LabeledList>
</Section>
))}
{!display_craftable_only && (
cant_craft.map(r => (
<Section key={r.name} title={r.name}
buttons={
<Button
icon="hammer"
content="Craft"
disabled />
}>
<LabeledList>
{r.catalyst_text && (
<LabeledList.Item label="Catalysts">
{r.catalyst_text}
</LabeledList.Item>
)}
<LabeledList.Item label="Requirements">
{r.req_text}
</LabeledList.Item>
{r.tool_text && (
<LabeledList.Item label="Tools">
{r.tool_text}
</LabeledList.Item>
)}
</LabeledList>
</Section>
))
)}
</Box>
);
};
+361
View File
@@ -0,0 +1,361 @@
import { Fragment } from "inferno";
import { useBackend } from "../backend";
import { Tabs, Button, LabeledList, Box, AnimatedNumber, Section, Grid } from "../components";
import { Window } from "../layouts";
export const RPD = (props, context) => {
const { act, data } = useBackend(context);
const {
mainmenu,
mode,
} = data;
const decideTab = index => {
switch (index) {
case 1:
return <AtmosPipeContent />;
case 2:
return <DisposalPipeContent />;
case 3:
return <RotatePipeContent />;
case 4:
return <FlipPipeContent />;
case 5:
return <BinPipeContent />;
default:
return "WE SHOULDN'T BE HERE!";
}
};
return (
<Window>
<Window.Content>
<Tabs>
{mainmenu.map(m => (
<Tabs.Tab
key={m.category}
content={m.category}
icon={m.icon}
selected={m.mode === mode}
onClick={
() => act('mode', { mode: m.mode })
} />
))}
</Tabs>
{decideTab(mode)}
</Window.Content>
</Window>
);
};
const AtmosPipeContent = (props, context) => {
const { act, data } = useBackend(context);
const {
pipemenu,
pipe_category,
pipelist,
whatpipe,
iconrotation,
} = data;
return (
<Box>
<Tabs>
{pipemenu.map(p => (
<Tabs.Tab
key={p.category}
content={p.category}
selected={p.pipemode === pipe_category}
onClick={
() => act('pipe_category', { pipe_category: p.pipemode })
} />
))}
</Tabs>
<Section>
<Grid>
<Grid.Column>
{pipelist.filter(p => (p.pipe_type === 1)).filter(p => (p.pipe_category === pipe_category)).map(p => (
<Box key={p.pipe_name}>
<Button
fluid
content={p.pipe_name}
icon="cog"
selected={p.pipe_id === whatpipe}
onClick={
() => act('whatpipe', { whatpipe: p.pipe_id })
} />
</Box>
))}
</Grid.Column>
<Grid.Column>
{pipelist.filter(p => (p.pipe_type === 1 && p.pipe_id === whatpipe && p.orientations !== 1)).map(p => (
<Box key={p.pipe_id}>
<Box>
<Button
fluid
textAlign="center"
content="Orient automatically"
selected={iconrotation === 0}
onClick={
() => act('iconrotation', { iconrotation: 0 })
} />
</Box>
{p.bendy ? (
<Fragment>
<Grid>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 4}
content={
<img src={p.pipe_icon + "-southeast.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 4 })
} />
</Grid.Column>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 2}
content={
<img src={p.pipe_icon + "-southwest.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 2 })
} />
</Grid.Column>
</Grid>
<Grid>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 1}
content={
<img src={p.pipe_icon + "-northeast.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 1 })
} />
</Grid.Column>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 8}
content={
<img src={p.pipe_icon + "-northwest.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 8 })
} />
</Grid.Column>
</Grid>
</Fragment>
) : (
<Fragment>
<Grid>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 1}
content={
<img src={p.pipe_icon + "-north.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 1 })
} />
</Grid.Column>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 4}
content={
<img src={p.pipe_icon + "-east.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 4 })
} />
</Grid.Column>
</Grid>
{p.orientations === 4 && (
<Grid>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 2}
content={
<img src={p.pipe_icon + "-south.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 2 })
} />
</Grid.Column>
<Grid.Column>
<Button
fluid
textAlign="center"
color="transparent"
selected={iconrotation === 8}
content={
<img src={p.pipe_icon + "-west.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 8 })
} />
</Grid.Column>
</Grid>
)}
</Fragment>
)}
</Box>
))}
</Grid.Column>
</Grid>
</Section>
</Box>
);
};
const DisposalPipeContent = (props, context) => {
const { act, data } = useBackend(context);
const {
pipe_category,
pipelist,
whatdpipe,
iconrotation,
} = data;
return (
<Section>
<Grid>
<Grid.Column>
{pipelist.filter(p => (p.pipe_type === 2)).map(p => (
<Box key={p.pipe_name}>
<Button
fluid
content={p.pipe_name}
icon="cog"
selected={p.pipe_id === whatdpipe}
onClick={
() => act('whatdpipe', { whatdpipe: p.pipe_id })
} />
</Box>
))}
</Grid.Column>
<Grid.Column>
{pipelist.filter(p => (p.pipe_type === 2 && p.pipe_id === whatdpipe && p.orientations !== 1)).map(p => (
<Fragment key={p.pipe_id}>
<Box>
<Button
fluid
textAlign="center"
content="Orient automatically"
selected={iconrotation === 0}
onClick={
() => act('iconrotation', { iconrotation: 0 })
} />
</Box>
<Grid>
<Grid.Column>
<Button
fluid
color="transparent"
textAlign="center"
selected={iconrotation === 1}
content={
<img src={p.pipe_icon + "-north.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 1 })
} />
</Grid.Column>
<Grid.Column>
<Button
fluid
color="transparent"
textAlign="center"
selected={iconrotation === 4}
content={
<img src={p.pipe_icon + "-east.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 4 })
} />
</Grid.Column>
</Grid>
{p.orientations === 4 && (
<Grid>
<Grid.Column>
<Button
fluid
color="transparent"
textAlign="center"
selected={iconrotation === 2}
content={
<img src={p.pipe_icon + "-south.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 2 })
} />
</Grid.Column>
<Grid.Column>
<Button
fluid
color="transparent"
textAlign="center"
selected={iconrotation === 8}
content={
<img src={p.pipe_icon + "-west.png"} />
}
onClick={
() => act('iconrotation', { iconrotation: 8 })
} />
</Grid.Column>
</Grid>
)}
</Fragment>
))}
</Grid.Column>
</Grid>
</Section>
);
};
// These ones are simple, but are like this incase the RPD gets future refactors
const RotatePipeContent = (props, context) => {
return (
<Box bold>
Device ready to rotate loose pipes...
</Box>
);
};
const FlipPipeContent = (props, context) => {
return (
<Box bold>
Device ready to flip loose pipes...
</Box>
);
};
const BinPipeContent = (props, context) => {
return (
<Box bold>
Device ready to eat loose pipes...
</Box>
);
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
@use '../base.scss';
@use '../colors.scss';
@use '../functions.scss' as *;
.AccountsUplinkTerminal__list {
tr > td {
text-align: center;
}
tr:not(:first-child) {
height: 24px;
line-height: 24px;
cursor: pointer;
transition: background-color 50ms;
&:hover, &:focus {
background-color: rgba(base.$color-bg, 1);
}
}
}
+1
View File
@@ -39,6 +39,7 @@
@include meta.load-css('./components/Tooltip.scss');
// Interfaces
@include meta.load-css('./interfaces/AccountsUplinkTerminal.scss');
@include meta.load-css('./interfaces/BrigCells.scss');
@include meta.load-css('./interfaces/CameraConsole.scss');
@include meta.load-css('./interfaces/NuclearBomb.scss');