Merge pull request #3153 from Yoshax/iconsplitting

'Improved' solution to the full uniform.dmi problem
This commit is contained in:
Anewbe
2017-03-28 18:22:04 -05:00
committed by GitHub
49 changed files with 111 additions and 108 deletions

View File

@@ -156,7 +156,7 @@ datum/supply_packs/costumes/witch
/obj/item/clothing/under/wedding/bride_blue,
/obj/item/clothing/under/wedding/bride_red,
/obj/item/clothing/under/wedding/bride_white,
/obj/item/clothing/under/dress/sundress,
/obj/item/clothing/under/sundress,
/obj/item/clothing/under/dress/dress_green,
/obj/item/clothing/under/dress/dress_pink,
/obj/item/clothing/under/dress/dress_orange,

View File

@@ -226,7 +226,7 @@
delete_me = 1
/obj/effect/landmark/costume/cutewitch/New()
new /obj/item/clothing/under/dress/sundress(src.loc)
new /obj/item/clothing/under/sundress(src.loc)
new /obj/item/clothing/head/witchwig(src.loc)
new /obj/item/weapon/staff/broom(src.loc)
delete_me = 1

View File

@@ -45,7 +45,7 @@
/obj/structure/closet/chefcloset/New()
..()
new /obj/item/clothing/under/dress/sundress(src)
new /obj/item/clothing/under/sundress(src)
new /obj/item/clothing/under/waiter(src)
new /obj/item/clothing/under/waiter(src)
new /obj/item/device/radio/headset/headset_service(src)

View File

@@ -273,11 +273,11 @@
/datum/gear/uniform/sundress
display_name = "sundress"
path = /obj/item/clothing/under/dress/sundress
path = /obj/item/clothing/under/sundress
/datum/gear/uniform/sundress/white
display_name = "sundress, white"
path = /obj/item/clothing/under/dress/sundress/white
path = /obj/item/clothing/under/sundress_white
/datum/gear/uniform/dress_fire
display_name = "flame dress"
@@ -446,10 +446,10 @@
display_name = "jumpsuit, hephaestus"
path = /obj/item/clothing/under/hephaestus
/datum/gear/uniform/yoga
/datum/gear/uniform/yogapants
display_name = "yoga pants"
path = /obj/item/clothing/under/pants/yoga
path = /obj/item/clothing/under/pants/yogapants
/datum/gear/uniform/yoga/New()
/datum/gear/uniform/yogapants/New()
..()
gear_tweaks = list(gear_tweak_free_color_choice)

View File

