From e54ce881ebd7b5efb5950e8f31b94463f8b86f34 Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Sun, 23 Mar 2014 13:49:44 -0500 Subject: [PATCH] NVG Bugfix Now they work, and also added a green hud element that tints the screen green when nvg's are worn. --- code/_onclick/hud/hud.dm | 8 ++++++++ code/modules/clothing/glasses/glasses.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 9 ++++++--- icons/obj/nvg_hud_full.dmi | Bin 0 -> 2075 bytes 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 icons/obj/nvg_hud_full.dmi diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 98e2fda1862..5e005c5f0e9 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -14,6 +14,7 @@ var/datum/global_hud/global_hud = new() var/obj/screen/blurry var/list/vimpaired var/list/darkMask + var/obj/screen/nvg /datum/global_hud/New() //420erryday psychedellic colours screen overlay for when you are high @@ -30,6 +31,13 @@ var/datum/global_hud/global_hud = new() blurry.layer = 17 blurry.mouse_opacity = 0 + nvg = new /obj/screen() + nvg.screen_loc = "1,1" + nvg.icon = 'icons/obj/nvg_hud_full.dmi' + nvg.icon_state = "nvg_hud" + nvg.layer = 17 + nvg.mouse_opacity = 0 + var/obj/screen/O var/i //that nasty looking dither you get when you're short-sighted diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 7ee835da35e..7897e8ce16e 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -35,7 +35,7 @@ icon_state = "night" item_state = "glasses" origin_tech = "magnets=2" - darkness_view = 3 + darkness_view = 7 /obj/item/clothing/glasses/eyepatch name = "eyepatch" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 9006124bf93..e1a97358004 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1138,7 +1138,7 @@ if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe client.images.Remove(hud) - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) + client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask, global_hud.nvg) update_action_buttons() @@ -1277,8 +1277,9 @@ see_in_dark += G.darkness_view if(G.vision_flags) sight |= G.vision_flags - if(!druggy) - see_invisible = SEE_INVISIBLE_MINIMUM + if(istype(G,/obj/item/clothing/glasses/night)) + see_invisible = SEE_INVISIBLE_MINIMUM + client.screen += global_hud.nvg /* HUD shit goes here, as long as it doesn't modify sight flags */ // The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl @@ -1296,6 +1297,8 @@ else if(!seer) see_invisible = SEE_INVISIBLE_LIVING + + if(healths) if (analgesic) healths.icon_state = "health_health_numb" diff --git a/icons/obj/nvg_hud_full.dmi b/icons/obj/nvg_hud_full.dmi new file mode 100644 index 0000000000000000000000000000000000000000..b9f8ad97e0ef072d443be1ae76a460e0a9c4e16d GIT binary patch literal 2075 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|=9Be?5+AI5}0;$5PkcbkO)Z*l#%z~24{5%GR ziaEN+H*z&7h_GI``CWASt;Gix9#!orSP|dh5Zuo7C3XM(fZLX)ZG}eMUvgILnDV&P z$