mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-21 12:05:28 +01:00
Food Synthesizers (#19569)
* Food Synthesizers
Initial port, need to figure out what madness you people have done to tgui... and sprite sheets.
At this moment, it compiles but I haven't tested it yet. Too eepy
* iconforge spritesheet nonsense
* Cleaning up tgui menu
full disclosure, After six plus hours of trying to figure out how to do the spritesheets and the tgui stuff I just gave up on this particular bit and threw it into Gemini for a looksie over.
As it's originally my code I figure it's worth at least a reasonable proof read. The side-by-side comparison is pretty wild.
* Passes tgu-lint building
* Appease Gripe err Grep checks
* Oh these for the grep as well whoops
* Sorts out the backend
also piss off linter check, it's COMMENTED OUT aaaaaaaaaa.
* changes from will
* changes from will and some UI splitting, needs proper testing and final adjustments
* passadata
* .
* can be combined
* .
* ml={1}
* id
* Crew category
* id handling
* .
* more cleanup
* smaller cleanup
* why not
* deps up, minor tgui core fix
* timer
* .
* .
* missed to put that back
* order
* this
* Change preference category for foodsynth cookies
* Enforce south facement for cookie image
* Maurice I am no longer asking
* .
---------
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
//Totally not just a blatant copypasta. Nooooo...
|
||||
/datum/wires/synthesizer
|
||||
holder_type = /obj/machinery/synthesizer
|
||||
wire_count = 6
|
||||
proper_name = "Food Synthesizer"
|
||||
|
||||
/datum/wires/synthesizer/New(atom/_holder)
|
||||
wires = list(WIRE_LATHE_HACK, WIRE_ELECTRIFY, WIRE_LATHE_DISABLE)
|
||||
var/obj/machinery/synthesizer/A = _holder
|
||||
if(A.hacked)
|
||||
cut_wires += WIRE_LATHE_HACK
|
||||
return ..()
|
||||
|
||||
/datum/wires/synthesizer/get_status()
|
||||
. = ..()
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
. += "The red light is [A.disabled ? "off" : "on"]."
|
||||
. += "The green light is [A.shocked ? "off" : "on"]."
|
||||
. += "The blue light is [A.hacked ? "off" : "on"]."
|
||||
|
||||
/datum/wires/synthesizer/interactable(mob/user)
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
if(A.panel_open)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/wires/synthesizer/on_cut(wire, mend)
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_LATHE_HACK)
|
||||
A.hacked = !mend
|
||||
A.update_tgui_static_data(usr)
|
||||
if(WIRE_ELECTRIFY)
|
||||
A.shocked = !mend
|
||||
if(WIRE_LATHE_DISABLE)
|
||||
A.disabled = !mend
|
||||
..()
|
||||
|
||||
/datum/wires/synthesizer/on_pulse(wire)
|
||||
if(is_cut(wire))
|
||||
return
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_LATHE_HACK)
|
||||
A.hacked = !A.hacked
|
||||
A.update_tgui_static_data(usr)
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_hacked), WIRE_LATHE_HACK, usr), 5 SECONDS)
|
||||
if(WIRE_ELECTRIFY)
|
||||
A.shocked = !A.shocked
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_electrify), WIRE_ELECTRIFY), 5 SECONDS)
|
||||
if(WIRE_LATHE_DISABLE)
|
||||
A.disabled = !A.disabled
|
||||
addtimer(CALLBACK(src, PROC_REF(reset_disable), WIRE_LATHE_DISABLE), 5 SECONDS)
|
||||
|
||||
/datum/wires/synthesizer/proc/reset_hacked(wire, mob/user)
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
if(A && !is_cut(wire))
|
||||
A.hacked = FALSE
|
||||
A.update_tgui_static_data(user)
|
||||
|
||||
/datum/wires/synthesizer/proc/reset_electrify(wire)
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
if(A && !is_cut(wire))
|
||||
A.shocked = FALSE
|
||||
|
||||
/datum/wires/synthesizer/proc/reset_disable(wire)
|
||||
var/obj/machinery/synthesizer/A = holder
|
||||
if(A && !is_cut(wire))
|
||||
A.disabled = FALSE
|
||||
Reference in New Issue
Block a user