Merge pull request #7133 from Citadel-Station-13/upstream-merge-38510

[MIRROR] Cleans up the chem synths jesus christ what the fuck
This commit is contained in:
LetterJay
2018-06-18 09:52:24 -05:00
committed by GitHub
4 changed files with 11 additions and 29 deletions

View File

@@ -5,44 +5,23 @@
icon_state = "dispenser"
amount = 10
resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | ACID_PROOF | LAVA_PROOF
working_state = null
nopower_state = null
flags_1 = NODECONSTRUCT_1
use_power = NO_POWER_USE
var/static/list/shortcuts = list(
"meth" = "methamphetamine",
"tricord" = "tricordrazine"
)
var/mutable_appearance/top_overlay
/obj/machinery/chem_dispenser/chem_synthesizer/Initialize()
. = ..()
GLOB.poi_list += src
top_overlay = mutable_appearance(icon, "disp_beaker", layer = ABOVE_ALL_MOB_LAYER)
update_icon()
/obj/machinery/chem_dispenser/chem_synthesizer/update_icon()
cut_overlays()
add_overlay(top_overlay)
/obj/machinery/chem_dispenser/chem_synthesizer/Destroy()
. = ..()
GLOB.poi_list -= src
QDEL_NULL(top_overlay)
/obj/machinery/chem_dispenser/chem_synthesizer/display_beaker()
return
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "chem_synthesizer", name, 390, 315, master_ui, state)
ui = new(user, src, ui_key, "chem_synthesizer", name, 390, 330, master_ui, state)
ui.open()
/obj/machinery/chem_dispenser/chem_synthesizer/ui_act(action, params)
if(..())
return
update_icon()
switch(action)
if("ejectBeaker")
if(beaker)
@@ -71,15 +50,18 @@
return
beaker = new /obj/item/reagent_containers/glass/beaker/bluespace(src)
visible_message("<span class='notice'>[src] dispenses a bluespace beaker.</span>")
if("amount")
var/input = input("Units to dispense", "Units") as num|null
if(input)
amount = input
update_icon()
/obj/machinery/chem_dispenser/chem_synthesizer/proc/find_reagent(input)
. = FALSE
if(GLOB.chemical_reagents_list[input]) //prefer IDs!
var/datum/reagent/R = GLOB.chemical_reagents_list[input]
if(R.can_synth_debug)
return input
return input
else
for(var/X in GLOB.chemical_reagents_list)
var/datum/reagent/R = GLOB.chemical_reagents_list[X]
if(R.can_synth_debug && input == replacetext(lowertext(R.name), " ", ""))
if(input == replacetext(lowertext(R.name), " ", ""))
return X

View File

@@ -21,7 +21,6 @@
var/volume = 0
var/color = "#000000" // rgb: 0, 0, 0
var/can_synth = TRUE // can this reagent be synthesized? (for example: odysseus syringe gun)
var/can_synth_debug = TRUE // can this reagent be synthesized by the debug chem synthesizer?
var/metabolization_rate = REAGENTS_METABOLISM //how fast the reagent is metabolized by the mob
var/overrides_metab = 0
var/overdose_threshold = 0

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@
<ui-section>
<ui-button icon='eject' state='{{data.isBeakerLoaded ? null : "disabled"}}' action='ejectBeaker'>Eject</ui-button>
<ui-button icon='circle' state='{{data.isBeakerLoaded ? null : "disabled"}}' action='input'>Input</ui-button>
<ui-button icon='circle' state='{{data.isBeakerLoaded ? null : "disabled"}}' action='amount'>{{data.amount}}U</ui-button>
<ui-button icon='plus' state='{{data.isBeakerLoaded ? "disabled" : null}}' action='makecup'>Create Beaker</ui-button>
</ui-section>
</ui-display>