Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/datums/outfits/misc/shitspawn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
/datum/outfit/psyops_officer
name = "psyops officer"

uniform = /obj/item/clothing/under/darkred
uniform = /obj/item/clothing/under/color/darkred
head = /obj/item/clothing/head/helmet/psyamp
suit = /obj/item/clothing/suit/armor/vest/fullbody/psy_robe
shoes = /obj/item/clothing/shoes/boots/combat
Expand Down Expand Up @@ -492,7 +492,7 @@
id = /obj/item/weapon/card/id/centcom/special_ops

/datum/outfit/wizard
uniform = /obj/item/clothing/under/lightpurple
uniform = /obj/item/clothing/under/color/lightpurple
shoes = /obj/item/clothing/shoes/sandal
l_ear = /obj/item/device/radio/headset
r_pocket = /obj/item/weapon/teleportation_scroll
Expand Down
8 changes: 4 additions & 4 deletions code/game/gamemodes/factions/families.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@
name = "Ballas"
gang_id = "B"
acceptable_clothes = list(/obj/item/clothing/head/soft/purple,
/obj/item/clothing/under/lightpurple,
/obj/item/clothing/under/color/lightpurple,
/obj/item/clothing/mask/scarf/violet,
/obj/item/clothing/gloves/purple,
/obj/item/clothing/mask/bandana/skull,
/obj/item/clothing/under/color/pink)

free_clothes = list(/obj/item/clothing/under/lightpurple,
free_clothes = list(/obj/item/clothing/under/color/lightpurple,
/obj/item/clothing/gloves/purple,
/obj/item/toy/crayon/spraycan)
gang_objective_type = /datum/objective/gang/protect_security
Expand All @@ -102,12 +102,12 @@
name = "Grove Street Families"
gang_id = "GSF"
acceptable_clothes = list(/obj/item/clothing/head/soft/green,
/obj/item/clothing/under/lightgreen,
/obj/item/clothing/under/color/lightgreen,
/obj/item/clothing/mask/scarf/green,
/obj/item/clothing/suit/poncho/green,
/obj/item/clothing/mask/bandana/green)
free_clothes = list(/obj/item/clothing/mask/bandana/green,
/obj/item/clothing/under/lightgreen,
/obj/item/clothing/under/color/lightgreen,
/obj/item/toy/crayon/spraycan)
gang_objective_type = /datum/objective/gang/capture_station

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/modes_gameplays/ninja/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Space Ninja"

uniform = /obj/item/clothing/under/color/black
uniform_f = /obj/item/clothing/under/color/blackf
uniform_f = /obj/item/clothing/under/blackf
shoes = /obj/item/clothing/shoes/space_ninja
suit = /obj/item/clothing/suit/space/space_ninja
gloves = /obj/item/clothing/gloves/space_ninja
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/modes_gameplays/wizard/artefact.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
for(var/obj/item/I in target)
target.remove_from_mob(I)
target.equip_to_slot_or_del(new /obj/item/device/radio/headset(target), SLOT_L_EAR)
target.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(target), SLOT_W_UNIFORM)
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(target), SLOT_W_UNIFORM)
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(target), SLOT_SHOES)
target.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(target), SLOT_WEAR_SUIT)
target.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(target), SLOT_HEAD)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/roles/wizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
qdel(wizard_mob.l_store)

wizard_mob.equip_to_slot_or_del(new /obj/item/device/radio/headset(wizard_mob), SLOT_L_EAR)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(wizard_mob), SLOT_W_UNIFORM)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(wizard_mob), SLOT_W_UNIFORM)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(wizard_mob), SLOT_SHOES)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(wizard_mob), SLOT_WEAR_SUIT)
wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(wizard_mob), SLOT_HEAD)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/washing_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var/global/list/dyed_item_types = list(
DYE_YELLOW = /obj/item/clothing/under/color/yellow,
DYE_GREEN = /obj/item/clothing/under/color/green,
DYE_BLUE = /obj/item/clothing/under/color/blue,
DYE_PURPLE = /obj/item/clothing/under/purple,
DYE_PURPLE = /obj/item/clothing/under/color/purple,
DYE_WHITE = /obj/item/clothing/under/color/white,
DYE_MIME = /obj/item/clothing/under/mime,
DYE_RAINBOW = /obj/item/clothing/under/rainbow,
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/pit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
/obj/item/clothing/under/pants/jeans,
/obj/item/clothing/under/pants/camo,
/obj/item/clothing/under/det,
/obj/item/clothing/under/brown,
/obj/item/clothing/under/color/brown,
/obj/item/clothing/under/jetsons,
/obj/item/clothing/under/jetsons/j2
)
Expand Down
20 changes: 13 additions & 7 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ BLIND // can't see anything
3 = Report location
*/
var/displays_id = 1
var/rolled_down = 0
var/rolled_down = FALSE
var/basecolor

var/fresh_laundered_until = 0
Expand All @@ -529,6 +529,7 @@ BLIND // can't see anything