@@ -525,10 +525,6 @@
var/rolled_down = -1 //0 = unrolled, 1 = rolled, -1 = cannot be toggled
var/rolled_sleeves = -1 //0 = unrolled, 1 = rolled, -1 = cannot be toggled
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/uniform.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/uniform.dmi',
"Tajaran" = 'icons/mob/species/tajaran/uniforms/uniform.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/uniform.dmi',
"Teshari" = 'icons/mob/species/seromi/uniform.dmi',
"Vox" = 'icons/mob/species/vox/uniform.dmi'
)
@@ -539,6 +535,9 @@
valid_accessory_slots = list("utility","armband","decor","over")
restricted_accessory_slots = list("utility", "armband")
var/icon/rolled_down_icon = 'icons/mob/uniform_rolled_down.dmi'
var/icon/rolled_down_sleeves_icon = 'icons/mob/uniform_sleeves_rolled.dmi'
/obj/item/clothing/under/attack_hand(var/mob/user)
if(accessories && accessories.len)
@@ -558,7 +557,7 @@
//autodetect rollability
if(rolled_down < 0)
if((worn_state + "_d_s") in icon_states('icons/mob/uniform.dmi'))
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)))
rolled_down = 0
/obj/item/clothing/under/proc/update_rolldown_status()
@@ -573,11 +572,13 @@
under_icon = sprite_sheets[H.species.get_bodytype(H)]
else if(item_icons && 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))
under_icon = rolled_down_icon
else
under_icon = INV_W_UNIFORM_DEF_ICON
// The _s is because the icon update procs append it.
if(("[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)))
if(rolled_down != 1)
rolled_down = 0
else
@@ -596,11 +597,13 @@
under_icon = sprite_sheets[H.species.get_bodytype(H)]
else if(item_icons && 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))
under_icon = rolled_down_sleeves_icon
else
under_icon = INV_W_UNIFORM_DEF_ICON
// The _s is because the icon update procs append it.
if(("[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)))
if(rolled_sleeves != 1)
rolled_sleeves = 0
else
@@ -682,10 +685,17 @@
if(rolled_down)
body_parts_covered = initial(body_parts_covered)
body_parts_covered &= ~(UPPER_TORSO|ARMS)
item_state_slots[slot_w_uniform_str] = "[worn_state]_d"
if("[worn_state]_s" in icon_states(rolled_down_icon))
icon_override = rolled_down_icon
item_state_slots[slot_w_uniform_str] = "[worn_state]"
else
item_state_slots[slot_w_uniform_str] = "[worn_state]_d"
usr << "<span class='notice'>You roll down your [src].</span>"
else
body_parts_covered = initial(body_parts_covered)
if(icon_override == rolled_down_icon)
icon_override = initial(icon_override)
item_state_slots[slot_w_uniform_str] = "[worn_state]"
usr << "<span class='notice'>You roll up your [src].</span>"
update_clothing_icon()
@@ -708,10 +718,16 @@
rolled_sleeves = !rolled_sleeves
if(rolled_sleeves)
body_parts_covered &= ~(ARMS)
item_state_slots[slot_w_uniform_str] = "[worn_state]_r"
if("[worn_state]_s" in icon_states(rolled_down_sleeves_icon))
icon_override = rolled_down_sleeves_icon
item_state_slots[slot_w_uniform_str] = "[worn_state]"
else
item_state_slots[slot_w_uniform_str] = "[worn_state]_r"
usr << "<span class='notice'>You roll up your [src]'s sleeves.</span>"
else
body_parts_covered = initial(body_parts_covered)
if(icon_override == rolled_down_sleeves_icon)
icon_override = initial(icon_override)
item_state_slots[slot_w_uniform_str] = "[worn_state]"
usr << "<span class='notice'>You roll down your [src]'s sleeves.</span>"
update_clothing_icon()

View File

@@ -1,11 +1,3 @@
/obj/item/clothing/under/color
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/color.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/color.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/color.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/color.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/color.dmi'
)
/obj/item/clothing/under/color/black
name = "black jumpsuit"
icon_state = "black"

View File

@@ -255,13 +255,6 @@
*/
/obj/item/clothing/under/dress
body_parts_covered = UPPER_TORSO|LOWER_TORSO
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/dresses.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/dresses.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/dresses.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/dresses.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/dresses.dmi'
)
/obj/item/clothing/under/dress/blacktango
name = "black tango dress"
@@ -353,14 +346,6 @@
*/
/obj/item/clothing/under/wedding
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/dresses.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/dresses.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/dresses.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/dresses.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/dresses.dmi'
)
/obj/item/clothing/under/wedding/bride_orange
name = "orange wedding dress"
@@ -393,13 +378,13 @@
flags_inv = HIDESHOES
body_parts_covered = UPPER_TORSO|LOWER_TORSO
/obj/item/clothing/under/dress/sundress
/obj/item/clothing/under/sundress
name = "sundress"
desc = "Makes you want to frolic in a field of daisies."
icon_state = "sundress"
body_parts_covered = UPPER_TORSO|LOWER_TORSO
/obj/item/clothing/under/dress/sundress/white
/obj/item/clothing/under/sundress_white
name = "white sundress"
desc = "A white sundress decorated with purple lilies."
icon_state = "sundress_white"
@@ -474,13 +459,6 @@
/obj/item/clothing/under/cheongsam
name = "white cheongsam"
desc = "It is a white cheongsam dress."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/dresses.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/dresses.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/dresses.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/dresses.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/dresses.dmi'
)
icon_state = "mai_yang"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS
@@ -508,13 +486,6 @@
/obj/item/clothing/under/croptop
name = "crop top"
desc = "A shirt that has had the top cropped. This one is NT sponsored."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/dresses.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/dresses.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/dresses.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/dresses.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/dresses.dmi'
)
icon_state = "croptop"
item_state_slots = list(slot_r_hand_str = "grey", slot_l_hand_str = "grey")

View File

