Added support for larger on-mob and item sprites. (#17819)

* Added support for larger on-mob and item sprites.

* DMDoc fixes

---------

Co-authored-by: Cody Brittain <cbrittain10@live.com>
This commit is contained in:
Cody Brittain
2023-11-27 00:47:17 +00:00
committed by GitHub
co-authored by Cody Brittain
parent 6c9ad01e6c
commit 9d3b2f50b6
4 changed files with 92 additions and 0 deletions
+6
View File
@@ -18,6 +18,12 @@
var/storage_cost
///Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly
var/worn_x_dimension = 32
///Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly
var/worn_y_dimension = 32
/**
* Determines which slots an item can fit, eg. `SLOT_BACK`
*
+6
View File
@@ -30,6 +30,9 @@ var/list/mob_icon_icon_states = list()
final_I.Insert(canvas, dir = use_dir)
LAZYINITLIST(H.species.equip_overlays)
var/image/final_image = overlay_image(final_I, color = color, flags = RESET_COLOR|RESET_ALPHA)
var/offset_x = worn_x_dimension
var/offset_y = worn_y_dimension
center_image(final_image, offset_x, offset_y)
H.species.equip_overlays[image_key] = final_image
var/image/I = new() // We return a copy of the cached image, in case downstream procs mutate it.
I.appearance = H.species.equip_overlays[image_key]
@@ -46,6 +49,9 @@ var/list/mob_icon_icon_states = list()
I.add_overlay(additional_parts)
if(has_accents)
I.add_overlay(overlay_image(icon,"[UNDERSCORE_OR_NULL(src.icon_species_tag)][item_state][contained_sprite ? slot_str_to_contained_flag(slot) : ""]_acc",accent_color, RESET_COLOR))
var/offset_x = worn_x_dimension
var/offset_y = worn_y_dimension
center_image(I, offset_x, offset_y)
return I
/obj/item/proc/get_image_key_mod()