Files
Bubberstation/code/modules/admin/create_object.dm
SyncIt21 a9a65bd929 Create object panel search function works again (#91431)
## About The Pull Request
Broken by #91379 all because a semicolon got misplaced

Before
![Screenshot
(463)](https://github.com/user-attachments/assets/7de12f0e-8da1-4ccf-9450-384cd66e6cb7)

After
![Screenshot
(464)](https://github.com/user-attachments/assets/6684b6a5-aa1b-4fe2-9e26-dc43b8dcba10)

And the code wasn't updated to check for this change

58cd0099d9/code/modules/admin/create_object.dm (L12)

58cd0099d9/code/modules/admin/create_object.dm (L29)

Well now it does

## Changelog
🆑
fix: create object panel for game admins works again
/🆑
2025-06-02 13:38:35 +00:00

33 lines
1.5 KiB
Plaintext

/datum/admins/proc/create_panel_helper(template)
var/final_html = replacetext(template, "/* ref src */", "[REF(src)];[HrefToken()]")
final_html = replacetext(final_html,"/* hreftokenfield */","[HrefTokenFormField()]")
return final_html
/datum/admins/proc/create_object(mob/user)
var/static/create_object_html = null
if (!create_object_html)
var/objectjs = null
objectjs = jointext(typesof(/obj), ";")
create_object_html = file2text('html/create_object.html')
create_object_html = replacetext(create_object_html, "null; /* object types */", "\"[objectjs]\";")
user << browse(create_panel_helper(create_object_html), "window=create_object;size=425x475")
/datum/admins/proc/quick_create_object(mob/user)
var/static/list/create_object_forms = list(
/obj, /obj/structure, /obj/machinery, /obj/effect,
/obj/item, /obj/item/clothing, /obj/item/stack, /obj/item,
/obj/item/reagent_containers, /obj/item/gun)
var/path = input("Select the path of the object you wish to create.", "Path", /obj) in sort_list(create_object_forms, GLOBAL_PROC_REF(cmp_typepaths_asc))
var/html_form = create_object_forms[path]
if (!html_form)
var/objectjs = jointext(typesof(path), ";")
html_form = file2text('html/create_object.html')
html_form = replacetext(html_form, "Create Object", "Create [path]")
html_form = replacetext(html_form, "null; /* object types */", "\"[objectjs]\";")
create_object_forms[path] = html_form
user << browse(create_panel_helper(html_form), "window=qco[path];size=425x475")