@@ -2,13 +2,6 @@
/obj/item/clothing/under/pants
name = "jeans"
desc = "A nondescript pair of tough blue jeans."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/pants.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/pants.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/pants.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/pants.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/pants.dmi'
)
icon_state = "jeans"
gender = PLURAL
body_parts_covered = LOWER_TORSO|LEGS
@@ -124,10 +117,10 @@
desc = "A pair of sexy, tight black leather chaps."
icon_state = "chapsbl"
/obj/item/clothing/under/pants/yoga
/obj/item/clothing/under/pants/yogapants
name = "yoga pants"
desc = "A pair of tight-fitting yoga pants for those lazy days."
icon_state = "yoga"
icon_state = "yogapants"
/*
* Baggy Pants

View File

@@ -2,13 +2,6 @@
/obj/item/clothing/under/shorts
name = "athletic shorts"
desc = "95% Polyester, 5% Spandex!"
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/pants.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/pants.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/pants.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/pants.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/pants.dmi'
)
gender = PLURAL
body_parts_covered = LOWER_TORSO
@@ -103,13 +96,6 @@
/obj/item/clothing/under/skirt
name = "short black skirt"
desc = "A skirt that is a shiny black."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/dresses.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/dresses.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/dresses.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/dresses.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/dresses.dmi'
)
icon_state = "skirt_short_black"
body_parts_covered = LOWER_TORSO
rolled_sleeves = -1
@@ -168,8 +154,6 @@
icon_state = "plaid_purple"
item_state_slots = list(slot_r_hand_str = "purple", slot_l_hand_str = "purple")
//Job skirts
/obj/item/clothing/under/rank/cargo/skirt
name = "quartermaster's jumpskirt"
desc = "It's a jumpskirt worn by the quartermaster. It's specially designed to prevent back injuries caused by pushing paper."

View File

@@ -4,12 +4,6 @@
/obj/item/clothing/under/pt
name = "pt uniform"
desc = "Shorts! Shirt! Miami! Sexy!"
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/military.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/military.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/military.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/military.dmi'
)
icon_state = "miami"
worn_state = "miami"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
@@ -40,13 +34,6 @@
/obj/item/clothing/under/utility
name = "utility uniform"
desc = "A comfortable turtleneck and black utility trousers."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/military.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/military.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/military.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/military.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/military.dmi'
)
icon_state = "blackutility"
worn_state = "blackutility"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
@@ -107,6 +94,7 @@
icon_state = "blackutility_com"
worn_state = "blackutility_com"
/obj/item/clothing/under/utility/fleet
name = "fleet coveralls"
desc = "The utility uniform of the SCG Fleet, made from an insulated material."
@@ -145,6 +133,7 @@
icon_state = "navyutility_com"
worn_state = "navyutility_com"
/obj/item/clothing/under/utility/marine
name = "marine fatigues"
desc = "The utility uniform of the SCG Marine Corps, made from durable material."
@@ -199,13 +188,6 @@
/obj/item/clothing/under/service
name = "service uniform"
desc = "A service uniform of some kind."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/military.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/military.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/military.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/military.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/military.dmi'
)
icon_state = "whiteservice"
worn_state = "whiteservice"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
@@ -233,13 +215,6 @@
/obj/item/clothing/under/mildress
name = "dress uniform"
desc = "A dress uniform of some kind."
sprite_sheets = list(
"Human" = 'icons/mob/uniforms/military.dmi',
"Skrell" = 'icons/mob/species/skrell/uniforms/military.dmi',
"Tajara" = 'icons/mob/species/tajaran/uniforms/military.dmi',
"Unathi" = 'icons/mob/species/unathi/uniforms/military.dmi',
"Diona" = 'icons/mob/species/diona/uniforms/military.dmi'
)
icon_state = "greydress"
worn_state = "greydress"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 KiB

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@@ -0,0 +1,5 @@
This Byond program takes all the icons in DmiToSplit along with input from the user and
splits the icons from the original file into a new file based on the user's provided criteria.
It also produces a file that is the original file minus the icons split into the new file.
-- Yoshax

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

@@ -0,0 +1,49 @@
/*
These are simple defaults for your project.
*/
world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
view = 6 // show up to 6 tiles outward from center (13x13 view)
// Make objects move 8 pixels per tick when walking
mob
step_size = 8
obj
step_size = 8
client/verb/split_dmi()
set name = "Split Dmi"
set desc = "Loads DmiToSplit.dmi and removes the icon_states of user provided input into another .dmi."
set category = "Here"
var/icon/DMIToSplit = icon('DmiToSplit.dmi')
var/icon/RunningOutputCut = new()
var/icon/RunningOutput = new()
var/user_input
while(!user_input)
user_input = input(usr, "Enter the criteria for the icon_states you wish to be split. For example, doing _d_s will remove all rolled down jumpsuits.","Split Criteria", "")
world << "Your split criteria is [user_input]"
for(var/OriginalState in icon_states(DMIToSplit))
if(findtext(OriginalState, user_input))
var/icon/ToAdd = icon(DMIToSplit, OriginalState)
var/good_name = replacetext(OriginalState, user_input, "")
good_name = "[good_name]_s"
RunningOutputCut.Insert(ToAdd, good_name)
else
var/icon/ToAdd = icon(DMIToSplit, OriginalState)
RunningOutput.Insert(ToAdd, OriginalState)
usr << ftp(RunningOutput,"CutUpDmi.dmi")
usr << ftp(RunningOutputCut, "CutUpDmiWithCriteria.dmi")

View File

@@ -0,0 +1,18 @@
// DM Environment file for IconSplitter.dme.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
// END_FILE_DIR
// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INCLUDE
#include "IconSplitter.dm"
// END_INCLUDE