Skip to content

Commit

Permalink
Merge pull request #22 from out-of-phaze/lighthouse-fix/fov-cleanup
Browse files Browse the repository at this point in the history
Clean up FOV module
  • Loading branch information
PolymorphBlue authored Jun 9, 2023
2 parents db22454 + 4c46a8f commit 77d595b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 53 deletions.
6 changes: 5 additions & 1 deletion code/__defines/_planes+layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ What is the naming convention for planes or layers?
#define BLIND_LAYER 3
#define CRIT_LAYER 4

#define HUD_PLANE 6
// LIGHTHOUSE EDIT START
// VISION_CONE_PLANE 6 - defined in fov_module
// AR_PLANE 8 - defined in neural_interface module
#define HUD_PLANE 7
// LIGHTHOUSE EDIT END
#define UNDER_HUD_LAYER 0
#define HUD_BASE_LAYER 2
#define HUD_ITEM_LAYER 3
Expand Down
2 changes: 1 addition & 1 deletion mods/content/fov_module/_fov_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
///////////////////////////////////////

#define HIDDEN_SHIT_PLANE -101 //Used for the hiding of the vision cone masking object.
#define VISION_CONE_PLANE 7 // For the vision cone.
#define VISION_CONE_PLANE 6 // For the vision cone.
#define OPPOSITE_DIR(D) turn(D, 180)

/decl/modpack/fov_module
Expand Down
31 changes: 9 additions & 22 deletions mods/content/fov_module/overrides/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,24 @@
. = ..()
if(!client)
return
var/obj/item/clothing/headwear = get_equipped_item(slot_head_str)
var/obj/item/clothing/maskwear = get_equipped_item(slot_head_str)
var/obj/item/clothing/eyeswear = get_equipped_item(slot_head_str)
var/use_original_cone = TRUE

var/obj/item/clothing/head/helmet = get_equipped_item(slot_head_str)
if(istype(helmet))
update_helmet_vision(helmet)
use_original_cone = FALSE

var/obj/item/clothing/mask/mask = get_equipped_item(slot_wear_mask_str)
if(istype(mask))
update_mask_vision(mask)
if(istype(headwear) && headwear.helmet_vision \
|| istype(maskwear) && maskwear.helmet_vision \
|| istype(eyeswear) && eyeswear.helmet_vision)
use_original_cone = FALSE

if(use_original_cone)
fov_mask.icon_state = "combat_mask"
fov.icon_state = "combat"

/mob/living/carbon/human/proc/update_helmet_vision(var/obj/item/clothing/head/H)
if(H.helmet_vision)
fov_mask.icon_state = "helmet_mask"
fov.icon_state = "helmet"
else
fov_mask.icon_state = "combat_mask"
fov.icon_state = "combat"

/mob/living/carbon/human/proc/update_mask_vision(var/obj/item/clothing/mask/M)
if(M.helmet_vision)
fov_mask.icon_state = "helmet_mask"
fov.icon_state = "helmet"
else
fov_mask.icon_state = "combat_mask"
fov.icon_state = "combat"

/obj/item/clothing
var/helmet_vision = FALSE

/obj/item/clothing/needs_vision_update()
return ..() || helmet_vision
30 changes: 1 addition & 29 deletions mods/content/fov_module/overrides/special.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Filter effects below.
*/
/mob/living/carbon/human/add_filter_effects()
/mob/proc/InitializeHud()
..()
var/obj/screen/plane_master/vision_cone_target/VC = new //ALWAYS DEFINE THIS, WEIRD SHIT HAPPENS OTHERWISE
var/obj/screen/plane_master/vision_cone/primary/mob = new//creating new masters to remove things from vision.
Expand All @@ -27,31 +27,3 @@ Filter effects below.
client.screen += lyinghuman
//client.screen += aboveturf //Comment this out if you don't like it
client.screen += footsteps

/mob/proc/InitializeHud()
..()
add_filter_effects()

/mob/proc/add_filter_effects()
var/obj/blur_planemaster/PM = new//This is the z-blur shit. It's HUD related so I put it here.
var/obj/blur_planemaster/zmob = new
var/obj/blur_planemaster/under = new
var/obj/screen/plane_master/blur/bullet_plane/BP = new
var/obj/screen/plane_master/blur/ghost_master/gm = new //So ghosts are spooky and blurry.
//var/obj/screen/plane_master/humanAO/HM = new
//var/obj/screen/plane_master/wallAO/WT = new
//var/obj/screen/plane_master/objectAO/OB = new
//var/obj/screen/plane_master/lying_human/LH = new
//var/obj/screen/plane_master/mobAO/MO = new
under.plane = UNDER_OPENSPACE_PLANE
zmob.plane = OVER_OPENSPACE_PLANE
//client.screen += LH
//client.screen += OB
//client.screen += WT
//client.screen += HM
//client.screen += MO
client.screen += zmob
client.screen += PM
client.screen += under
client.screen += gm
client.screen += BP

0 comments on commit 77d595b

Please sign in to comment.