diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index 6c6f0ca142f..9ec31f6fe8b 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -8,6 +8,7 @@
volume = 100
var/mechanical = 1 // Set to 0 to stop it from drawing the alert lights.
+ var/base_name = "tray"
// Plant maintenance vars.
var/waterlevel = 100 // Water (max 100)
@@ -19,7 +20,7 @@
var/dead = 0 // Is it dead?
var/harvest = 0 // Is it ready to harvest?
var/age = 0 // Current plant age
- var/sampled = 0 // Have wa taken a sample?
+ var/sampled = 0 // Have we taken a sample?
// Harvest/mutation mods.
var/yield_mod = 0 // Modifier to yield
@@ -35,6 +36,7 @@
var/closed_system // If set, the tray will attempt to take atmos from a pipe.
var/force_update // Set this to bypass the cycle time check.
var/obj/temp_chem_holder // Something to hold reagents during process_reagents()
+ var/labelled
// Seed details/line data.
var/datum/seed/seed = null // The currently planted seed
@@ -120,6 +122,12 @@
"mutagen" = 15
)
+/obj/machinery/portable_atmospherics/hydroponics/AltClick()
+ if(mechanical && !usr.stat && !usr.lying && Adjacent(usr))
+ close_lid(usr)
+ return
+ return ..()
+
/obj/machinery/portable_atmospherics/hydroponics/attack_generic(var/mob/user)
if(istype(user,/mob/living/carbon/alien/diona))
var/mob/living/carbon/alien/diona/nymph = user
@@ -139,15 +147,13 @@
nymph.visible_message("[nymph] rolls around in [src] for a bit.","You roll around in [src] for a bit.")
return
-/obj/machinery/portable_atmospherics/hydroponics/proc/can_label()
- return 1
-
/obj/machinery/portable_atmospherics/hydroponics/New()
..()
temp_chem_holder = new()
temp_chem_holder.create_reagents(10)
create_reagents(200)
- connect()
+ if(mechanical)
+ connect()
update_icon()
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
@@ -329,6 +335,22 @@
return
+/obj/machinery/portable_atmospherics/hydroponics/verb/remove_label()
+
+ set name = "Remove Label"
+ set category = "Object"
+ set src in view(1)
+
+ if(labelled)
+ usr << "You remove the label."
+ labelled = null
+ update_icon()
+ else
+ usr << "There is no label to remove."
+ return
+
+/obj/machinery/portable_atmospherics/hydroponics/verb/set_light()
+
/obj/machinery/portable_atmospherics/hydroponics/proc/check_level_sanity()
//Make sure various values are sane.
if(seed)
@@ -527,27 +549,29 @@
..()
+ if(!seed)
+ usr << "[src] is empty."
+ return
+
+ usr << "[seed.display_name] are growing here."
+
if(!Adjacent(usr))
return
- if(seed)
- usr << "[src] has [seed.display_name] planted."
- if(dead)
- usr << "The plant is dead."
- else if(health <= (seed.get_trait(TRAIT_ENDURANCE)/ 2))
- usr << "The plant looks unhealthy."
- else
- usr << "[src] is empty."
usr << "Water: [round(waterlevel,0.1)]/100"
usr << "Nutrient: [round(nutrilevel,0.1)]/10"
if(weedlevel >= 5)
- usr << "[src] is infested with weeds!"
+ usr << "\The [src] is infested with weeds!"
if(pestlevel >= 5)
- usr << "[src] is infested with tiny worms!"
+ usr << "\The [src] is infested with tiny worms!"
+
+ if(dead)
+ usr << "The plant is dead."
+ else if(health <= (seed.get_trait(TRAIT_ENDURANCE)/ 2))
+ usr << "The plant looks unhealthy."
if(mechanical)
-
var/turf/T = loc
var/datum/gas_mixture/environment
@@ -571,14 +595,16 @@
usr << "The tray's sensor suite is reporting a light level of [light_available] lumens and a temperature of [environment.temperature]K."
-/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid()
+/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb()
set name = "Toggle Tray Lid"
set category = "Object"
set src in view(1)
+ close_lid(usr)
- if(!usr || usr.stat || usr.restrained())
+/obj/machinery/portable_atmospherics/hydroponics/proc/close_lid(var/mob/living/user)
+ if(!user || user.stat || user.restrained())
return
closed_system = !closed_system
- usr << "You [closed_system ? "close" : "open"] the tray's lid."
+ user << "You [closed_system ? "close" : "open"] the tray's lid."
update_icon()
diff --git a/code/modules/hydroponics/trays/tray_soil.dm b/code/modules/hydroponics/trays/tray_soil.dm
index 087c8acd9d3..abcf137e39f 100644
--- a/code/modules/hydroponics/trays/tray_soil.dm
+++ b/code/modules/hydroponics/trays/tray_soil.dm
@@ -13,10 +13,8 @@
/obj/machinery/portable_atmospherics/hydroponics/soil/New()
..()
- verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid
-
-/obj/machinery/portable_atmospherics/hydroponics/soil/can_label()
- return 0
+ verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb
+ verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/remove_label
/obj/machinery/portable_atmospherics/hydroponics/soil/CanPass()
return 1
diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm
index c0ff8cb0f2b..de66f4297e6 100644
--- a/code/modules/hydroponics/trays/tray_update_icons.dm
+++ b/code/modules/hydroponics/trays/tray_update_icons.dm
@@ -1,8 +1,18 @@
//Refreshes the icon and sets the luminosity
/obj/machinery/portable_atmospherics/hydroponics/update_icon()
+ // Update name.
+ if(seed)
+ if(mechanical)
+ name = "[base_name] (#[seed.uid])"
+ else
+ name = "[seed.seed_name]"
+ else
+ name = initial(name)
+
+ if(labelled)
+ name += " ([labelled])"
overlays.Cut()
-
// Updates the plant overlay.
if(!isnull(seed))
diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm
index fe519e01d4b..5006af6cc3e 100644
--- a/code/modules/paperwork/handlabeler.dm
+++ b/code/modules/paperwork/handlabeler.dm
@@ -6,12 +6,12 @@
var/label = null
var/labels_left = 30
var/mode = 0 //off or on.
-
+
/obj/item/weapon/hand_labeler/attack()
return
/obj/item/weapon/hand_labeler/afterattack(atom/A, mob/user as mob, proximity)
- if(!proximity)
+ if(!proximity)
return
if(!mode) //if it's off, give up.
return
@@ -39,6 +39,14 @@
if(istype(A, /obj/item/weapon/reagent_containers/glass))
user << "The label can't stick to the [A.name]. (Try using a pen)"
return
+ if(istype(A, /obj/machinery/portable_atmospherics/hydroponics))
+ var/obj/machinery/portable_atmospherics/hydroponics/tray = A
+ if(!tray.mechanical)
+ user << "How are you going to label that?"
+ return
+ tray.labelled = label
+ spawn(1)
+ tray.update_icon()
user.visible_message("[user] labels [A] as [label].", \
"You label [A] as [label].")