Files
7d058fc613 Jukebox TGUI update, Earphones autoplay, sound keys refactor (#21630)
V2 of [previous music playing
PR](https://github.com/Aurorastation/Aurora.3/pull/21466). TLDR no
longer uses the connect_range component for implementation because it
turned out a bit too inflexible for overlapping music players.

Removes a NanoUI template for the [TGUI
update](https://github.com/Aurorastation/Aurora.3/pull/21046).

New changelog:
  - refactor: "Ported Jukebox's NanoUI interface to TGUI."
- refactor: "Ported Jukebox audio playing functionality to a component."
- refactor: "Sound keys refactored from singletons to datums, along with
larger breakout of sound.dm to allow for easier SFX updates in future."
  - code_imp: "Expanded track datums to include track lengths."
- code_imp: "Reorganized music file folders for more intuitive access."
  - rscadd: "Earphone status feedback text now includes track length."
  - rscadd: "Added autoplay functionality to earphones."
- bugfix: "Fixed earphones' 'Previous Song' verb not sending you to the
end of the playlist when used while the first track is selected."
- bugfix: "Fixed gain adjustment for 'Konyang-1' (-23 dB -> standard
-9.8 dB)."
- bugfix: "Fixed y-offset of audioconsole-running overlay animation to
line up with the actual screen."

---------

Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2026-01-22 16:54:40 +00:00

91 lines
3.2 KiB
Plaintext

/obj/machinery/portable_atmospherics/hydroponics/soil
name = "soil"
desc = "A mound of earth. You could plant some seeds here."
icon_state = "soil"
density = FALSE
use_power = POWER_USE_OFF
mechanical = FALSE
tray_light = 0
/// Water level begins at zero.
waterlevel = 0
/// Nutrient level begins at zero. Soil's hard mode, baby.
nutrilevel = 0
/// Retains the ability for soil to grow weeds, as it should.
maxWeedLevel = 10
/// TODO: Really need to just merge this with its parent proc, this is all duplicated.
/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(obj/item/attacking_item, mob/user)
//A special case for if the container has only water, for manual watering with buckets
if (istype(attacking_item, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RC = attacking_item
if (LAZYLEN(RC.reagents.reagent_volumes) == 1)
if (RC.reagents.has_reagent(/singleton/reagent/water, 1))
if (waterlevel < maxWaterLevel)
var/amountToRemove = min((maxWaterLevel - waterlevel), RC.reagents.total_volume)
RC.reagents.remove_reagent(/singleton/reagent/water, amountToRemove, 1)
waterlevel += amountToRemove
user.visible_message("[user] pours [amountToRemove]u of water into the soil."," You pour [amountToRemove]u of water into the soil.")
playsound(src, SFX_POUR, 25, 1)
else
to_chat(user, "The soil is saturated with water already.")
return 1
if(istype(attacking_item, /obj/item/tank))
return
if(istype(attacking_item, /obj/item/shovel))
if(attacking_item.use_tool(src, user, 50, volume = 50))
new /obj/item/stack/material/sandstone{amount = 3}(loc)
to_chat(user, SPAN_NOTICE("You remove the soil from the bed and dismantle the sandstone base."))
playsound(src, 'sound/effects/stonedoor_openclose.ogg', 40, 1)
qdel(src)
else
..()
/* Holder for vine plants.
Icons for plants are generated as overlays, so setting it to invisible wouldn't work.
Hence using a blank icon. */
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible
name = "plant"
desc = null
icon = 'icons/obj/seeds.dmi'
icon_state = "blank"
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Initialize(var/newloc,var/datum/seed/newseed,var/start_mature)
. = ..()
seed = newseed
dead = 0
age = start_mature ? GET_SEED_TRAIT(seed, TRAIT_MATURATION) : 1
health = GET_SEED_TRAIT(seed, TRAIT_ENDURANCE)
lastcycle = world.time
pixel_y = rand(-5,5)
waterlevel = 100
nutrilevel = 100
check_health()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/remove_dead()
..()
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
..()
if(!seed) // Repeat harvests are a thing.
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die()
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process()
if(!seed)
qdel(src)
return
else if(name=="plant")
name = seed.display_name
..()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Destroy()
// Check if we're masking a decal that needs to be visible again.
for(var/obj/effect/plant/plant in get_turf(src))
if(plant.invisibility == INVISIBILITY_MAXIMUM)
plant.set_invisibility(initial(plant.invisibility))
return ..()