Ports Clothing Expansion Code from World Server

This commit is contained in:
Atermonera
2020-01-28 11:15:31 -08:00
committed by VirgoBot
parent 87d4a21676
commit 130d942a2d
25 changed files with 79 additions and 7 deletions

View File

@@ -115,10 +115,10 @@
#define INV_BACK_DEF_ICON 'icons/mob/back.dmi' #define INV_BACK_DEF_ICON 'icons/mob/back.dmi'
#define INV_L_HAND_DEF_ICON 'icons/mob/items/lefthand.dmi' #define INV_L_HAND_DEF_ICON 'icons/mob/items/lefthand.dmi'
#define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi' #define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi'
#define INV_W_UNIFORM_DEF_ICON 'icons/mob/uniform.dmi' #define INV_W_UNIFORM_DEF_ICON "icons/mob/uniform"
#define INV_ACCESSORIES_DEF_ICON 'icons/mob/ties.dmi' #define INV_ACCESSORIES_DEF_ICON 'icons/mob/ties.dmi'
#define INV_TIE_DEF_ICON 'icons/mob/ties.dmi' #define INV_TIE_DEF_ICON 'icons/mob/ties.dmi'
#define INV_SUIT_DEF_ICON 'icons/mob/suit.dmi' #define INV_SUIT_DEF_ICON "icons/mob/suit"
#define INV_SPACESUIT_DEF_ICON 'icons/mob/spacesuit.dmi' #define INV_SPACESUIT_DEF_ICON 'icons/mob/spacesuit.dmi'
#define INV_WEAR_ID_DEF_ICON 'icons/mob/mob.dmi' #define INV_WEAR_ID_DEF_ICON 'icons/mob/mob.dmi'
#define INV_GLOVES_DEF_ICON 'icons/mob/hands.dmi' #define INV_GLOVES_DEF_ICON 'icons/mob/hands.dmi'

View File

@@ -24,8 +24,11 @@
var/ear_protection = 0 var/ear_protection = 0
var/blood_sprite_state 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 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. //Updates the icons of the mob wearing the clothing item, if any.
/obj/item/clothing/proc/update_clothing_icon() /obj/item/clothing/proc/update_clothing_icon()
return return
@@ -35,12 +38,14 @@
..() ..()
gunshot_residue = null gunshot_residue = null
/obj/item/clothing/New() /obj/item/clothing/New()
..() ..()
if(starting_accessories) if(starting_accessories)
for(var/T in starting_accessories) for(var/T in starting_accessories)
var/obj/item/clothing/accessory/tie = new T(src) var/obj/item/clothing/accessory/tie = new T(src)
src.attach_accessory(null, tie) src.attach_accessory(null, tie)
set_clothing_index()
/obj/item/clothing/equipped(var/mob/user,var/slot) /obj/item/clothing/equipped(var/mob/user,var/slot)
..() ..()
@@ -224,6 +229,9 @@
SPECIES_VOX = 'icons/mob/species/vox/gloves.dmi' SPECIES_VOX = 'icons/mob/species/vox/gloves.dmi'
) )
/obj/item/clothing/proc/set_clothing_index()
return
/obj/item/clothing/gloves/update_clothing_icon() /obj/item/clothing/gloves/update_clothing_icon()
if (ismob(src.loc)) if (ismob(src.loc))
var/mob/M = src.loc var/mob/M = src.loc
@@ -602,6 +610,7 @@
var/mob/M = src.loc var/mob/M = src.loc
M.update_inv_shoes() M.update_inv_shoes()
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
//Suit //Suit
/obj/item/clothing/suit /obj/item/clothing/suit
@@ -627,6 +636,20 @@
SPECIES_VOX = 'icons/mob/species/vox/suit.dmi' 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) valid_accessory_slots = (ACCESSORY_SLOT_OVER | ACCESSORY_SLOT_ARMBAND)
restricted_accessory_slots = (ACCESSORY_SLOT_ARMBAND) restricted_accessory_slots = (ACCESSORY_SLOT_ARMBAND)
@@ -635,6 +658,8 @@
var/mob/M = src.loc var/mob/M = src.loc
M.update_inv_wear_suit() M.update_inv_wear_suit()
set_clothing_index()
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
//Under clothing //Under clothing
/obj/item/clothing/under /obj/item/clothing/under
@@ -707,7 +732,7 @@
//autodetect rollability //autodetect rollability
if(rolled_down < 0) 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 rolled_down = 0
if(rolled_down == -1) if(rolled_down == -1)
@@ -715,6 +740,23 @@
if(rolled_sleeves == -1) if(rolled_sleeves == -1)
verbs -= /obj/item/clothing/under/verb/rollsleeves 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() /obj/item/clothing/under/proc/update_rolldown_status()
var/mob/living/carbon/human/H var/mob/living/carbon/human/H
if(istype(src.loc, /mob/living/carbon/human)) if(istype(src.loc, /mob/living/carbon/human))
@@ -729,8 +771,6 @@
under_icon = item_icons[slot_w_uniform_str] under_icon = item_icons[slot_w_uniform_str]
else if ("[worn_state]_s" in icon_states(rolled_down_icon)) else if ("[worn_state]_s" in icon_states(rolled_down_icon))
under_icon = 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. // 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))) 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] under_icon = item_icons[slot_w_uniform_str]
else if ("[worn_state]_s" in icon_states(rolled_down_sleeves_icon)) else if ("[worn_state]_s" in icon_states(rolled_down_sleeves_icon))
under_icon = rolled_down_sleeves_icon under_icon = rolled_down_sleeves_icon
else else if(index)
under_icon = INV_W_UNIFORM_DEF_ICON under_icon = new /icon("[INV_W_UNIFORM_DEF_ICON]_[index].dmi")
// The _s is because the icon update procs append it. // 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))) 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 var/mob/M = src.loc
M.update_inv_w_uniform() M.update_inv_w_uniform()
set_clothing_index()
/obj/item/clothing/under/examine(mob/user) /obj/item/clothing/under/examine(mob/user)
..(user) ..(user)

