diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index deba080ca2..ee33f16d61 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -15,6 +15,7 @@ var/max_n_of_items = 1500 var/allow_ai_retrieve = FALSE var/list/initial_contents + var/visible_contents = TRUE /obj/machinery/smartfridge/Initialize() . = ..() @@ -37,11 +38,21 @@ update_icon() /obj/machinery/smartfridge/update_icon() - var/startstate = initial(icon_state) if(!stat) - icon_state = startstate + if(visible_contents) + switch(contents.len) + if(0) + icon_state = "[initial(icon_state)]" + if(1 to 25) + icon_state = "[initial(icon_state)]1" + if(26 to 75) + icon_state = "[initial(icon_state)]2" + if(76 to INFINITY) + icon_state = "[initial(icon_state)]3" + else + icon_state = "[initial(icon_state)]" else - icon_state = "[startstate]-off" + icon_state = "[initial(icon_state)]-off" @@ -50,7 +61,11 @@ ********************/ /obj/machinery/smartfridge/attackby(obj/item/O, mob/user, params) - if(default_deconstruction_screwdriver(user, "smartfridge_open", "smartfridge", O)) + if(default_deconstruction_screwdriver(user, icon_state, icon_state, O)) + cut_overlays() + if(panel_open) + add_overlay("[initial(icon_state)]-panel") + updateUsrDialog() return if(default_pry_open(O)) @@ -64,49 +79,53 @@ updateUsrDialog() return - if(!stat) + if(user.a_intent == INTENT_HARM) + return ..() - if(contents.len >= max_n_of_items) - to_chat(user, "\The [src] is full!") - return FALSE - - if(accept_check(O)) - load(O) - user.visible_message("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].") - updateUsrDialog() - return TRUE - - if(istype(O, /obj/item/storage/bag)) - var/obj/item/storage/P = O - var/loaded = 0 - for(var/obj/G in P.contents) - if(contents.len >= max_n_of_items) - break - if(accept_check(G)) - load(G) - loaded++ - updateUsrDialog() - - if(loaded) - if(contents.len >= max_n_of_items) - user.visible_message("[user] loads \the [src] with \the [O].", \ - "You fill \the [src] with \the [O].") - else - user.visible_message("[user] loads \the [src] with \the [O].", \ - "You load \the [src] with \the [O].") - if(O.contents.len > 0) - to_chat(user, "Some items are refused.") - return TRUE - else - to_chat(user, "There is nothing in [O] to put in [src]!") - return FALSE - - if(user.a_intent != INTENT_HARM) - to_chat(user, "\The [src] smartly refuses [O].") + if(stat) updateUsrDialog() return FALSE - else - return ..() + + if(contents.len >= max_n_of_items) + to_chat(user, "\The [src] is full!") + return FALSE + + if(accept_check(O)) + load(O) + user.visible_message("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].") + updateUsrDialog() + if (visible_contents) + update_icon() + return TRUE + + if(istype(O, /obj/item/storage/bag)) + var/obj/item/storage/P = O + var/loaded = 0 + for(var/obj/G in P.contents) + if(contents.len >= max_n_of_items) + break + if(accept_check(G)) + load(G) + loaded++ + updateUsrDialog() + + if(loaded) + if(contents.len >= max_n_of_items) + user.visible_message("[user] loads \the [src] with \the [O].", \ + "You fill \the [src] with \the [O].") + else + user.visible_message("[user] loads \the [src] with \the [O].", \ + "You load \the [src] with \the [O].") + if(O.contents.len > 0) + to_chat(user, "Some items are refused.") + return TRUE + else + to_chat(user, "There is nothing in [O] to put in [src]!") + return FALSE + + to_chat(user, "\The [src] smartly refuses [O].") + updateUsrDialog() + return FALSE @@ -186,6 +205,8 @@ O.forceMove(drop_location()) adjust_item_drop_location(O) break + if (visible_contents) + update_icon() return TRUE for(var/obj/item/O in src) @@ -195,6 +216,8 @@ O.forceMove(drop_location()) adjust_item_drop_location(O) desired-- + if (visible_contents) + update_icon() return TRUE return FALSE @@ -210,6 +233,7 @@ use_power = IDLE_POWER_USE idle_power_usage = 5 active_power_usage = 200 + visible_contents = FALSE var/drying = FALSE /obj/machinery/smartfridge/drying_rack/Initialize() @@ -414,6 +438,7 @@ name = "disk compartmentalizer" desc = "A machine capable of storing a variety of disks. Denoted by most as the DSU (disk storage unit)." icon_state = "disktoaster" + visible_contents = FALSE pass_flags = PASSTABLE /obj/machinery/smartfridge/disks/accept_check(obj/item/O) diff --git a/icons/obj/vending.dmi b/icons/obj/vending.dmi index e5d474f01d..553336115b 100644 Binary files a/icons/obj/vending.dmi and b/icons/obj/vending.dmi differ