mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
ChemMaster UI tweaks (#16733)
* change+changelog * amazin' * bruhndle * move defines
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
// Update asset_cache.dm if you change these.
|
||||
#define BOTTLE_SPRITES list("bottle-1", "bottle-2", "bottle-3", "bottle-4", "bottle-5", "bottle-6") //list of available bottle sprites
|
||||
|
||||
#define CHEMMASTER_BOTTLE_SOUND playsound(src, 'sound/items/pickup/bottle.ogg', 75, 1)
|
||||
#define CHEMMASTER_DISPENSE_SOUND playsound(src, 'sound/machines/reagent_dispense.ogg', 75, 1)
|
||||
#define CHEMMASTER_CHANGESETTINGS_SOUND playsound(src, 'sound/machines/slide_change.ogg', 75, 1)
|
||||
#define CHEMMASTER_SWITCH_SOUND playsound(src, 'sound/machines/switch1.ogg', 75, 1)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -45,6 +49,7 @@
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/chem_master/attackby(var/obj/item/B, mob/user)
|
||||
|
||||
if(istype(B, /obj/item/reagent_containers/glass))
|
||||
@@ -60,6 +65,7 @@
|
||||
to_chat(user, "You add the beaker to the machine!")
|
||||
src.updateUsrDialog()
|
||||
icon_state = "mixer1"
|
||||
CHEMMASTER_BOTTLE_SOUND
|
||||
|
||||
else if(istype(B, /obj/item/storage/pill_bottle))
|
||||
if(condi)
|
||||
@@ -153,12 +159,15 @@
|
||||
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/chem_master/ui_act(action, params)
|
||||
. = ..()
|
||||
|
||||
if(.)
|
||||
return
|
||||
|
||||
playsound(src, 'sound/machines/button3.ogg', 75, 1) //Buttons clicky
|
||||
|
||||
if(action == "ejectp")
|
||||
if(loaded_pill_bottle)
|
||||
if(Adjacent(usr))
|
||||
@@ -185,8 +194,9 @@
|
||||
analysis["DNA"] = Gdata["blood_DNA"]
|
||||
else if(params["name"] == "Close")
|
||||
analysis = list()
|
||||
|
||||
CHEMMASTER_SWITCH_SOUND
|
||||
return TRUE
|
||||
|
||||
else if(action == "add")
|
||||
if(params["amount"])
|
||||
var/rtype = text2path(params["add"])
|
||||
@@ -213,10 +223,12 @@
|
||||
beaker = null
|
||||
reagents.clear_reagents()
|
||||
icon_state = "mixer0"
|
||||
CHEMMASTER_BOTTLE_SOUND
|
||||
return TRUE
|
||||
|
||||
if (action == "toggle")
|
||||
mode = !mode
|
||||
CHEMMASTER_CHANGESETTINGS_SOUND
|
||||
return TRUE
|
||||
|
||||
else if(action == "createbottle")
|
||||
@@ -233,6 +245,7 @@
|
||||
else
|
||||
var/obj/item/reagent_containers/food/condiment/P = new/obj/item/reagent_containers/food/condiment(get_turf(src))
|
||||
reagents.trans_to_obj(P,50)
|
||||
CHEMMASTER_BOTTLE_SOUND
|
||||
return TRUE
|
||||
|
||||
else if (action == "createpill" || action == "createpill_multiple")
|
||||
@@ -265,18 +278,22 @@
|
||||
reagents.trans_to_obj(P,amount_per_pill)
|
||||
if(src.loaded_pill_bottle)
|
||||
loaded_pill_bottle.insert_into_storage(P)
|
||||
CHEMMASTER_DISPENSE_SOUND
|
||||
return TRUE
|
||||
|
||||
else if(action == "pill_sprite")
|
||||
pillsprite = sanitizeSafe(params["pill_sprite"])
|
||||
CHEMMASTER_CHANGESETTINGS_SOUND
|
||||
return TRUE
|
||||
|
||||
else if(action == "bottle_sprite")
|
||||
bottlesprite = sanitizeSafe(params["bottle_sprite"])
|
||||
CHEMMASTER_CHANGESETTINGS_SOUND
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
|
||||
|
||||
/obj/machinery/chem_master/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
@@ -601,3 +618,8 @@
|
||||
|
||||
eject()
|
||||
detach()
|
||||
|
||||
#undef CHEMMASTER_DISPENSE_SOUND
|
||||
#undef CHEMMASTER_CHANGESETTINGS_SOUND
|
||||
#undef CHEMMASTER_SWITCH_SOUND
|
||||
#undef CHEMMASTER_BOTTLE_SOUND
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# maptweak
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
# balance
|
||||
# admin
|
||||
# backend
|
||||
# security
|
||||
# refactor
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: FluffyGhost
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- tweak: "Tweaked the new chemmaster UI and added some sounds to its operations."
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Section, Stack, Table, Flex, Box, Collapsible, LabeledList } from '../components';
|
||||
import { Button, Section, Stack, Table, Flex, Box, Collapsible, LabeledList, Divider } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export type DispenserData = {
|
||||
@@ -52,7 +52,8 @@ const ReagentFactory = (props, context) => {
|
||||
onClick={() => act('analyze', { name: 'Blood' })}
|
||||
/>
|
||||
) : null
|
||||
}>
|
||||
}
|
||||
mt="-3px">
|
||||
{quantities.map((quantity) => (
|
||||
<DispenseButton
|
||||
key={quantity}
|
||||
@@ -112,7 +113,7 @@ export const ChemMaster = (props, context) => {
|
||||
<Window
|
||||
title={data.machine_name}
|
||||
theme={data.is_condimaster ? 'idris' : 'zenghu'}>
|
||||
<Window.Content scrollable>
|
||||
<Window.Content scrollable fitted fontSize={0.95}>
|
||||
<Section
|
||||
title={data.machine_name}
|
||||
buttons={
|
||||
@@ -173,6 +174,7 @@ export const ChemMaster = (props, context) => {
|
||||
</Table.Row>
|
||||
</Table>
|
||||
</Section>
|
||||
<Divider />
|
||||
<Section title={data.machine_name.split(' ')[0] + ' Content'}>
|
||||
<Stack vertical>
|
||||
<Stack.Item>
|
||||
@@ -224,6 +226,7 @@ export const ChemMaster = (props, context) => {
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Section>
|
||||
<Divider />
|
||||
<Section title="Preferences">
|
||||
<Collapsible title="Bottle type">
|
||||
<Flex pt="10px" wrap="wrap" align="center">
|
||||
|
||||
Reference in New Issue
Block a user