Add bapi-dmm to reduce startup time by... a lot (#16148)

* Add bapi-dmm, a rust maploader that goes BRRRRRRR

* A few more maps switched away from file paths

* Update to include 48f4879d8704cb057a (better path error handling)
This commit is contained in:
ShadowLarkens
2024-10-26 04:32:41 -07:00
committed by GitHub
parent 1375d4c23b
commit a8affbd4ae
68 changed files with 1224 additions and 2936 deletions

View File

@@ -10,20 +10,13 @@
return
template = SSmapping.map_templates[map]
var/orientation = text2dir(tgui_input_list(usr, "Choose an orientation for this Map Template.", "Orientation", list("North", "South", "East", "West")))
if(!orientation)
return
// Convert dir to degrees rotation
orientation = dir2angle(orientation)
var/turf/T = get_turf(mob)
if(!T)
return
var/list/preview = list()
template.preload_size(template.mappath, orientation)
for(var/S in template.get_affected_turfs(T,centered = TRUE, orientation=orientation))
template.preload_size(template.mappath)
for(var/S in template.get_affected_turfs(T,centered = TRUE))
preview += image('icons/misc/debug_group.dmi',S ,"red")
usr.client.images += preview
if(tgui_alert(usr,"Confirm location.", "Template Confirm",list("No","Yes")) == "Yes")
@@ -31,7 +24,7 @@
usr.client.images -= preview
return
if(template.load(T, centered = TRUE, orientation=orientation))
if(template.load(T, centered = TRUE))
message_admins(span_adminnotice("[key_name_admin(usr)] has placed a map template ([template.name])."))
else
to_chat(usr, "Failed to place map")
@@ -49,20 +42,13 @@
return
template = SSmapping.map_templates[map]
var/orientation = text2dir(tgui_input_list(usr, "Choose an orientation for this Map Template.", "Orientation", list("North", "South", "East", "West")))
if(!orientation)
return
// Convert dir to degrees rotation
orientation = dir2angle(orientation)
if((!(orientation%180) && template.width > world.maxx || template.height > world.maxy) || (orientation%180 && template.width > world.maxy || template.height > world.maxx))
if(tgui_alert(usr,"This template is larger than the existing z-levels. It will EXPAND ALL Z-LEVELS to match the size of the template. This may cause chaos. Are you sure you want to do this?","DANGER!!!",list("Cancel","Yes")) != "Yes")
if(template.width > world.maxx || template.height > world.maxx)
if(tgui_alert(usr,"This template is larger than the existing z-levels. It will EXPAND ALL Z-LEVELS to match the size of the template. This may cause chaos. Are you sure you want to do this?","DANGER!!!",list("Cancel","Yes")) == "Cancel")
to_chat(usr,"Template placement aborted.")
return
if(tgui_alert(usr,"Confirm map load.", "Template Confirm",list("No","Yes")) == "Yes")
if(template.load_new_z(orientation=orientation))
if(template.load_new_z())
message_admins(span_adminnotice("[key_name_admin(usr)] has placed a map template ([template.name]) on Z level [world.maxz]."))
else
to_chat(usr, "Failed to place map")