Files
Bubberstation/code/modules/wiremod/shell/controller.dm
Andrew 0818d6ae4c Crafting/Cooking menu update (#71779)
## About The Pull Request

Updated crafting menu, adding a lot of new functions and recipes that
were not in the crafting menu before.

<img alt="cult"
src="https://user-images.githubusercontent.com/3625094/206009533-aec3a1dd-cbe5-45eb-8515-1b75fabb65c5.PNG">

<img alt="nH77dLyyGx"
src="https://user-images.githubusercontent.com/3625094/206009786-b6706f70-0599-40bf-b051-8f499de43abd.png">


![image](https://user-images.githubusercontent.com/3625094/206623881-12d8abfc-de5e-458e-a01c-3daac8dbe9bd.png)


https://user-images.githubusercontent.com/3625094/206009841-738e4a03-0660-45b7-8d83-15eeb6501967.mp4

## Why It's Good For The Game

It is easier to use, and it has a lot of recipes that were spread
throughout the game, some of which weren't even on the wiki.
Crafting and cooking now count about 1200 recipes in total, including
conditionally available ones.

## Changelog

🆑
qol: Rewrote the crafting/cooking menu UI
qol: Split crafting and cooking menus in two different menus
qol: Crafting is no longer blocking the entire UI, only the "Make"
buttons are disabled
qol: Added stack crafting recipes to the crafting menu
qol: Added cooking recipes that were absent in the crafting menu before
(tool recipes, machine recipes, reactions)
qol: Added option to search recipes by title
qol: Added option to filter recipes by required materials/ingredients
qol: Added food types to the cooking menu, highlighting diet of your
species (liked, disliked foods)
qol: Added total nutrition value of the result to the cooking menu
qol: Added option to filter cooking recipes by the food type of the
resulting food
qol: Added "Can make" category that lists all currently craftable
recipes throughout all categories
refactor: changed categories and reshuffled some items in them
code: Reagents now have default container to get an icon from the
reagent datum
code: Objects now have `desc_controls` var for OOC information about
mouse controls that are visible on examine, but not in the description
fix: Fixed alignment on many food icons
fix: Fixed missing icon for beef stroganoff
/🆑

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-12-25 12:27:49 -08:00

89 lines
3.0 KiB
Plaintext

/**
* # Compact Remote
*
* A handheld device with several buttons.
* In game, this translates to having different signals for normal usage, alt-clicking, and ctrl-clicking when in your hand.
*/
/obj/item/controller
name = "controller"
icon = 'icons/obj/wiremod.dmi'
icon_state = "setup_small_calc"
inhand_icon_state = "electronic"
worn_icon_state = "electronic"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
light_system = MOVABLE_LIGHT_DIRECTIONAL
light_on = FALSE
/obj/item/controller/Initialize(mapload)
. = ..()
AddComponent(/datum/component/shell, list(
new /obj/item/circuit_component/controller()
), SHELL_CAPACITY_MEDIUM)
/obj/item/circuit_component/controller
display_name = "Controller"
desc = "Used to receive inputs from the controller shell. Use the shell in hand to trigger the output signal."
desc_controls = "Alt-click for the alternate signal. Right click for the extra signal."
/// The three separate buttons that are called in attack_hand on the shell.
var/datum/port/output/signal
var/datum/port/output/alt
var/datum/port/output/right
/// The entity output
var/datum/port/output/entity
/obj/item/circuit_component/controller/populate_ports()
entity = add_output_port("User", PORT_TYPE_ATOM)
signal = add_output_port("Signal", PORT_TYPE_SIGNAL)
alt = add_output_port("Alternate Signal", PORT_TYPE_SIGNAL)
right = add_output_port("Extra Signal", PORT_TYPE_SIGNAL)
/obj/item/circuit_component/controller/register_shell(atom/movable/shell)
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF, PROC_REF(send_trigger))
RegisterSignal(shell, COMSIG_CLICK_ALT, PROC_REF(send_alternate_signal))
RegisterSignal(shell, COMSIG_ITEM_ATTACK_SELF_SECONDARY, PROC_REF(send_right_signal))
/obj/item/circuit_component/controller/unregister_shell(atom/movable/shell)
UnregisterSignal(shell, list(
COMSIG_ITEM_ATTACK_SELF,
COMSIG_ITEM_ATTACK_SELF_SECONDARY,
COMSIG_CLICK_ALT,
))
/**
* Called when the shell item is used in hand
*/
/obj/item/circuit_component/controller/proc/send_trigger(atom/source, mob/user)
SIGNAL_HANDLER
if(!user.Adjacent(source))
return
source.balloon_alert(user, "clicked primary button")
playsound(source, get_sfx(SFX_TERMINAL_TYPE), 25, FALSE)
entity.set_output(user)
signal.set_output(COMPONENT_SIGNAL)
/**
* Called when the shell item is alt-clicked
*/
/obj/item/circuit_component/controller/proc/send_alternate_signal(atom/source, mob/user)
SIGNAL_HANDLER
if(!user.Adjacent(source))
return
source.balloon_alert(user, "clicked alternate button")
playsound(source, get_sfx(SFX_TERMINAL_TYPE), 25, FALSE)
entity.set_output(user)
alt.set_output(COMPONENT_SIGNAL)
/**
* Called when the shell item is right-clicked in active hand
*/
/obj/item/circuit_component/controller/proc/send_right_signal(atom/source, mob/user)
SIGNAL_HANDLER
if(!user.Adjacent(source))
return
source.balloon_alert(user, "clicked extra button")
playsound(source, get_sfx(SFX_TERMINAL_TYPE), 25, FALSE)
entity.set_output(user)
right.set_output(COMPONENT_SIGNAL)