Spawn panel improvements

This commit is contained in:
c0
2015-08-15 13:34:15 +03:00
parent 7a6afb6889
commit 7e1bd34583
3 changed files with 48 additions and 49 deletions
+13 -14
View File
@@ -1,4 +1,8 @@
/var/create_object_html = null
var/create_object_html = null
var/list/create_object_forms = list(
/obj, /obj/structure, /obj/machinery, /obj/effect,
/obj/item, /obj/item/clothing, /obj/item/stack,
/obj/item/weapon, /obj/item/weapon/reagent_containers, /obj/item/weapon/gun)
/datum/admins/proc/create_object(mob/user)
if (!create_object_html)
@@ -11,18 +15,13 @@
/datum/admins/proc/quick_create_object(mob/user)
var/path = input("Select the path of the object you wish to create.", "Path", /obj) in create_object_forms
var/html_form = create_object_forms[path]
var/quick_create_object_html = null
var/pathtext = null
if (!html_form)
var/objectjs = list2text(typesof(path), ";")
html_form = file2text('html/create_object.html')
html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"")
create_object_forms[path] = html_form
pathtext = input("Select the path of the object you wish to create.", "Path", "/obj") in list("/obj","/obj/structure","/obj/effect","/obj/item","/obj/item/clothing","/obj/item/weapon/reagent_containers/food","/obj/item/weapon","/obj/item/weapon/gun","/obj/machinery","/obj/item/stack")
var path = text2path(pathtext)
if (!quick_create_object_html)
var/objectjs = null
objectjs = list2text(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(html_form, "/* ref src */", "\ref[src]"), "window=qco[path];size=425x475")