Skip to content

Commit

Permalink
asfdasdfsdaf
Browse files Browse the repository at this point in the history
  • Loading branch information
Anorak2024 committed Aug 30, 2024
1 parent ed51def commit b45189a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion code/game/machinery/constructable_frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ to destroy them and players will be able to make replacements.
"Service Departament ClothesMate Botanical" = /obj/machinery/vending/clothing/departament/service/botanical,
"Service Departament ClothesMate Chaplain" = /obj/machinery/vending/clothing/departament/service/chaplain,
"RoboFriends" = /obj/machinery/vending/pai,
"Customat" = /obj/machinery/customat,)
"Customat" = /obj/machinery/customat,)

var/static/list/unique_vendors = list(
"ShadyCigs Ultra" = /obj/machinery/vending/cigarette/beach,
Expand Down
24 changes: 12 additions & 12 deletions code/game/machinery/customat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


/obj/machinery/customat
name = "\improper Castomomat"
name = "\improper Customat"
desc = "Торговый автомат с кастомным содержимым."
icon = 'icons/obj/machines/vending.dmi'
icon_state = "generic_off"
Expand Down Expand Up @@ -88,7 +88,6 @@
/// Item currently being bought
var/datum/data/customat_product/currently_vending = null

var/list/imagelist = list()

// Stuff relating vocalizations
/// List of slogans the vendor will say, optional
Expand Down Expand Up @@ -154,9 +153,6 @@
component_parts += canister
RefreshParts()

for(var/datum/data/customat_product/product in products)
imagelist[product.key] = "[icon2base64(icon(initial(product.product_icon), initial(product.product_icon_state), SOUTH, 1, FALSE))]"

update_icon(UPDATE_OVERLAYS)

/obj/machinery/customat/proc/eject_all()
Expand Down Expand Up @@ -461,8 +457,12 @@
else
data["guestNotice"] = "Unlinked ID detected. Present cash to pay.";
data["stock"] = list()
for (var/datum/data/vending_product/product in products)
data["stock"][product.name] = product.amount
for (var/datum/data/customat_product/product in products)
data["stock"][product.key] = product.amount
data["icons"] = list()
for (var/datum/data/customat_product/product in products)
var/obj/item/I = product.containtment[1]
data["icons"][product.key] = "[icon2base64(icon(initial(I.icon), initial(I.icon_state), SOUTH, 1, FALSE))]"
data["vend_ready"] = vend_ready
data["panel_open"] = panel_open ? TRUE : FALSE
data["speaker"] = shut_up ? FALSE : TRUE
Expand All @@ -483,7 +483,6 @@
)
data["products"] += list(data_pr)
i++
data["imagelist"] = imagelist
return data

/obj/machinery/customat/ui_act(action, params)
Expand Down Expand Up @@ -577,7 +576,7 @@



/obj/machinery/customat/proc/vend(datum/data/vending_product/product, mob/user)
/obj/machinery/customat/proc/vend(datum/data/customat_product/product, mob/user)
if(!allowed(user) && !user.can_admin_interact() && !emagged && scan_id)
balloon_alert(user, "Access denied.")
flick_vendor_overlay(FLICK_DENY)
Expand All @@ -603,7 +602,7 @@
addtimer(CALLBACK(src, PROC_REF(delayed_vend), product, user), vend_delay)


/obj/machinery/customat/proc/delayed_vend(datum/data/vending_product/product, mob/user)
/obj/machinery/customat/proc/delayed_vend(datum/data/customat_product/product, mob/user)
do_vend(product, user)
vend_ready = TRUE
currently_vending = null
Expand All @@ -613,15 +612,16 @@
* Override this proc to add handling for what to do with the vended product
* when you have a inserted item and remember to include a parent call for this generic handling
*/
/obj/machinery/customat/proc/do_vend(datum/data/vending_product/product, mob/user)
/obj/machinery/customat/proc/do_vend(datum/data/customat_product/product, mob/user)
var/put_on_turf = TRUE
var/obj/item/vended = new product.product_path(drop_location())
var/obj/item/vended = product.containtment[1]
if(istype(vended) && user && iscarbon(user) && user.Adjacent(src))
if(user.put_in_hands(vended, ignore_anim = FALSE))
put_on_turf = FALSE
if(put_on_turf)
var/turf/T = get_turf(src)
vended.forceMove(T)
product.containtment.Remove(product.containtment[1])
return TRUE

/obj/machinery/customat/process()
Expand Down
8 changes: 4 additions & 4 deletions tgui/packages/tgui/interfaces/Customat.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export const Customat = (props, context) => {
chargesMoney,
products = [],
stock,
icons,
vend_ready,
inserted_item_name,
panel_open,
speaker,
imagelist,
} = data;
let inventory;

Expand Down Expand Up @@ -143,10 +143,10 @@ export const Customat = (props, context) => {
<Table>
{inventory.map((product) => (
<VendingRow
key={product.name}
key={product.key}
product={product}
productStock={stock[product.name]}
productImage={imagelist[product.key]}
productStock={stock[product.key]}
productImage={icons[product.key]}
/>
))}
</Table>
Expand Down

0 comments on commit b45189a

Please sign in to comment.