View File

@@ -8,6 +8,7 @@
flags_inv = HIDEHOLSTER 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) 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) 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 /obj/item/clothing/suit/storage/toggle/labcoat/red
name = "red labcoat" name = "red labcoat"

View File

@@ -357,6 +357,7 @@
name = "maid costume" name = "maid costume"
desc = "Maid in China." desc = "Maid in China."
icon_state = "maid" icon_state = "maid"
index = 1
/obj/item/clothing/under/dress/maid/janitor /obj/item/clothing/under/dress/maid/janitor
name = "maid uniform" name = "maid uniform"

View File

@@ -5,6 +5,7 @@
icon_state = "jeans" icon_state = "jeans"
gender = PLURAL gender = PLURAL
body_parts_covered = LOWER_TORSO|LEGS body_parts_covered = LOWER_TORSO|LEGS
index = 1
/obj/item/clothing/under/pants/ripped /obj/item/clothing/under/pants/ripped
name = "ripped jeans" name = "ripped jeans"

View File

@@ -4,6 +4,7 @@
desc = "95% Polyester, 5% Spandex!" desc = "95% Polyester, 5% Spandex!"
gender = PLURAL gender = PLURAL
body_parts_covered = LOWER_TORSO body_parts_covered = LOWER_TORSO
index = 1
/obj/item/clothing/under/shorts/red /obj/item/clothing/under/shorts/red
name = "red athletic shorts" name = "red athletic shorts"
@@ -99,6 +100,7 @@
icon_state = "skirt_short_black" icon_state = "skirt_short_black"
body_parts_covered = LOWER_TORSO body_parts_covered = LOWER_TORSO
rolled_sleeves = -1 rolled_sleeves = -1
index = 1
/obj/item/clothing/under/skirt/khaki /obj/item/clothing/under/skirt/khaki
name = "khaki skirt" name = "khaki skirt"

View File

@@ -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)) 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 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 //Build a uniform sprite
<<<<<<< HEAD
//VOREStation Edit start. //VOREStation Edit start.
var/icon/c_mask = null var/icon/c_mask = null
if(tail_style && tail_style.clip_mask_icon && tail_style.clip_mask_state) 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) 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. //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) apply_layer(UNIFORM_LAYER)
/mob/living/carbon/human/update_inv_wear_id() /mob/living/carbon/human/update_inv_wear_id()
@@ -758,6 +771,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
if(!wear_suit) if(!wear_suit)
return //No point, no suit. return //No point, no suit.
<<<<<<< HEAD
// Part of splitting the suit sprites up // Part of splitting the suit sprites up
var/iconFile = INV_SUIT_DEF_ICON var/iconFile = INV_SUIT_DEF_ICON
var/obj/item/clothing/suit/S //VOREStation edit - break this var out a level for use below. 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) 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) 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. //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) apply_layer(SUIT_LAYER)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 322 KiB

BIN
icons/mob/suit_1.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 KiB

After

Width:  |  Height:  |  Size: 343 KiB

BIN
icons/mob/uniform_1.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB