Skip to content

Commit

Permalink
fix(icons): fixes a HELLFUKKENTON of held icons
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyThorne authored Mar 28, 2024
1 parent a03ff4d commit b3104f1
Show file tree
Hide file tree
Showing 36 changed files with 198 additions and 17 deletions.
21 changes: 15 additions & 6 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -916,21 +916,30 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
user_human = user_mob

var/mob_state = get_icon_state(slot)
if(isnull(mob_state))
// No way to get a mob_state whatsoever, most likely the item has no base icon and is entirely made of overlays (i.e. bodyparts).
return

var/mob_icon

if(icon_override)
mob_icon = icon_override
if(slot == slot_l_hand_str || slot == slot_l_ear_str)

if(slot == slot_l_hand_str || slot == slot_l_ear_str)
mob_state = "[mob_state]_l"
if(slot == slot_r_hand_str || slot == slot_r_ear_str)

if(slot == slot_r_hand_str || slot == slot_r_ear_str)
mob_state = "[mob_state]_r"

else
if(item_icons && item_icons[slot])
mob_icon = item_icons[slot]

else if(user_human?.body_build)
mob_icon = user_human.body_build.get_mob_icon(slot, mob_state)

else
// Couldn't find no icon to use, aborting.
return

var/image/ret_overlay
Expand Down Expand Up @@ -971,8 +980,8 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
for(var/shift_facing in shifts)
var/list/facing_list = shifts[shift_facing]
final_I = dir_shift(final_I, text2dir(shift_facing), facing_list["x"], facing_list["y"])
ret_overlay = overlay_image(final_I, color, flags = RESET_COLOR)

ret_overlay = overlay_image(final_I, null, color, flags = RESET_COLOR)
user_human.body_build.equip_overlays[image_key] = ret_overlay

else
Expand All @@ -987,8 +996,8 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
for(var/shift_facing in shifts)
var/list/facing_list = shifts[shift_facing]
main_icon = dir_shift(main_icon, text2dir(shift_facing), facing_list["x"], facing_list["y"])
ret_overlay = overlay_image(main_icon, color, flags = RESET_COLOR)

ret_overlay = overlay_image(main_icon, null, color, flags = RESET_COLOR)
user_human.body_build.equip_overlays[image_key] = ret_overlay

ret_list += ret_overlay
Expand All @@ -1002,14 +1011,14 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
for(var/shift_facing in shifts)
var/list/facing_list = shifts[shift_facing]
back_icon = dir_shift(back_icon, text2dir(shift_facing), facing_list["x"], facing_list["y"])
ret_overlay = overlay_image(back_icon, color, flags = RESET_COLOR)

ret_overlay = overlay_image(back_icon, null, color, flags = RESET_COLOR)
user_human.body_build.equip_overlays[image_key] = ret_overlay

ret_list += ret_overlay

if(use_list && !length(ret_list))
ret_list = list(overlay_image(main_icon, color, flags = RESET_COLOR), overlay_image(back_icon, color, flags = RESET_COLOR))
ret_list = list(overlay_image(main_icon, null, color, flags = RESET_COLOR), overlay_image(back_icon, null, color, flags = RESET_COLOR))

return use_list ? ret_list : ret_overlay

Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/stacks/tiles/tile_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
name = "tile"
singular_name = "tile"
desc = "A non-descript floor tile."
item_state = "tile"
randpixel = 7
w_class = ITEM_SIZE_NORMAL
max_amount = 100
Expand All @@ -34,6 +35,7 @@
singular_name = "grass floor tile"
desc = "A patch of grass like they often use on golf courses."
icon_state = "tile_grass"
item_state = "tile_grass"
origin_tech = list(TECH_BIO = 1)

drop_sound = SFX_DROP_HERB
Expand All @@ -47,6 +49,7 @@
singular_name = "wood floor tile"
desc = "An easy to fit wooden floor tile."
icon_state = "tile-wood"
item_state = "tile_wood"

drop_sound = SFX_DROP_WOODEN
pickup_sound = SFX_PICKUP_WOODEN
Expand All @@ -64,6 +67,7 @@
singular_name = "darkwood floor tile"
desc = "An easy to fit darkwood floor tile."
icon_state = "tile-darkwood"
item_state = "tile_wood"
stacktype = /obj/item/stack/tile/darkwood
build_type = /obj/item/stack/tile/darkwood

Expand Down
8 changes: 6 additions & 2 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
desc = "It's just an ordinary box."
icon = 'icons/obj/storage/boxes.dmi'
icon_state = "box"
item_state = "syringe_kit"
item_state = "box"
inspect_state = "box-open"
max_storage_space = DEFAULT_BOX_STORAGE
var/obj/item/foldable = /obj/item/stack/material/cardboard // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
var/obj/item/foldable = /obj/item/stack/material/cardboard // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
use_sound = SFX_SEARCH_CLOTHES

