From e47b75c02fa048544f55e31fc626f11532afda76 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sat, 31 May 2014 13:45:14 -0600 Subject: [PATCH 1/5] Strip Menu now obscures items based on flags_inv I also made it look pretty --- code/_globalvars/misc.dm | 1 + code/modules/mob/living/carbon/human/human.dm | 93 +++++++++++++------ 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 6a6de9d49e0..39c76e379be 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -12,3 +12,4 @@ var/timezoneOffset = 0 // The difference betwen midnight (of the host computer) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. var/fileaccess_timer = 0 +var/TAB = "    " \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 95ca9cf0f7c..591cb3ff5cb 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -291,55 +291,96 @@ /mob/living/carbon/human/show_inv(mob/user) user.set_machine(src) + var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) + var/skipgloves = 0 + var/skipsuitstorage = 0 + var/skipjumpsuit = 0 + var/skipshoes = 0 + var/skipmask = 0 + var/skipears = 0 + var/skipeyes = 0 + + //exosuits and helmets obscure what we can see + if(wear_suit) + skipgloves = wear_suit.flags_inv & HIDEGLOVES + skipsuitstorage = wear_suit.flags_inv & HIDESUITSTORAGE + skipjumpsuit = wear_suit.flags_inv & HIDEJUMPSUIT + skipshoes = wear_suit.flags_inv & HIDESHOES + + if(head) + skipmask = head.flags_inv & HIDEMASK + skipeyes = head.flags_inv & HIDEEYES + skipears = head.flags_inv & HIDEEARS + var/dat = {"
- [name] -
-
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]
Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]
Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"] -
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Nothing"] -
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Nothing"] -
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Nothing"]
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"] -
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Nothing"]"} + "} - dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Nothing"]" - if(w_uniform) - dat += "
Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Nothing"]" - if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) - dat += "
[internal ? "Disable Internals" : "Set Internals"]" + if(!skipmask) + dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]" + else + dat += "
Mask: Obscured by [head]" + + if(!skipeyes) + dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Nothing"]" + else + dat += "
Eyes: Obscured by [head]" + + if(!skipears) + dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Nothing"]" + else + dat += "
Ears: Obscured by [head]" dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Nothing"]" - if(wear_suit) - dat += "
Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Nothing"]" + if(wear_suit && !skipsuitstorage) + dat += "
[TAB]↳Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Nothing"]" if(has_breathable_mask && istype(wear_suit, /obj/item/weapon/tank)) - dat += "
[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + + if(!skipshoes) + dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Nothing"]" + else + dat += "
Shoes: Obscured by [wear_suit]" + + if(!skipgloves) + dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Nothing"]" + else + dat += "
Gloves: Obscured by [wear_suit]" dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Nothing"]" if(has_breathable_mask && istype(back, /obj/item/weapon/tank)) - dat += "
[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - if(w_uniform) //we checked already, but a different place. - dat += "
ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" + if(!skipjumpsuit) + dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Nothing"]" + if(w_uniform) + dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Nothing"]" + if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) + dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB]↳Pockets: Left ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" + dat += " - Right ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" + dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" + else + dat += "
Uniform: Obscured by [wear_suit]" + dat += "
" if(handcuffed) - dat += "
Handcuffed" + dat += "
Handcuffed: Remove" if(legcuffed) - dat += "
Legcuffed" - if(w_uniform) - dat += "

Left Pocket ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += " - Right Pocket ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" + dat += "
Legcuffed: Remove" dat += {"

