[MIRROR] moves the last admin verbs (#12656)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-04-12 23:02:58 -07:00
committed by GitHub
parent 0ff0ec0cca
commit 256cd81e28
25 changed files with 406 additions and 662 deletions
+2 -2
View File
@@ -31,7 +31,7 @@
// Test to see if rand_seed() can be used reliably.
var/priority_process
/datum/random_map/New(var/seed, var/tx, var/ty, var/tz, var/tlx, var/tly, var/do_not_apply, var/do_not_announce)
/datum/random_map/New(var/seed, var/tx, var/ty, var/tz, var/tlx, var/tly, var/do_not_apply, var/do_not_announce, var/admin_map)
if(!isnum(tz))
var/old_tz = tz
tz = GLOB.map_templates_loaded[tz]
@@ -45,7 +45,7 @@
else
GLOB.map_count[descriptor]++
name = "[descriptor] #[GLOB.map_count[descriptor]]"
if(preserve_map) GLOB.random_maps[name] = src
if(preserve_map || admin_map) GLOB.random_maps[name] = src
// Get origins for applying the map later.
set_origins(tx, ty, tz)
+44 -79
View File
@@ -1,108 +1,73 @@
/client/proc/print_random_map()
set category = "Debug.Events"
set name = "Display Random Map"
set desc = "Show the contents of a random map."
if(!check_rights_for(src, R_HOLDER)) return
var/choice = tgui_input_list(usr, "Choose a map to display.", "Map Choice", GLOB.random_maps)
ADMIN_VERB(print_random_map, R_DEBUG, "Display Random Map", "Show the contents of a random map.", ADMIN_CATEGORY_DEBUG_EVENTS)
var/choice = tgui_input_list(user, "Choose a map to display.", "Map Choice", GLOB.random_maps)
if(!choice)
return
var/datum/random_map/M = GLOB.random_maps[choice]
if(istype(M))
M.display_map(usr)
var/datum/random_map/selected_map = GLOB.random_maps[choice]
if(istype(selected_map))
selected_map.display_map(user)
/client/proc/delete_random_map()
set category = "Debug.Events"
set name = "Delete Random Map"
set desc = "Delete a random map."
if(!check_rights_for(src, R_HOLDER)) return
var/choice = tgui_input_list(usr, "Choose a map to delete.", "Map Choice", GLOB.random_maps)
ADMIN_VERB(delete_random_map, R_DEBUG, "Delete Random Map", "Delete a random map.", ADMIN_CATEGORY_DEBUG_EVENTS)
var/choice = tgui_input_list(user, "Choose a map to delete.", "Map Choice", GLOB.random_maps)
if(!choice)
return
var/datum/random_map/M = GLOB.random_maps[choice]
var/datum/random_map/selected_map = GLOB.random_maps[choice]
GLOB.random_maps[choice] = null
if(istype(M))
message_admins("[key_name_admin(usr)] has deleted [M.name].")
log_admin("[key_name(usr)] has deleted [M.name].")
qdel(M)
if(istype(selected_map))
log_and_message_admins("has deleted [selected_map.name].", user)
qdel(selected_map)
/client/proc/create_random_map()
set category = "Debug.Events"
set name = "Create Random Map"
set desc = "Create a random map."
if(!check_rights_for(src, R_HOLDER)) return
var/map_datum = tgui_input_list(usr, "Choose a map to create.", "Map Choice", subtypesof(/datum/random_map))
ADMIN_VERB(create_random_map, R_DEBUG, "Create Random Map", "Create a random map.", ADMIN_CATEGORY_DEBUG_EVENTS)
var/map_datum = tgui_input_list(user, "Choose a map to create.", "Map Choice", subtypesof(/datum/random_map))
if(!map_datum)
return
var/datum/random_map/M
if(tgui_alert(usr, "Do you wish to customise the map?","Customize",list("Yes","No")) == "Yes")
var/seed = tgui_input_text(usr, "Seed? (blank for none)")
var/lx = tgui_input_number(usr, "X-size? (blank for default)")
var/ly = tgui_input_number(usr, "Y-size? (blank for default)")
M = new map_datum(seed,null,null,null,lx,ly,1)
var/datum/random_map/selected_map
if(tgui_alert(user, "Do you wish to customise the map?","Customize",list("Yes","No")) == "Yes")
var/seed = tgui_input_text(user, "Seed? (blank for none)")
var/lx = tgui_input_number(user, "X-size? (blank for default)")
var/ly = tgui_input_number(user, "Y-size? (blank for default)")
selected_map = new map_datum(seed,null,null,0,lx,ly,1,null,TRUE)
else
M = new map_datum(null,null,null,null,null,null,1)
selected_map = new map_datum(null,null,null,0,null,null,1,null,TRUE)
if(M)
message_admins("[key_name_admin(usr)] has created [M.name].")
log_admin("[key_name(usr)] has created [M.name].")
if(selected_map)
log_and_message_admins("has created [selected_map.name]", user)
/client/proc/apply_random_map()
set category = "Debug.Events"
set name = "Apply Random Map"
set desc = "Apply a map to the game world."
if(!check_rights_for(src, R_HOLDER)) return
var/choice = tgui_input_list(usr, "Choose a map to apply.", "Map Choice", GLOB.random_maps)
ADMIN_VERB(apply_random_map, R_DEBUG, "Apply Random Map", "Apply a map to the game world.", ADMIN_CATEGORY_DEBUG_EVENTS)
var/choice = tgui_input_list(user, "Choose a map to apply.", "Map Choice", GLOB.random_maps)
if(!choice)
return
var/datum/random_map/M = GLOB.random_maps[choice]
if(istype(M))
var/tx = tgui_input_number(usr, "X? (default to current turf)")
var/ty = tgui_input_number(usr, "Y? (default to current turf)")
var/tz = tgui_input_number(usr, "Z? (default to current turf)")
if(isnull(tx) || isnull(ty) || isnull(tz))
var/turf/T = get_turf(usr)
tx = !isnull(tx) ? tx : T.x
ty = !isnull(ty) ? ty : T.y
tz = !isnull(tz) ? tz : T.z
message_admins("[key_name_admin(usr)] has applied [M.name] at x[tx],y[ty],z[tz].")
log_admin("[key_name(usr)] has applied [M.name] at x[tx],y[ty],z[tz].")
M.set_origins(tx,ty,tz)
M.apply_to_map()
var/datum/random_map/selected_map = GLOB.random_maps[choice]
if(istype(selected_map))
var/tx = tgui_input_number(user, "X? (default to current turf)")
var/ty = tgui_input_number(user, "Y? (default to current turf)")
var/tz = tgui_input_number(user, "Z? (default to current turf)")
if(!tx || !ty || !tz) //If someone puts 0 for ANY of these, ignore it and get their current turf.
var/turf/target_turf = get_turf(user.mob)
tx = tx ? tx : target_turf.x
ty = ty ? ty : target_turf.y
tz = tz ? tz : target_turf.z
log_and_message_admins("has applied [selected_map.name] at x[tx],y[ty],z[tz].", user)
selected_map.set_origins(tx,ty,tz)
selected_map.apply_to_map()
/client/proc/overlay_random_map()
set category = "Debug.Events"
set name = "Overlay Random Map"
set desc = "Apply a map to another map."
if(!check_rights_for(src, R_HOLDER)) return
var/choice = tgui_input_list(usr, "Choose a map as base.", "Map Choice", GLOB.random_maps)
ADMIN_VERB(overlay_random_map, R_DEBUG, "Overlay Random Map", "Apply a map to another map.", ADMIN_CATEGORY_DEBUG_EVENTS)
var/choice = tgui_input_list(user, "Choose a map as base.", "Map Choice", GLOB.random_maps)
if(!choice)
return
var/datum/random_map/base_map = GLOB.random_maps[choice]
choice = null
choice = tgui_input_list(usr, "Choose a map to overlay.", "Map Choice", GLOB.random_maps)
choice = tgui_input_list(user, "Choose a map to overlay.", "Map Choice", GLOB.random_maps)
if(!choice)
return
var/datum/random_map/overlay_map = GLOB.random_maps[choice]
if(istype(base_map) && istype(overlay_map))
var/tx = tgui_input_number(usr, "X? (default to 1)")
var/ty = tgui_input_number(usr, "Y? (default to 1)")
var/tx = tgui_input_number(user, "X? (default to 1)")
var/ty = tgui_input_number(user, "Y? (default to 1)")
if(!tx) tx = 1
if(!ty) ty = 1
message_admins("[key_name_admin(usr)] has applied [overlay_map.name] to [base_map.name] at x[tx],y[ty].")
log_admin("[key_name(usr)] has applied [overlay_map.name] to [base_map.name] at x[tx],y[ty].")
log_and_message_admins("has applied [overlay_map.name] to [base_map.name] at x[tx],y[ty],z[overlay_map.origin_z].", user)
overlay_map.overlay_with(base_map,tx,ty)
base_map.display_map(usr)
base_map.display_map(user)