Skip to content

Commit

Permalink
adds debug verb
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Feb 24, 2024
1 parent 7dac02f commit b76a233
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ GLOBAL_LIST_INIT(admin_verbs_major_event, list(
/client/proc/load_event_level,
/client/proc/cmd_fun_fire_ob,
/client/proc/map_template_upload,
/client/proc/force_load_lazy_template,
/client/proc/enable_podlauncher,
/client/proc/change_taskbar_icon,
/client/proc/change_weather,
Expand Down
27 changes: 27 additions & 0 deletions code/modules/admin/verbs/map_template_loadverb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,30 @@
SSmapping.map_templates[M.name] = M
message_admins(SPAN_ADMINNOTICE("[key_name_admin(src)] has uploaded a map template '[map]' ([M.width]x[M.height])[report_link]."))
to_chat(src, SPAN_NOTICE("Map template '[map]' ready to place ([M.width]x[M.height])"), confidential = TRUE)

/client/proc/force_load_lazy_template()
set name = "Map Template - Lazy Load/Jump"
set category = "Admin.Events"
if(!check_rights(R_EVENT))
return

var/choice = tgui_input_list(usr, "Key?", "Lazy Loader", GLOB.lazy_templates)
if(!choice)
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(reservation.bottom_left_turfs[1])

message_admins("[key_name_admin(usr)] has loaded lazy template '[choice]'")
to_chat(usr, SPAN_BOLD("Template loaded, you have been moved to the bottom left of the reservation."))
2 changes: 1 addition & 1 deletion code/modules/shuttle/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@

if(must_launch_home)
if(action == "launch_home")
var/datum/turf_reservation/loaded = SSmapping.lazy_load_template(ert.home_base)
var/datum/turf_reservation/loaded = SSmapping.lazy_load_template(ert.home_base, force = TRUE)
var/turf/bottom_left = loaded.bottom_left_turfs[1]
var/turf/top_right = loaded.top_right_turfs[1]

Expand Down

0 comments on commit b76a233

Please sign in to comment.