From c270354fe7eab10d1f2db4a3bd8614fad8f796eb Mon Sep 17 00:00:00 2001
From: FartMaster69420 <78667902+FartMaster69420@users.noreply.github.com>
Date: Wed, 4 May 2022 14:18:57 -0400
Subject: [PATCH] Autoclose the panel
So people can't leave a cocoon and keep changing.
---
code/game/objects/items/weapons/storage/egg_vr.dm | 2 ++
.../species/station/station_special_abilities_vr.dm | 3 ++-
code/modules/tgui/modules/appearance_changer_vr.dm | 10 ++++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/code/game/objects/items/weapons/storage/egg_vr.dm b/code/game/objects/items/weapons/storage/egg_vr.dm
index 0adb9533bf5..97da55c4ff0 100644
--- a/code/game/objects/items/weapons/storage/egg_vr.dm
+++ b/code/game/objects/items/weapons/storage/egg_vr.dm
@@ -35,6 +35,8 @@
animate_shake()
drop_contents()
icon = open_egg_icon
+ if(user.transforming)
+ user.transforming = FALSE
/obj/item/weapon/storage/vore_egg/proc/animate_shake()
var/init_px = pixel_x
diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm
index 97a3cd7cdc6..34a70546435 100644
--- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm
+++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm
@@ -1050,7 +1050,8 @@
if(do_after(src, 25, exclusive = TASK_USER_EXCLUSIVE))
var/obj/item/weapon/storage/vore_egg/bugcocoon/C = new(loc)
forceMove(C)
- var/datum/tgui_module/appearance_changer/V = new(src, src)
+ transforming = TRUE
+ var/datum/tgui_module/appearance_changer/cocoon/V = new(src, src)
V.tgui_interact(src)
var/mob_holder_type = src.holder_type || /obj/item/weapon/holder
diff --git a/code/modules/tgui/modules/appearance_changer_vr.dm b/code/modules/tgui/modules/appearance_changer_vr.dm
index d5ace1b7e7c..8ae0ffe9bf3 100644
--- a/code/modules/tgui/modules/appearance_changer_vr.dm
+++ b/code/modules/tgui/modules/appearance_changer_vr.dm
@@ -43,3 +43,13 @@
if(APPEARANCECHANGER_CHANGED_EYES)
to_chat(M, "You feel lightheaded and drowsy...")
to_chat(O, "You feel warm as you make subtle changes to your captive's body.")
+
+// Cocoon Stuff
+/datum/tgui_module/appearance_changer/cocoon
+ name ="Appearance Editor (Cocoon)"
+
+/datum/tgui_module/appearance_changer/cocoon/tgui_status(mob/user, datum/tgui_state/state)
+ //if(!istype(owner.loc, /obj/item/weapon/storage/vore_egg/bugcocoon))
+ if(!owner.transforming)
+ return STATUS_CLOSE
+ return ..()
\ No newline at end of file