[MIRROR] Kitchen UI Update (#9567)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2024-11-30 06:58:59 -07:00
committed by GitHub
parent f9843e1ddf
commit 08156ced8c
10 changed files with 256 additions and 51 deletions

View File

@@ -43,6 +43,11 @@
var/combine_first = FALSE // If TRUE, this appliance will do combination cooking before checking recipes
var/food_safety = FALSE //RS ADD - If true, the appliance automatically ejects food instead of burning it
var/static/radial_eject = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_eject")
var/static/radial_power = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_power")
var/static/radial_safety = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_safety")
var/static/radial_output = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_change_output")
/obj/machinery/appliance/Initialize()
. = ..()
@@ -611,8 +616,31 @@
if(..())
return
if(cooking_objs.len)
removal_menu(user)
interact(user)
/obj/machinery/appliance/interact(mob/user)
var/list/options = list(
"power" = radial_power,
"safety" = radial_safety,
)
if(LAZYLEN(cooking_objs))
options["remove"] = radial_eject
if(LAZYLEN(output_options))
options["select_output"] = radial_output
var/choice = show_radial_menu(user, src, options, require_near = !issilicon(user))
switch(choice)
if("power")
toggle_power()
if("safety")
toggle_safety()
if("remove")
removal_menu(user)
if("select_output")
choose_output()
/obj/machinery/appliance/proc/removal_menu(var/mob/user)
if (can_remove_items(user))

View File

@@ -26,11 +26,15 @@
/obj/machinery/appliance/cooker/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = !(stat & POWEROFF)
data["safety"] = food_safety
data["temperature"] = round(temperature - T0C, 0.1)
data["optimalTemp"] = round(optimal_temp - T0C, 0.1)
data["temperatureEnough"] = temperature >= min_temp
data["efficiency"] = round(get_efficiency(), 0.1)
data["containersRemovable"] = can_remove_items(user, show_warning = FALSE)
data["selected_option"] = selected_option
data["show_selected_option"] = LAZYLEN(output_options)
var/list/our_contents = list()
for(var/i in 1 to max_contents)
@@ -56,6 +60,15 @@
return TRUE
switch(action)
if("toggle_power")
attempt_toggle_power(usr)
return TRUE
if("toggle_safety")
toggle_safety()
return TRUE
if("change_output")
choose_output()
return TRUE
if("slot")
var/slot = params["slot"]
var/obj/item/I = usr.get_active_hand()