mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Context menu option (adminverb) - Open player panel of mobs inside vehicles/crates/machinery/etc. (#94787)
## About The Pull Request This PR adds an option to the context menu of objects that allows admins to open player panel of mobs inside closets/crates/coffins, body bags (both folded and unfolded), machinery, vehicles, morgue trays and crematoriums without selecting particular mob in VV of the object. Supported types of objects: /obj/vehicle; /obj/structure/closet; /obj/structure/bodycontainer; /obj/machinery; /obj/item/bodybag. The selection menu displays mob names and tags. If an /obj/vehicle is selected, its driver is marked accordingly in the menu. This verb also checks /obj/structure/closet and /obj/structure/bodycontainer for body bags (both folded and unfolded), adding any mobs inside them to the list. <img width="483" height="343" alt="prtest-pp-2" src="https://github.com/user-attachments/assets/5b387d15-5f86-4f78-b85b-3590ce9d1495" /> <img width="390" height="391" alt="prtest-pp-1" src="https://github.com/user-attachments/assets/e16c24a3-1741-43a7-8f3c-4f4d4dbba089" /> https://github.com/user-attachments/assets/2c75b7f8-5879-4476-973b-38f2fa638d10 ## Why It's Good For The Game QOL. You don't have to open PP via object's VV->occupants/contents->list->VV of a particular mob->show PP. ## Changelog 🆑 admin: New adminverb "show occupants PP". You can now open the PP of mobs inside vehicles, closets, machinery, body bags, etc. via the RMB context menu. /🆑 --------- Co-authored-by: AlexTheEng1neer <128976622+AlexTheEng1neer@users.noreply.github.com> Co-authored-by: Cornka <112967882+Kocma-san@users.noreply.github.com>
This commit is contained in:
co-authored by
AlexTheEng1neer
Cornka
parent
d81ce4211d
commit
d98c0112c4
@@ -151,6 +151,76 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_ADMIN, "Show Player Panel", mo
|
||||
user << browse(body, "window=adminplayeropts-[REF(player)];size=550x540")
|
||||
BLACKBOX_LOG_ADMIN_VERB("Player Panel")
|
||||
|
||||
ADMIN_VERB_ONLY_CONTEXT_MENU(show_occupants_player_panel, R_ADMIN, "Show Occupants PP", obj/target in world)
|
||||
var/list/options = list()
|
||||
|
||||
// Vehicles
|
||||
if(istype(target, /obj/vehicle))
|
||||
var/obj/vehicle/target_vehicle = target
|
||||
if(istype(target_vehicle.occupants, /list) && target_vehicle.occupants.len)
|
||||
for(var/mob/mob_occupant in target_vehicle.occupants)
|
||||
options["[mob_occupant.name] ([mob_occupant.tag])[target_vehicle.is_driver(mob_occupant) ? " (Driver)" : ""]"] = "\ref[mob_occupant]"
|
||||
// Searching for mobs in exosuit equipment (e.g. seccage, sleepers)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/obj_contents in target.contents)
|
||||
for(var/mob/mob_in_equipment in obj_contents.contents)
|
||||
options["[mob_in_equipment.name] ([mob_in_equipment.tag])"] = "\ref[mob_in_equipment]"
|
||||
|
||||
// Closets, crates, bodybags, coffins, etc.
|
||||
else if(istype(target, /obj/structure/closet))
|
||||
for(var/mob/mob_occupant in target.contents)
|
||||
options["[mob_occupant.name] ([mob_occupant.tag])"] = "\ref[mob_occupant]"
|
||||
// Searching for mobs in bodybags placed inside closet
|
||||
for(var/obj/structure/closet/obj_contents in target.contents)
|
||||
for(var/mob/mob_in_bodybag in obj_contents.contents)
|
||||
options["[mob_in_bodybag.name] ([mob_in_bodybag.tag])"] = "\ref[mob_in_bodybag]"
|
||||
// That's basically the same for folded bodybags (e.g. bluespace bodybags with mobs inside)
|
||||
for(var/obj/item/bodybag/obj_contents_folded in target.contents)
|
||||
for(var/mob/mob_in_bodybag_folded in obj_contents_folded.contents)
|
||||
options["[mob_in_bodybag_folded.name] ([mob_in_bodybag_folded.tag])"] = "\ref[mob_in_bodybag_folded]"
|
||||
|
||||
// Folded bodybags (e.g. bluespace bodybags with mobs inside)
|
||||
else if(istype(target, /obj/item/bodybag))
|
||||
for(var/mob/mob_occupant in target.contents)
|
||||
options["[mob_occupant.name] ([mob_occupant.tag])"] = "\ref[mob_occupant]"
|
||||
|
||||
// Body containers (morgue trays, crematoriums)
|
||||
else if(istype(target, /obj/structure/bodycontainer))
|
||||
for(var/mob/mob_occupant in target.contents)
|
||||
options["[mob_occupant.name] ([mob_occupant.tag])"] = "\ref[mob_occupant]"
|
||||
// Searching for mobs in bodybags placed inside body container
|
||||
for(var/obj/structure/closet/obj_contents in target.contents)
|
||||
for(var/mob/mob_in_bodybag in obj_contents.contents)
|
||||
options["[mob_in_bodybag.name] ([mob_in_bodybag.tag])"] = "\ref[mob_in_bodybag]"
|
||||
// That's basically the same for folded bodybags (e.g. bluespace bodybags with mobs inside)
|
||||
for(var/obj/item/bodybag/obj_contents_folded in target.contents)
|
||||
for(var/mob/mob_in_bodybag_folded in obj_contents_folded.contents)
|
||||
options["[mob_in_bodybag_folded.name] ([mob_in_bodybag_folded.tag])"] = "\ref[mob_in_bodybag_folded]"
|
||||
|
||||
// Machinery
|
||||
else if(istype(target, /obj/machinery))
|
||||
for(var/mob/mob_occupant in target.contents)
|
||||
options["[mob_occupant.name] ([mob_occupant.tag])"] = "\ref[mob_occupant]"
|
||||
|
||||
else
|
||||
tgui_alert(user,"Unsupported object type! Supported types: /obj/vehicle; /obj/structure/closet; /obj/structure/bodycontainer; /obj/machinery; /obj/item/bodybag.")
|
||||
return
|
||||
|
||||
if(!options.len)
|
||||
tgui_alert(user, "No occupants found!")
|
||||
return
|
||||
|
||||
var/choice
|
||||
if(options.len == 1)
|
||||
choice = options[1]
|
||||
else
|
||||
choice = tgui_input_list(user, "Select mob", "Player Panel", options)
|
||||
|
||||
if(choice)
|
||||
var/mob/selected_mob = locate(options[choice])
|
||||
if(selected_mob)
|
||||
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/show_player_panel, selected_mob)
|
||||
return
|
||||
|
||||
/client/proc/cmd_admin_godmode(mob/mob in GLOB.mob_list)
|
||||
set category = "Admin.Game"
|
||||
set name = "Godmode"
|
||||
|
||||
Reference in New Issue
Block a user