/obj/item/clothing/under/equipped(mob/user, slot)
..()
rolled_down = FALSE
if(slot == SLOT_W_UNIFORM && fresh_laundered_until > world.time)
fresh_laundered_until = world.time
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "fresh_laundry", /datum/mood_event/fresh_laundry)
Expand Down Expand Up @@ -631,18 +632,23 @@ BLIND // can't see anything
if(usr.incapacitated())
return

if(copytext(item_state,-2) != "_d")
basecolor = item_state
if(icon_exists('icons/mob/uniform.dmi', "[basecolor]_d"))
item_state = item_state == "[basecolor]" ? "[basecolor]_d" : "[basecolor]"
update_inv_mob()
if(rolled_down)
to_chat(usr, "<span class='notice'>Вы пытаетесь распахнуть униформу.</span>")
else
to_chat(usr, "<span class='notice'>You cannot roll down the uniform!</span>")
to_chat(usr, "<span class='notice'>Вы пытаетесь застягнуть униформу.</span>")
rolled_down = !rolled_down
update_inv_mob()

/obj/item/clothing/under/wash_act(w_color)
. = ..()
fresh_laundered_until = world.time + 5 MINUTES

var/obj/item/clothing/dye_type = get_dye_type(w_color)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не уверен что понимаю что тут происходит

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вроде ты когда-то и писал, #9117 😆

не проблема, но вообще согласен

if(!dye_type)
return
color = dye_type.color


/obj/item/clothing/under/rank/atom_init()
sensor_mode = pick(SUIT_SENSOR_OFF, SUIT_SENSOR_BINARY, SUIT_SENSOR_VITAL, SUIT_SENSOR_TRACKING)
. = ..()
Expand Down
214 changes: 118 additions & 96 deletions code/modules/clothing/under/color.dm
Original file line number Diff line number Diff line change
@@ -1,133 +1,155 @@
/obj/item/clothing/under/color/black
name = "black jumpsuit"
icon_state = "black"
item_state = "black"

/obj/item/clothing/under/color
name = "colored uniform"
icon_state = "colored"
item_state_inventory= "colored"
item_state_world = "colored_w"
item_state = "colored"
color = "#818181"
flags = ONESIZEFITSALL|HEAR_TALK
var/mutable_appearance/item_under_overlay

