mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-27 15:18:09 +01:00
[MIRROR] next set of admin verbs (#12574)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
b397129b6b
commit
62b8453b69
@@ -1,24 +1,37 @@
|
||||
/datum/admins/proc/capture_map(tx as null|num, ty as null|num, tz as null|num, range as null|num)
|
||||
set category = "Server.Game"
|
||||
set name = "Capture Map Part"
|
||||
set desc = "Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range (captures part of a map originating from bottom left corner)"
|
||||
|
||||
if(!check_rights(R_ADMIN|R_DEBUG|R_SERVER))
|
||||
ADMIN_VERB(capture_map, R_ADMIN, "Capture Map Part", "Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range (captures part of a map originating from bottom left corner).", ADMIN_CATEGORY_SERVER_GAME)
|
||||
|
||||
var/pos_type = tgui_alert(user, "Do you want to use your current loc or a manual number input?", "Where?", list("Manual", "Location", "Cancel"))
|
||||
if(!pos_type || pos_type == "Cancel")
|
||||
return
|
||||
|
||||
var/tx
|
||||
var/ty
|
||||
var/tz
|
||||
if(pos_type == "Location")
|
||||
tx = user.mob.x
|
||||
ty = user.mob.y
|
||||
tz = user.mob.z
|
||||
else
|
||||
tx = tgui_input_number(user, "Select X location", "X Loc", 1, world.maxx, 1)
|
||||
ty = tgui_input_number(user, "Select Y location", "Y Loc", 1, world.maxy, 1)
|
||||
tz = tgui_input_number(user, "Select Z location", "Z Loc", 1, world.maxz, 1)
|
||||
|
||||
var/range = tgui_input_number(user, "Select Range", "Range", 1, 32, 1)
|
||||
|
||||
if(isnull(tx) || isnull(ty) || isnull(tz) || isnull(range))
|
||||
to_chat(usr, span_filter_notice("Capture Map Part, captures part of a map using camara like rendering."))
|
||||
to_chat(usr, span_filter_notice("Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range."))
|
||||
to_chat(usr, span_filter_notice("Target coordinates specify bottom left corner of the capture, range defines render distance to opposite corner."))
|
||||
to_chat(user, span_filter_notice("Capture Map Part, captures part of a map using camara like rendering."))
|
||||
to_chat(user, span_filter_notice("Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range."))
|
||||
to_chat(user, span_filter_notice("Target coordinates specify bottom left corner of the capture, range defines render distance to opposite corner."))
|
||||
return
|
||||
|
||||
if(range > 32 || range <= 0)
|
||||
to_chat(usr, span_filter_notice("Capturing range is incorrect, it must be within 1-32."))
|
||||
to_chat(user, span_filter_notice("Capturing range is incorrect, it must be within 1-32."))
|
||||
return
|
||||
|
||||
if(locate(tx,ty,tz))
|
||||
var/list/turfstocapture = list()
|
||||
var/hasasked = 0
|
||||
var/hasasked = FALSE
|
||||
for(var/xoff = 0 to range)
|
||||
for(var/yoff = 0 to range)
|
||||
var/turf/T = locate(tx + xoff,ty + yoff,tz)
|
||||
@@ -26,8 +39,8 @@
|
||||
turfstocapture.Add(T)
|
||||
else
|
||||
if(!hasasked)
|
||||
var/answer = tgui_alert(usr, "Capture includes non existant turf, Continue capture?","Continue capture?", list("No", "Yes"))
|
||||
hasasked = 1
|
||||
var/answer = tgui_alert(user, "Capture includes non existant turf, Continue capture?","Continue capture?", list("No", "Yes"))
|
||||
hasasked = TRUE
|
||||
if(answer != "Yes")
|
||||
return
|
||||
|
||||
@@ -53,7 +66,7 @@
|
||||
cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)
|
||||
|
||||
var/file_name = "map_capture_x[tx]_y[ty]_z[tz]_r[range].png"
|
||||
to_chat(usr, span_filter_notice("Saved capture in cache as [file_name]."))
|
||||
usr << browse_rsc(cap, file_name)
|
||||
to_chat(user, span_filter_notice("Saved capture in cache as [file_name]."))
|
||||
DIRECT_OUTPUT(user, browse_rsc(cap, file_name))
|
||||
else
|
||||
to_chat(usr, span_filter_notice("Target coordinates are incorrect."))
|
||||
to_chat(user, span_filter_notice("Target coordinates are incorrect."))
|
||||
|
||||
Reference in New Issue
Block a user