ui now works for jump and spawn, fixes UI not opening after its closed, adds header

This commit is contained in:
Birdtalon
2018-10-20 16:35:50 +01:00
parent f07b819dab
commit e0784310b9
3 changed files with 13 additions and 20 deletions
+9 -15
View File
@@ -21,7 +21,7 @@
this["desc"] = ""
this["uids"] = list()
for(var/spawner_obj in GLOB.mob_spawners[spawner])
this["uids"] += "[UID(spawner_obj)]"
this["uids"] += "\ref[spawner_obj]"
if(!this["desc"])
if(istype(spawner_obj, /obj/effect/mob_spawn))
var/obj/effect/mob_spawn/MS = spawner_obj
@@ -37,22 +37,16 @@
/datum/spawners_menu/Topic(href, href_list)
if(..())
return 1
//var/spawner_ref = pick(GLOB.mob_spawners[href_list["name"]])
var/spawners = href_list["uid"]
spawners = replacetext(spawners, ",", ";")
to_chat(world, spawners)
var/spawners = replacetext(href_list["uid"], ",", ";")
var/list/possible_spawners = params2list(spawners)
var/obj/effect/mob_spawn/MS = locateUID(pick(possible_spawners))
if(!MS)
var/obj/effect/mob_spawn/MS = locate(pick(possible_spawners))
if(!MS || !istype(MS))
log_runtime(EXCEPTION("A ghost tried to interact with an invalid spawner, or the spawner didn't exist."))
return
to_chat(world,"ms passed!")
switch(href_list["action"])
if("jump")
if(MS)
owner.forceMove(get_turf(MS))
. = TRUE
owner.forceMove(get_turf(MS))
. = TRUE
if("spawn")
if(MS)
MS.attack_ghost(owner)
. = TRUE
to_chat(world,"FUzxcCKKK")
MS.attack_ghost(owner)
. = TRUE