TG: Changed a bunch of constants to defines and made setup.dm all pretty and easy to

read.

Defined some clothing-overlay layers. The defines are float-layers. So they will
always appear above the mob they are overlaying. They can be found in setup.dm

This pretty much means you can change to order in which the icons are added to
the overlays variable without fear of eyes appearing above glasses and such. So
no more of these dumb bugs.
It also paves the way for selective clothing updates which should speed things
up a fair bit.
Revision: r3704
Author: 	 elly1...@rocketmail.com
This commit is contained in:
Erthilo
2012-06-03 17:09:44 +01:00
parent 9075aa4a86
commit 65416c202f
3 changed files with 135 additions and 84 deletions
@@ -392,12 +392,12 @@
var/t1 = wear_suit.item_state
if (!t1)
t1 = wear_suit.icon_state
overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = SUIT_LAYER)
if (wear_suit.blood_DNA)
if (istype(wear_suit, /obj/item/clothing/suit/armor))
overlays += image("icon" = 'blood.dmi', "icon_state" = "armorblood[!lying ? "" : "2"]", "layer" = MOB_LAYER)
overlays += image("icon" = 'blood.dmi', "icon_state" = "armorblood[!lying ? "" : "2"]", "layer" = B_SUIT_LAYER)
else
overlays += image("icon" = 'blood.dmi', "icon_state" = "suitblood[!lying ? "" : "2"]", "layer" = MOB_LAYER)
overlays += image("icon" = 'blood.dmi', "icon_state" = "suitblood[!lying ? "" : "2"]", "layer" = B_SUIT_LAYER)
wear_suit.screen_loc = ui_alien_oclothing
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
if (handcuffed)
@@ -417,9 +417,9 @@
var/t1 = head.item_state
if (!t1)
t1 = head.icon_state
overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = HEAD_LAYER)
if (head.blood_DNA)
overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood[!lying ? "" : "2"]", "layer" = MOB_LAYER)
overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood[!lying ? "" : "2"]", "layer" = B_HEAD_LAYER)
head.screen_loc = ui_alien_head
if (l_store)
@@ -433,12 +433,12 @@
client.screen += contents
if (r_hand)
overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = MOB_LAYER+1)
overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = INHANDS_LAYER)
r_hand.screen_loc = ui_rhand
if (l_hand)
overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = MOB_LAYER+1)
overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = INHANDS_LAYER)
l_hand.screen_loc = ui_lhand
+93 -69
View File
@@ -291,7 +291,7 @@
if(shoes)
tally += shoes.slowdown
if(bodytemperature < 283.222)
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if (stuttering < 10)
stuttering = 10
@@ -579,6 +579,7 @@
return
if (!istype(W, /obj/item))
return
if (!( W.slot_flags & SLOT_OCLOTHING ))
return
return
@@ -960,21 +961,20 @@
// Uniform
if(w_uniform)
// What is screen_loc stuff doing here?!
w_uniform.screen_loc = ui_iclothing
if(w_uniform)//I should really not need these
w_uniform.screen_loc = ui_iclothing
if(istype(w_uniform, /obj/item/clothing/under))
var/t1 = w_uniform.color
if (!t1)
t1 = icon_state
clothing_overlays += image("icon" = 'uniform.dmi', "icon_state" = text("[][]",t1, (!(lying) ? "_s" : "_l")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'uniform.dmi', "icon_state" = text("[][]",t1, (!(lying) ? "_s" : "_l")), "layer" = UNIFORM_LAYER)
if (w_uniform.blood_DNA)
var/icon/stain_icon = icon('blood.dmi', "uniformblood[!lying ? "" : "2"]")
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
clothing_overlays += image("icon" = stain_icon, "layer" = B_UNIFORM_LAYER)
if (wear_id)
if(wear_id.over_jumpsuit)
clothing_overlays += image("icon" = 'mob.dmi', "icon_state" = "id[!lying ? null : "2"]", "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'mob.dmi', "icon_state" = "id[!lying ? null : "2"]", "layer" = ID_LAYER)
if (client)
client.screen -= hud_used.intents
@@ -997,34 +997,34 @@
gloves_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
if(ro.destroyed)
gloves_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
clothing_overlays += image(gloves_icon, "layer" = MOB_LAYER)
clothing_overlays += image(gloves_icon, "layer" = GLOVES_LAYER)
if (gloves.blood_DNA)
var/icon/stain_icon = icon('blood.dmi', "bloodyhands[!lying ? "" : "2"]")
if(lo.destroyed)
stain_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
else if(ro.destroyed)
stain_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
clothing_overlays += image("icon" = stain_icon, "layer" = B_GLOVES_LAYER)
else if (blood_DNA)
var/icon/stain_icon = icon('blood.dmi', "bloodyhands[!lying ? "" : "2"]")
if(lo.destroyed)
stain_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
else if(ro.destroyed)
stain_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
clothing_overlays += image("icon" = stain_icon, "layer" = B_GLOVES_LAYER)
// Glasses
if (glasses)
var/t1 = glasses.icon_state
clothing_overlays += image("icon" = 'eyes.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'eyes.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = GLASSES_LAYER)
// Ears
if (l_ear)
var/t1 = l_ear.icon_state
clothing_overlays += image("icon" = 'ears.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'ears.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = EARS_LAYER)
if (r_ear)
var/t1 = r_ear.icon_state
clothing_overlays += image("icon" = 'ears.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'ears.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = EARS_LAYER)
// Shoes
lo = organs["l_foot"]
@@ -1036,63 +1036,34 @@
shoes_icon.Blend(new /icon('limb_mask.dmi', "right[lying?"_l":""]"), ICON_MULTIPLY)
else if(ro.destroyed && !lying)
shoes_icon.Blend(new /icon('limb_mask.dmi', "left[lying?"_l":""]"), ICON_MULTIPLY)
clothing_overlays += image(shoes_icon, "layer" = MOB_LAYER)
clothing_overlays += image(shoes_icon, "layer" = SHOES_LAYER)
if (shoes.blood_DNA)
var/icon/stain_icon = icon('blood.dmi', "shoeblood[!lying ? "" : "2"]")
if(lo.destroyed)
stain_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
else if(ro.destroyed)
stain_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER) // Radio
clothing_overlays += image("icon" = stain_icon, "layer" = B_SHOES_LAYER) // Radio
if (s_store)
var/t1 = s_store.item_state
if (!t1)
t1 = s_store.icon_state
if(!istype(wear_suit, /obj/item/clothing/suit/storage/armoredundersuit))
clothing_overlays += image("icon" = 'belt_mirror.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'belt_mirror.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = SUIT_STORE_LAYER)
s_store.screen_loc = ui_sstore1
if (wear_suit)
if (istype(wear_suit, /obj/item/clothing/suit))
var/t1 = wear_suit.icon_state
clothing_overlays += image("icon" = 'suit.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
if (wear_suit)
if (wear_suit.blood_DNA)
var/icon/stain_icon = null
if (istype(wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/storage/wcoat))
stain_icon = icon('blood.dmi', "armorblood[!lying ? "" : "2"]")
else if (istype(wear_suit, /obj/item/clothing/suit/storage/det_suit || /obj/item/clothing/suit/storage/labcoat))
stain_icon = icon('blood.dmi', "coatblood[!lying ? "" : "2"]")
else
stain_icon = icon('blood.dmi', "suitblood[!lying ? "" : "2"]")
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
wear_suit.screen_loc = ui_oclothing
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
if (handcuffed)
handcuffed.loc = loc
handcuffed.layer = initial(handcuffed.layer)
handcuffed = null
if ((l_hand || r_hand))
// I don't know what this does, but it looks horrible
var/h = hand
hand = 1
drop_item()
hand = 0
drop_item()
hand = h
if (wear_mask)
if (istype(wear_mask, /obj/item/clothing/mask))
var/t1 = wear_mask.icon_state
clothing_overlays += image("icon" = 'mask.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'mask.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = FACEMASK_LAYER)
if (!istype(wear_mask, /obj/item/clothing/mask/cigarette))
if (wear_mask.blood_DNA)
var/icon/stain_icon = icon('blood.dmi', "maskblood[!lying ? "" : "2"]")
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
clothing_overlays += image("icon" = stain_icon, "layer" = B_FACEMASK_LAYER)
wear_mask.screen_loc = ui_mask
// Head
@@ -1101,12 +1072,12 @@
var/icon/head_icon = icon('head.dmi', text("[][]", t1, (!( lying ) ? null : "2")))
if(istype(head,/obj/item/clothing/head/kitty))
head_icon = (( lying ) ? head:mob2 : head:mob)
clothing_overlays += image("icon" = head_icon, "layer" = MOB_LAYER)
clothing_overlays += image("icon" = head_icon, "layer" = HEAD_LAYER)
if(gimmick_hat)
clothing_overlays += image("icon" = icon('gimmick_head.dmi', "[gimmick_hat][!lying ? "" : "2"]"), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = icon('gimmick_head.dmi', "[gimmick_hat][!lying ? "" : "2"]"), "layer" = HEAD_LAYER)
if (head.blood_DNA)
var/icon/stain_icon = icon('blood.dmi', "helmetblood[!lying ? "" : "2"]")
clothing_overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
clothing_overlays += image("icon" = stain_icon, "layer" = B_HEAD_LAYER)
head.screen_loc = ui_head
// Belt
@@ -1114,9 +1085,12 @@
var/t1 = belt.item_state
if (!t1)
t1 = belt.icon_state
clothing_overlays += image("icon" = 'belt.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'belt.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = BELT_LAYER)
belt.screen_loc = ui_belt
name = get_visible_name()
if (wear_id)
wear_id.screen_loc = ui_id
@@ -1128,7 +1102,7 @@
if (back)
var/t1 = back.icon_state
clothing_overlays += image("icon" = 'back.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'back.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = BACK_LAYER)
back.screen_loc = ui_back
if(client) hud_used.other_update() //Update the screenloc of the items on the 'other' inventory bar
@@ -1138,33 +1112,25 @@
pulling = null
var/h1 = handcuffed.icon_state
if (!lying)
clothing_overlays += image("icon" = 'mob.dmi', "icon_state" = "[h1]1", "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'mob.dmi', "icon_state" = "[h1]1", "layer" = CUFFED_LAYER)
else
clothing_overlays += image("icon" = 'mob.dmi', "icon_state" = "[h1]2", "layer" = MOB_LAYER)
clothing_overlays += image("icon" = 'mob.dmi', "icon_state" = "[h1]2", "layer" = CUFFED_LAYER)
if (r_hand)
clothing_overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = MOB_LAYER+1)
clothing_overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = INHANDS_LAYER)
r_hand.screen_loc = ui_rhand
if (l_hand)
clothing_overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = MOB_LAYER+1)
clothing_overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = INHANDS_LAYER)
l_hand.screen_loc = ui_lhand
var/shielded = 0
for (var/obj/item/weapon/cloaking_device/S in src)
if (S.active)
shielded = 2
break
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)&&wear_suit:s_active)
shielded = 3
if(shielded == 1)
clothing_overlays += image("icon" = 'effects.dmi', "icon_state" = "shield", "layer" = MOB_LAYER+1)
if(client && client.admin_invis)
invisibility = 100
@@ -1180,6 +1146,64 @@
else if(!targeted_by && target_locked)
del(target_locked)
if (wear_suit)
if (wear_suit)
if (istype(wear_suit, /obj/item/clothing/suit))
var/t1 = wear_suit.icon_state
clothing_overlays += image("icon" = 'suit.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = SUIT_LAYER)
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
if (handcuffed)
handcuffed.loc = loc
handcuffed.layer = initial(handcuffed.layer)
handcuffed = null
if ((l_hand || r_hand))
// I don't know what this does, but it looks horrible
var/h = hand
hand = 1
drop_item()
hand = 0
drop_item()
hand = h
else if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)&&wear_suit:s_active)
shielded = 3
if (wear_suit.blood_DNA)
var/icon/stain_icon = null
if (istype(wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/storage/wcoat))
stain_icon = icon('blood.dmi', "armorblood[!lying ? "" : "2"]")
else if (istype(wear_suit, /obj/item/clothing/suit/storage/det_suit || /obj/item/clothing/suit/storage/labcoat))
stain_icon = icon('blood.dmi', "coatblood[!lying ? "" : "2"]")
else
stain_icon = icon('blood.dmi', "suitblood[!lying ? "" : "2"]")
clothing_overlays += image("icon" = stain_icon, "layer" = B_SUIT_LAYER)
wear_suit.screen_loc = ui_oclothing
switch(shielded)
if(1)
overlays += image("icon" = 'effects.dmi', "icon_state" = "shield", "layer" = SHIELD_LAYER)
if(2)
invisibility = 2
//New stealth. Hopefully doesn't lag too much. /N
if(istype(loc, /turf))//If they are standing on a turf.
AddCamoOverlay(loc)//Overlay camo.
if(3)
if(istype(loc, /turf))
//Ninjas may flick into view once in a while if they are stealthed.
if(prob(90))
NinjaStealthActive(loc)
else
NinjaStealthMalf()
else
invisibility = 0
/*
for (var/mob/M in viewers(1, src))//For the love of god DO NOT REFRESH EVERY SECOND - Mport
if ((M.client && M.machine == src))
spawn (0)
show_inv(M)
return
*/
last_b_state = stat
/mob/living/carbon/human/proc/misc_clothing_updates()
@@ -1193,7 +1217,7 @@
var/list/L = dd_text2list(intent, ",")
L[1] += ":-11"
i_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
i_select.screen_loc = dd_list2text(L,",") //ICONS4
else
i_select.screen_loc = null
if (m_select)
@@ -1202,7 +1226,7 @@
var/list/L = dd_text2list(m_int, ",")
L[1] += ":-11"
m_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
m_select.screen_loc = dd_list2text(L,",") //ICONS4
else
m_select.screen_loc = null
@@ -1502,9 +1526,9 @@
face_standing = new /image()
face_lying = new /image()
face_standing.icon = eyes_s
face_standing.layer = MOB_LAYER
face_standing.layer = FACE_LAYER
face_lying.icon = eyes_l
face_lying.layer = MOB_LAYER
face_lying.layer = FACE_LAYER
del(mouth_l)
del(mouth_s)