Files
MrMelbert 5f35bdee00 [MDB Ignore] Re-add hop console second ID slot (#92157)
## About The Pull Request

<img width="491" height="301" alt="image"
src="https://github.com/user-attachments/assets/a3b5b19f-edf5-4de9-9201-9cbfab9e8827"
/>

Mod computers with the access changing software installed have a
secondary ID slot once again. This ID slot doesn't contribute to access.
You can insert IDs into the slot with right click and remove them with
alt-right click.

Also removes the "New IDs and you" memo paper.

Also tweaks PDA on_deconstruct so contents are dropped on when they're
deconstructed with assembly.

Fixes #92151

## Why It's Good For The Game

Changing IDs is very unnecessarily clunky with the one slot. Insert hop
id, log in, remove hop id, insert crew id, change access, remove crew
id, log out.

We had it right back when we had two slots. Insert hop ID, insert crew
id, log in. It just works.

This also allows for mobile HoPs to change access without necessitating
removing their ID from their PDA.

Other changes:

The "New IDs and you" memo is very old. They haven't been new for 4
years now. I don't think anyone reads it and they served their purpose.

I found it odd that, if your PDA was melted or blown up, it would delete
your ID. If this is a hold-over from old PDA behavior feel free to let
me know but otherwise it seems sensible that it'd spit out the contents
as you would expect.

## Changelog

🆑 Melbert
qol: The access changing software (the HoP console) now has ID two slots
again (one for the HoP's id and one for the ID being changed). You can
insert IDs in the secondary slot via the UI or right click, and remove
them via the UI or alt-right click.
qol: If your PDA is destroyed via acid or bombs, your ID (and similar
contents such as disks) are spit out instead of being deleted
del: Deletes the "New IDs and you" memo in the HoP's office. They
haven't been new for 4 years.
fix: Engineering sub-tab in the access changing software no longer looks
messed up
fix: Fix reversed alt-click logic for mod pcs
/🆑
# Conflicts:
#	code/modules/modular_computers/computers/item/computer.dm
2025-08-19 22:32:57 -04:00

147 lines
4.9 KiB
Plaintext

/datum/computer_file/program/robocontrol
filename = "botkeeper"
filedesc = "BotKeeper"
downloader_category = PROGRAM_CATEGORY_SCIENCE
program_open_overlay = "robot"
extended_desc = "A remote controller used for giving basic commands to non-sentient robots."
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
size = 6
tgui_id = "NtosRoboControl"
program_icon = "robot"
///Number of simple robots on-station.
var/botcount = 0
///Access granted by the used to summon robots.
var/list/current_access = list()
///List of all ping types you can annoy drones with.
var/static/list/drone_ping_types = list(
"Low",
"Medium",
"High",
"Critical",
)
/datum/computer_file/program/robocontrol/ui_data(mob/user)
var/list/data = list()
var/turf/current_turf = get_turf(computer.ui_host())
var/list/botlist = list()
var/list/mulelist = list()
if(computer)
data["id_owner"] = computer.stored_id || ""
botcount = 0
for(var/mob/living/simple_animal/bot/simple_bot as anything in GLOB.bots_list)
if(!is_valid_z_level(current_turf, get_turf(simple_bot)) || !(simple_bot.bot_mode_flags & BOT_MODE_REMOTE_ENABLED)) //Only non-emagged bots on the same Z-level are detected!
continue
if(!simple_bot.allowed(user) && !simple_bot.check_access(computer.stored_id)) // Only check Bots we can access
continue
var/list/newbot = list(
"name" = simple_bot.name,
"mode" = simple_bot.get_mode_ui(),
"model" = simple_bot.bot_type,
"locat" = get_area(simple_bot),
"bot_ref" = REF(simple_bot),
"mule_check" = FALSE,
)
if(simple_bot.bot_type == MULE_BOT)
var/mob/living/simple_animal/bot/mulebot/simple_mulebot = simple_bot
mulelist += list(list(
"name" = simple_mulebot.name,
"id" = simple_mulebot.id,
"dest" = simple_mulebot.destination,
"power" = simple_mulebot.cell ? simple_mulebot.cell.percent() : 0,
"home" = simple_mulebot.home_destination,
"autoReturn" = simple_mulebot.mulebot_delivery_flags & MULEBOT_RETURN_MODE,
"autoPickup" = simple_mulebot.mulebot_delivery_flags & MULEBOT_AUTO_PICKUP_MODE,
"reportDelivery" = simple_mulebot.mulebot_delivery_flags & MULEBOT_REPORT_DELIVERY_MODE,
"mule_ref" = REF(simple_mulebot),
"load" = simple_mulebot.get_load_name(),
))
newbot["mule_check"] = TRUE
botlist += list(newbot)
for(var/mob/living/basic/drone/all_drones as anything in GLOB.drones_list)
if(all_drones.hacked)
continue
if(!is_valid_z_level(current_turf, get_turf(all_drones)))
continue
var/list/drone_data = list(
"name" = all_drones.name,
"status" = all_drones.stat,
"drone_ref" = REF(all_drones),
)
data["drones"] += list(drone_data)
data["bots"] = botlist
data["mules"] = mulelist
data["botcount"] = botlist.len
data["droneaccess"] = GLOB.drone_machine_blacklist_enabled
data["dronepingtypes"] = drone_ping_types
return data
/datum/computer_file/program/robocontrol/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
var/mob/current_user = ui.user
var/obj/item/card/id/id_card = computer?.stored_id
var/static/list/standard_actions = list(
"patroloff",
"patrolon",
"ejectpai",
)
var/static/list/MULE_actions = list(
"stop",
"go",
"home",
"destination",
"setid",
"sethome",
"unload",
"autoret",
"autopick",
"report",
"ejectpai",
)
var/mob/living/simple_animal/bot/simple_bot = locate(params["robot"]) in GLOB.bots_list
if (action in standard_actions)
simple_bot.bot_control(action, current_user, id_card?.GetAccess())
if (action in MULE_actions)
simple_bot.bot_control(action, current_user, id_card?.GetAccess(), TRUE)
switch(action)
if("summon")
simple_bot.bot_control(action, current_user, id_card ? id_card.access : id_card?.GetAccess())
if("ejectcard")
if(!computer || !computer.stored_id)
return
if(id_card)
GLOB.manifest.modify(id_card.registered_name, id_card.assignment, id_card.get_trim_assignment())
computer.remove_id(usr)
else
playsound(get_turf(computer.ui_host()) , 'sound/machines/buzz/buzz-sigh.ogg', 25, FALSE)
if("changedroneaccess")
if(!computer || !computer.stored_id || !id_card)
to_chat(current_user, span_notice("No ID found, authorization failed."))
return
if(isdrone(current_user))
to_chat(current_user, span_notice("You can't free yourself."))
return
if(!(ACCESS_CE in id_card.access))
to_chat(current_user, span_notice("Required access not found on ID."))
return
GLOB.drone_machine_blacklist_enabled = !GLOB.drone_machine_blacklist_enabled
if("ping_drones")
if(!(params["ping_type"]) || !(params["ping_type"] in drone_ping_types))
return
var/area/current_area = get_area(current_user)
if(!current_area || QDELETED(current_user))
return
var/msg = span_boldnotice("NON-DRONE PING: [current_user.name]: [params["ping_type"]] priority alert in [current_area.name]!")
_alert_drones(msg, TRUE, current_user)
to_chat(current_user, msg)
playsound(src, 'sound/machines/terminal/terminal_success.ogg', 15, TRUE)