Allows admins to upload a map template to be used by themselves or other admins, does NOT persist between rounds.

This commit is contained in:
Remie Richards
2015-12-23 02:24:08 +00:00
parent 38c6af7032
commit 67c71b5961
2 changed files with 37 additions and 7 deletions
+2 -1
View File
@@ -136,7 +136,8 @@ var/list/admin_verbs_debug = list(
/client/proc/reset_latejoin_spawns,
/client/proc/create_outfits,
/client/proc/debug_huds,
/client/proc/map_template_load
/client/proc/map_template_load,
/client/proc/map_template_upload
)
var/list/admin_verbs_possess = list(
/proc/possess,
@@ -1,18 +1,47 @@
/client/proc/map_template_load()
set category = "Debug"
set name = "Load Map Template"
set name = "Map template - Place"
var/turf/T = get_turf(mob)
if(!T)
return
var/map = input(usr, "Choose a Map Template to load at your CURRENT LOCATION","Load Map Template") as null|anything in flist("_maps/templates/")
var/list/filelist = flist("_maps/templates/")
filelist |= map_template_uploads
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in filelist
if(!map)
return
var/formatted_map = "_maps/templates/[map]"
var/mapfile = file(formatted_map)
var/mapfile
if(map in map_template_uploads) //in the cache, not the template folder
mapfile = map
else
mapfile = file("_maps/templates/[map]")
if(isfile(mapfile))
maploader.load_map(mapfile, T.x, T.y, T.z)
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has loaded a map template ([map]) at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>(JMP)</a></span>")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has placed a map template ([map]) at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>(JMP)</a></span>")
else
usr << "Bad map file"
usr << "Bad map file: [map]"
//A list of map files that have been uploaded by admins
//It's NOT persistent between rounds
var/global/list/map_template_uploads = list()
/client/proc/map_template_upload()
set category = "Debug"
set name = "Map Template - Upload"
var/map = input(usr, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file
if(!map)
return
if(!findtext("[map]",".dmm"))
usr << "Bad map file: [map]"
return
map_template_uploads |= file(map)
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has uploaded a map template ([map])</span>")