Fixes the identification section not appearing in PDAs and improves its appearance just a bit (while also fixing some runtimes) (#71467)

## About The Pull Request
Yeah so turns out that #71420 broke the display of the identification
section in PDAs (and by extension, all modular (I guess not really
modular anymore) computers), because it forgot to remove a now unused
variable from the interface. However, while investigating this, I
strolled upon many more bugs and other general unresponsiveness of the
interface, so I went ahead and fixed those.

There's also no longer an empty set of `()` on both of the fields if
there's no ID inside of the computer anymore, because that was stupid.

## Why It's Good For The Game
Bug bad, fix good. Multiple fix, even better.

## Changelog

🆑 GoldenAlpharex
fix: PDAs (and by extension, modular computers) now can see the ID
section at the top of their main screen again, which means that PDAs can
have IDs imprinted on them again.
fix: Fixes the ID section not displaying anything when there wasn't any
ID inserted in it, even if it had an imprinted name and job.
fix: Fixes the "Eject ID" and "Imprint ID" buttons not being disabled
when there's no ID in the computer/PDA.
fix: There's no longer any empty () by in the "ID Name" and "Assignment"
fields of the ID section of computers when there's no ID in them.
/🆑
This commit is contained in:
GoldenAlpharex
2022-11-25 14:36:18 -05:00
committed by GitHub
parent 27d0f624f5
commit 06af45cfc5
2 changed files with 51 additions and 40 deletions

View File

@@ -57,23 +57,17 @@
/obj/item/modular_computer/ui_data(mob/user)
var/list/data = get_header_data()
data["device_theme"] = device_theme
data["login"] = list()
if(computer_id_slot)
var/stored_name = saved_identification
var/stored_title = saved_job
if(!stored_name)
stored_name = "Unknown"
if(!stored_title)
stored_title = "Unknown"
data["login"] = list(
IDName = saved_identification,
IDJob = saved_job,
)
data["proposed_login"] = list(
IDName = computer_id_slot.registered_name,
IDJob = computer_id_slot.assignment,
)
data["login"] = list(
IDName = saved_identification || "Unknown",
IDJob = saved_job || "Unknown",
)
data["proposed_login"] = list(
IDName = computer_id_slot?.registered_name,
IDJob = computer_id_slot?.assignment,
)
data["removable_media"] = list()
if(inserted_disk)
@@ -166,18 +160,26 @@
if("Eject Disk")
if(!inserted_disk)
return
user.put_in_hands(inserted_disk)
inserted_disk = null
playsound(src, 'sound/machines/card_slide.ogg', 50)
return TRUE
if("intelliCard")
var/datum/computer_file/program/ai_restorer/airestore_app = locate() in stored_files
if(!airestore_app)
return
if(airestore_app.try_eject(user))
playsound(src, 'sound/machines/card_slide.ogg', 50)
return TRUE
if("ID")
if(RemoveID())
playsound(src, 'sound/machines/card_slide.ogg', 50)
return TRUE
if("PC_Imprint_ID")
saved_identification = computer_id_slot.registered_name
saved_job = computer_id_slot.assignment