Lazy Template Loading - Nukie/Wiz (#71785)

## About The Pull Request

Removes the nukie base and wizard den from the base centcom map. They
are instead now lazy loaded as required.
To make a new lazy load template is fairly simple, make a map, allocate
an area for it, and place a marker at the bottom left corner of that
area. I have it check an area to ensure that if someone makes the map
larger than expected but doesn't account for the template allocation it
doesn't overwrite stuff without warning

[Replaces some improper CHECK_TICKs with
MAPLOADING_CHECK_TICKs](https://github.com/tgstation/tgstation/pull/71785/commits/c7fbca9148812b392dca76d5450fb6bb86716462)

Atom init has already been tripped by the time we get to this portion of
the loading, so if we don't use the right check tick, we will
potentially block unrelated init attempts. This is bad. (Lemon edit, I
want this in the commit desc)

## Why It's Good For The Game

Cuts down on init times.
Closes https://github.com/tgstation/dev-cycles-initiative/issues/17
## Changelog
🆑
admin: New mapping verb to load lazy templates as needed. In your admin
tab under the Mapping category.
/🆑
this isnt technically player visible, so not sure it needs a changelog

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
Zephyr
2022-12-21 00:33:30 -08:00
committed by GitHub
co-authored by san7890 Mothblocks LemonInTheDark
parent a6ea690a63
commit b182d6f320
29 changed files with 31431 additions and 18526 deletions
+34
View File
@@ -88,6 +88,7 @@ GLOBAL_PROTECT(admin_verbs_admin)
/client/proc/message_pda, /*send a message to somebody on PDA*/
/client/proc/fax_panel, /*send a paper to fax*/
/datum/admins/proc/trophy_manager,
/client/proc/force_load_lazy_template,
)
GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/ban_panel, /client/proc/stickybanpanel))
GLOBAL_PROTECT(admin_verbs_ban)
@@ -979,3 +980,36 @@ GLOBAL_PROTECT(admin_verbs_poll)
var/datum/browser/popup = new(mob, "spellreqs", "Spell Requirements", 600, 400)
popup.set_content(page_contents)
popup.open()
/client/proc/force_load_lazy_template()
set name = "Load/Jump Lazy Template"
set category = "Admin.Events"
if(!check_rights(R_ADMIN))
return
var/list/choices = LAZY_TEMPLATE_KEY_LIST_ALL()
var/choice = tgui_input_list(usr, "Key?", "Lazy Loader", choices)
if(!choice)
return
choice = choices[choice]
if(!choice)
to_chat(usr, span_warning("No template with that key found, report this!"))
return
var/already_loaded = LAZYACCESS(SSmapping.loaded_lazy_templates, choice)
var/force_load = FALSE
if(already_loaded && (tgui_alert(usr, "Template already loaded.", "", list("Jump", "Load Again")) == "Load Again"))
force_load = TRUE
var/datum/turf_reservation/reservation = SSmapping.lazy_load_template(choice, force = force_load)
if(!reservation)
to_chat(usr, span_boldwarning("Failed to load template!"))
return
if(!isobserver(usr))
admin_ghost()
usr.forceMove(coords2turf(reservation.bottom_left_coords))
message_admins("[key_name_admin(usr)] has loaded lazy template '[choice]'")
to_chat(usr, span_boldnicegreen("Template loaded, you have been moved to the bottom left of the reservation."))