drop_sound = SFX_DROP_CARDBOARD
Expand Down Expand Up @@ -87,6 +87,7 @@
desc = "A durable plastic box decorated in warning colors that contains a limited supply of survival tools. The panel and white stripe indicate this one contains oxygen. It has special foldlines, making it able to be folded into an emergency crowbar."
icon_state = "survival"
inspect_state = "survival-open"
item_state = "box_survival"
foldable = /obj/item/crowbar/emergency
startswith = list(/obj/item/clothing/mask/breath = 1,
/obj/item/tank/emergency/oxygen = 1,
Expand All @@ -100,6 +101,7 @@
desc = "A durable plastic box decorated in warning colors that contains a limited supply of survival tools. The panel and black stripe indicate this one contains nitrogen. It has special foldlines, making it able to be folded into an emergency crowbar."
icon_state = "survivalvox"
inspect_state = "survival-open"
item_state = "box_survival"
foldable = /obj/item/crowbar/emergency/vox
startswith = list(/obj/item/clothing/mask/breath = 1,
/obj/item/tank/emergency/nitrogen = 1,
Expand All @@ -112,6 +114,7 @@
desc = "A durable plastic box decorated in warning colors that contains a limited supply of survival tools. The panel and orange stripe indicate this one as the engineering variant. It has special foldlines, making it able to be folded into an emergency crowbar."
icon_state = "survivaleng"
inspect_state = "survival-open"
item_state = "box_survival"
foldable = /obj/item/crowbar/emergency/eng
startswith = list(/obj/item/clothing/mask/breath = 1,
/obj/item/tank/emergency/oxygen/engi = 1,
Expand All @@ -126,6 +129,7 @@
desc = "A durable plastic box decorated in warning colors that contains a limited supply of survival tools. The panel and red & black stripe indicate this one as the security variant. It has special foldlines, making it able to be folded into an emergency crowbar."
icon_state = "survivalsec"
inspect_state = "survival-open"
item_state = "box_survival"
foldable = /obj/item/crowbar/emergency/sec
startswith = list(/obj/item/clothing/mask/breath = 1,
/obj/item/tank/emergency/oxygen = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var/global/list/stool_cache = list() //haha stool
/obj/item/stool/bar_new
name = "wooden bar stool"
icon_state = "barstool_new_preview" //set for the map
item_state = "barstool_new"
item_state = "bar_stool"
base_icon = "barstool_new"

/obj/item/stool/bar_new/padded
Expand Down
5 changes: 5 additions & 0 deletions code/modules/clothing/gloves.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
drop_sound = SFX_DROP_GLOVES
pickup_sound = SFX_PICKUP_GLOVES

item_state_slots = list(
slot_l_hand_str = "bgloves",
slot_r_hand_str = "bgloves",
)

var/transfer_blood = 0
var/mob/living/carbon/human/bloody_hands_mob

Expand Down
5 changes: 5 additions & 0 deletions code/modules/clothing/gloves/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
icon_state = "white"
armor = list(melee = 10, bullet = 5, laser = 5, energy = 0, bomb = 0, bio = 0)

item_state_slots = list(
slot_l_hand_str = "lgloves",
slot_r_hand_str = "lgloves",
)

/obj/item/clothing/gloves/color/modified
item_flags = ITEM_FLAG_PREMODIFIED

Expand Down
5 changes: 5 additions & 0 deletions code/modules/clothing/gloves/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
drop_sound = SFX_DROP_RUBBER
pickup_sound = SFX_PICKUP_RUBBER

item_state_slots = list(
slot_l_hand_str = "ygloves",
slot_r_hand_str = "ygloves",
)

/obj/item/clothing/gloves/insulated/cheap //Cheap Chinese Crap
desc = "These gloves are cheap copies of the coveted gloves, no way this can end badly."
name = "budget insulated gloves"
Expand Down
15 changes: 15 additions & 0 deletions code/modules/clothing/masks/gasmask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@
item_state = "clown"
istinted = 0

item_state_slots = list(
slot_l_hand_str = "clown_hat",
slot_r_hand_str = "clown_hat",
)

/obj/item/clothing/mask/gas/sexyclown
name = "sexy-clown wig and mask"
desc = "A feminine clown mask for the dabbling crossdressers or female entertainers."
Expand Down Expand Up @@ -181,6 +186,11 @@
istinted = 0
siemens_coefficient = 1.0

item_state_slots = list(
slot_l_hand_str = "owl_mask",
slot_r_hand_str = "owl_mask",
)

/obj/item/clothing/mask/gas/vox
name = "vox breathing mask"
desc = "A small oxygen filter for use by Vox"
Expand All @@ -204,3 +214,8 @@
filtered_gases = list("phoron", "sleeping_agent", "oxygen")
say_messages = list("Mmfph!", "Mmmf mrrfff!", "Mmmf mnnf!")
say_verbs = list("mumbles")

item_state_slots = list(
slot_l_hand_str = "plasticbag",
slot_r_hand_str = "plasticbag",
)
5 changes: 5 additions & 0 deletions code/modules/clothing/shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
drop_sound = SFX_DROP_SHOES
pickup_sound = SFX_PICKUP_SHOES

item_state_slots = list(
slot_l_hand_str = "shoes",
slot_r_hand_str = "shoes",
)

var/overshoes = 0
var/can_hold_knife
var/obj/item/holding
Expand Down
43 changes: 43 additions & 0 deletions code/modules/clothing/shoes/colour.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
heat_protection = FEET
max_heat_protection_temperature = SHOE_MAX_HEAT_PROTECTION_TEMPERATURE

item_state_slots = list(
slot_l_hand_str = "bl_shoes",
slot_r_hand_str = "bl_shoes",
)

/obj/item/clothing/shoes/brown
name = "brown shoes"
desc = "A pair of brown shoes."
icon_state = "brown"

item_state_slots = list(
slot_l_hand_str = "b_shoes",
slot_r_hand_str = "b_shoes",
)

/obj/item/clothing/shoes/blue
name = "blue shoes"
icon_state = "blue"
Expand All @@ -34,28 +44,53 @@
desc = "Stylish red shoes."
icon_state = "red"

item_state_slots = list(
slot_l_hand_str = "r_shoes",
slot_r_hand_str = "r_shoes",
)

/obj/item/clothing/shoes/white
name = "white shoes"
icon_state = "white"
permeability_coefficient = 0.01

item_state_slots = list(
slot_l_hand_str = "w_shoes",
slot_r_hand_str = "w_shoes",
)

/obj/item/clothing/shoes/leather
name = "leather shoes"
desc = "A sturdy pair of leather shoes."
icon_state = "leather"

item_state_slots = list(
slot_l_hand_str = "leather_shoes",
slot_r_hand_str = "leather_shoes",
)

/obj/item/clothing/shoes/rainbow
name = "rainbow shoes"
desc = "Very gay shoes."
icon_state = "rain_bow"

item_state_slots = list(
slot_l_hand_str = "r_shoes",
slot_r_hand_str = "r_shoes",
)

/obj/item/clothing/shoes/orange
name = "orange shoes"
icon_state = "orange"
force = 0 //nerf brig shoe throwing
throwforce = 0
siemens_coefficient = 1 // prisoners shall be scared of tasers
desc = "A pair of flimsy, cheap shoes. The soles have been made of a soft rubber."
item_state_slots = list(
slot_l_hand_str = "o_shoes",
slot_r_hand_str = "o_shoes",
)

var/obj/item/handcuffs/chained = null

/obj/item/clothing/shoes/orange/proc/attach_cuffs(obj/item/handcuffs/cuffs, mob/user as mob)
Expand All @@ -66,6 +101,10 @@
chained = cuffs
slowdown_per_slot[slot_shoes] += 15
icon_state = "orange1"
item_state_slots = list(
slot_l_hand_str = "o_shoes1",
slot_r_hand_str = "o_shoes1",
)

/obj/item/clothing/shoes/orange/proc/remove_cuffs(mob/user as mob)
if(!chained)
Expand All @@ -76,6 +115,10 @@

slowdown_per_slot[slot_shoes] -= 15
icon_state = "orange"
item_state_slots = list(
slot_l_hand_str = "o_shoes",
slot_r_hand_str = "o_shoes",
)
chained = null

/obj/item/clothing/shoes/orange/attack_self(mob/user as mob)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/clothing/shoes/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
desc = "Rubber boots."
name = "galoshes"
icon_state = "galoshes"
item_state_slots = null
permeability_coefficient = 0.05
item_flags = ITEM_FLAG_NOSLIP
can_hold_knife = 1
Expand All @@ -21,6 +22,7 @@
name = "jackboots"
desc = "Tall synthleather boots with an artificial shine."
icon_state = "jackboots"
item_state_slots = null
force = 3
armor = list(melee = 70, bullet = 70, laser = 60, energy = 25, bomb = 20, bio = 30)
siemens_coefficient = 0.5
Expand Down Expand Up @@ -56,6 +58,11 @@
drop_sound = SFX_DROP_BOOTS
pickup_sound = SFX_PICKUP_BOOTS

item_state_slots = list(
slot_l_hand_str = "jackboots",
slot_r_hand_str = "jackboots",
)

/obj/item/clothing/shoes/workboots/toeless
name = "toe-less workboots"
desc = "A pair of toeless work boots designed for use in industrial settings. Modified for species whose toes have claws."
Expand Down
5 changes: 5 additions & 0 deletions code/modules/clothing/shoes/magboots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
drop_sound = SFX_DROP_BOOTS
pickup_sound = SFX_PICKUP_BOOTS

item_state_slots = list(
slot_l_hand_str = "magboots",
slot_r_hand_str = "magboots",
)

/obj/item/clothing/shoes/magboots/proc/set_slowdown()
slowdown_per_slot[slot_shoes] = shoes? max(0, shoes.slowdown_per_slot[slot_shoes]): 0 //So you can't put on magboots to make you walk faster.
if (magpulse)
Expand Down
Loading

0 comments on commit b3104f1

Please sign in to comment.