From 8263926efa66a5046848616d47a798515d196a52 Mon Sep 17 00:00:00 2001
From: Killian <49700375+KillianKirilenko@users.noreply.github.com>
Date: Sun, 5 Jul 2020 07:08:35 +0100
Subject: [PATCH 1/4] AR glasses tweaks
---
.../loadout/loadout_eyes_vr.dm | 5 ++
code/modules/clothing/glasses/hud_vr.dm | 76 ++++++++++++++++---
2 files changed, 71 insertions(+), 10 deletions(-)
diff --git a/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm b/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm
index 276554554f9..e32c42f702a 100644
--- a/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm
@@ -17,6 +17,11 @@
display_name = "AR-S glasses (Sec)"
path = /obj/item/clothing/glasses/omnihud/sec
allowed_roles = list("Security Officer","Head of Security","Warden","Detective")
+
+/datum/gear/eyes/arglasses/sci
+ display_name = "AR-R glasses (Sci)"
+ path = /obj/item/clothing/glasses/omnihud/rnd
+ allowed_roles = list("Research Director","Scientist","Xenobiologist","Roboticist")
/datum/gear/eyes/arglasses/eng
display_name = "AR-E glasses (Eng)"
diff --git a/code/modules/clothing/glasses/hud_vr.dm b/code/modules/clothing/glasses/hud_vr.dm
index db22d70e97a..c45471ae732 100644
--- a/code/modules/clothing/glasses/hud_vr.dm
+++ b/code/modules/clothing/glasses/hud_vr.dm
@@ -1,7 +1,8 @@
/obj/item/clothing/glasses/omnihud
name = "\improper AR glasses"
desc = "The ARG-62 AR Glasses are capable of displaying information on individuals. \
- Commonly used to allow non-augmented crew to interact with virtual interfaces."
+ Commonly used to allow non-augmented crew to interact with virtual interfaces. \
+
They are also fitted with toggleable electrochromic lenses."
origin_tech = list(TECH_MAGNET = 3, TECH_BIO = 3)
var/obj/item/clothing/glasses/hud/omni/hud = null
var/mode = "civ"
@@ -31,6 +32,13 @@
arscreen = null
spawn(20 SECONDS)
arscreen = disconnect_ar
+
+ //extra fun for non-sci variants; a small chance flip the state to the dumb 3d glasses when EMP'd
+ if(icon_state == "glasses" || icon_state == "sun")
+ if(prob(10))
+ icon_state = "3d"
+ if(ishuman(loc))
+ to_chat(loc, "The lenses of your [src.name] malfunction!")
..()
/obj/item/clothing/glasses/omnihud/proc/flashed()
@@ -40,12 +48,18 @@
/obj/item/clothing/glasses/omnihud/prescribe(var/mob/user)
prescription = !prescription
playsound(src,'sound/items/screwdriver.ogg', 50, 1)
- if(prescription)
+ if(prescription && icon_state == "glasses")
name = "[initial(name)] (pr)"
user.visible_message("[user] uploads new prescription data to the [src.name].")
+ icon_state = "glasses"
+ else if(prescription && icon_state == "sun")
+ name = "[initial(name)] (shaded, pr)"
+ user.visible_message("[user] uploads new prescription data to the [src.name].")
+ icon_state = "sun"
else
name = "[initial(name)]"
- user.visible_message("[user] deletes the prescription data on the [src.name].")
+ user.visible_message("[user] deletes the prescription data on the [src.name] and resets the lenses.")
+ icon_state = "glasses"
/obj/item/clothing/glasses/omnihud/attack_self(mob/user)
if(!ishuman(user))
@@ -58,6 +72,41 @@
if(!ar_interact(H))
to_chat(user, "The [src] does not have any kind of special display.")
+//cosmetic shading, doesn't enhance eye protection
+/obj/item/clothing/glasses/omnihud/verb/chromatize()
+ set name = "Toggle AR Glasses Shading"
+ set desc = "Toggle the cosmetic electrochromatic shading of your AR glasses."
+ set category = "Object"
+ set src in usr
+ if(!usr.canmove || usr.stat || usr.restrained())
+ return
+ if(icon_state == "3d")
+ to_chat(usr, "You reset the electrochromic lenses of \the [src] back to normal.")
+ if(prescription)
+ name = "[initial(name)] (pr)"
+ else
+ name = "[initial(name)]"
+ icon_state = "glasses"
+ else if(prescription)
+ if(icon_state == "glasses")
+ to_chat(usr, "You darken the electrochromic lenses of \the [src] to one-way transparency.")
+ name = "[initial(name)] (shaded, pr)"
+ icon_state = "sun"
+ else if(icon_state == "sun")
+ to_chat(usr, "You restore the electrochromic lenses of \the [src] to standard two-way transparency.")
+ name = "[initial(name)] (pr)"
+ icon_state = "glasses"
+ else if(!prescription)
+ if(icon_state == "glasses")
+ to_chat(usr, "You darken the electrochromic lenses of \the [src] to one-way transparency.")
+ name = "[initial(name)] (shaded)"
+ icon_state = "sun"
+ else if(icon_state == "sun")
+ to_chat(usr, "You restore the electrochromic lenses of \the [src] to standard two-way transparency.")
+ name = "[initial(name)]"
+ icon_state = "glasses"
+ update_clothing_icon()
+
/obj/item/clothing/glasses/omnihud/proc/ar_interact(var/mob/living/carbon/human/user)
return 0 //The base models do nothing.
@@ -68,7 +117,8 @@
/obj/item/clothing/glasses/omnihud/med
name = "\improper AR-M glasses"
desc = "The ARG-62-M AR Glasses are capable of displaying information on individuals. \
- These have been upgraded with medical records access and virus database integration."
+ These have been upgraded with medical records access and virus database integration. \
+ They can also read data from active suit sensors using the crew monitoring system."
mode = "med"
action_button_name = "AR Console (Crew Monitor)"
arscreen_path = /datum/nano_module/program/crew_monitor
@@ -82,7 +132,8 @@
/obj/item/clothing/glasses/omnihud/sec
name = "\improper AR-S glasses"
desc = "The ARG-62-S AR Glasses are capable of displaying information on individuals. \
- These have been upgraded with security records integration and flash protection."
+ These have been upgraded with security records integration and flash protection. \
+ They also have access to security alerts such as camera and motion sensor alarms."
mode = "sec"
flash_protection = FLASH_PROTECTION_MAJOR
action_button_name = "AR Console (Security Alerts)"
@@ -97,7 +148,8 @@
/obj/item/clothing/glasses/omnihud/eng
name = "\improper AR-E glasses"
desc = "The ARG-62-E AR Glasses are capable of displaying information on individuals. \
- These have been upgraded with advanced electrochromic lenses to protect your eyes during welding."
+ These have been upgraded with advanced electrochromic lenses to protect your eyes during welding, \
+ and can also display a list of atmospheric, fire, and power alarms."
mode = "eng"
flash_protection = FLASH_PROTECTION_MAJOR
action_button_name = "AR Console (Station Alerts)"
@@ -111,11 +163,8 @@
/obj/item/clothing/glasses/omnihud/rnd
name = "\improper AR-R glasses"
desc = "The ARG-62-R AR Glasses are capable of displaying information on individuals. \
- These have been ... modified ... to fit into a different frame."
+ They... don't seem to do anything particularly interesting? But hey, at least they look kinda science-y."
mode = "sci"
- icon = 'icons/obj/clothing/glasses.dmi'
- icon_override = null
- icon_state = "purple"
/obj/item/clothing/glasses/omnihud/eng/meson
name = "meson scanner HUD"
@@ -161,6 +210,13 @@
mode = "best"
flash_protection = FLASH_PROTECTION_MAJOR
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED)
+ action_button_name = "AR Console (All Alerts)"
+ arscreen_path = /datum/nano_module/alarm_monitor/all
+
+ ar_interact(var/mob/living/carbon/human/user)
+ if(arscreen)
+ arscreen.ui_interact(user,"main",null,1,glasses_state)
+ return 1
/obj/item/clothing/glasses/hud/security/eyepatch
name = "Security Hudpatch"
From caf631acb8db21e84a658688f1d67d87502b5a5e Mon Sep 17 00:00:00 2001
From: Killian <49700375+KillianKirilenko@users.noreply.github.com>
Date: Sun, 5 Jul 2020 08:05:35 +0100
Subject: [PATCH 2/4] Update hud_vr.dm
---
code/modules/clothing/glasses/hud_vr.dm | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/code/modules/clothing/glasses/hud_vr.dm b/code/modules/clothing/glasses/hud_vr.dm
index c45471ae732..71dd4b0b244 100644
--- a/code/modules/clothing/glasses/hud_vr.dm
+++ b/code/modules/clothing/glasses/hud_vr.dm
@@ -48,18 +48,14 @@
/obj/item/clothing/glasses/omnihud/prescribe(var/mob/user)
prescription = !prescription
playsound(src,'sound/items/screwdriver.ogg', 50, 1)
- if(prescription && icon_state == "glasses")
- name = "[initial(name)] (pr)"
- user.visible_message("[user] uploads new prescription data to the [src.name].")
- icon_state = "glasses"
- else if(prescription && icon_state == "sun")
- name = "[initial(name)] (shaded, pr)"
- user.visible_message("[user] uploads new prescription data to the [src.name].")
- icon_state = "sun"
+ if(prescription)
+ user.visible_message("[user] uploads new prescription data to the [src.name] and resets the lenses.")
+ name = "[initial(name)] (pr)" //change the name *after* the text so the message above is accurate
+ icon_state = "[initial(icon_state)]" //reset the icon state just to be safe
else
- name = "[initial(name)]"
user.visible_message("[user] deletes the prescription data on the [src.name] and resets the lenses.")
- icon_state = "glasses"
+ name = "[initial(name)]"
+ icon_state = "[initial(icon_state)]"
/obj/item/clothing/glasses/omnihud/attack_self(mob/user)
if(!ishuman(user))
@@ -86,7 +82,7 @@
name = "[initial(name)] (pr)"
else
name = "[initial(name)]"
- icon_state = "glasses"
+ icon_state = "[initial(icon_state)]"
else if(prescription)
if(icon_state == "glasses")
to_chat(usr, "You darken the electrochromic lenses of \the [src] to one-way transparency.")
@@ -96,6 +92,8 @@
to_chat(usr, "You restore the electrochromic lenses of \the [src] to standard two-way transparency.")
name = "[initial(name)] (pr)"
icon_state = "glasses"
+ else
+ to_chat(usr, "The [src] don't seem to support this functionality.")
else if(!prescription)
if(icon_state == "glasses")
to_chat(usr, "You darken the electrochromic lenses of \the [src] to one-way transparency.")
@@ -105,6 +103,8 @@
to_chat(usr, "You restore the electrochromic lenses of \the [src] to standard two-way transparency.")
name = "[initial(name)]"
icon_state = "glasses"
+ else
+ to_chat(usr, "The [src] don't seem to support this functionality.")
update_clothing_icon()
/obj/item/clothing/glasses/omnihud/proc/ar_interact(var/mob/living/carbon/human/user)
From 8b92138c1f9bf1ae1859b46345a6609fe3beee9e Mon Sep 17 00:00:00 2001
From: Killian <49700375+KillianKirilenko@users.noreply.github.com>
Date: Mon, 6 Jul 2020 22:22:39 +0100
Subject: [PATCH 3/4] add projector to loadout, more minor tweaks
---
.../preference_setup/loadout/loadout_eyes_vr.dm | 4 ++++
code/modules/clothing/glasses/hud_vr.dm | 14 ++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm b/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm
index e32c42f702a..baa19d0aeca 100644
--- a/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_eyes_vr.dm
@@ -47,6 +47,10 @@
display_name = "science goggles (no overlay)"
path = /obj/item/clothing/glasses/fluff/science_proper
+/datum/gear/eyes/meson/retinal
+ display_name = "retinal projector, meson (Eng, Sci, Mining)"
+ path = /obj/item/clothing/glasses/omnihud/eng/meson
+
/datum/gear/eyes/security/secpatch
display_name = "Security HUDpatch"
path = /obj/item/clothing/glasses/hud/security/eyepatch
diff --git a/code/modules/clothing/glasses/hud_vr.dm b/code/modules/clothing/glasses/hud_vr.dm
index 71dd4b0b244..cf02ad326c9 100644
--- a/code/modules/clothing/glasses/hud_vr.dm
+++ b/code/modules/clothing/glasses/hud_vr.dm
@@ -2,7 +2,8 @@
name = "\improper AR glasses"
desc = "The ARG-62 AR Glasses are capable of displaying information on individuals. \
Commonly used to allow non-augmented crew to interact with virtual interfaces. \
-
They are also fitted with toggleable electrochromic lenses."
+
They are also fitted with toggleable cosmetic electrochromic lenses. \
+ The lenses will not protect against sudden bright flashes or welding."
origin_tech = list(TECH_MAGNET = 3, TECH_BIO = 3)
var/obj/item/clothing/glasses/hud/omni/hud = null
var/mode = "civ"
@@ -135,7 +136,7 @@
These have been upgraded with security records integration and flash protection. \
They also have access to security alerts such as camera and motion sensor alarms."
mode = "sec"
- flash_protection = FLASH_PROTECTION_MAJOR
+ flash_protection = FLASH_PROTECTION_MODERATE //weld protection is a little too widespread
action_button_name = "AR Console (Security Alerts)"
arscreen_path = /datum/nano_module/alarm_monitor/security
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_WANTED,VIS_AUGMENTED)
@@ -168,7 +169,7 @@
/obj/item/clothing/glasses/omnihud/eng/meson
name = "meson scanner HUD"
- desc = "A headset equipped with a scanning lens and mounted retinal projector. They don't provide any eye protection, but they're less obtrusive than goggles."
+ desc = "A headset equipped with a scanning lens and mounted retinal projector. It doesn't provide any eye protection, but it's less obtrusive than goggles."
icon = 'icons/vore/custom_items_vr.dmi'
icon_override = 'icons/vore/custom_clothes_vr.dmi'
icon_state = "projector"
@@ -176,6 +177,7 @@
body_parts_covered = 0
toggleable = 1
vision_flags = SEE_TURFS //but they can spot breaches. Due to the way HUDs work, they don't provide darkvision up-close the way mesons do.
+ flash_protection = 0 //it's an open, single-eye retinal projector. there's no way it protects your eyes from flashes or welders.
/obj/item/clothing/glasses/omnihud/eng/meson/attack_self(mob/user)
if(!active)
@@ -206,7 +208,8 @@
/obj/item/clothing/glasses/omnihud/all
name = "\improper AR-B glasses"
desc = "The ARG-62-B AR Glasses are capable of displaying information on individuals. \
- These have been upgraded with every feature the lesser models have. Now we're talkin'."
+ These have been upgraded with (almost) every feature the lesser models have. Now we're talkin'. \
+
Offers full protection against bright flashes/welders and full access to system alarm monitoring."
mode = "best"
flash_protection = FLASH_PROTECTION_MAJOR
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED)
@@ -263,5 +266,4 @@
icon_state = "[icon_state]_1"
else
icon_state = initial(icon_state)
- update_clothing_icon()
-
+ update_clothing_icon()
\ No newline at end of file
From c4ca9eb34cb8c40c103d68d551591f0919524a9a Mon Sep 17 00:00:00 2001
From: Killian <49700375+KillianKirilenko@users.noreply.github.com>
Date: Wed, 19 Aug 2020 14:16:11 +0100
Subject: [PATCH 4/4] tgui compat for AR-B
---
code/modules/clothing/glasses/hud_vr.dm | 6 +++---
code/modules/tgui/modules/alarm.dm | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/code/modules/clothing/glasses/hud_vr.dm b/code/modules/clothing/glasses/hud_vr.dm
index 0a67f7f3566..613c09e91e4 100644
--- a/code/modules/clothing/glasses/hud_vr.dm
+++ b/code/modules/clothing/glasses/hud_vr.dm
@@ -228,11 +228,11 @@
flash_protection = FLASH_PROTECTION_MAJOR
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED)
action_button_name = "AR Console (All Alerts)"
- arscreen_path = /datum/nano_module/alarm_monitor/all
+ tgarscreen_path = /datum/tgui_module/alarm_monitor/all/glasses
ar_interact(var/mob/living/carbon/human/user)
- if(arscreen)
- arscreen.ui_interact(user,"main",null,1,glasses_state)
+ if(tgarscreen)
+ tgarscreen.tgui_interact(user)
return 1
/obj/item/clothing/glasses/hud/security/eyepatch
diff --git a/code/modules/tgui/modules/alarm.dm b/code/modules/tgui/modules/alarm.dm
index 2c0c75a6e8b..b9de22c7e69 100644
--- a/code/modules/tgui/modules/alarm.dm
+++ b/code/modules/tgui/modules/alarm.dm
@@ -13,6 +13,11 @@
..()
alarm_handlers = SSalarm.all_handlers
+// Subtype for glasses_state
+/datum/tgui_module/alarm_monitor/all/glasses
+/datum/tgui_module/alarm_monitor/all/glasses/tgui_state(mob/user)
+ return GLOB.tgui_glasses_state
+
/datum/tgui_module/alarm_monitor/all/robot
/datum/tgui_module/alarm_monitor/all/robot/tgui_state(mob/user)
return GLOB.tgui_self_state