mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-07 06:48:44 +00:00
* Ice cream vat uses a radial menu (#80965) ## About The Pull Request Removes the ice cream vat's html window for ice cream, reagents, and cones and replaces it with a radial menu and the ability to simply examine the machine to see its contents. Soup and Salads currently allow you to see whats inside without the need for science/bar goggles, so following that theme I thought it would make more sense for it to also be the case here (and for feature parity with previous behavior). #### Controls Left-click chooses ice cream flavor or ice cream cone Right-click swaps between which one you will be choosing from Left click with a beaker will put it inside to use for custom ingredients Right click with a beaker will transfer its reagents to the machine (any that is used for making ice cream) Dispensing custom ice cream takes from the beaker inside of the beaker Video demonstration https://github.com/tgstation/tgstation/assets/53777086/9ebdcb13-b29f-4b3c-9d5f-54be1f6da888 Custom Ice cream https://github.com/tgstation/tgstation/assets/53777086/687af270-14e4-4851-bf1f-3c4da4aeb21f ## Why It's Good For The Game The ice cream machine is genuinely confusing because of it's UI and personally it was unironically the last kitchen tool I learned because I just didn't think it was worth it. This makes it feel way better to use. It also helps me with https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA which I've been trying to chisel away at. ## Changelog 🆑 refactor: Ice cream vats now use a radial menu instead of an HTML one. /🆑 * Ice cream vat uses a radial menu --------- Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
115 lines
4.3 KiB
Plaintext
115 lines
4.3 KiB
Plaintext
/atom
|
|
///If non-null, overrides a/an/some in all cases
|
|
var/article
|
|
|
|
/**
|
|
* Called when a mob examines (shift click or verb) this atom
|
|
*
|
|
* Default behaviour is to get the name and icon of the object and it's reagents where
|
|
* the [TRANSPARENT] flag is set on the reagents holder
|
|
*
|
|
* Produces a signal [COMSIG_ATOM_EXAMINE]
|
|
*/
|
|
/atom/proc/examine(mob/user)
|
|
var/examine_string = get_examine_string(user, thats = TRUE)
|
|
if(examine_string)
|
|
. = list("[examine_string].", EXAMINE_SECTION_BREAK) // SKYRAT EDIT CHANGE
|
|
else
|
|
. = list()
|
|
|
|
. += get_name_chaser(user)
|
|
if(desc)
|
|
. += desc
|
|
|
|
if(custom_materials)
|
|
// SKYRAT EDIT ADDITION BEGIN - HR sections
|
|
if(length(custom_materials) > 1)
|
|
. += EXAMINE_SECTION_BREAK //SKYRAT EDIT ADDITION
|
|
//SKYRAT EDIT ADDITION END
|
|
var/list/materials_list = list()
|
|
for(var/custom_material in custom_materials)
|
|
var/datum/material/current_material = GET_MATERIAL_REF(custom_material)
|
|
materials_list += "[current_material.name]"
|
|
. += "<u>It is made out of [english_list(materials_list)]</u>."
|
|
// SKYRAT EDIT ADDITION BEGIN - HR sections
|
|
if(length(custom_materials) > 1)
|
|
. += EXAMINE_SECTION_BREAK //SKYRAT EDIT ADDITION
|
|
//SKYRAT EDIT ADDITION END
|
|
|
|
if(reagents)
|
|
var/user_sees_reagents = user.can_see_reagents()
|
|
var/reagent_sigreturn = SEND_SIGNAL(src, COMSIG_ATOM_REAGENT_EXAMINE, user, ., user_sees_reagents)
|
|
if(!(reagent_sigreturn & STOP_GENERIC_REAGENT_EXAMINE))
|
|
if(reagents.flags & TRANSPARENT)
|
|
if(reagents.total_volume)
|
|
. += "It contains <b>[reagents.total_volume]</b> units of various reagents[user_sees_reagents ? ":" : "."]"
|
|
if(user_sees_reagents || (reagent_sigreturn & ALLOW_GENERIC_REAGENT_EXAMINE)) //Show each individual reagent for detailed examination
|
|
for(var/datum/reagent/current_reagent as anything in reagents.reagent_list)
|
|
. += "• [round(current_reagent.volume, CHEMICAL_VOLUME_ROUNDING)] units of [current_reagent.name]"
|
|
if(reagents.is_reacting)
|
|
. += span_warning("It is currently reacting!")
|
|
. += span_notice("The solution's pH is [round(reagents.ph, 0.01)] and has a temperature of [reagents.chem_temp]K.")
|
|
|
|
else
|
|
. += "It contains:<br>Nothing."
|
|
else if(reagents.flags & AMOUNT_VISIBLE)
|
|
if(reagents.total_volume)
|
|
. += span_notice("It has [reagents.total_volume] unit\s left.")
|
|
else
|
|
. += span_danger("It's empty.")
|
|
|
|
SEND_SIGNAL(src, COMSIG_ATOM_EXAMINE, user, .)
|
|
|
|
/**
|
|
* Called when a mob examines (shift click or verb) this atom twice (or more) within EXAMINE_MORE_WINDOW (default 1 second)
|
|
*
|
|
* This is where you can put extra information on something that may be superfluous or not important in critical gameplay
|
|
* moments, while allowing people to manually double-examine to take a closer look
|
|
*
|
|
* Produces a signal [COMSIG_ATOM_EXAMINE_MORE]
|
|
*/
|
|
/atom/proc/examine_more(mob/user)
|
|
SHOULD_CALL_PARENT(TRUE)
|
|
RETURN_TYPE(/list)
|
|
|
|
. = list()
|
|
SEND_SIGNAL(src, COMSIG_ATOM_EXAMINE_MORE, user, .)
|
|
SEND_SIGNAL(user, COMSIG_MOB_EXAMINING_MORE, src, .)
|
|
|
|
/**
|
|
* Get the name of this object for examine
|
|
*
|
|
* You can override what is returned from this proc by registering to listen for the
|
|
* [COMSIG_ATOM_GET_EXAMINE_NAME] signal
|
|
*/
|
|
/atom/proc/get_examine_name(mob/user)
|
|
. = "\a <b>[src]</b>"
|
|
var/list/override = list(gender == PLURAL ? "some" : "a", " ", "[name]")
|
|
if(article)
|
|
. = "[article] <b>[src]</b>"
|
|
override[EXAMINE_POSITION_ARTICLE] = article
|
|
if(SEND_SIGNAL(src, COMSIG_ATOM_GET_EXAMINE_NAME, user, override) & COMPONENT_EXNAME_CHANGED)
|
|
. = override.Join("")
|
|
|
|
///Generate the full examine string of this atom (including icon for goonchat)
|
|
/atom/proc/get_examine_string(mob/user, thats = FALSE)
|
|
return "[icon2html(src, user)] [thats? "That's ":""][get_examine_name(user)]"
|
|
|
|
/**
|
|
* Returns an extended list of examine strings for any contained ID cards.
|
|
*
|
|
* Arguments:
|
|
* * user - The user who is doing the examining.
|
|
*/
|
|
/atom/proc/get_id_examine_strings(mob/user)
|
|
. = list()
|
|
return
|
|
|
|
///Used to insert text after the name but before the description in examine()
|
|
/atom/proc/get_name_chaser(mob/user, list/name_chaser = list())
|
|
return name_chaser
|
|
|
|
/// Used by mobs to determine the name for someone wearing a mask, or with a disfigured or missing face. By default just returns the atom's name. add_id_name will control whether or not we append "(as [id_name])".
|
|
/atom/proc/get_visible_name(add_id_name)
|
|
return name
|