[MIRROR] forward refs in usr dialog (#10115)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-02-08 16:06:42 -07:00
committed by GitHub
parent dd1e35202f
commit 90329c46d2
50 changed files with 229 additions and 202 deletions

View File

@@ -91,7 +91,7 @@
else
set_light(2, 2, emptycolor)
/obj/machinery/slime/extractor/proc/extract_cores()
/obj/machinery/slime/extractor/proc/extract_cores(mob/user)
if(!src.occupant)
src.visible_message("[icon2html(src,viewers(src))] [src] pings unhappily.")
else if(inuse)
@@ -99,31 +99,36 @@
inuse = 1
update_light_color()
spawn(30)
icon_state = "scanner_1old"
for(var/i=1 to occupant.cores)
var/obj/item/xenoproduct/slime/core/C = new(src)
C.traits = new()
occupant.traitdat.copy_traits(C.traits)
addtimer(CALLBACK(src, PROC_REF(do_extraction), user) , 3 SECONDS, TIMER_DELETE_ME)
C.nameVar = occupant.nameVar
/obj/machinery/slime/extractor/proc/do_extraction(mob/user)
PRIVATE_PROC(TRUE)
icon_state = "scanner_1old"
for(var/i=1 to occupant.cores)
var/obj/item/xenoproduct/slime/core/C = new(src)
C.traits = new()
occupant.traitdat.copy_traits(C.traits)
C.create_reagents(C.traits.traits[TRAIT_XENO_CHEMVOL])
for(var/reagent in occupant.traitdat.chems)
C.reagents.add_reagent(reagent, occupant.traitdat.chems[reagent])
C.nameVar = occupant.nameVar
C.color = C.traits.traits[TRAIT_XENO_COLOR]
if(occupant.traitdat.get_trait(TRAIT_XENO_BIOLUMESCENT))
C.set_light(occupant.traitdat.get_trait(TRAIT_XENO_GLOW_STRENGTH),occupant.traitdat.get_trait(TRAIT_XENO_GLOW_RANGE), occupant.traitdat.get_trait(TRAIT_XENO_BIO_COLOR))
C.create_reagents(C.traits.traits[TRAIT_XENO_CHEMVOL])
for(var/reagent in occupant.traitdat.chems)
C.reagents.add_reagent(reagent, occupant.traitdat.chems[reagent])
spawn(30)
icon_state = "scanner_0old"
qdel(occupant)
occupant = null //If qdel's being slow or acting up, let's make sure we can't make more cores from this one.
inuse = 0
eject_contents()
update_light_color()
src.updateUsrDialog()
C.color = C.traits.traits[TRAIT_XENO_COLOR]
if(occupant.traitdat.get_trait(TRAIT_XENO_BIOLUMESCENT))
C.set_light(occupant.traitdat.get_trait(TRAIT_XENO_GLOW_STRENGTH),occupant.traitdat.get_trait(TRAIT_XENO_GLOW_RANGE), occupant.traitdat.get_trait(TRAIT_XENO_BIO_COLOR))
qdel(occupant)
occupant = null //If qdel's being slow or acting up, let's make sure we can't make more cores from this one.
addtimer(CALLBACK(src, PROC_REF(finish_extraction), user) , 3 SECONDS, TIMER_DELETE_ME)
/obj/machinery/slime/extractor/proc/finish_extraction(mob/user)
PRIVATE_PROC(TRUE)
icon_state = "scanner_0old"
inuse = 0
eject_contents()
update_light_color()
src.updateUsrDialog(user)
/obj/machinery/slime/extractor/proc/eject_slime()
if(occupant)
@@ -168,10 +173,10 @@
usr.set_machine(src)
switch(href_list["action"])
if ("extract")
extract_cores()
extract_cores(usr)
if("eject")
eject_slime()
src.updateUsrDialog()
src.updateUsrDialog(usr)
return
//Circuit board below,

View File

@@ -246,7 +246,7 @@
usr.set_machine(src)
src.add_fingerprint(usr)
src.updateUsrDialog()
src.updateUsrDialog(usr)
return
/obj/machinery/xenobio/editor

View File

@@ -55,7 +55,7 @@
else
set_light(2, 2, emptycolor)
/obj/machinery/slime/replicator/proc/replicate_slime()
/obj/machinery/slime/replicator/proc/replicate_slime(mob/user)
if(!src.core)
src.visible_message("[icon2html(src,viewers(src))] [src] pings unhappily.")
else if(inuse)
@@ -64,21 +64,28 @@
inuse = 1
update_light_color()
icon_state = "restruct_1"
spawn(30)
var/mob/living/simple_mob/xeno/slime/S = new(src)
S.traitdat = new() //New instance, so that if the core is deleted, the slime retains a trait datum.
S.nameVar = core.nameVar
S.name = "[S.nameVar] baby slime"
core.traits.copy_traits(S.traitdat)
S.ProcessTraits()
addtimer(CALLBACK(src, PROC_REF(spawn_slime), user), 3 SECONDS, TIMER_DELETE_ME)
spawn(30)
qdel(core)
core = null //If qdel's being a bit slow or acting up, let's just make sure we can't clone the core.
inuse = 0
eject_slime()
icon_state = "restruct_0"
update_light_color()
src.updateUsrDialog()
/obj/machinery/slime/replicator/proc/spawn_slime(mob/user)
PRIVATE_PROC(TRUE)
var/mob/living/simple_mob/xeno/slime/S = new(src)
S.traitdat = new() //New instance, so that if the core is deleted, the slime retains a trait datum.
S.nameVar = core.nameVar
S.name = "[S.nameVar] baby slime"
core.traits.copy_traits(S.traitdat)
S.ProcessTraits()
qdel(core)
core = null //If qdel's being a bit slow or acting up, let's just make sure we can't clone the core.
addtimer(CALLBACK(src, PROC_REF(finish_spawn)), 3 SECONDS, TIMER_DELETE_ME)
/obj/machinery/slime/replicator/proc/finish_spawn(mob/user)
PRIVATE_PROC(TRUE)
inuse = 0
eject_slime()
icon_state = "restruct_0"
update_light_color()
src.updateUsrDialog(user)
/obj/machinery/slime/replicator/proc/eject_slime()
for(var/mob/thing in contents)
@@ -123,10 +130,10 @@
usr.set_machine(src)
switch(href_list["action"])
if ("replicate")
replicate_slime()
replicate_slime(usr)
if("eject")
eject_core()
src.updateUsrDialog()
src.updateUsrDialog(usr)
return
//Circuit board below,