Updating spawn(Create Object) for admin panel (#5442)

Create Object now populates list of objects instantly. Compared to original 3-4 seconds of freezes.
Quick Create Object was removed due to regular being extremely fast.
This commit is contained in:
Mykhailo Bykhovtsev
2018-10-28 03:02:17 -07:00
committed by Werner
parent 65f0c886c1
commit 76c630dcfb
5 changed files with 68 additions and 39 deletions
+1 -20
View File
@@ -7,23 +7,4 @@
create_object_html = file2text('html/create_object.html')
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
user << browse(replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")
/datum/admins/proc/quick_create_object(var/mob/user)
var/quick_create_object_html = null
var/pathtext = null
pathtext = input("Select the path of the object you wish to create.", "Path", "/obj") as null|anything in list("/obj","/obj/structure","/obj/item","/obj/item/weapon","/obj/item/clothing","/obj/machinery","/obj/mecha")
if(!pathtext)
return
var path = text2path(pathtext)
if (!quick_create_object_html)
var/objectjs = null
objectjs = jointext(typesof(path), ";")
quick_create_object_html = file2text('html/create_object.html')
quick_create_object_html = replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"")
user << browse(replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "window=quick_create_object;size=425x475")
user << browse(replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")