diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 2008ed8aec9..31f4ba05845 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -16733,9 +16733,7 @@ /turf/open/floor/plasteel, /area/crew_quarters/locker) "aQX" = ( -/obj/machinery/firealarm{ - pixel_y = 24 - }, +/obj/machinery/vending/modularpc, /turf/open/floor/plasteel, /area/crew_quarters/locker) "aQY" = ( @@ -19236,6 +19234,7 @@ /area/crew_quarters/locker) "aXt" = ( /obj/effect/turf_decal/stripes/corner, +/obj/machinery/lapvend, /turf/open/floor/plasteel, /area/crew_quarters/locker) "aXu" = ( @@ -22751,7 +22750,6 @@ areastring = "/area/medical/apothecary"; dir = 1; name = "Apothecary APC"; - pixel_x = 0; pixel_y = 23 }, /turf/open/floor/plasteel/white, @@ -51907,6 +51905,12 @@ /obj/item/flashlight, /turf/open/floor/plasteel/dark, /area/engine/engineering) +"uea" = ( +/obj/machinery/firealarm{ + pixel_y = 24 + }, +/turf/open/floor/plasteel, +/area/crew_quarters/locker) "uhH" = ( /obj/item/wrench, /obj/item/weldingtool, @@ -69691,7 +69695,7 @@ aLE aNl aOl aPA -aQN +uea aQN aQN aUn diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index ebb82e1fa90..7eded8050cb 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -82801,12 +82801,10 @@ /obj/effect/turf_decal/tile/purple{ dir = 8 }, +/obj/item/gps, /turf/open/floor/plasteel/white, /area/science/research) "cXw" = ( -/obj/structure/table, -/obj/item/gps, -/obj/item/assembly/flash/handheld, /obj/machinery/status_display/evac{ pixel_y = -32 }, @@ -82814,6 +82812,7 @@ /obj/effect/turf_decal/tile/purple{ dir = 8 }, +/obj/machinery/lapvend, /turf/open/floor/plasteel/white, /area/science/research) "cXx" = ( @@ -82822,6 +82821,7 @@ /obj/item/pen, /obj/structure/disposalpipe/segment, /obj/effect/turf_decal/tile/purple, +/obj/item/assembly/flash/handheld, /turf/open/floor/plasteel/white, /area/science/research) "cXy" = ( @@ -98590,7 +98590,6 @@ dir = 4 }, /obj/machinery/vending/wallmed{ - pixel_x = 0; pixel_y = 32 }, /turf/open/floor/plasteel/white, diff --git a/_maps/map_files/Donutstation/Donutstation.dmm b/_maps/map_files/Donutstation/Donutstation.dmm index cc42441d333..e6f13328524 100644 --- a/_maps/map_files/Donutstation/Donutstation.dmm +++ b/_maps/map_files/Donutstation/Donutstation.dmm @@ -13561,6 +13561,7 @@ /obj/effect/turf_decal/tile/green{ dir = 4 }, +/obj/machinery/lapvend, /turf/open/floor/plasteel, /area/crew_quarters/fitness/recreation) "aKW" = ( @@ -21027,8 +21028,7 @@ }, /obj/structure/table/glass, /obj/item/storage/box/masks{ - pixel_x = 4; - pixel_z = 0 + pixel_x = 4 }, /obj/item/storage/box/gloves{ pixel_x = -4 @@ -31067,8 +31067,7 @@ areastring = "/area/quartermaster/sorting"; dir = 8; name = "Delivery Office APC"; - pixel_x = -25; - pixel_y = 0 + pixel_x = -25 }, /obj/structure/cable, /obj/machinery/light{ @@ -31585,7 +31584,6 @@ dir = 8 }, /obj/machinery/door/window/westleft{ - dir = 8; name = "Cargo Packages"; req_access_txt = "55" }, @@ -34218,12 +34216,12 @@ /turf/open/floor/plating, /area/maintenance/fore) "bLC" = ( -/obj/structure/table, /obj/effect/turf_decal/tile/neutral, /obj/machinery/airalarm{ dir = 1; pixel_y = -22 }, +/obj/structure/table, /obj/item/paicard, /turf/open/floor/plasteel, /area/crew_quarters/fitness/recreation) @@ -36468,11 +36466,11 @@ /turf/open/floor/plasteel/dark, /area/crew_quarters/dorms) "bRL" = ( +/obj/effect/turf_decal/tile/neutral, +/obj/effect/landmark/start/assistant, /obj/structure/chair{ dir = 8 }, -/obj/effect/turf_decal/tile/neutral, -/obj/effect/landmark/start/assistant, /turf/open/floor/plasteel, /area/crew_quarters/fitness/recreation) "bRM" = ( @@ -47224,6 +47222,16 @@ }, /turf/open/floor/plasteel, /area/storage/tools) +"qHa" = ( +/obj/effect/turf_decal/tile/green{ + dir = 1 + }, +/obj/effect/turf_decal/tile/green{ + dir = 4 + }, +/obj/machinery/vending/modularpc, +/turf/open/floor/plasteel, +/area/crew_quarters/fitness/recreation) "qHu" = ( /obj/structure/table, /obj/item/storage/toolbox/mechanical{ @@ -48554,8 +48562,7 @@ /obj/machinery/power/apc{ areastring = "/area/ai_monitored/turret_protected/ai_upload"; name = "AI Upload APC"; - pixel_x = -25; - pixel_y = 0 + pixel_x = -25 }, /obj/effect/turf_decal/tile/blue{ dir = 1 @@ -78794,7 +78801,7 @@ auo aCh avn aKP -aKV +qHa bro asP aih diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 725b0b406c6..2c673313a19 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -47312,14 +47312,13 @@ /turf/open/floor/plasteel/white, /area/science/research) "cav" = ( -/obj/structure/chair, -/obj/effect/landmark/start/assistant, /obj/effect/turf_decal/tile/purple{ dir = 1 }, /obj/effect/turf_decal/tile/purple{ dir = 4 }, +/obj/machinery/lapvend, /turf/open/floor/plasteel/white, /area/science/research) "caw" = ( @@ -47340,6 +47339,7 @@ /obj/effect/turf_decal/tile/purple{ dir = 4 }, +/obj/effect/landmark/start/assistant, /turf/open/floor/plasteel/white, /area/science/research) "caz" = ( @@ -73567,15 +73567,11 @@ /obj/structure/sink/kitchen{ desc = "A sink used for washing one's hands and face. It looks rusty and home-made"; dir = 4; - icon_state = "sink_alt"; name = "old sink"; - pixel_x = -12; - pixel_y = 0; - pixel_z = 0 + pixel_x = -12 }, /obj/structure/mirror{ - pixel_x = -27; - pixel_y = 0 + pixel_x = -27 }, /turf/open/floor/wood, /area/maintenance/port/aft) @@ -73953,8 +73949,7 @@ pixel_y = 2 }, /obj/item/folder/yellow{ - pixel_x = -5; - pixel_y = 0 + pixel_x = -5 }, /turf/open/floor/plasteel/white, /area/medical/chemistry) diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index b1074f0eb0c..914adcc3087 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -24277,7 +24277,7 @@ /turf/open/floor/plasteel/dark, /area/hallway/primary/aft) "bkr" = ( -/obj/machinery/modular_computer/console/preset/civilian, +/obj/machinery/lapvend, /turf/open/floor/plasteel/dark, /area/hallway/primary/aft) "bks" = ( diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index aea4e031dae..3cced586f7c 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -49,7 +49,7 @@ dev_card = 0 // Recalculates the price and optionally even fabricates the device. -/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = 0) +/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = FALSE) total_price = 0 if(devtype == 1) // Laptop, generally cheaper to make it accessible for most station roles var/obj/item/computer_hardware/battery/battery_module = null @@ -163,7 +163,7 @@ if(fabricate) fabricated_tablet.install_component(new/obj/item/computer_hardware/card_slot) return total_price - return 0 + return FALSE @@ -171,90 +171,106 @@ /obj/machinery/lapvend/ui_act(action, params) if(..()) - return 1 + return TRUE switch(action) if("pick_device") if(state) // We've already picked a device type - return 0 + return FALSE devtype = text2num(params["pick"]) state = 1 - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("clean_order") reset_order() - return 1 + return TRUE if("purchase") try_purchase() - return 1 + return TRUE if((state != 1) && devtype) // Following IFs should only be usable when in the Select Loadout mode - return 0 + return FALSE switch(action) if("confirm_order") state = 2 // Wait for ID swipe for payment processing - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_cpu") dev_cpu = text2num(params["cpu"]) - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_battery") dev_battery = text2num(params["battery"]) - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_disk") dev_disk = text2num(params["disk"]) - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_netcard") dev_netcard = text2num(params["netcard"]) - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_tesla") dev_apc_recharger = text2num(params["tesla"]) - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_nanoprint") dev_printer = text2num(params["print"]) - fabricate_and_recalc_price(0) - return 1 + fabricate_and_recalc_price(FALSE) + return TRUE if("hw_card") dev_card = text2num(params["card"]) - fabricate_and_recalc_price(0) - return 1 - return 0 + fabricate_and_recalc_price(FALSE) + return TRUE + return FALSE /obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) if(stat & (BROKEN | NOPOWER | MAINT)) if(ui) ui.close() - return 0 + return FALSE ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) ui = new(user, src, ui_key, "computer_fabricator", "Personal Computer Vendor", ui_x, ui_y, state = state) ui.open() - ui.set_autoupdate(state = 1) -/obj/machinery/lapvend/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/lapvend/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/stack/spacecash)) var/obj/item/stack/spacecash/c = I - if(!user.temporarilyRemoveItemFromInventory(c)) return credits += c.value - visible_message("[usr] inserts [c.value] credits into [src].") + visible_message("[user] inserts [c.value] credits into [src].") qdel(c) return + else if(istype(I, /obj/item/holochip)) + var/obj/item/holochip/HC = I + credits += HC.credits + visible_message("[user] inserts a $[HC.credits] holocredit chip into [src].") + qdel(HC) + return + else if(istype(I, /obj/item/card/id)) + if(state != 2) + return + var/obj/item/card/id/ID = I + var/datum/bank_account/account = ID.registered_account + var/target_credits = total_price - credits + if(!account.adjust_money(-target_credits)) + say("Insufficient money on card to purchase!") + return + credits += target_credits + say("$[target_credits] has been desposited from your account.") + return return ..() // Simplified payment processing, returns 1 on success. /obj/machinery/lapvend/proc/process_payment() if(total_price > credits) say("Insufficient credits.") - return 0 + return FALSE else - return 1 + return TRUE /obj/machinery/lapvend/ui_data(mob/user) @@ -290,5 +306,6 @@ credits -= total_price say("Enjoy your new product!") state = 3 - return 1 - return 0 + addtimer(CALLBACK(src, .proc/reset_order), 100) + return TRUE + return FALSE diff --git a/tgui-next/packages/tgui/interfaces/ComputerFabricator.js b/tgui-next/packages/tgui/interfaces/ComputerFabricator.js new file mode 100644 index 00000000000..5c7078e1b36 --- /dev/null +++ b/tgui-next/packages/tgui/interfaces/ComputerFabricator.js @@ -0,0 +1,425 @@ +import { Fragment } from 'inferno'; +import { act } from '../byond'; +import { Box, Button, LabeledList, NumberInput, Section, Grid, Table, Tooltip } from '../components'; +import { multiline } from 'common/string'; + +// This had a pretty gross backend so this was unfortunately one of the best ways of doing it. +export const CFScreen = props => { + const { state } = props; + const { config, data } = state; + const { ref } = config; + switch (data.state) { + case 0: + return ( +
+ + Choose your Device + + + + +
+ ); + case 1: + return ( +
+ ${data.totalprice} + + )} + > + + + + Battery: + + + +
+
+ ); + case 2: + return ( +
+ + Your device is ready for fabrication... + + + + Please insert the required + + {' '} + + ${data.totalprice} + + + + Current: + + = data.totalprice ? "good" : "bad"} + > + ${data.credits} + +
+ ); + case 3: + return ( +
+ + Thank you for your purchase! + + + If you experience any difficulties with your new device, please contact your local network administrator. + +
+ ); + } +}; + +export const ComputerFabricator = props => { + const { state } = props; + const { config, data } = state; + const { ref } = config; + return ( + +
+ Your perfect device, only three steps away... +
+ {data.state !== 0 && ( +