diff --git a/code/_onclick/hud/screen_objects_vr.dm b/code/_onclick/hud/screen_objects_vr.dm index 526a316618..65b6df5c3b 100644 --- a/code/_onclick/hud/screen_objects_vr.dm +++ b/code/_onclick/hud/screen_objects_vr.dm @@ -66,43 +66,6 @@ if(istype(H) && istype(H.species, /datum/species/xenochimera)) // If you're somehow able to click this while not a chimera, this should prevent weird runtimes. Will need changing if regeneration is ever opened to non-chimera using the same alert. if(H.revive_ready == REVIVING_DONE) // Sanity check. H.hatch() // Hatch. - //pAI buttons!!! - if("fold/unfold") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - if(p.loc == p.card) - p.fold_out() - else - p.fold_up() - if("choose chassis") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - p.choose_chassis() - - if("software interface") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - p.paiInterface() - - if("radio configuration") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - p.radio.tgui_interact(p) - - if("pda") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - p.pda.cmd_pda_open_ui() - - if("communicator") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - p.communicator.activate() - - if("known languages") - if(ispAI(usr)) - var/mob/living/silicon/pai/p = usr - p.check_languages() else return 0 diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index f3177ebc97..9e992f7414 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -84,8 +84,7 @@ var/obj/item/device/pda/ai/pai/pda = null - var/secHUD = 0 // Toggles whether the Security HUD is active or not - var/medHUD = 0 // Toggles whether the Medical HUD is active or not + var/paiHUD = 0 // Toggles whether the AR HUD is active or not var/medical_cannotfind = 0 var/datum/data/record/medicalActive1 // Datacore record declarations for record software diff --git a/code/modules/mob/living/silicon/pai/pai_hud.dm b/code/modules/mob/living/silicon/pai/pai_hud.dm index ce1fe4384b..aede47e7e1 100644 --- a/code/modules/mob/living/silicon/pai/pai_hud.dm +++ b/code/modules/mob/living/silicon/pai/pai_hud.dm @@ -1,6 +1,74 @@ /mob/living/silicon/pai var/obj/screen/pai/pai_fold_display = null +/obj/screen/pai + icon = 'icons/mob/pai_hud.dmi' + var/base_state + +/obj/screen/pai/Click_vr(location, control, params) + if(!usr) return 1 + if(!ispAI(usr)) return 1 + var/mob/living/silicon/pai/p = usr + switch(name) + if("fold/unfold") + if(p.loc == p.card) + p.fold_out() + else + p.fold_up() + if("choose chassis") + p.choose_chassis() + + if("software interface") + p.paiInterface() + + if("radio configuration") + p.radio.tgui_interact(p) + + if("pda") + p.pda.cmd_pda_open_ui() + + if("communicator") + p.communicator.activate() + + if("known languages") + p.check_languages() + + if("software toggle") + p.refresh_software_status() + if(p.hud_used.inventory_shown) + p.hud_used.inventory_shown = 0 + p.client.screen -= p.hud_used.other + else + p.hud_used.inventory_shown = 1 + p.client.screen += p.hud_used.other + + if("directives") + p.directives() + + if("crew manifest") + p.crew_manifest() + + if("universal translator") + p.translator() + + if("medical records") + p.med_records() + + if("security records") + p.sec_records() + + if("remote signaler") + p.remote_signal() + + if("atmosphere sensor") + p.atmos_sensor() + + if("door jack") + p.door_jack() + + if("ar hud") + p.ar_hud() + /obj/screen/pai/pai_fold_display name = "fold/unfold" icon = 'icons/mob/pai_hud.dmi' @@ -26,7 +94,7 @@ HUD.hotkeybuttons = hotkeybuttons HUD.hud_elements = hud_elements - var/obj/screen/using + var/obj/screen/pai/using //Small intent quarters @@ -91,66 +159,6 @@ using.alpha = ui_alpha HUD.hotkeybuttons += using - //Choose chassis button - using = new /obj/screen() - using.name = "choose chassis" - using.icon = ui_style - using.icon_state = "choose_chassis" - using.screen_loc = ui_movi - using.color = ui_color - using.alpha = ui_alpha - hud_elements |= using - - //Software interface button - using = new /obj/screen() - using.name = "software interface" - using.icon = ui_style - using.icon_state = "software_interface" - using.screen_loc = ui_acti - using.color = ui_color - using.alpha = ui_alpha - hud_elements |= using - - //Radio configuration button - using = new /obj/screen() - using.name = "radio configuration" - using.icon = ui_style - using.icon_state = "radio_configuration" - using.screen_loc = ui_acti - using.color = ui_color - using.alpha = ui_alpha - hud_elements |= using - - //PDA button - using = new /obj/screen() - using.name = "pda" - using.icon = ui_style - using.icon_state = "pda" - using.screen_loc = ui_pai_comms - using.color = ui_color - using.alpha = ui_alpha - hud_elements |= using - - //Communicator button - using = new /obj/screen() - using.name = "communicator" - using.icon = ui_style - using.icon_state = "communicator" - using.screen_loc = ui_pai_comms - using.color = ui_color - using.alpha = ui_alpha - hud_elements |= using - - //Language button - using = new /obj/screen() - using.name = "known languages" - using.icon = ui_style - using.icon_state = "language" - using.screen_loc = ui_acti - using.color = ui_color - using.alpha = ui_alpha - hud_elements |= using - //Pull button pullin = new /obj/screen() pullin.icon = ui_style @@ -183,6 +191,139 @@ pai_fold_display.icon_state = "folded" HUD.hud_elements |= pai_fold_display + //Choose chassis button + using = new /obj/screen/pai() + using.name = "choose chassis" + using.icon_state = "choose_chassis" + using.screen_loc = ui_movi + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + //Software interface button + using = new /obj/screen/pai() + using.name = "software interface" + using.icon_state = "software_interface" + using.screen_loc = ui_acti + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + //Radio configuration button + using = new /obj/screen/pai() + using.name = "radio configuration" + using.icon_state = "radio_configuration" + using.screen_loc = ui_acti + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + //PDA button + using = new /obj/screen/pai() + using.name = "pda" + using.icon_state = "pda" + using.screen_loc = ui_pai_comms + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + //Communicator button + using = new /obj/screen/pai() + using.name = "communicator" + using.icon_state = "communicator" + using.screen_loc = ui_pai_comms + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + //Language button + using = new /obj/screen/pai() + using.name = "known languages" + using.icon_state = "language" + using.screen_loc = ui_acti + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + using = new /obj/screen/pai() + using.name = "software toggle" + using.icon_state = "software" + using.screen_loc = ui_inventory + using.color = ui_color + using.alpha = ui_alpha + hud_elements |= using + + using = new /obj/screen/pai() + using.name = "directives" + using.icon_state = "directives" + using.screen_loc = "WEST:6,SOUTH:18" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "crew manifest" + using.icon_state = "manifest" + using.screen_loc = "WEST:6,SOUTH+1:2" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "medical records" + using.base_state = "med_records" + using.screen_loc = "WEST:6,SOUTH+1:18" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "security records" + using.base_state = "sec_records" + using.screen_loc = "WEST:6,SOUTH+2:2" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "atmosphere sensor" + using.base_state = "atmos_sensor" + using.screen_loc = "WEST:6,SOUTH+2:18" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "remote signaler" + using.base_state = "signaller" + using.screen_loc = "WEST:6,SOUTH+3:2" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "universal translator" + using.base_state = "translator" + using.screen_loc = "WEST:6,SOUTH+3:18" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "door jack" + using.base_state = "door_jack" + using.screen_loc = "WEST:6,SOUTH+4:2" + using.color = ui_color + using.alpha = ui_alpha + other |= using + + using = new /obj/screen/pai() + using.name = "ar hud" + using.base_state = "ar_hud" + using.screen_loc = "WEST:6,SOUTH+4:18" + using.color = ui_color + using.alpha = ui_alpha + other |= using if(client) client.screen = list() @@ -190,6 +331,9 @@ client.screen += adding + hotkeybuttons client.screen += client.void + HUD.inventory_shown = 0 + + /mob/living/silicon/pai/handle_regular_hud_updates() . = ..() if(healths) diff --git a/code/modules/mob/living/silicon/pai/pai_vr.dm b/code/modules/mob/living/silicon/pai/pai_vr.dm index 62deaa125f..12dd50682d 100644 --- a/code/modules/mob/living/silicon/pai/pai_vr.dm +++ b/code/modules/mob/living/silicon/pai/pai_vr.dm @@ -42,6 +42,14 @@ "car", "typeone" ) + //These vars keep track of whether you have the related software, used for easily updating the UI + var/soft_ut = FALSE //universal translator + var/soft_mr = FALSE //medical records + var/soft_sr = FALSE //security records + var/soft_dj = FALSE //door jack + var/soft_as = FALSE //atmosphere sensor + var/soft_si = FALSE //signaler + var/soft_ar = FALSE //ar hud /mob/living/silicon/pai/Initialize() . = ..() @@ -362,4 +370,181 @@ if(!new_gender_identity) return 0 gender = new_gender_identity - return 1 \ No newline at end of file +<<<<<<< HEAD + return 1 +======= + return 1 + +/mob/living/silicon/pai/verb/pai_hide() + set name = "Hide" + set desc = "Allows to hide beneath tables or certain items. Toggled on or off." + set category = "Abilities" + + hide() + if(status_flags & HIDING) + hide_glow = TRUE + else + hide_glow = FALSE + update_icon() + +/mob/living/silicon/pai/verb/screen_message(message as text|null) + set category = "pAI Commands" + set name = "Screen Message" + set desc = "Allows you to display a message on your screen. This will show up in the chat of anyone who is holding your card." + + if (src.client) + if(client.prefs.muted & MUTE_IC) + to_chat(src, "You cannot speak in IC (muted).") + return + if(loc != card) + to_chat(src, "Your message won't be visible while unfolded!") + if (!message) + message = tgui_input_text(src, "Enter text you would like to show on your screen.","Screen Message") + message = sanitize_or_reflect(message,src) + if (!message) + return + message = capitalize(message) + if (stat == DEAD) + return + card.screen_msg = message + var/logmsg = "(CARD SCREEN)[message]" + log_say(logmsg,src) + to_chat(src, "You print a message to your screen, \"[message]\"") + if(isliving(card.loc)) + var/mob/living/L = card.loc + if(L.client) + to_chat(L, "[src.name]'s screen prints, \"[message]\"") + else return + else if(isbelly(card.loc)) + var/obj/belly/b = card.loc + if(b.owner.client) + to_chat(b.owner, "[src.name]'s screen prints, \"[message]\"") + else return + else if(istype(card.loc, /obj/item/device/pda)) + var/obj/item/device/pda/p = card.loc + if(isliving(p.loc)) + var/mob/living/L = p.loc + if(L.client) + to_chat(L, "[src.name]'s screen prints, \"[message]\"") + else return + else if(isbelly(p.loc)) + var/obj/belly/b = card.loc + if(b.owner.client) + to_chat(b.owner, "[src.name]'s screen prints, \"[message]\"") + else return + else return + else return + to_chat(src, "Your message was relayed.") + for (var/mob/G in player_list) + if (istype(G, /mob/new_player)) + continue + else if(isobserver(G) && G.is_preference_enabled(/datum/client_preference/ghost_ears)) + if(is_preference_enabled(/datum/client_preference/whisubtle_vis) || G.client.holder) + to_chat(G, "[src.name]'s screen prints, \"[message]\"") + +/mob/living/silicon/pai/proc/touch_window(soft_name) //This lets us touch TGUI procs and windows that may be nested behind other TGUI procs and windows + for(var/thing in software) //so we can access our software without having to open up the software interface TGUI window + var/datum/pai_software/S = software[thing] + if(istype(S, /datum/pai_software) && S.name == soft_name) + if(S.toggle) + S.toggle(src) + to_chat(src, "You toggled [S.name].") + refresh_software_status() + else + S.tgui_interact(src) + refresh_software_status() + return + for(var/thing in pai_software_by_key) + var/datum/pai_software/our_soft = pai_software_by_key[thing] + if(our_soft.name == soft_name) + if(!(ram >= our_soft.ram_cost)) + to_chat(src, "Insufficient RAM for download. (Cost [our_soft.ram_cost] : [ram] Remaining)") + return + if(tgui_alert(src, "Do you want to download [our_soft.name]? It costs [our_soft.ram_cost], and you have [ram] remaining.", "Download [our_soft.name]", list("Yes", "No")) == "Yes") + ram -= our_soft.ram_cost + software[our_soft.id] = our_soft + to_chat(src, "You downloaded [our_soft.name]. ([ram] RAM remaining.)") + refresh_software_status() + +/mob/living/silicon/pai/proc/refresh_software_status() //This manages the pAI software status buttons icon states based on if you have them and if they are enabled + for(var/thing in software) //this only gets called when you click one of the relevent buttons, rather than all the time! + var/datum/pai_software/soft = software[thing] + if(istype(soft,/datum/pai_software/med_records)) + soft_mr = TRUE + if(istype(soft,/datum/pai_software/sec_records)) + soft_sr = TRUE + if(istype(soft,/datum/pai_software/door_jack)) + soft_dj = TRUE + if(istype(soft,/datum/pai_software/atmosphere_sensor)) + soft_as = TRUE + if(istype(soft,/datum/pai_software/pai_hud)) + soft_ar = TRUE + if(istype(soft,/datum/pai_software/translator)) + soft_ut = TRUE + if(istype(soft,/datum/pai_software/signaller)) + soft_si = TRUE + for(var/obj/screen/pai/button in hud_used.other) + if(button.name == "medical records") + if(soft_mr) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + if(button.name == "security records") + if(soft_sr) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + if(button.name == "door jack") + if(soft_dj) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + if(button.name == "atmosphere sensor") + if(soft_as) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + if(button.name == "remote signaler") + if(soft_si) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + if(button.name == "universal translator") + if(soft_ut && translator_on) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + if(button.name == "ar hud") + if(soft_ar && paiHUD) + button.icon_state = "[button.base_state]" + else + button.icon_state = "[button.base_state]_o" + +//Procs for using the various UI buttons for your softwares +/mob/living/silicon/pai/proc/directives() + touch_window("Directives") + +/mob/living/silicon/pai/proc/crew_manifest() + touch_window("Crew Manifest") + +/mob/living/silicon/pai/proc/med_records() + touch_window("Medical Records") + +/mob/living/silicon/pai/proc/sec_records() + touch_window("Security Records") + +/mob/living/silicon/pai/proc/remote_signal() + touch_window("Remote Signaler") + +/mob/living/silicon/pai/proc/atmos_sensor() + touch_window("Atmosphere Sensor") + +/mob/living/silicon/pai/proc/translator() + touch_window("Universal Translator") + +/mob/living/silicon/pai/proc/door_jack() + touch_window("Door Jack") + +/mob/living/silicon/pai/proc/ar_hud() + touch_window("AR HUD") +>>>>>>> 950b23cc87... Merge pull request #13142 from Very-Soft/morepaiinterface diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm index 07d82b74d0..d8594fd5fc 100644 --- a/code/modules/mob/living/silicon/pai/software_modules.dm +++ b/code/modules/mob/living/silicon/pai/software_modules.dm @@ -369,34 +369,24 @@ return data -/datum/pai_software/sec_hud - name = "Security HUD" - ram_cost = 20 - id = "sec_hud" +/datum/pai_software/pai_hud + name = "AR HUD" + ram_cost = 30 + id = "ar_hud" -/datum/pai_software/sec_hud/toggle(mob/living/silicon/pai/user) - user.secHUD = !user.secHUD - user.plane_holder.set_vis(VIS_CH_ID, user.secHUD) - user.plane_holder.set_vis(VIS_CH_WANTED, user.secHUD) - user.plane_holder.set_vis(VIS_CH_IMPTRACK, user.secHUD) - user.plane_holder.set_vis(VIS_CH_IMPLOYAL, user.secHUD) - user.plane_holder.set_vis(VIS_CH_IMPCHEM, user.secHUD) +/datum/pai_software/pai_hud/toggle(mob/living/silicon/pai/user) + user.paiHUD = !user.paiHUD + user.plane_holder.set_vis(VIS_CH_ID,user.paiHUD) + user.plane_holder.set_vis(VIS_CH_WANTED,user.paiHUD) + user.plane_holder.set_vis(VIS_CH_IMPTRACK,user.paiHUD) + user.plane_holder.set_vis(VIS_CH_IMPCHEM,user.paiHUD) + user.plane_holder.set_vis(VIS_CH_STATUS_R,user.paiHUD) + user.plane_holder.set_vis(VIS_CH_HEALTH_VR,user.paiHUD) + user.plane_holder.set_vis(VIS_CH_BACKUP,user.paiHUD) //backup stuff from silicon_vr is here now + user.plane_holder.set_vis(VIS_AUGMENTED,user.paiHUD) -/datum/pai_software/sec_hud/is_active(mob/living/silicon/pai/user) - return user.secHUD - -/datum/pai_software/med_hud - name = "Medical HUD" - ram_cost = 20 - id = "med_hud" - -/datum/pai_software/med_hud/toggle(mob/living/silicon/pai/user) - user.medHUD = !user.medHUD - user.plane_holder.set_vis(VIS_CH_STATUS, user.medHUD) - user.plane_holder.set_vis(VIS_CH_HEALTH, user.medHUD) - -/datum/pai_software/med_hud/is_active(mob/living/silicon/pai/user) - return user.medHUD +/datum/pai_software/pai_hud/is_active(mob/living/silicon/pai/user) + return user.paiHUD /datum/pai_software/translator name = "Universal Translator" diff --git a/icons/mob/pai_hud.dmi b/icons/mob/pai_hud.dmi index c1be3ab314..2009b0e237 100644 Binary files a/icons/mob/pai_hud.dmi and b/icons/mob/pai_hud.dmi differ