[MIRROR] next set of admin verbs (#12574)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-03-22 21:28:46 +01:00
committed by GitHub
co-authored by Kashargul
parent b397129b6b
commit 62b8453b69
62 changed files with 1129 additions and 2147 deletions
@@ -2,14 +2,7 @@
Event Collector Admin Commands
*/
/client/proc/modify_event_collector(var/obj/structure/event_collector/target in GLOB.event_collectors)
set category = "Fun.Event Kit"
set desc="Configure Event Collector"
set name="Configure Collector"
if(!check_rights(R_ADMIN))
return
ADMIN_VERB_AND_CONTEXT_MENU(modify_event_collector, R_ADMIN, "Configure Collector", "Configure Event Collector.", ADMIN_CATEGORY_FUN_EVENT_KIT, obj/structure/event_collector/target in GLOB.event_collectors)
var/msg = "---------------\n"
if(target?.active_recipe?.len > 0)
msg += " [target] has [target.active_recipe.len] left in its current recipe\n"
@@ -27,7 +20,7 @@ Event Collector Admin Commands
if(blockers > 0)
msg += "[target] has [blockers] things blocking/slowing it down! Anything more than 10 means it's stopped!"
to_chat(usr,msg)
to_chat(user, msg)
var/list/options = list(
@@ -37,7 +30,7 @@ Event Collector Admin Commands
"Force Clear Blockers"
)
var/option = tgui_input_list(usr, "What Would You Like To Do?", "Event Collector",options,"Cancel")
var/option = tgui_input_list(user, "What Would You Like To Do?", "Event Collector",options,"Cancel")
switch(option)
if("Cancel")
return
@@ -56,16 +49,9 @@ Event Collector Admin Commands
if("Empty Stored Items")
target.empty_items()
/client/proc/induce_malfunction(var/obj/structure/event_collector_blocker/target in GLOB.event_collector_blockers)
set category = "Fun.Event Kit"
set desc="Configure Collector Blocker"
set name="Toggle Malfunction State"
if(!check_rights(R_ADMIN))
return
ADMIN_VERB_AND_CONTEXT_MENU(induce_malfunction, R_ADMIN, "Toggle Malfunction State", "Configure Collector Blocker.", ADMIN_CATEGORY_FUN_EVENT_KIT, obj/structure/event_collector_blocker/target in GLOB.event_collector_blockers)
if(target.block_amount)
target.fix()
return
else
target.induce_failure()
target.induce_failure()
@@ -91,11 +91,7 @@
user.visible_message(span_notice("[text_deactivated]"))
update_icon()
/client/proc/generic_item()
set category = "Fun.Event Kit"
set name = "Spawn Generic Item"
set desc = "Spawn a customisable item with a range of different options."
ADMIN_VERB(generic_item, R_SPAWN, "Spawn Generic Item", "Spawn a customisable item with a range of different options.", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/s_activatable = 0
var/s_togglable = 0
var/s_icon_state_on = 0
@@ -142,6 +138,7 @@
"fleshorb",
"fleshorb_moving",
"Upload Own Sprite")
var/list/sound_options = list('sound/effects/alert.ogg',
'sound/effects/bamf.ogg',
'sound/effects/bang.ogg',
@@ -174,36 +171,32 @@
var/check_togglable
if(!check_rights_for(src, R_HOLDER))
return
var/s_name = tgui_input_text(src, "Item Name:", "Name")
var/s_desc = tgui_input_text(src, "Item Description:", "Description")
var/s_icon_state_off = tgui_input_list(src, "Choose starting icon state:", "icon_state_off", icon_state_options)
var/s_name = tgui_input_text(user, "Item Name:", "Name")
var/s_desc = tgui_input_text(user, "Item Description:", "Description")
var/s_icon_state_off = tgui_input_list(user, "Choose starting icon state:", "icon_state_off", icon_state_options)
if(s_icon_state_off == "Upload Own Sprite")
s_icon = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
var/check_activatable = tgui_alert(src, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel"))
s_icon = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
var/check_activatable = tgui_alert(user, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel"))
if(!check_activatable || check_activatable == "Cancel")
return
if(check_activatable == "No")
s_activatable = 0
if(check_activatable == "Yes")
s_activatable = 1
s_text_activated = tgui_input_text(src, "Activation text:", "Activation Text")
check_togglable = tgui_alert(src, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel"))
s_text_activated = tgui_input_text(user, "Activation text:", "Activation Text")
check_togglable = tgui_alert(user, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel"))
if(!check_togglable || check_togglable == "Cancel")
return
if(check_togglable == "No")
s_togglable = 0
if(check_togglable == "Yes")
s_text_deactivated = tgui_input_text(src, "Deactivation text:", "Deactivation Text")
s_text_deactivated = tgui_input_text(user, "Deactivation text:", "Deactivation Text")
s_togglable = 1
s_icon_state_on = tgui_input_list(src, "Choose activated icon state:", "icon_state_on", icon_state_options)
s_icon_state_on = tgui_input_list(user, "Choose activated icon state:", "icon_state_on", icon_state_options)
if(s_icon_state_on == "Upload Own Sprite")
s_icon2 = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
s_delay = tgui_input_number(src, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay")
var/check_effect = tgui_alert(src, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Cancel"))
s_icon2 = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
s_delay = tgui_input_number(user, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay")
var/check_effect = tgui_alert(user, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Cancel"))
if(!check_effect || check_effect == "Cancel")
return
if(check_effect == "No")
@@ -216,14 +209,14 @@
s_effect = 3
if(check_effect == "Spawn Item")
s_effect = 4
s_object = get_path_from_partial_text()
var/check_sound = tgui_alert(src, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel"))
s_object = user.get_path_from_partial_text()
var/check_sound = tgui_alert(user, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel"))
if(!check_sound || check_sound == "Cancel")
return
if(check_sound == "Yes")
s_sound = tgui_input_list(src, "Choose a sound to play on activation:", "Sound", sound_options)
s_sound = tgui_input_list(user, "Choose a sound to play on activation:", "Sound", sound_options)
var/spawnloc = get_turf(src.mob)
var/spawnloc = get_turf(user.mob)
var/obj/item/generic_item/P = new(spawnloc)
P.name = s_name
P.desc = s_desc
@@ -106,11 +106,7 @@
to_chat(user, span_notice("You [anchored? "un" : ""]secured \the [src]!"))
anchored = !anchored
/client/proc/generic_structure()
set category = "Fun.Event Kit"
set name = "Spawn Generic Structure"
set desc = "Spawn a customisable structure with a range of different options."
ADMIN_VERB(generic_structure, R_SPAWN, "Spawn Generic Structure", "Spawn a customisable structure with a range of different options.", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/s_wrenchable = 0
var/s_anchored = 0
var/s_density = 0
@@ -193,6 +189,7 @@
"ob_warhead_4",
"angel",
"Upload Own Sprite")
var/list/sound_options = list('sound/effects/alert.ogg',
'sound/effects/bamf.ogg',
'sound/effects/bang.ogg',
@@ -225,57 +222,53 @@
var/check_togglable
if(!check_rights_for(src, R_HOLDER))
return
var/s_name = tgui_input_text(src, "Structure Name:", "Name")
var/s_desc = tgui_input_text(src, "Structure Description:", "Description")
var/check_anchored = tgui_alert(src, "Start anchored?", "anchored", list("Yes", "No", "Cancel"))
var/s_name = tgui_input_text(user, "Structure Name:", "Name")
var/s_desc = tgui_input_text(user, "Structure Description:", "Description")
var/check_anchored = tgui_alert(user, "Start anchored?", "anchored", list("Yes", "No", "Cancel"))
if(!check_anchored || check_anchored == "Cancel")
return
if(check_anchored == "No")
s_anchored = 0
if(check_anchored == "Yes")
s_anchored = 1
var/check_density = tgui_alert(src, "Start dense?", "density", list("Yes", "No", "Cancel"))
var/check_density = tgui_alert(user, "Start dense?", "density", list("Yes", "No", "Cancel"))
if(!check_density || check_density == "Cancel")
return
if(check_density == "No")
s_density = 0
if(check_density == "Yes")
s_density = 1
var/check_wrenchable = tgui_alert(src, "Allow it to be fastened and unfastened with a wrench?", "wrenchable", list("Yes", "No", "Cancel"))
var/check_wrenchable = tgui_alert(user, "Allow it to be fastened and unfastened with a wrench?", "wrenchable", list("Yes", "No", "Cancel"))
if(!check_wrenchable || check_wrenchable == "Cancel")
return
if(check_wrenchable == "No")
s_wrenchable = 0
if(check_wrenchable == "Yes")
s_wrenchable = 1
var/s_icon_state_off = tgui_input_list(src, "Choose starting icon state:", "icon_state_off", icon_state_options)
var/s_icon_state_off = tgui_input_list(user, "Choose starting icon state:", "icon_state_off", icon_state_options)
if(s_icon_state_off == "Upload Own Sprite")
s_icon = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
var/check_activatable = tgui_alert(src, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel"))
s_icon = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
var/check_activatable = tgui_alert(user, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel"))
if(!check_activatable || check_activatable == "Cancel")
return
if(check_activatable == "No")
s_activatable = 0
if(check_activatable == "Yes")
s_activatable = 1
s_text_activated = tgui_input_text(src, "Activation text:", "Activation Text")
check_togglable = tgui_alert(src, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel"))
s_text_activated = tgui_input_text(user, "Activation text:", "Activation Text")
check_togglable = tgui_alert(user, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel"))
if(!check_togglable || check_togglable == "Cancel")
return
if(check_togglable == "No")
s_togglable = 0
if(check_togglable == "Yes")
s_text_deactivated = tgui_input_text(src, "Deactivation text:", "Deactivation Text")
s_text_deactivated = tgui_input_text(user, "Deactivation text:", "Deactivation Text")
s_togglable = 1
s_icon_state_on = tgui_input_list(src, "Choose activated icon state:", "icon_state_on", icon_state_options)
s_icon_state_on = tgui_input_list(user, "Choose activated icon state:", "icon_state_on", icon_state_options)
if(s_icon_state_on == "Upload Own Sprite")
s_icon2 = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
s_delay = tgui_input_number(src, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay")
var/check_effect = tgui_alert(src, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Fear", "Cancel"))
s_icon2 = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file
s_delay = tgui_input_number(user, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay")
var/check_effect = tgui_alert(user, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Fear", "Cancel"))
if(!check_effect || check_effect == "Cancel")
return
if(check_effect == "No")
@@ -288,16 +281,16 @@
s_effect = 3
if(check_effect == "Spawn Item")
s_effect = 4
s_object = get_path_from_partial_text()
s_object = user.get_path_from_partial_text()
if(check_effect == "Fear")
s_effect = 5
var/check_sound = tgui_alert(src, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel"))
var/check_sound = tgui_alert(user, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel"))
if(!check_sound || check_sound == "Cancel")
return
if(check_sound == "Yes")
s_sound = tgui_input_list(src, "Choose a sound to play on activation:", "Sound", sound_options)
s_sound = tgui_input_list(user, "Choose a sound to play on activation:", "Sound", sound_options)
var/spawnloc = get_turf(src.mob)
var/spawnloc = get_turf(user.mob)
var/obj/structure/generic_structure/P = new(spawnloc)
P.name = s_name
P.desc = s_desc
@@ -322,7 +315,7 @@
P.update_icon()
/client/proc/get_path_from_partial_text(default_path)
var/desired_path = tgui_input_text(usr, "Enter full or partial typepath.","Typepath","[default_path]")
var/desired_path = tgui_input_text(src, "Enter full or partial typepath.","Typepath","[default_path]")
if(!desired_path) //VOREStation Add - If you don't give it anything it builds a list of every possible thing in the game and crashes your client.
return //VOREStation Add - And the main way for it to do that is to push the cancel button, which should just do nothing. :U
@@ -335,7 +328,7 @@
matches += path
if(matches.len==0)
tgui_alert_async(usr, "No results found. Sorry.")
tgui_alert_async(src, "No results found. Sorry.")
return
var/result = null
@@ -343,5 +336,5 @@
if(matches.len==1)
result = matches[1]
else
result = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches, strict_modern = TRUE)
result = tgui_input_list(src, "Select an atom type", "Spawn Atom", matches, strict_modern = TRUE)
return result
@@ -190,15 +190,9 @@
/datum/eventkit/mob_spawner/tgui_close(mob/user)
. = ..()
qdel(src)
/client/proc/eventkit_open_mob_spawner()
set category = "Fun.Event Kit"
set name = "Open Mob Spawner"
set desc = "Opens an advanced version of the mob spawner."
if(!check_rights(R_SPAWN))
return
if(!QDELETED(src))
qdel(src)
ADMIN_VERB(eventkit_open_mob_spawner, R_SPAWN, "Open Mob Spawner", "Opens an advanced version of the mob spawner.", ADMIN_CATEGORY_FUN_EVENT_KIT)
var/datum/eventkit/mob_spawner/spawner = new()
spawner.tgui_interact(usr)
spawner.tgui_interact(user.mob)