mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Ports Clothing Expansion Code from World Server
This commit is contained in:
@@ -24,8 +24,11 @@
|
||||
var/ear_protection = 0
|
||||
var/blood_sprite_state
|
||||
|
||||
var/index //null by default, if set, will change which dmi it uses
|
||||
|
||||
var/update_icon_define = null // Only needed if you've got multiple files for the same type of clothing
|
||||
|
||||
|
||||
//Updates the icons of the mob wearing the clothing item, if any.
|
||||
/obj/item/clothing/proc/update_clothing_icon()
|
||||
return
|
||||
@@ -35,12 +38,14 @@
|
||||
..()
|
||||
gunshot_residue = null
|
||||
|
||||
|
||||
/obj/item/clothing/New()
|
||||
..()
|
||||
if(starting_accessories)
|
||||
for(var/T in starting_accessories)
|
||||
var/obj/item/clothing/accessory/tie = new T(src)
|
||||
src.attach_accessory(null, tie)
|
||||
set_clothing_index()
|
||||
|
||||
/obj/item/clothing/equipped(var/mob/user,var/slot)
|
||||
..()
|
||||
@@ -224,6 +229,9 @@
|
||||
SPECIES_VOX = 'icons/mob/species/vox/gloves.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/proc/set_clothing_index()
|
||||
return
|
||||
|
||||
/obj/item/clothing/gloves/update_clothing_icon()
|
||||
if (ismob(src.loc))
|
||||
var/mob/M = src.loc
|
||||
@@ -602,6 +610,7 @@
|
||||
var/mob/M = src.loc
|
||||
M.update_inv_shoes()
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//Suit
|
||||
/obj/item/clothing/suit
|
||||
@@ -627,6 +636,20 @@
|
||||
SPECIES_VOX = 'icons/mob/species/vox/suit.dmi'
|
||||
)
|
||||
|
||||
/obj/item/clothing/suit/set_clothing_index()
|
||||
..()
|
||||
|
||||
if(index && !icon_override)
|
||||
icon = new /icon("icons/obj/clothing/suits_[index].dmi")
|
||||
item_icons = list(
|
||||
slot_l_hand_str = new /icon("icons/mob/items/lefthand_suits_[index].dmi"),
|
||||
slot_r_hand_str = new /icon("icons/mob/items/righthand_suits_[index].dmi"),
|
||||
)
|
||||
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
valid_accessory_slots = (ACCESSORY_SLOT_OVER | ACCESSORY_SLOT_ARMBAND)
|
||||
restricted_accessory_slots = (ACCESSORY_SLOT_ARMBAND)
|
||||
|
||||
@@ -635,6 +658,8 @@
|
||||
var/mob/M = src.loc
|
||||
M.update_inv_wear_suit()
|
||||
|
||||
set_clothing_index()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//Under clothing
|
||||
/obj/item/clothing/under
|
||||
@@ -707,7 +732,7 @@
|
||||
|
||||
//autodetect rollability
|
||||
if(rolled_down < 0)
|
||||
if(("[worn_state]_d_s" in icon_states(INV_W_UNIFORM_DEF_ICON)) || ("[worn_state]_s" in icon_states(rolled_down_icon)) || ("[worn_state]_d_s" in icon_states(icon_override)))
|
||||
if(("[worn_state]_d_s" in icon_states(icon)) || ("[worn_state]_s" in icon_states(rolled_down_icon)) || ("[worn_state]_d_s" in icon_states(icon_override)))
|
||||
rolled_down = 0
|
||||
|
||||
if(rolled_down == -1)
|
||||
@@ -715,6 +740,23 @@
|
||||
if(rolled_sleeves == -1)
|
||||
verbs -= /obj/item/clothing/under/verb/rollsleeves
|
||||
|
||||
/obj/item/clothing/under/set_clothing_index()
|
||||
..()
|
||||
|
||||
if(index && !icon_override)
|
||||
icon = new /icon("icons/obj/clothing/uniforms_[index].dmi")
|
||||
|
||||
item_icons = list(
|
||||
slot_l_hand_str = new /icon("icons/mob/items/lefthand_uniforms_[index].dmi"),
|
||||
slot_r_hand_str = new /icon("icons/mob/items/righthand_uniforms_[index].dmi"),
|
||||
)
|
||||
|
||||
rolled_down_icon = new /icon("icons/mob/uniform_rolled_down_[index].dmi")
|
||||
rolled_down_sleeves_icon = new /icon("icons/mob/uniform_sleeves_rolled_[index].dmi")
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/item/clothing/under/proc/update_rolldown_status()
|
||||
var/mob/living/carbon/human/H
|
||||
if(istype(src.loc, /mob/living/carbon/human))
|
||||
@@ -729,8 +771,6 @@
|
||||
under_icon = item_icons[slot_w_uniform_str]
|
||||
else if ("[worn_state]_s" in icon_states(rolled_down_icon))
|
||||
under_icon = rolled_down_icon
|
||||
else
|
||||
under_icon = INV_W_UNIFORM_DEF_ICON
|
||||
|
||||
// The _s is because the icon update procs append it.
|
||||
if((under_icon == rolled_down_icon && "[worn_state]_s" in icon_states(under_icon)) || ("[worn_state]_d_s" in icon_states(under_icon)))
|
||||
@@ -754,8 +794,8 @@
|
||||
under_icon = item_icons[slot_w_uniform_str]
|
||||
else if ("[worn_state]_s" in icon_states(rolled_down_sleeves_icon))
|
||||
under_icon = rolled_down_sleeves_icon
|
||||
else
|
||||
under_icon = INV_W_UNIFORM_DEF_ICON
|
||||
else if(index)
|
||||
under_icon = new /icon("[INV_W_UNIFORM_DEF_ICON]_[index].dmi")
|
||||
|
||||
// The _s is because the icon update procs append it.
|
||||
if((under_icon == rolled_down_sleeves_icon && "[worn_state]_s" in icon_states(under_icon)) || ("[worn_state]_r_s" in icon_states(under_icon)))
|
||||
@@ -770,6 +810,8 @@
|
||||
var/mob/M = src.loc
|
||||
M.update_inv_w_uniform()
|
||||
|
||||
set_clothing_index()
|
||||
|
||||
|
||||
/obj/item/clothing/under/examine(mob/user)
|
||||
..(user)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
flags_inv = HIDEHOLSTER
|
||||
allowed = list(/obj/item/device/analyzer,/obj/item/stack/medical,/obj/item/weapon/dnainjector,/obj/item/weapon/reagent_containers/dropper,/obj/item/weapon/reagent_containers/syringe,/obj/item/weapon/reagent_containers/hypospray,/obj/item/device/healthanalyzer,/obj/item/device/flashlight/pen,/obj/item/weapon/reagent_containers/glass/bottle,/obj/item/weapon/reagent_containers/glass/beaker,/obj/item/weapon/reagent_containers/pill,/obj/item/weapon/storage/pill_bottle,/obj/item/weapon/paper)
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 50, rad = 0)
|
||||
index = 1
|
||||
|
||||
/obj/item/clothing/suit/storage/toggle/labcoat/red
|
||||
name = "red labcoat"
|
||||
|
||||
@@ -357,6 +357,7 @@
|
||||
name = "maid costume"
|
||||
desc = "Maid in China."
|
||||
icon_state = "maid"
|
||||
index = 1
|
||||
|
||||
/obj/item/clothing/under/dress/maid/janitor
|
||||
name = "maid uniform"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "jeans"
|
||||
gender = PLURAL
|
||||
body_parts_covered = LOWER_TORSO|LEGS
|
||||
index = 1
|
||||
|
||||
/obj/item/clothing/under/pants/ripped
|
||||
name = "ripped jeans"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
desc = "95% Polyester, 5% Spandex!"
|
||||
gender = PLURAL
|
||||
body_parts_covered = LOWER_TORSO
|
||||
index = 1
|
||||
|
||||
/obj/item/clothing/under/shorts/red
|
||||
name = "red athletic shorts"
|
||||
@@ -99,6 +100,7 @@
|
||||
icon_state = "skirt_short_black"
|
||||
body_parts_covered = LOWER_TORSO
|
||||
rolled_sleeves = -1
|
||||
index = 1
|
||||
|
||||
/obj/item/clothing/under/skirt/khaki
|
||||
name = "khaki skirt"
|
||||
|
||||
@@ -580,7 +580,17 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
if(wear_suit && (wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space/rig))
|
||||
return //Wearing a suit that prevents uniform rendering
|
||||
|
||||
var/obj/item/clothing/under/under = w_uniform
|
||||
|
||||
var/uniform_sprite
|
||||
|
||||
if(under.index)
|
||||
uniform_sprite = "[INV_W_UNIFORM_DEF_ICON]_[under.index].dmi"
|
||||
else
|
||||
uniform_sprite = "[INV_W_UNIFORM_DEF_ICON].dmi"
|
||||
|
||||
//Build a uniform sprite
|
||||
<<<<<<< HEAD
|
||||
//VOREStation Edit start.
|
||||
var/icon/c_mask = null
|
||||
if(tail_style && tail_style.clip_mask_icon && tail_style.clip_mask_state)
|
||||
@@ -590,6 +600,9 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
overlays_standing[UNIFORM_LAYER] = w_uniform.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_w_uniform_str, default_icon = INV_W_UNIFORM_DEF_ICON, default_layer = UNIFORM_LAYER, clip_mask = c_mask)
|
||||
//VOREStation Edit end.
|
||||
|
||||
=======
|
||||
overlays_standing[UNIFORM_LAYER] = w_uniform.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_w_uniform_str, default_icon = uniform_sprite, default_layer = UNIFORM_LAYER)
|
||||
>>>>>>> 3af55c5... Merge pull request #6651 from Cerebulon/ClothingExpansionPort
|
||||
apply_layer(UNIFORM_LAYER)
|
||||
|
||||
/mob/living/carbon/human/update_inv_wear_id()
|
||||
@@ -758,6 +771,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
if(!wear_suit)
|
||||
return //No point, no suit.
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Part of splitting the suit sprites up
|
||||
var/iconFile = INV_SUIT_DEF_ICON
|
||||
var/obj/item/clothing/suit/S //VOREStation edit - break this var out a level for use below.
|
||||
@@ -775,6 +789,17 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
c_mask = new /icon(tail_style.clip_mask_icon, tail_style.clip_mask_state)
|
||||
overlays_standing[SUIT_LAYER] = wear_suit.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_wear_suit_str, default_icon = iconFile, default_layer = SUIT_LAYER, clip_mask = c_mask)
|
||||
//VOREStation Edit end.
|
||||
=======
|
||||
var/obj/item/clothing/suit/suit = wear_suit
|
||||
var/suit_sprite
|
||||
|
||||
if(suit.index)
|
||||
suit_sprite = "[INV_SUIT_DEF_ICON]_[suit.index].dmi"
|
||||
else
|
||||
suit_sprite = "[INV_SUIT_DEF_ICON].dmi"
|
||||
|
||||
overlays_standing[SUIT_LAYER] = wear_suit.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_wear_suit_str, default_icon = suit_sprite, default_layer = SUIT_LAYER)
|
||||
>>>>>>> 3af55c5... Merge pull request #6651 from Cerebulon/ClothingExpansionPort
|
||||
|
||||
apply_layer(SUIT_LAYER)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user