Files
Bubberstation/code/modules/transport/admin.dm
John Willard 390c925352 Makes some admin panels use browser (#89398)
## About The Pull Request

del() log, radio log, check antagonists, law/dna/fingerprint logs all
use browser instead, which means darkmode, wahoo


![image](https://github.com/user-attachments/assets/efd968cf-9182-4e65-a4f0-2edb3431827a)

![image](https://github.com/user-attachments/assets/2bfd6ad2-42f0-4e42-8ad7-63821b31f021)

![image](https://github.com/user-attachments/assets/4a8f13e4-8e81-43cc-b00c-aecf033c9947)

The only difference now is that they are in darkmode, really.
Also removed browse calls to pipe dispensers (the machine) and windoor
assembly, as they both use TGUI now so these don't do anything.
Lastly, adds an early return to the tram admin tool if you don't select
a tram, cause I found it annoying.

## Why It's Good For The Game

Try to use old admin tools, get flashbanged

## Changelog

🆑
admin: Check antagonists & del/law/dna/fingerprint/radio log panels use
browsers which means they have darkmode. Also the tram panel will cancel
out if you click cancel.
/🆑
2025-02-12 17:09:33 -07:00

79 lines
4.2 KiB
Plaintext

ADMIN_VERB(reset_tram, R_DEBUG|R_ADMIN, "Reset Tram", "Reset a tram controller or its contents.", ADMIN_CATEGORY_DEBUG)
var/static/list/debug_tram_list = list(
TRAMSTATION_LINE_1,
BIRDSHOT_LINE_1,
BIRDSHOT_LINE_2,
HILBERT_LINE_1,
)
var/datum/transport_controller/linear/tram/broken_controller
var/selected_transport_id = tgui_input_list(user, "Which tram?", "Off the rails", debug_tram_list)
if(isnull(selected_transport_id))
return
var/reset_type = tgui_input_list(user, "How hard of a reset?", "How bad is it screwed up", list("Clear Tram Contents", "Controller", "Controller and Contents", "Delete Datum", "Cancel"))
if(isnull(reset_type) || reset_type == "Cancel")
return
for(var/datum/transport_controller/linear/tram/transport as anything in SStransport.transports_by_type[TRANSPORT_TYPE_TRAM])
if(transport.specific_transport_id == selected_transport_id)
broken_controller = transport
break
if(isnull(broken_controller))
to_chat(user, span_warning("Couldn't find a transport controller datum with ID [selected_transport_id]!"))
return
switch(reset_type)
if("Clear Tram Contents")
var/selection = tgui_alert(user, "Include player mobs in the clearing?", "Contents reset [selected_transport_id]", list("Contents", "Contents and Players", "Cancel"))
switch(selection)
if("Contents")
broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = FALSE)
message_admins("[key_name_admin(user)] performed a contents reset of tram ID [selected_transport_id].")
log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents reset.")
if("Contents and Players")
broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = TRUE)
message_admins("[key_name_admin(user)] performed a contents and player mob reset of tram ID [selected_transport_id].")
log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents and player mob reset.")
else
return
if("Controller")
log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a controller reset, force operational.")
message_admins("[key_name_admin(user)] performed a controller reset of tram ID [selected_transport_id].")
broken_controller.set_operational(TRUE)
broken_controller.reset_position()
if("Controller and Contents")
var/selection = tgui_alert(user, "Include player mobs in the clearing?", "Contents reset [selected_transport_id]", list("Contents", "Contents and Players", "Cancel"))
switch(selection)
if("Contents")
message_admins("[key_name_admin(user)] performed a contents and controller reset of tram ID [selected_transport_id].")
log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents reset. Controller reset, force operational.")
broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = FALSE)
if("Contents and Players")
message_admins("[key_name_admin(user)] performed a contents/player/controller reset of tram ID [selected_transport_id].")
log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents and player mob reset. Controller reset, force operational.")
broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = TRUE)
else
return
broken_controller.set_operational(TRUE)
broken_controller.reset_position()
if("Delete Datum")
var/confirm = tgui_alert(user, "Deleting [selected_transport_id] will make it unrecoverable this round. Are you sure?", "Delete tram ID [selected_transport_id]", list("Yes", "Cancel"))
if(confirm != "Yes")
return
var/obj/machinery/transport/tram_controller/tram_cabinet = broken_controller.paired_cabinet
if(!isnull(tram_cabinet))
tram_cabinet.controller_datum = null
tram_cabinet.update_appearance()
broken_controller.cycle_doors(CYCLE_OPEN, BYPASS_DOOR_CHECKS)
broken_controller.estop()
qdel(broken_controller)
message_admins("[key_name_admin(user)] performed a datum delete of tram ID [selected_transport_id].")