// if needed, this can easily be changed to /obj/item/clothing/under
// in case of adding support for /obj/item/clothing, this proc will require some tweaking
/obj/item/clothing/under/color/get_standing_overlay(mob/living/carbon/human/H, def_icon_path, sprite_sheet_slot, layer, bloodied_icon_state = null, icon_state_appendix = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

склейка standing_overlay сейчас очень костыльная, какая-то часть кода униформы уже оказалась в родителе с проверкой на SPRITE_SHEET_UNIFORM, и потом тут еще раз проходимся и переприклеиваем все оверлеи.

Надо как-то сделать по другому, но я сходу не могу вникнуть и предложить лучший вариант.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Может быть какой-то общий флаг для вещей с покраской через color, но там еще с rolldown что-то надо делать. Может надо изменить логику get_standing_overlay, делать не снизу вверх, а наоборот (сначала клеить что-то на уровне предмета, а потом в родительском проке).

Но это сейчас я просто тыкаю наугад.

var/mutable_appearance/I = ..()

var/icon_path = def_icon_path
var/t_state = item_state ? item_state : icon_state

var/datum/species/S = H.species

if(S.sprite_sheets[sprite_sheet_slot])
icon_path = S.sprite_sheets[sprite_sheet_slot]

var/fem_appendix = ""

// we dont have female sprites for fat uniforms
if(H.gender == FEMALE && S.gender_limb_icons && sprite_sheet_slot != SPRITE_SHEET_UNIFORM_FAT)
fem_appendix = "_fem"

// checks if we have a colorless overlay we need to apply
if(rolled_down || !icon_exists(icon_path, "[t_state]_overlay[fem_appendix]"))
return I

/obj/item/clothing/under/color/blackf
name = "feminine black jumpsuit"
desc = "It's very smart and in a ladies-size!"
icon_state = "black"
item_state = "blackf"
// add the colorless overlay
I.cut_overlays()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем удалять все предыдущие оверлеи

var/mutable_appearance/under_mob_overlay = mutable_appearance(icon = icon_path, icon_state = "[t_state]_overlay[fem_appendix]")
under_mob_overlay.appearance_flags = RESET_COLOR
I.add_overlay(under_mob_overlay)

// re-apply blood & dirt
if(dirt_overlay && bloodied_icon_state)
var/mutable_appearance/bloodsies = mutable_appearance(icon = 'icons/effects/blood.dmi', icon_state = bloodied_icon_state)
bloodsies.color = dirt_overlay.color
I.add_overlay(bloodsies)

return I

/obj/item/clothing/under/color/update_icon()
..()

// add the colorless overlay
//var/mutable_appearance/under_overlay = mutable_appearance(icon, "[icon_state]_overlay")
//under_overlay.appearance_flags = RESET_COLOR
//add_overlay(under_overlay)
Comment on lines +49 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если код не юзается зачем его оставлять


/obj/item/clothing/under/color/dropped()
. = ..()
update_world_icon()

// cut_overlay just isnt fast enough for this, unfortunately.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну конечно, он же выполняется в оверлей контроллере скорее всего в следующий тик.

/obj/item/clothing/under/color/putdown_animation()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

будто бы можно сделать какие-то лайфхаки с кешем и подтягиванием нужного готового спрайта прямо в анимации.

return

/obj/item/clothing/under/color/update_world_icon()
..()

// add the colorless overlay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем этот комментарий

cut_overlay(item_under_overlay)
item_under_overlay = image(icon, "[icon_state]_overlay")
item_under_overlay.appearance_flags = RESET_COLOR
add_overlay(item_under_overlay)

/obj/item/clothing/under/color/black
name = "black jumpsuit"
color = "#303030"

/obj/item/clothing/under/color/blue
name = "blue jumpsuit"
icon_state = "blue"
item_state = "blue"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#2b4e95"

/obj/item/clothing/under/color/green
name = "green jumpsuit"
icon_state = "green"
item_state = "green"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#477238"

/obj/item/clothing/under/color/grey
name = "grey jumpsuit"
icon_state = "grey"
item_state = "grey"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#818181"

/obj/item/clothing/under/color/orange
name = "orange jumpsuit"
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position."
icon_state = "orange"
item_state = "orange"
color = "#b9451d"
has_sensor = 2
sensor_mode = SUIT_SENSOR_TRACKING
flags = ONESIZEFITSALL|HEAR_TALK

/obj/item/clothing/under/color/pink
name = "pink jumpsuit"
icon_state = "pink"
item_state = "pink"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#e27285"

/obj/item/clothing/under/color/red
name = "red jumpsuit"
icon_state = "red"
item_state = "red"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#b91d1d"

/obj/item/clothing/under/color/white
name = "white jumpsuit"
icon_state = "white"
item_state = "white"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#f1ebdb"

/obj/item/clothing/under/color/yellow
name = "yellow jumpsuit"
icon_state = "yellow"
item_state = "yellow"
flags = ONESIZEFITSALL|HEAR_TALK
color = "#f8c53a"

/obj/item/clothing/under/psyche
name = "psychedelic"
desc = "Groovy!"
icon_state = "psyche"
/obj/item/clothing/under/color/lightblue
name = "lightblue jumpsuit"
color = "#42bfe8"

/obj/item/clothing/under/lightblue
name = "lightblue"
desc = "lightblue"
icon_state = "lightblue"
flags = ONESIZEFITSALL|HEAR_TALK
/obj/item/clothing/under/color/aqua
name = "aqua jumpsuit"
color = "#59cf93"

/obj/item/clothing/under/aqua
name = "aqua"
desc = "aqua"
icon_state = "aqua"
flags = ONESIZEFITSALL|HEAR_TALK
/obj/item/clothing/under/color/purple
name = "purple jumpsuit"
color = "#9052bc"

/obj/item/clothing/under/purple
name = "purple"
desc = "purple"
icon_state = "purple"
item_state = "purple"
/obj/item/clothing/under/color/lightpurple
name = "lightpurple jumpsuit"
color = "#ceaaed"

/obj/item/clothing/under/lightpurple
name = "lightpurple"
desc = "lightpurple"
icon_state = "lightpurple"
flags = ONESIZEFITSALL|HEAR_TALK
/obj/item/clothing/under/color/lightgreen
name = "lightgreen jumpsuit"
color = "#c4f129"

/obj/item/clothing/under/lightgreen
name = "lightgreen"
desc = "lightgreen"
icon_state = "lightgreen"

/obj/item/clothing/under/lightblue
name = "lightblue"
desc = "lightblue"
icon_state = "lightblue"

/obj/item/clothing/under/lightbrown
name = "lightbrown"
desc = "lightbrown"
icon_state = "lightbrown"

/obj/item/clothing/under/brown
name = "brown"
desc = "brown"
icon_state = "brown"

/obj/item/clothing/under/yellowgreen
name = "yellowgreen"
desc = "yellowgreen"
icon_state = "yellowgreen"

/obj/item/clothing/under/darkblue
name = "darkblue"
desc = "darkblue"
icon_state = "darkblue"
flags = ONESIZEFITSALL|HEAR_TALK
/obj/item/clothing/under/color/lightbrown
name = "lightbrown jumpsuit"
color = "#d39741"

/obj/item/clothing/under/lightred
name = "lightred"
desc = "lightred"
icon_state = "lightred"
/obj/item/clothing/under/color/brown
name = "brown jumpsuit"
color = "#855f39"

/obj/item/clothing/under/darkred
name = "darkred"
desc = "darkred"
icon_state = "darkred"
flags = ONESIZEFITSALL|HEAR_TALK
/obj/item/clothing/under/color/yellowgreen
name = "yellowgreen jumpsuit"
color = "#b0dc1d"

/obj/item/clothing/under/color/darkblue
name = "darkblue jumpsuit"
color = "#1b2447"

/obj/item/clothing/under/color/lightred
name = "lightred jumpsuit"
color = "#e27272"

/obj/item/clothing/under/color/darkred
name = "darkred jumpsuit"
color = "#612721"
Loading
Loading