diff --git a/code/game/objects/items/weapons/rpd.dm b/code/game/objects/items/weapons/rpd.dm index 415a02f4456..cf52238b2d9 100644 --- a/code/game/objects/items/weapons/rpd.dm +++ b/code/game/objects/items/weapons/rpd.dm @@ -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) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index b28c20626c3..e884c9573f4 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -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" diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index aae3b84a3c5..1a994123cee 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -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, "[TR.name] constructed.") - 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, "Construction failed[fail_msg]") - 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, "[TR.name] constructed.") + 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, "Construction failed[fail_msg]") + 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) diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm index 0a2b500a0d3..19e2bcafe0b 100644 --- a/code/modules/economy/Accounts.dm +++ b/code/modules/economy/Accounts.dm @@ -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 = {"Account details (confidential)


Account holder: [M.owner_name]
Account number: [M.account_number]
diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index aafc91cb849..dccab690af3 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -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 {"

[report_name]

[station_name()] Accounting Report
+ Generated By: [L?.id?.registered_name ? L.id.registered_name : "Unknown"], [L?.id?.assignment ? L.id.assignment : "Unknown"]

- Generated By: [held_card.registered_name], [held_card.assignment]
"} /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, "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 + + + + + + + + + + + "} - 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)] - Holder: [detailed_account_view.owner_name]
- Balance: $[detailed_account_view.money]
- Status: [detailed_account_view.suspended ? "Suspended" : "Active"]
- Transactions: ([detailed_account_view.transaction_log.len])
-
Account NumberHolderBalanceStatus
- - - - - - - - - - - "} + for(var/i in 1 to length(GLOB.all_money_accounts)) + var/datum/money_account/D = GLOB.all_money_accounts[i] + text += {" + + + + + + + "} - for(var/datum/transaction/T in detailed_account_view.transaction_log) - text += {" - - - - - - - - "} + text += {" + +
TimestampTargetReasonValueTerminal
#[D.account_number][D.owner_name]$[D.money][D.suspended ? "Suspended" : "Active"]
[T.date] [T.time][T.target_name][T.purpose][T.amount][T.source_terminal]
+ "} - text += {" - - - "} + P.info = text + visible_message("[src] prints out a report.") + 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, "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)] + Holder: [detailed_account_view.owner_name]
+ Balance: $[detailed_account_view.money]
+ Status: [detailed_account_view.suspended ? "Suspended" : "Active"]
+ Transactions: ([detailed_account_view.transaction_log.len])
+ + + + + + + + + + + + "} -
TimestampTargetReasonValueTerminal
- - - - - - - - - + for(var/datum/transaction/T in detailed_account_view.transaction_log) + text += {" + + + + + + + "} - for(var/i=1, i<=GLOB.all_money_accounts.len, i++) - var/datum/money_account/D = GLOB.all_money_accounts[i] - text += {" - - - - - - - "} + text += {" + +
Account NumberHolderBalanceStatus
[T.date] [T.time][T.target_name][T.purpose][T.amount][T.source_terminal]
#[D.account_number][D.owner_name]$[D.money][D.suspended ? "Suspended" : "Active"]
+ "} - text += {" - - - "} + P.info = text + visible_message("[src] prints out a report.") + next_print = world.time + 30 SECONDS - P.info = text - visible_message("[src] prints out a report.") - - return 1 +#undef AUT_ACCLST +#undef AUT_ACCINF +#undef AUT_ACCNEW diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fb4db882578..62fc21ff968 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -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... diff --git a/code/modules/reagents/chemistry/recipes/food.dm b/code/modules/reagents/chemistry/recipes/food.dm index d9c0e0727aa..f559864486e 100644 --- a/code/modules/reagents/chemistry/recipes/food.dm +++ b/code/modules/reagents/chemistry/recipes/food.dm @@ -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("A faint cheese-ish smell drifts through the air...") diff --git a/code/modules/tgui/plugins/login.dm b/code/modules/tgui/plugins/login.dm index ae0ac9c028e..044ab46fad7 100644 --- a/code/modules/tgui/plugins/login.dm +++ b/code/modules/tgui/plugins/login.dm @@ -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, "Access Denied") + return else if(login_type == LOGIN_TYPE_AI && isAI(usr)) state.name = usr.name state.rank = "AI" diff --git a/icons/mob/species/vox/head.dmi b/icons/mob/species/vox/head.dmi index d73146e4e7d..223dd0337c4 100644 Binary files a/icons/mob/species/vox/head.dmi and b/icons/mob/species/vox/head.dmi differ diff --git a/icons/obj/pipe-item.dmi b/icons/obj/pipe-item.dmi index 73d62edfaa8..e4322cc8e98 100644 Binary files a/icons/obj/pipe-item.dmi and b/icons/obj/pipe-item.dmi differ diff --git a/nano/templates/accounts_terminal.tmpl b/nano/templates/accounts_terminal.tmpl deleted file mode 100644 index de738cd2940..00000000000 --- a/nano/templates/accounts_terminal.tmpl +++ /dev/null @@ -1,146 +0,0 @@ -
-
- Machine: -
-
- {{:data.machine_id}} -
-
-
-
- ID: -
-
- {{:helper.link(data.id_card, 'eject', {'insert_card' : 1}, null, data.id_inserted ? 'fixedLeftWidest' : 'fixedLeft')}} -
-
- -{{if data.access_level > 0}} -
-

Menu

-
- {{: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}} -
-

Create Account

-
- -
- - -
-
- Account Holder: -
-
- -
-
-
-
- Initial Deposit: -
-
- -
-
-
- -
-
- {{else data.detailed_account_view}} -
-

Account Details

-
- -
-
- Account Number: -
-
- #{{:data.account_number}} -
-
- -
-
- Holder: -
-
- {{:data.owner_name}} -
-
- -
-
- Balance: -
-
- ${{:helper.formatNumber(data.money)}} -
-
- -
-
- Status: -
-
- - {{:data.suspended ? "Suspended" : "Active"}} - -
-
-
- {{:helper.link(data.suspended ? "Unsuspend" : "Suspend", 'gear', {'choice' : 'toggle_suspension'})}} -
- -
- {{if data.transactions}} - - - - - - - - - - - - {{for data.transactions}} - - - - - - - - {{/for}} - -
TimestampTargetReasonValueTerminal
{{:value.date}} {{:value.time}}{{:value.target_name}}{{:value.purpose}}{{:value.amount}}{{:value.source_terminal}}
- {{else}} - This account has no financial transactions on record for today. - {{/if}} -
- {{else}} -
-

Nanotrasen Accounts

-
- {{if data.accounts}} - - {{for data.accounts}} - - - - - - {{/for}} -
{{:helper.link('#' + value.account_number, '', {'choice' : 'view_account_detail', 'account_index' : value.account_index})}}{{:value.owner_name}}{{:value.suspended}}
- {{else}} - There are no accounts available. - {{/if}} - {{/if}} -{{/if}} diff --git a/nano/templates/personal_crafting.tmpl b/nano/templates/personal_crafting.tmpl deleted file mode 100644 index 3158d7c3906..00000000000 --- a/nano/templates/personal_crafting.tmpl +++ /dev/null @@ -1,116 +0,0 @@ - - - -
-

{{:data.category}}{{if data.subcategory}} : {{:data.subcategory}}{{/if}}

-
-
- {{: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})}} -
- {{if data.subcategory}} -
- {{:helper.link(data.prev_subcat, 'arrow-left', {'backwardSubCat': 1})}} - {{:helper.link(data.next_subcat, 'arrow-right', {'forwardSubCat': 1})}} -
- {{/if}} - {{if data.display_compact}} -
-
- - {{for data.can_craft}} - - - - - {{/for}} - {{if !data.display_craftable_only}} - {{for data.cant_craft}} - - - - - {{/for}} - {{/if}} -
{{:value.name}}:
- {{:helper.link('Craft', 'gears', {'make': value.ref})}} -
{{:value.name}}:
- {{:helper.link('Craft', 'gears', {'make': value.ref}, 'disabled')}} -
-
-
- {{else}} - {{for data.can_craft}} -
-

