diff --git a/code/__DEFINES/machines.dm b/code/__DEFINES/machines.dm index b56024bfab8..070aaaa2249 100644 --- a/code/__DEFINES/machines.dm +++ b/code/__DEFINES/machines.dm @@ -92,3 +92,8 @@ // Firelock states #define FD_OPEN 1 #define FD_CLOSED 2 + +// Computer login types +#define LOGIN_TYPE_NORMAL 1 +#define LOGIN_TYPE_AI 2 +#define LOGIN_TYPE_ROBOT 3 diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 7ad38e59993..823610e7ea7 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -94,8 +94,11 @@ data["temp"] = temp data["scan"] = scan ? scan.name : null data["authenticated"] = authenticated + data["rank"] = rank data["screen"] = screen data["printing"] = printing + data["isAI"] = isAI(user) + data["isRobot"] = isrobot(user) if(authenticated) switch(screen) if(MED_DATA_R_LIST) @@ -211,17 +214,18 @@ I.forceMove(src) scan = I if("login") - if(isAI(usr)) - authenticated = usr.name - rank = "AI" - else if(isrobot(usr)) - authenticated = usr.name - var/mob/living/silicon/robot/R = usr - rank = "[R.modtype] [R.braintype]" - else if(istype(scan, /obj/item/card/id)) + var/login_type = text2num(params["login_type"]) + if(login_type == LOGIN_TYPE_NORMAL && istype(scan)) if(check_access(scan)) authenticated = scan.registered_name rank = scan.assignment + else if(login_type == LOGIN_TYPE_AI && isAI(usr)) + authenticated = usr.name + rank = "AI" + else if(login_type == LOGIN_TYPE_ROBOT && isrobot(usr)) + authenticated = usr.name + var/mob/living/silicon/robot/R = usr + rank = "[R.modtype] [R.braintype]" if(authenticated) active1 = null active2 = null diff --git a/tgui/packages/tgui/interfaces/common/LoginInfo.js b/tgui/packages/tgui/interfaces/common/LoginInfo.js index 0bb9decc12d..7a8bb1dc427 100644 --- a/tgui/packages/tgui/interfaces/common/LoginInfo.js +++ b/tgui/packages/tgui/interfaces/common/LoginInfo.js @@ -2,7 +2,8 @@ import { useBackend } from '../../backend'; import { Box, Button, NoticeBox } from '../../components'; /** - * Displays a notice box showing the `scan` data field if it exists. + * Displays a notice box showing the + * `authenticated` and `rank` data fields if they exist. * * Also gives an option to log off (calls `logout` TGUI action) * @param {object} _properties @@ -11,7 +12,8 @@ import { Box, Button, NoticeBox } from '../../components'; export const LoginInfo = (_properties, context) => { const { act, data } = useBackend(context); const { - scan, + authenticated, + rank, } = data; if (!data) { return; @@ -19,7 +21,7 @@ export const LoginInfo = (_properties, context) => { return ( - Logged in as: {scan} + Logged in as: {authenticated} ({rank})