Ports TG lazy-loading of map templates using turf reservations (#28101)

* kills off heaps

* turf reservations

* lazy loading map templates

* atmos + a comment

* port LISTASSERTLEN and rename a proc

* CI happy

* yes

* oops

* removes blocks air and adds comments
This commit is contained in:
Contrabang
2025-02-07 05:15:08 -05:00
committed by GitHub
parent 659c4bb47e
commit f9f3b4aac6
21 changed files with 407 additions and 108 deletions
+1
View File
@@ -159,6 +159,7 @@ GLOBAL_LIST_INIT(admin_verbs_debug, list(
/proc/machine_upgrade,
/client/proc/map_template_load,
/client/proc/map_template_upload,
/client/proc/map_template_load_lazy,
/client/proc/view_runtimes,
/client/proc/admin_serialize,
/client/proc/uid_log,
@@ -56,3 +56,23 @@
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has uploaded a map template ([map]). Took [stop_watch(timer)]s.</span>")
else
to_chat(usr, "Map template '[map]' failed to load properly")
/client/proc/map_template_load_lazy()
set category = "Debug"
set name = "Map template - Lazy Load"
if(!check_rights(R_DEBUG))
return
var/map = input(usr, "Choose a Map Template to place on the lazy load map level.","Place Map Template") as null|anything in GLOB.map_templates
if(!map)
return
var/datum/map_template/template = GLOB.map_templates[map]
message_admins("<span class='adminnotice'>[key_name_admin(usr)] is lazyloading the map template ([template.name]).</span>")
var/datum/turf_reservation/reserve = SSmapping.lazy_load_template(template)
if(!istype(reserve))
message_admins("<span class='danger'>Lazyloading [template.name] failed! You should report this as a bug.</span>")
return
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has lazyloaded the map template ([template.name]) at [ADMIN_JMP(reserve.bottom_left_turf)]</span>")