mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
[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 /🆑
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
interaction_flags_mouse_drop = NEED_HANDS | ALLOW_RESTING
|
||||
|
||||
///The ID currently stored in the computer.
|
||||
var/obj/item/card/id/computer_id_slot
|
||||
var/obj/item/card/id/stored_id
|
||||
///The alt slot, only used by certain UIs like the access app.
|
||||
var/obj/item/card/id/alt_stored_id
|
||||
///The disk in this PDA. If set, this will be inserted on Initialize.
|
||||
var/obj/item/computer_disk/inserted_disk
|
||||
///The power cell the computer uses to run on.
|
||||
@@ -189,8 +191,9 @@
|
||||
QDEL_NULL(inserted_disk)
|
||||
if(istype(inserted_pai))
|
||||
QDEL_NULL(inserted_pai)
|
||||
if(computer_id_slot)
|
||||
QDEL_NULL(computer_id_slot)
|
||||
|
||||
QDEL_NULL(stored_id)
|
||||
QDEL_NULL(alt_stored_id)
|
||||
|
||||
shell = null
|
||||
physical = null
|
||||
@@ -230,7 +233,7 @@
|
||||
if(issilicon(user))
|
||||
return NONE
|
||||
|
||||
if(RemoveID(user))
|
||||
if(remove_id(user))
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
if(istype(inserted_pai)) // Remove pAI
|
||||
@@ -239,22 +242,31 @@
|
||||
|
||||
return CLICK_ACTION_BLOCKING
|
||||
|
||||
/obj/item/modular_computer/click_alt_secondary(mob/user)
|
||||
if(issilicon(user))
|
||||
return NONE
|
||||
|
||||
if(remove_secondary_id(user))
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
return NONE
|
||||
|
||||
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs. //guess what
|
||||
/obj/item/modular_computer/GetAccess()
|
||||
if(computer_id_slot)
|
||||
return computer_id_slot.GetAccess()
|
||||
if(stored_id)
|
||||
return stored_id.GetAccess()
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/GetID()
|
||||
if(computer_id_slot)
|
||||
return computer_id_slot
|
||||
if(stored_id)
|
||||
return stored_id
|
||||
return ..()
|
||||
|
||||
/obj/item/modular_computer/get_id_examine_strings(mob/user)
|
||||
. = ..()
|
||||
if(computer_id_slot)
|
||||
. += "[src] is displaying [computer_id_slot]:"
|
||||
. += computer_id_slot.get_id_examine_strings(user)
|
||||
if(stored_id)
|
||||
. += "[src] is displaying [stored_id]:"
|
||||
. += stored_id.get_id_examine_strings(user)
|
||||
|
||||
/obj/item/modular_computer/proc/print_text(text_to_print, paper_title = "")
|
||||
if(!stored_paper)
|
||||
@@ -269,23 +281,23 @@
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* InsertID
|
||||
* Attempt to insert the ID in either card slot, if ID is present - attempts swap
|
||||
*
|
||||
* Args:
|
||||
* inserting_id - the ID being inserted
|
||||
* user - The person inserting the ID
|
||||
*/
|
||||
/obj/item/modular_computer/InsertID(obj/item/card/inserting_id, mob/user)
|
||||
/obj/item/modular_computer/insert_id(obj/item/card/inserting_id, mob/user)
|
||||
if(!isnull(user) && !user.transferItemToLoc(inserting_id, src))
|
||||
return FALSE
|
||||
|
||||
else
|
||||
inserting_id.forceMove(src)
|
||||
|
||||
if(!isnull(computer_id_slot))
|
||||
RemoveID(user, silent = TRUE)
|
||||
if(!isnull(stored_id))
|
||||
remove_id(user, silent = TRUE)
|
||||
|
||||
computer_id_slot = inserting_id
|
||||
stored_id = inserting_id
|
||||
|
||||
if(!isnull(user))
|
||||
to_chat(user, span_notice("You insert \the [inserting_id] into the card slot."))
|
||||
@@ -303,30 +315,79 @@
|
||||
SEND_SIGNAL(src, COMSIG_MODULAR_COMPUTER_INSERTED_ID, inserting_id, user)
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Attempts to insert a secondary ID card into the computer. If there is already a secondary ID card, attempts to swap
|
||||
*
|
||||
* Args:
|
||||
* * secondary_id - The ID card to insert into the secondary slot.
|
||||
* * user - The mob trying to insert the ID, if there is one.
|
||||
*/
|
||||
/obj/item/modular_computer/proc/insert_secondary_id(obj/item/card/id/secondary_id, mob/user)
|
||||
if(!isnull(alt_stored_id))
|
||||
remove_secondary_id(user, silent = TRUE)
|
||||
|
||||
if(!user.transferItemToLoc(secondary_id, src))
|
||||
return FALSE
|
||||
|
||||
alt_stored_id = secondary_id
|
||||
if(!isnull(user))
|
||||
to_chat(user, span_notice("You insert \the [secondary_id] into the secondary card slot."))
|
||||
balloon_alert(user, "inserted secondary ID")
|
||||
playsound(src, 'sound/machines/terminal/terminal_insert_disc.ogg', 50, FALSE)
|
||||
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Removes the alt ID card from the computer, and puts it in loc's hand if it's a mob
|
||||
*
|
||||
* Args:
|
||||
* * user - The mob trying to remove the ID, if there is one
|
||||
* * silent - Boolean, determines whether fluff text would be printed
|
||||
*/
|
||||
/obj/item/modular_computer/proc/remove_secondary_id(mob/user, silent = FALSE)
|
||||
if(!alt_stored_id)
|
||||
return FALSE
|
||||
|
||||
if(!issilicon(user) && in_range(src, user))
|
||||
user.put_in_hands(alt_stored_id)
|
||||
else
|
||||
alt_stored_id.forceMove(drop_location())
|
||||
|
||||
var/obj/item/lost_id = alt_stored_id
|
||||
alt_stored_id = null
|
||||
|
||||
if(!silent && !isnull(user))
|
||||
to_chat(user, span_notice("You remove \the [lost_id] from the secondary card slot."))
|
||||
balloon_alert(user, "removed secondary ID")
|
||||
playsound(src, 'sound/machines/terminal/terminal_insert_disc.ogg', 50, FALSE)
|
||||
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Removes the ID card from the computer, and puts it in loc's hand if it's a mob
|
||||
* Args:
|
||||
* user - The mob trying to remove the ID, if there is one
|
||||
* silent - Boolean, determines whether fluff text would be printed
|
||||
* * user - The mob trying to remove the ID, if there is one
|
||||
* * silent - Boolean, determines whether fluff text would be printed
|
||||
*/
|
||||
/obj/item/modular_computer/RemoveID(mob/user, silent = FALSE)
|
||||
if(!computer_id_slot)
|
||||
/obj/item/modular_computer/remove_id(mob/user, silent = FALSE)
|
||||
if(!stored_id)
|
||||
return ..()
|
||||
|
||||
if(crew_manifest_update)
|
||||
GLOB.manifest.modify(computer_id_slot.registered_name, computer_id_slot.assignment, computer_id_slot.get_trim_assignment())
|
||||
GLOB.manifest.modify(stored_id.registered_name, stored_id.assignment, stored_id.get_trim_assignment())
|
||||
|
||||
if(user && !issilicon(user) && in_range(src, user))
|
||||
user.put_in_hands(computer_id_slot)
|
||||
user.put_in_hands(stored_id)
|
||||
else
|
||||
computer_id_slot.forceMove(drop_location())
|
||||
stored_id.forceMove(drop_location())
|
||||
|
||||
computer_id_slot = null
|
||||
var/obj/item/lost_id = stored_id
|
||||
stored_id = null
|
||||
|
||||
if(!silent && !isnull(user))
|
||||
to_chat(user, span_notice("You remove the card from the card slot."))
|
||||
playsound(src, 'sound/machines/terminal/terminal_insert_disc.ogg', 50, FALSE)
|
||||
to_chat(user, span_notice("You remove \the [lost_id] from the card slot."))
|
||||
balloon_alert(user, "removed ID")
|
||||
playsound(src, 'sound/machines/terminal/terminal_insert_disc.ogg', 50, FALSE)
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
@@ -391,15 +452,20 @@
|
||||
. += "It is upgraded with an experimental long-ranged network capabilities, picking up NTNet frequencies while further away."
|
||||
. += span_notice("It has [max_capacity] GQ of storage capacity.")
|
||||
|
||||
if(computer_id_slot)
|
||||
if(stored_id)
|
||||
if(Adjacent(user))
|
||||
. += "It has \the [computer_id_slot] card installed in its card slot."
|
||||
. += "It has \the [stored_id] card inserted in its card slot.[alt_stored_id ? "" : " [span_info("Alt-click to eject it.")]"]"
|
||||
else
|
||||
. += "Its identification card slot is currently occupied."
|
||||
. += span_info("Alt-click [src] to eject the identification card.")
|
||||
|
||||
if(alt_stored_id)
|
||||
if(Adjacent(user))
|
||||
. += "It has \the [alt_stored_id] card stored in its secondary card slot. [span_info("Alt-click to eject it.")]"
|
||||
else
|
||||
. += "Its secondary identification card slot is currently occupied."
|
||||
|
||||
if(internal_cell)
|
||||
. += span_info("Right-click it with a screwdriver to eject the [internal_cell]")
|
||||
. += span_info("Right-click it with a screwdriver to eject the [internal_cell].")
|
||||
|
||||
/obj/item/modular_computer/examine_more(mob/user)
|
||||
. = ..()
|
||||
@@ -415,8 +481,10 @@
|
||||
/obj/item/modular_computer/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
|
||||
. = ..()
|
||||
|
||||
if(computer_id_slot && isidcard(held_item))
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Swap ID"
|
||||
if(isidcard(held_item))
|
||||
context[SCREENTIP_CONTEXT_LMB] = stored_id ? "Swap ID" : "Insert ID"
|
||||
if(HAS_TRAIT(src, TRAIT_MODPC_TWO_ID_SLOTS))
|
||||
context[SCREENTIP_CONTEXT_RMB] = alt_stored_id ? "Swap Secondary ID" : "Insert Secondary ID"
|
||||
. = CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
if(held_item?.tool_behaviour == TOOL_SCREWDRIVER && internal_cell)
|
||||
@@ -426,7 +494,10 @@
|
||||
context[SCREENTIP_CONTEXT_RMB] = "Deconstruct"
|
||||
. = CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
if(computer_id_slot) // ID get removed first before pAIs
|
||||
if(alt_stored_id)
|
||||
context[SCREENTIP_CONTEXT_ALT_RMB] = "Remove Secondary ID"
|
||||
. = CONTEXTUAL_SCREENTIP_SET
|
||||
if(stored_id) // ID get removed first before pAIs
|
||||
context[SCREENTIP_CONTEXT_ALT_LMB] = "Remove ID"
|
||||
. = CONTEXTUAL_SCREENTIP_SET
|
||||
else if(inserted_pai)
|
||||
@@ -457,12 +528,14 @@
|
||||
internal_cell = null
|
||||
if(enabled && !use_energy())
|
||||
shutdown_computer()
|
||||
if(computer_id_slot == gone)
|
||||
computer_id_slot = null
|
||||
if(stored_id == gone)
|
||||
stored_id = null
|
||||
update_slot_icon()
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/human_wearer = loc
|
||||
human_wearer.update_ID_card()
|
||||
if(alt_stored_id == gone)
|
||||
alt_stored_id = null
|
||||
if(inserted_pai == gone)
|
||||
update_appearance(UPDATE_ICON)
|
||||
if(inserted_disk == gone)
|
||||
@@ -718,8 +791,8 @@
|
||||
///Imprints name and job into the modular computer, and calls back to necessary functions.
|
||||
///Acts as a replacement to directly setting the imprints fields. All fields are optional, the proc will try to fill in missing gaps.
|
||||
/obj/item/modular_computer/proc/imprint_id(name = null, job_name = null)
|
||||
saved_identification = name || computer_id_slot?.registered_name || saved_identification
|
||||
saved_job = job_name || computer_id_slot?.assignment || saved_job
|
||||
saved_identification = name || stored_id?.registered_name || saved_identification
|
||||
saved_job = job_name || stored_id?.assignment || saved_job
|
||||
SEND_SIGNAL(src, COMSIG_MODULAR_PDA_IMPRINT_UPDATED, saved_identification, saved_job)
|
||||
UpdateDisplay()
|
||||
|
||||
@@ -823,9 +896,15 @@
|
||||
update_appearance()
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/modular_computer/item_interaction_secondary(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(isidcard(tool) && HAS_TRAIT(src, TRAIT_MODPC_TWO_ID_SLOTS))
|
||||
return insert_secondary_id(tool, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
|
||||
|
||||
return item_interaction(user, tool, modifiers)
|
||||
|
||||
/obj/item/modular_computer/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(isidcard(tool))
|
||||
return InsertID(tool, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
|
||||
return insert_id(tool, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
|
||||
|
||||
if(iscash(tool))
|
||||
return money_act(user, tool)
|
||||
@@ -854,8 +933,10 @@
|
||||
if(istype(tool, /obj/item/computer_disk))
|
||||
return computer_disk_act(user, tool)
|
||||
|
||||
return NONE
|
||||
|
||||
/obj/item/modular_computer/proc/money_act(mob/user, obj/item/money)
|
||||
var/obj/item/card/id/inserted_id = computer_id_slot?.GetID()
|
||||
var/obj/item/card/id/inserted_id = stored_id?.GetID()
|
||||
if(!inserted_id)
|
||||
balloon_alert(user, "no ID!")
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
@@ -934,16 +1015,16 @@
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/modular_computer/atom_deconstruct(disassembled = TRUE)
|
||||
var/atom/droploc = drop_location()
|
||||
remove_pai()
|
||||
eject_aicard()
|
||||
if (disassembled)
|
||||
internal_cell?.forceMove(drop_location())
|
||||
computer_id_slot?.forceMove(drop_location())
|
||||
inserted_disk?.forceMove(drop_location())
|
||||
new /obj/item/stack/sheet/iron(drop_location(), steel_sheet_cost)
|
||||
else
|
||||
internal_cell?.forceMove(droploc)
|
||||
stored_id?.forceMove(droploc)
|
||||
alt_stored_id?.forceMove(droploc)
|
||||
inserted_disk?.forceMove(droploc)
|
||||
if (!disassembled)
|
||||
physical.visible_message(span_notice("\The [src] breaks apart!"))
|
||||
new /obj/item/stack/sheet/iron(drop_location(), round(steel_sheet_cost * 0.5))
|
||||
new /obj/item/stack/sheet/iron(droploc, steel_sheet_cost * (disassembled ? 1 : 0.5))
|
||||
relay_qdel()
|
||||
|
||||
// Ejects the inserted intellicard, if one exists. Used when the computer is deconstructed.
|
||||
@@ -998,7 +1079,7 @@
|
||||
if(SEC_LEVEL_RED) // all-hands-on-deck situations, everyone is responsible for combatting a threat
|
||||
return ALERT_RELEVANCY_PERTINENT
|
||||
if(SEC_LEVEL_BLUE) // suspected threat. security needs to be alert and possibly preparing for it, no further concerns
|
||||
if(ACCESS_SECURITY in computer_id_slot?.access)
|
||||
if(ACCESS_SECURITY in stored_id?.access)
|
||||
return ALERT_RELEVANCY_PERTINENT
|
||||
else
|
||||
return ALERT_RELEVANCY_WARN
|
||||
|
||||
@@ -97,9 +97,9 @@
|
||||
)
|
||||
|
||||
data["proposed_login"] = list(
|
||||
IDInserted = computer_id_slot ? TRUE : FALSE,
|
||||
IDName = computer_id_slot?.registered_name,
|
||||
IDJob = computer_id_slot?.assignment,
|
||||
IDInserted = stored_id ? TRUE : FALSE,
|
||||
IDName = stored_id?.registered_name,
|
||||
IDJob = stored_id?.assignment,
|
||||
)
|
||||
|
||||
data["removable_media"] = list()
|
||||
@@ -211,7 +211,7 @@
|
||||
return TRUE
|
||||
|
||||
if("ID")
|
||||
if(RemoveID(user))
|
||||
if(remove_id(user))
|
||||
playsound(src, 'sound/machines/card_slide.ogg', 50)
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
/obj/item/modular_computer/pda/update_overlays()
|
||||
. = ..()
|
||||
if(computer_id_slot)
|
||||
if(stored_id)
|
||||
. += mutable_appearance(overlays_icon, "id_overlay")
|
||||
if(light_on)
|
||||
. += mutable_appearance(overlays_icon, "light_overlay")
|
||||
|
||||
@@ -50,10 +50,16 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/modular_computer/add_context(atom/source, list/context, obj/item/held_item, mob/user)
|
||||
. = ..()
|
||||
. = NONE
|
||||
|
||||
if(isnull(held_item))
|
||||
context[SCREENTIP_CONTEXT_RMB] = "Toggle processor interaction"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
. |= CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
if(CPU_INTERACTABLE(user))
|
||||
. |= cpu?.add_context(source, context, held_item, user)
|
||||
|
||||
return .
|
||||
|
||||
/obj/machinery/modular_computer/attack_hand_secondary(mob/user, list/modifiers)
|
||||
. = ..()
|
||||
@@ -117,11 +123,17 @@
|
||||
return update_icon(updates)
|
||||
|
||||
/obj/machinery/modular_computer/click_alt(mob/user)
|
||||
if(CPU_INTERACTABLE(user) || !can_interact(user))
|
||||
if(!CPU_INTERACTABLE(user) || !can_interact(user))
|
||||
return NONE
|
||||
cpu.click_alt(user)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/machinery/modular_computer/click_alt_secondary(mob/user)
|
||||
if(!CPU_INTERACTABLE(user) || !can_interact(user))
|
||||
return NONE
|
||||
cpu.click_alt_secondary(user)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
/obj/machinery/modular_computer/interact(mob/user)
|
||||
@@ -157,6 +169,9 @@
|
||||
/obj/machinery/modular_computer/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
return (CPU_INTERACTABLE(user) && !user.combat_mode) ? cpu.item_interaction(user, tool, modifiers) : ..()
|
||||
|
||||
/obj/machinery/modular_computer/item_interaction_secondary(mob/living/user, obj/item/tool, list/modifiers)
|
||||
return (CPU_INTERACTABLE(user) && !user.combat_mode) ? cpu.item_interaction_secondary(user, tool, modifiers) : ..()
|
||||
|
||||
/obj/machinery/modular_computer/attacked_by(obj/item/attacking_item, mob/living/user, list/modifiers, list/attack_modifiers)
|
||||
return CPU_INTERACTABLE(user) ? cpu.attacked_by(attacking_item, user, modifiers, attack_modifiers) : ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user