{{:value.name}}

-
- {{if value.req_text}} -
-
Requirements:
-
{{:value.req_text}}
-
- {{/if}} - {{if value.catalyst_text}} -
-
Catalysts:
-
{{:value.catalyst_text}}
-
- {{/if}} - {{if value.tool_text}} -
-
Tools:
-
{{:value.tool_text}}
-
- {{/if}} -
- {{:helper.link('Craft', 'gears', {'make': value.ref})}} -
-
-
- {{/for}} - {{if !data.display_craftable_only}} - {{for data.cant_craft}} -
-

{{:value.name}}

-
- {{if value.req_text}} -
-
Requirements:
-
{{:value.req_text}}
-
- {{/if}} - {{if value.catalyst_text}} -
-
Catalysts:
-
{{:value.catalyst_text}}
-
- {{/if}} - {{if value.tool_text}} -
-
Tools:
-
{{:value.tool_text}}
-
- {{/if}} -
-
- {{/for}} - {{/if}} - {{/if}} -
-
- -{{if data.busy}} -
-
-

Crafting...

-
-
-{{/if}} \ No newline at end of file diff --git a/nano/templates/rpd.tmpl b/nano/templates/rpd.tmpl deleted file mode 100644 index 6a9c2ccb517..00000000000 --- a/nano/templates/rpd.tmpl +++ /dev/null @@ -1,115 +0,0 @@ - -

