diff --git a/code/__DEFINES/inventory/rendering.dm b/code/__DEFINES/inventory/rendering.dm index ff11e9195049..0184b93127b0 100644 --- a/code/__DEFINES/inventory/rendering.dm +++ b/code/__DEFINES/inventory/rendering.dm @@ -4,9 +4,9 @@ /// _all for state on inhands #define WORN_RENDER_INHAND_ONE_FOR_ALL (1<<1) /// allow worn defaulting -#define WORN_RENDER_SLOT_ALLOW_DEFAULT (1<<2) +#define WORN_RENDER_SLOT_FORCE_DEFAULT (1<<2) /// allow inhand defaulting -#define WORN_RENDER_INHAND_ALLOW_DEFAULT (1<<3) +#define WORN_RENDER_INHAND_FORCE_DEFAULT (1<<3) /// don't render in slots; render_additional still used, others aren't #define WORN_RENDER_SLOT_NO_RENDER (1<<4) /// don't render in inhands; render_additional still used, others aren't @@ -17,8 +17,8 @@ DEFINE_BITFIELD(worn_render_flags, list( BITFIELD(WORN_RENDER_SLOT_ONE_FOR_ALL), BITFIELD(WORN_RENDER_INHAND_ONE_FOR_ALL), - BITFIELD(WORN_RENDER_SLOT_ALLOW_DEFAULT), - BITFIELD(WORN_RENDER_INHAND_ALLOW_DEFAULT), + BITFIELD(WORN_RENDER_SLOT_FORCE_DEFAULT), + BITFIELD(WORN_RENDER_INHAND_FORCE_DEFAULT), BITFIELD(WORN_RENDER_SLOT_NO_RENDER), BITFIELD(WORN_RENDER_INHAND_NO_RENDER), BITFIELD(WORN_RENDER_SLOT_USE_PLURAL), diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index c8bda1c43adc..71cbc097c74a 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -268,7 +268,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM throw_speed = 0.5 w_class = ITEMSIZE_TINY slot_flags = SLOT_EARS | SLOT_MASK - worn_render_flags = WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_SLOT_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_SLOT_FORCE_DEFAULT attack_verb = list("burnt", "singed") type_butt = /obj/item/cigbutt chem_volume = 15 diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm index c3c26f5b25d0..feba31bf8714 100644 --- a/code/modules/clothing/under/miscellaneous.dm +++ b/code/modules/clothing/under/miscellaneous.dm @@ -980,7 +980,7 @@ icon = 'icons/clothing/uniform/misc/future.dmi' worn_has_rolldown = UNIFORM_HAS_ROLL worn_has_rollsleeve = UNIFORM_HAS_NO_ROLL - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_NO_RENDER | WORN_RENDER_INHAND_FORCE_DEFAULT worn_bodytypes = BODYTYPE_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_UNIFORMS inhand_state = "jensen" diff --git a/code/modules/holidays/halloween_loadout_masquarade.dm b/code/modules/holidays/halloween_loadout_masquarade.dm index 46a5ed400aac..46ce11ea9e27 100644 --- a/code/modules/holidays/halloween_loadout_masquarade.dm +++ b/code/modules/holidays/halloween_loadout_masquarade.dm @@ -51,7 +51,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/sneaksuit.dmi' inhand_default_type = INHAND_DEFAULT_ICON_UNIFORMS inhand_state = "black" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS cold_protection = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS @@ -65,7 +65,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/sneaksuit.dmi' inhand_default_type = INHAND_DEFAULT_ICON_SUITS inhand_state = "armor" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = UPPER_TORSO|LOWER_TORSO cold_protection = UPPER_TORSO|LOWER_TORSO @@ -79,7 +79,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/sneaksuit.dmi' inhand_default_type = INHAND_DEFAULT_ICON_GLOVES inhand_state = "black" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = HANDS cold_protection = HANDS @@ -93,7 +93,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/sneaksuit.dmi' inhand_default_type = INHAND_DEFAULT_ICON_HATS inhand_state = "helmet" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = HEAD|EYES clothing_flags = ALLOWINTERNALS cold_protection = HEAD @@ -108,7 +108,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/sneaksuit.dmi' inhand_default_type = INHAND_DEFAULT_ICON_SHOES inhand_state = "cult" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = FEET cold_protection = FEET @@ -122,7 +122,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/sneaksuit.dmi' inhand_default_type = INHAND_DEFAULT_ICON_MASKS inhand_state = "gas" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = HEAD|EYES clothing_flags = ALLOWINTERNALS cold_protection = HEAD @@ -137,7 +137,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/contractor.dmi' inhand_default_type = INHAND_DEFAULT_ICON_HATS inhand_state = "helmet" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = HEAD|EYES clothing_flags = ALLOWINTERNALS cold_protection = HEAD @@ -152,7 +152,7 @@ icon = 'icons/antagonists/syndicate/items/clothing/contractor.dmi' inhand_default_type = INHAND_DEFAULT_ICON_GLOVES inhand_state = "armor" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS|FEET cold_protection = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS|FEET diff --git a/code/modules/mob/inventory/rendering.dm b/code/modules/mob/inventory/rendering.dm index 164aa61eb697..4ff127886fc9 100644 --- a/code/modules/mob/inventory/rendering.dm +++ b/code/modules/mob/inventory/rendering.dm @@ -75,7 +75,7 @@ * pickaxe_onhand_right * 7. Defaulting: In the case you want to default slot/inhands (usually one but not the other), * simply add to worn_render_flags, depending on which: - * WORN_RENDER_SLOT_ALLOW_DEFAULT + * WORN_RENDER_SLOT_FORCE_DEFAULT * WORN_RENDER_INHAND_ALLOW_DEFAULt * 8. Congratulations, you're done! * @@ -225,7 +225,7 @@ /// bodytypes that just skip rendering (i hate teshari) var/datum/bodytypes/worn_bodytypes_invisible = BODYTYPES_NONE /// worn rendering flags - var/worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT | WORN_RENDER_SLOT_ALLOW_DEFAULT + var/worn_render_flags = WORN_RENDER_INHAND_FORCE_DEFAULT | WORN_RENDER_SLOT_FORCE_DEFAULT //? support for adminbus /// vv only; slot id to icon; worn_x_dimension and worn_y_dimension will be used in this case. VAR_PRIVATE/list/worn_icon_override @@ -369,7 +369,7 @@ data[WORN_DATA_SIZE_Y] = worn_y_dimension //* inventory slot defaults - else if(inhands? (worn_render_flags & WORN_RENDER_INHAND_ALLOW_DEFAULT) : (worn_render_flags & WORN_RENDER_SLOT_ALLOW_DEFAULT)) + else if(inhands? (worn_render_flags & WORN_RENDER_INHAND_FORCE_DEFAULT) : (worn_render_flags & WORN_RENDER_SLOT_FORCE_DEFAULT)) var/list/resolved = slot_meta.resolve_default_assets(bodytype, data[WORN_DATA_STATE], M, src, inhand_default_type) if(!resolved && (bodytype != BODYTYPE_DEFAULT) && CHECK_BODYTYPE(worn_bodytypes_fallback, bodytype)) // attempt 2 - use fallback if available diff --git a/code/modules/mob/inventory/slot_meta.dm b/code/modules/mob/inventory/slot_meta.dm index db881f99a3d1..dcdb3bc55ca2 100644 --- a/code/modules/mob/inventory/slot_meta.dm +++ b/code/modules/mob/inventory/slot_meta.dm @@ -125,8 +125,6 @@ GLOBAL_LIST_EMPTY(inventory_slot_type_cache) var/render_key_plural /// rendering default layer; first is default, rest are alt layers. can be list or just one number. VAR_PROTECTED/list/render_layer - /// rendering icon state cache for default icons - VAR_PRIVATE/list/render_state_cache /// rendering default icons by bodytype VAR_PROTECTED/list/render_default_icons /// rendering dim x @@ -168,7 +166,6 @@ GLOBAL_LIST_EMPTY(inventory_slot_type_cache) /datum/inventory_slot_meta/proc/rebuild_rendering_caches() PROTECTED_PROC(TRUE) // if you think you need this outside you should rethink - render_state_cache = list() render_dim_x_cache = list() render_dim_y_cache = list() if(!islist(render_default_icons)) // save the checks later for null @@ -182,10 +179,6 @@ GLOBAL_LIST_EMPTY(inventory_slot_type_cache) render_default_icons -= bodytype_str continue var/icon/I = render_default_icons[bodytype_str] - render_state_cache[bodytype_str] = icon_states(I) - // turn into hash - for(var/state in render_state_cache[bodytype_str]) - render_state_cache[bodytype_str][state] = TRUE render_dim_x_cache[bodytype_str] = I.Width() render_dim_y_cache[bodytype_str] = I.Height() @@ -194,8 +187,6 @@ GLOBAL_LIST_EMPTY(inventory_slot_type_cache) */ /datum/inventory_slot_meta/proc/resolve_default_assets(bodytype, state, mob/wearer, obj/item/equipped, inhand_domain) var/bodytype_str = bodytype_to_string(bodytype) - if(!render_state_cache[bodytype_str]?[state]) - return return list(render_default_icons[bodytype_str], render_dim_x_cache[bodytype_str], render_dim_y_cache[bodytype_str]) /** @@ -726,8 +717,6 @@ GLOBAL_LIST_EMPTY(inventory_slot_type_cache) * returns (icon, dim_x, dim_y) if found in defaults, null if not */ /datum/inventory_slot_meta/abstract/hand/resolve_default_assets(bodytype, state, mob/wearer, obj/item/equipped, inhand_domain) - if(!render_state_cache[inhand_domain]?[state]) - return return list(render_default_icons[inhand_domain], render_dim_x_cache[inhand_domain], render_dim_y_cache[inhand_domain]) /datum/inventory_slot_meta/abstract/hand/left diff --git a/code/modules/photography/album.dm b/code/modules/photography/album.dm index 4efab8361ccb..11e2523ba0e0 100644 --- a/code/modules/photography/album.dm +++ b/code/modules/photography/album.dm @@ -4,7 +4,7 @@ name = "Photo album" icon = 'icons/modules/photography/album.dmi' icon_state = "album" - worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_INHAND_FORCE_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_STORAGE inhand_state = "briefcase" can_hold = list(/obj/item/photo) diff --git a/code/modules/photography/film.dm b/code/modules/photography/film.dm index 212e2eec9ce4..abb066b72a52 100644 --- a/code/modules/photography/film.dm +++ b/code/modules/photography/film.dm @@ -5,7 +5,7 @@ desc = "A camera film cartridge. Insert it into a camera to reload it." icon = 'icons/modules/photography/film.dmi' icon_state = "film" - worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_INHAND_FORCE_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_STORAGE inhand_state = "camera" w_class = ITEMSIZE_TINY diff --git a/code/modules/photography/photo.dm b/code/modules/photography/photo.dm index 8e837e515a24..ecdcf24100c3 100644 --- a/code/modules/photography/photo.dm +++ b/code/modules/photography/photo.dm @@ -32,7 +32,7 @@ name = "photo" icon = 'icons/modules/photography/photo.dmi' icon_state = "photo" - worn_render_flags = WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_INHAND_FORCE_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_GENERAL inhand_state = "paper" w_class = ITEMSIZE_TINY diff --git a/donator/unclebourbon/pmc_mask.dm b/donator/unclebourbon/pmc_mask.dm index 71a29cccfdfa..5f92ab752878 100644 --- a/donator/unclebourbon/pmc_mask.dm +++ b/donator/unclebourbon/pmc_mask.dm @@ -3,7 +3,7 @@ desc = "A rugged black gas mask with red lenses." icon = 'donator/unclebourbon/pmc_mask.dmi' icon_state = "pmc" - worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_ALLOW_DEFAULT + worn_render_flags = WORN_RENDER_SLOT_ONE_FOR_ALL | WORN_RENDER_INHAND_FORCE_DEFAULT inhand_default_type = INHAND_DEFAULT_ICON_MASKS inhand_state = "swat"