Close "} - user << browse(dat, "window=mob\ref[src];size=340x480") - onclose(user, "mob\ref[src]") - + var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 340, 480) + popup.set_content(dat) + popup.open() // called when something steps onto a human // this could be made more general, but for now just handle mulebot From 5a7db48f96475ae16b1ff30a73e1b2e90d4b877c Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sat, 31 May 2014 14:26:48 -0600 Subject: [PATCH 2/5] Improved readability of the strip panel with
s --- code/modules/mob/living/carbon/human/human.dm | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 591cb3ff5cb..4c55db34fad 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -314,12 +314,18 @@ skipears = head.flags_inv & HIDEEARS var/dat = {" -
-
Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"] -
Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"] -
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"] + Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]
+ Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]
"} + dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Nothing"]" + if(has_breathable_mask && istype(back, /obj/item/weapon/tank)) + dat += "
[TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + + dat += "
" + + dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"]" + if(!skipmask) dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]" else @@ -335,6 +341,8 @@ else dat += "
Ears: Obscured by [head]" + dat += "
" + dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Nothing"]" if(wear_suit && !skipsuitstorage) dat += "
[TAB]↳Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Nothing"]" @@ -351,10 +359,6 @@ else dat += "
Gloves: Obscured by [wear_suit]" - dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Nothing"]" - if(has_breathable_mask && istype(back, /obj/item/weapon/tank)) - dat += "
[TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - if(!skipjumpsuit) dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Nothing"]" if(w_uniform) @@ -368,6 +372,7 @@ dat += "
Uniform: Obscured by [wear_suit]" dat += "
" + if(handcuffed) dat += "
Handcuffed: Remove" if(legcuffed) From 8cd20b3e77afb16fbfc96fcbf414173c6f23b65a Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sun, 1 Jun 2014 21:12:06 -0600 Subject: [PATCH 3/5] Added checks in Topic() --- code/modules/mob/living/carbon/human/human.dm | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4c55db34fad..7ded2a8a1ed 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -404,10 +404,46 @@ /mob/living/carbon/human/Topic(href, href_list) - ..() - //strip panel - if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) + if(canUseTopic(src)) + if(href_list["item"]) + var/obscuring = null + var/slot = text2num(href_list["item"]) + switch(slot) + if(slot_wear_mask) + if(head && head.flags_inv & HIDEMASK) + obscuring = head + if(slot_glasses) + if(head && head.flags_inv & HIDEEYES) + obscuring = head + if(slot_ears) + if(head && head.flags_inv & HIDEEARS) + obscuring = head + if(slot_gloves) + if(wear_suit && wear_suit.flags_inv & HIDEGLOVES) + obscuring = wear_suit + if(slot_shoes) + if(wear_suit && wear_suit.flags_inv & HIDESHOES) + obscuring = wear_suit + if(slot_s_store) + if(wear_suit && wear_suit.flags_inv & HIDESUITSTORAGE) + obscuring = wear_suit + if(slot_w_uniform) + if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) + obscuring = wear_suit + if(slot_belt) + if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) + obscuring = wear_suit + if(slot_wear_id) + if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) + obscuring = wear_suit + if(obscuring) + usr << "[obscuring] is in the way. Remove that first." + return + if(href_list["pockets"]) + if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) + usr << "[wear_suit] is in the way. Remove that first." + return var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) @@ -436,13 +472,14 @@ // Update strip window if(usr.machine == src && in_range(src, usr)) show_inv(usr) - - - else // Display a warning if the user mocks up src << "You feel your [pocket_side] pocket being fumbled with!" + ..() + return + + if(href_list["criminal"]) if(istype(usr, /mob/living/carbon/human)) var/mob/living/carbon/human/H = usr From ce35503695e7b2e880c266b8d2d60e7cea75b12a Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sun, 1 Jun 2014 22:45:28 -0600 Subject: [PATCH 4/5] Greyed out empty slots for easier readability --- code/modules/mob/living/carbon/human/human.dm | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7ded2a8a1ed..b13e6c8c1d4 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -314,60 +314,60 @@ skipears = head.flags_inv & HIDEEARS var/dat = {" - Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]
- Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]
+ Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Empty"]
+ Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Empty"]
"} - dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Nothing"]" + dat += "
Back: [(back && !(back.flags&ABSTRACT)) ? back : "Empty"]" if(has_breathable_mask && istype(back, /obj/item/weapon/tank)) dat += "
[TAB]↳[internal ? "Disable Internals" : "Set Internals"]" dat += "
" - dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"]" + dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Empty"]" if(!skipmask) - dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]" + dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" else dat += "
Mask: Obscured by [head]" if(!skipeyes) - dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Nothing"]" + dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]" else dat += "
Eyes: Obscured by [head]" if(!skipears) - dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Nothing"]" + dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Empty"]" else dat += "
Ears: Obscured by [head]" dat += "
" - dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Nothing"]" + dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Empty"]" if(wear_suit && !skipsuitstorage) - dat += "
[TAB]↳Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Nothing"]" + dat += "
[TAB]↳Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Empty"]" if(has_breathable_mask && istype(wear_suit, /obj/item/weapon/tank)) dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" if(!skipshoes) - dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Nothing"]" + dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" else dat += "
Shoes: Obscured by [wear_suit]" if(!skipgloves) - dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Nothing"]" + dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]" else dat += "
Gloves: Obscured by [wear_suit]" if(!skipjumpsuit) - dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Nothing"]" + dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Empty"]" if(w_uniform) - dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Nothing"]" + dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - dat += "
[TAB]↳Pockets: Left ([(l_store && !(l_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += " - Right ([(r_store && !(r_store.flags&ABSTRACT)) ? "Full" : "Empty"])" - dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Nothing"]" + dat += "
[TAB]↳Pockets: [(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" + dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]" + dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]" else dat += "
Uniform: Obscured by [wear_suit]" From 8e94bff33cd73adf4d71b4e1959100fe30d24e63 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Mon, 2 Jun 2014 21:07:21 -0600 Subject: [PATCH 5/5] -Giacom's Feeback -Belt, ID, and Pockets are no longer blocked by exosuits, as they are still visible --- .../mob/living/carbon/human/examine.dm | 38 ++--- code/modules/mob/living/carbon/human/human.dm | 138 +++++++----------- 2 files changed, 64 insertions(+), 112 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 0f7690a1a4d..ea0cc16a2d5 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -6,28 +6,8 @@ usr << "Something is there but you can't see it." return - var/skipgloves = 0 - var/skipsuitstorage = 0 - var/skipjumpsuit = 0 - var/skipshoes = 0 - var/skipmask = 0 - var/skipears = 0 - var/skipeyes = 0 + var/list/obscured = check_obscured_slots() var/skipface = 0 - - //exosuits and helmets obscure our view and stuff. - if(wear_suit) - skipgloves = wear_suit.flags_inv & HIDEGLOVES - skipsuitstorage = wear_suit.flags_inv & HIDESUITSTORAGE - skipjumpsuit = wear_suit.flags_inv & HIDEJUMPSUIT - skipshoes = wear_suit.flags_inv & HIDESHOES - - if(head) - skipmask = head.flags_inv & HIDEMASK - skipeyes = head.flags_inv & HIDEEYES - skipears = head.flags_inv & HIDEEARS - skipface = head.flags_inv & HIDEFACE - if(wear_mask) skipface |= wear_mask.flags_inv & HIDEFACE @@ -40,7 +20,7 @@ var/msg = "*---------*\nThis is " - if( skipjumpsuit && skipface ) //big suits/masks/helmets make it hard to tell their gender + if( slot_w_uniform in obscured && skipface ) //big suits/masks/helmets make it hard to tell their gender t_He = "They" t_his = "their" t_him = "them" @@ -62,7 +42,7 @@ msg += "[src.name]!\n" //uniform - if(w_uniform && !skipjumpsuit) + if(w_uniform && !(slot_w_uniform in obscured)) //Ties var/tie_msg if(istype(w_uniform,/obj/item/clothing/under)) @@ -90,7 +70,7 @@ msg += "[t_He] [t_is] wearing \icon[wear_suit] \a [wear_suit].\n" //suit/armour storage - if(s_store && !skipsuitstorage) + if(s_store) if(s_store.blood_DNA) msg += "[t_He] [t_is] carrying \icon[s_store] [s_store.gender==PLURAL?"some":"a"] blood-stained [s_store.name] on [t_his] [wear_suit.name]!\n" else @@ -118,7 +98,7 @@ msg += "[t_He] [t_is] holding \icon[r_hand] \a [r_hand] in [t_his] right hand.\n" //gloves - if(gloves && !skipgloves) + if(gloves && !(slot_gloves in obscured)) if(gloves.blood_DNA) msg += "[t_He] [t_has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] blood-stained [gloves.name] on [t_his] hands!\n" else @@ -143,28 +123,28 @@ msg += "[t_He] [t_has] \icon[belt] \a [belt] about [t_his] waist.\n" //shoes - if(shoes && !skipshoes) + if(shoes && !(slot_shoes in obscured)) if(shoes.blood_DNA) msg += "[t_He] [t_is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] blood-stained [shoes.name] on [t_his] feet!\n" else msg += "[t_He] [t_is] wearing \icon[shoes] \a [shoes] on [t_his] feet.\n" //mask - if(wear_mask && !skipmask) + if(wear_mask && !(slot_wear_mask in obscured)) if(wear_mask.blood_DNA) msg += "[t_He] [t_has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] blood-stained [wear_mask.name] on [t_his] face!\n" else msg += "[t_He] [t_has] \icon[wear_mask] \a [wear_mask] on [t_his] face.\n" //eyes - if(glasses && !skipeyes) + if(glasses && !(slot_glasses in obscured)) if(glasses.blood_DNA) msg += "[t_He] [t_has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] blood-stained [glasses] covering [t_his] eyes!\n" else msg += "[t_He] [t_has] \icon[glasses] \a [glasses] covering [t_his] eyes.\n" //ears - if(ears && !skipears) + if(ears && !(slot_ears in obscured)) msg += "[t_He] [t_has] \icon[ears] \a [ears] on [t_his] ears.\n" //ID diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b13e6c8c1d4..f19f39dd7f7 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -291,27 +291,8 @@ /mob/living/carbon/human/show_inv(mob/user) user.set_machine(src) - var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) - var/skipgloves = 0 - var/skipsuitstorage = 0 - var/skipjumpsuit = 0 - var/skipshoes = 0 - var/skipmask = 0 - var/skipears = 0 - var/skipeyes = 0 - - //exosuits and helmets obscure what we can see - if(wear_suit) - skipgloves = wear_suit.flags_inv & HIDEGLOVES - skipsuitstorage = wear_suit.flags_inv & HIDESUITSTORAGE - skipjumpsuit = wear_suit.flags_inv & HIDEJUMPSUIT - skipshoes = wear_suit.flags_inv & HIDESHOES - - if(head) - skipmask = head.flags_inv & HIDEMASK - skipeyes = head.flags_inv & HIDEEYES - skipears = head.flags_inv & HIDEEARS + var/list/obscured = check_obscured_slots() var/dat = {" Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Empty"]
@@ -326,50 +307,50 @@ dat += "
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Empty"]" - if(!skipmask) - dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" - else + if(slot_wear_mask in obscured) dat += "
Mask: Obscured by [head]" - - if(!skipeyes) - dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]" else + dat += "
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]" + + if(slot_glasses in obscured) dat += "
Eyes: Obscured by [head]" - - if(!skipears) - dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Empty"]" else + dat += "
Eyes: [(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]" + + if(slot_ears in obscured) dat += "
Ears: Obscured by [head]" + else + dat += "
Ears: [(ears && !(ears.flags&ABSTRACT)) ? ears : "Empty"]" dat += "
" dat += "
Exosuit: [(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Empty"]" - if(wear_suit && !skipsuitstorage) + if(wear_suit) dat += "
[TAB]↳Suit Storage: [(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Empty"]" if(has_breathable_mask && istype(wear_suit, /obj/item/weapon/tank)) dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - if(!skipshoes) - dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" - else + if(slot_shoes in obscured) dat += "
Shoes: Obscured by [wear_suit]" - - if(!skipgloves) - dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]" else + dat += "
Shoes: [(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]" + + if(slot_gloves in obscured) dat += "
Gloves: Obscured by [wear_suit]" - - if(!skipjumpsuit) - dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Empty"]" - if(w_uniform) - dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" - if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) - dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" - dat += "
[TAB]↳Pockets: [(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" - dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]" - dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]" else + dat += "
Gloves: [(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]" + + if(slot_w_uniform in obscured) dat += "
Uniform: Obscured by [wear_suit]" + else + dat += "
Uniform: [(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Empty"]" + if(w_uniform) + dat += "
[TAB]↳Belt: [(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" + if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) + dat += "
[TAB][TAB]↳[internal ? "Disable Internals" : "Set Internals"]" + dat += "
[TAB]↳Pockets: [(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" + dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]" + dat += "
[TAB]↳ID: [(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]" dat += "
" @@ -383,7 +364,7 @@
Close "} - var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 340, 480) + var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 340, 500) popup.set_content(dat) popup.open() @@ -406,45 +387,12 @@ /mob/living/carbon/human/Topic(href, href_list) if(canUseTopic(src)) if(href_list["item"]) - var/obscuring = null var/slot = text2num(href_list["item"]) - switch(slot) - if(slot_wear_mask) - if(head && head.flags_inv & HIDEMASK) - obscuring = head - if(slot_glasses) - if(head && head.flags_inv & HIDEEYES) - obscuring = head - if(slot_ears) - if(head && head.flags_inv & HIDEEARS) - obscuring = head - if(slot_gloves) - if(wear_suit && wear_suit.flags_inv & HIDEGLOVES) - obscuring = wear_suit - if(slot_shoes) - if(wear_suit && wear_suit.flags_inv & HIDESHOES) - obscuring = wear_suit - if(slot_s_store) - if(wear_suit && wear_suit.flags_inv & HIDESUITSTORAGE) - obscuring = wear_suit - if(slot_w_uniform) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - obscuring = wear_suit - if(slot_belt) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - obscuring = wear_suit - if(slot_wear_id) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - obscuring = wear_suit - if(obscuring) - usr << "[obscuring] is in the way. Remove that first." + if(slot in check_obscured_slots()) + usr << "You can't reach that. Something is covering it." return if(href_list["pockets"]) - if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT) - usr << "[wear_suit] is in the way. Remove that first." - return - var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store) @@ -544,4 +492,28 @@ . = 0 if(!. && error_msg && user) // Might need re-wording. - user << "There is no exposed flesh or thin material [above_neck(target_zone) ? "on their head" : "on their body"]." \ No newline at end of file + user << "There is no exposed flesh or thin material [above_neck(target_zone) ? "on their head" : "on their body"]." + +/mob/living/carbon/human/proc/check_obscured_slots() + var/list/obscured = list() + + if(wear_suit) + if(wear_suit.flags_inv & HIDEGLOVES) + obscured |= slot_gloves + if(wear_suit.flags_inv & HIDEJUMPSUIT) + obscured |= slot_w_uniform + if(wear_suit.flags_inv & HIDESHOES) + obscured |= slot_shoes + + if(head) + if(head.flags_inv & HIDEMASK) + obscured |= slot_wear_mask + if(head.flags_inv & HIDEEYES) + obscured |= slot_glasses + if(head.flags_inv & HIDEEARS) + obscured |= slot_ears + + if(obscured.len > 0) + return obscured + else + return null \ No newline at end of file