Mode:

-
- {{for data.mainmenu}} - {{:helper.link(value.category, value.icon, {mode: value.mode}, data.mode == value.mode ? "linkOn" : null)}} - {{/for}} -
-{{if data.mode == 1}} -

Pipe type:

-
- {{for data.pipemenu}} - {{:helper.link(value.category, null, {pipe_category: value.pipemode}, data.pipe_category == value.pipemode ? "linkOn" : null)}} - {{/for}} -
-

Available pipes:

-
- {{for data.pipelist}} - {{if value.pipe_type == 1 && value.pipe_category == data.pipe_category}} -
{{:helper.link(value.pipe_name, "arrow-right", {whatpipe: value.pipe_id}, data.whatpipe == value.pipe_id ? "linkOn" : null)}}
- {{/if}} - {{/for}} -
- {{for data.pipelist}} - {{if value.pipe_type != 1 || value.pipe_id != data.whatpipe || value.orientations == 1}} - {{continue;}} - {{/if}} -
-
- {{:helper.link("Orient automatically", null, {iconrotation: 0}, data.iconrotation == 0 ? "linkOn" : null)}} -
- {{if value.bendy}} -
- {{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}} - -
- {{else}} -
- {{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}} - -
- {{if value.orientations == 4}} -
- {{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}} - -
- {{/if}} - {{/if}} -
- {{/for}} -{{else data.mode == 2}} -

Available pipes:

-
- {{for data.pipelist}} - {{if value.pipe_type == 2}} -
{{:helper.link(value.pipe_name, "arrow-right", {whatdpipe: value.pipe_id}, data.whatdpipe == value.pipe_id ? "linkOn" : null)}}
- {{/if}} - {{/for}} -
- {{for data.pipelist}} - {{if value.pipe_type != 2 || value.pipe_id != data.whatdpipe || value.orientations == 1}} - {{continue;}} - {{/if}} -
-
- {{:helper.link("Orient automatically", null, {iconrotation: 0}, data.iconrotation == 0 ? "linkOn" : null)}} -
-
- {{:helper.link("", "arrow-right", {iconrotation: 1}, data.iconrotation == 1 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 4}, data.iconrotation == 4 ? "linkOn" : null)}} - -
- {{if value.orientations == 4}} -
- {{:helper.link("", "arrow-right", {iconrotation: 2}, data.iconrotation == 2 ? "linkOn" : null)}} - -
-
- {{:helper.link("", "arrow-right", {iconrotation: 8}, data.iconrotation == 8 ? "linkOn" : null)}} - -
- {{/if}} -
- {{/for}} -{{else data.mode == 3}} -

Device ready to rotate loose pipes...

-{{else data.mode == 4}} -

Device ready to flip loose pipes...

-{{else data.mode == 5}} -

Device ready to eat loose pipes...

-{{/if}} \ No newline at end of file diff --git a/tgui/packages/tgui/interfaces/AccountsUplinkTerminal.js b/tgui/packages/tgui/interfaces/AccountsUplinkTerminal.js new file mode 100644 index 00000000000..b6d073574bd --- /dev/null +++ b/tgui/packages/tgui/interfaces/AccountsUplinkTerminal.js @@ -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 ( + + + + + + ); + } else { + if (currentPage === 1) { + body = ; + } else if (currentPage === 2) { + body = ; + } else if (currentPage === 3) { + body = ; + } + } + + return ( + + + + {body} + + + ); +}; + +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 ( + + + +
+ + + Account Holder + Account Number + Account Status + + {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 => ( + act('view_account_detail', { index: account.account_index }) + }> + {account.owner_name} + #{account.account_number} + {account.suspended} + + ))} +
+
+
+
+ ); +}; + +const SortButton = (properties, context) => { + const [sortId, setSortId] = useLocalState(context, "sortId", "name"); + const [sortOrder, setSortOrder] = useLocalState(context, "sortOrder", true); + const { + id, + children, + } = properties; + return ( + + + + ); +}; + +const AccountsActions = (properties, context) => { + const { act, data } = useBackend(context); + const { + is_printing, + } = data; + const [searchText, setSearchText] = useLocalState(context, "searchText", ""); + return ( + + +