mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Refactors admin verbs from giant ass lists into datums (#72407)
## About The Pull Request See title. ## Why It's Good For The Game Makes it easier for people to add new admin buttons, and also removes the giant ass ugly lists that are an affront to my eyes. Yes you are still able to call them manually via the verb bar   ## Changelog 🆑 refactor: Admin verbs are now datums with a dedicated panel handler admin: Admin verbs now come with a handy description when you hover over them! /🆑 --------- Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
/datum/admins/proc/spawn_objasmob(object as text)
|
||||
set category = "Debug"
|
||||
set desc = "(obj path) Spawn object-mob"
|
||||
set name = "Spawn object-mob"
|
||||
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
ADMIN_VERB(debug, spawn_object_as_mob, "Spawn an object-mob", R_SPAWN, object as text)
|
||||
var/chosen = pick_closest_path(object, make_types_fancy(subtypesof(/obj)))
|
||||
|
||||
if (!chosen)
|
||||
return
|
||||
|
||||
@@ -16,18 +8,60 @@
|
||||
var/obj/chosen_obj = text2path(chosen)
|
||||
|
||||
var/list/settings = list(
|
||||
"mainsettings" = list(
|
||||
"name" = list("desc" = "Name", "type" = "string", "value" = "Bob"),
|
||||
"maxhealth" = list("desc" = "Max. health", "type" = "number", "value" = 100),
|
||||
"access" = list("desc" = "Access ID", "type" = "datum", "path" = "/obj/item/card/id", "value" = "Default"),
|
||||
"objtype" = list("desc" = "Base obj type", "type" = "datum", "path" = "/obj", "value" = "[chosen]"),
|
||||
"googlyeyes" = list("desc" = "Googly eyes", "type" = "boolean", "value" = "No"),
|
||||
"disableai" = list("desc" = "Disable AI", "type" = "boolean", "value" = "Yes"),
|
||||
"idledamage" = list("desc" = "Damaged while idle", "type" = "boolean", "value" = "No"),
|
||||
"dropitem" = list("desc" = "Drop obj on death", "type" = "boolean", "value" = "Yes"),
|
||||
"mobtype" = list("desc" = "Base mob type", "type" = "datum", "path" = "/mob/living/simple_animal/hostile/mimic/copy", "value" = "/mob/living/simple_animal/hostile/mimic/copy"),
|
||||
"ckey" = list("desc" = "ckey", "type" = "ckey", "value" = "none"),
|
||||
))
|
||||
"mainsettings" = list(
|
||||
"name" = list(
|
||||
"desc" = "Name",
|
||||
"type" = "string",
|
||||
"value" = "Bob",
|
||||
),
|
||||
"maxhealth" = list(
|
||||
"desc" = "Max. health",
|
||||
"type" = "number",
|
||||
"value" = 100,
|
||||
),
|
||||
"access" = list(
|
||||
"desc" = "Access ID",
|
||||
"type" = "datum",
|
||||
"path" = "/obj/item/card/id",
|
||||
"value" = "Default",
|
||||
),
|
||||
"objtype" = list(
|
||||
"desc" = "Base obj type",
|
||||
"type" = "datum",
|
||||
"path" = "/obj", "value" = "[chosen]",
|
||||
),
|
||||
"googlyeyes" = list(
|
||||
"desc" = "Googly eyes",
|
||||
"type" = "boolean",
|
||||
"value" = "No",
|
||||
),
|
||||
"disableai" = list(
|
||||
"desc" = "Disable AI",
|
||||
"type" = "boolean",
|
||||
"value" = "Yes",
|
||||
),
|
||||
"idledamage" = list(
|
||||
"desc" = "Damaged while idle",
|
||||
"type" = "boolean",
|
||||
"value" = "No",
|
||||
),
|
||||
"dropitem" = list(
|
||||
"desc" = "Drop obj on death",
|
||||
"type" = "boolean",
|
||||
"value" = "Yes",
|
||||
),
|
||||
"mobtype" = list(
|
||||
"desc" = "Base mob type",
|
||||
"type" = "datum",
|
||||
"path" = "/mob/living/simple_animal/hostile/mimic/copy", "value" = "/mob/living/simple_animal/hostile/mimic/copy",
|
||||
),
|
||||
"ckey" = list(
|
||||
"desc" = "ckey",
|
||||
"type" = "ckey",
|
||||
"value" = "none",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
var/list/prefreturn = presentpreflikepicker(usr,"Customize mob", "Customize mob", Button1="Ok", width = 450, StealFocus = 1,Timeout = 0, settings=settings)
|
||||
if (prefreturn["button"] == 1)
|
||||
@@ -63,7 +97,4 @@
|
||||
|
||||
if (mainsettings["ckey"]["value"] != "none")
|
||||
basemob.ckey = mainsettings["ckey"]["value"]
|
||||
|
||||
|
||||
log_admin("[key_name(usr)] spawned a sentient object-mob [basemob] from [chosen_obj] at [AREACOORD(usr)]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn object-mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
Reference in New Issue
Block a user