mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
Admin Verb Datums MkIII | Now with functional command bar (#82511)
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
/client/proc/map_export()
|
||||
set category = "Debug"
|
||||
set name = "Map Export"
|
||||
set desc = "Select a part of the map by coordinates and download it."
|
||||
|
||||
var/z_level = tgui_input_number(usr, "Export Which Z-Level?", "Map Exporter", usr.z || 2)
|
||||
var/start_x = tgui_input_number(usr, "Start X?", "Map Exporter", usr.x || 1, world.maxx, 1)
|
||||
var/start_y = tgui_input_number(usr, "Start Y?", "Map Exporter", usr.y || 1, world.maxy, 1)
|
||||
var/end_x = tgui_input_number(usr, "End X?", "Map Exporter", usr.x || 1, world.maxx, 1)
|
||||
var/end_y = tgui_input_number(usr, "End Y?", "Map Exporter", usr.y || 1, world.maxy, 1)
|
||||
ADMIN_VERB(map_export, R_DEBUG, "Map Export", "Select a part of the map by coordinates and download it.", ADMIN_CATEGORY_DEBUG)
|
||||
var/user_x = user.mob.x
|
||||
var/user_y = user.mob.y
|
||||
var/user_z = user.mob.z
|
||||
var/z_level = tgui_input_number(user, "Export Which Z-Level?", "Map Exporter", user_z || 2)
|
||||
var/start_x = tgui_input_number(user, "Start X?", "Map Exporter", user_x || 1, world.maxx, 1)
|
||||
var/start_y = tgui_input_number(user, "Start Y?", "Map Exporter", user_y || 1, world.maxy, 1)
|
||||
var/end_x = tgui_input_number(user, "End X?", "Map Exporter", user_x || 1, world.maxx, 1)
|
||||
var/end_y = tgui_input_number(user, "End Y?", "Map Exporter", user_y || 1, world.maxy, 1)
|
||||
var/date = time2text(world.timeofday, "YYYY-MM-DD_hh-mm-ss")
|
||||
var/file_name = sanitize_filename(tgui_input_text(usr, "Filename?", "Map Exporter", "exported_map_[date]"))
|
||||
var/confirm = tgui_alert(usr, "Are you sure you want to do this? This will cause extreme lag!", "Map Exporter", list("Yes", "No"))
|
||||
var/file_name = sanitize_filename(tgui_input_text(user, "Filename?", "Map Exporter", "exported_map_[date]"))
|
||||
var/confirm = tgui_alert(user, "Are you sure you want to do this? This will cause extreme lag!", "Map Exporter", list("Yes", "No"))
|
||||
|
||||
if(confirm != "Yes" || !check_rights(R_DEBUG))
|
||||
if(confirm != "Yes")
|
||||
return
|
||||
|
||||
var/map_text = write_map(start_x, start_y, z_level, end_x, end_y, z_level)
|
||||
log_admin("Build Mode: [key_name(usr)] is exporting the map area from ([start_x], [start_y], [z_level]) through ([end_x], [end_y], [z_level])")
|
||||
send_exported_map(usr, file_name, map_text)
|
||||
log_admin("Build Mode: [key_name(user)] is exporting the map area from ([start_x], [start_y], [z_level]) through ([end_x], [end_y], [z_level])")
|
||||
send_exported_map(user, file_name, map_text)
|
||||
|
||||
/**
|
||||
* A procedure for saving DMM text to a file and then sending it to the user.
|
||||
|
||||
Reference in New Issue
Block a user