From 3acfe5960ee2b17e4ee6321ccca28c1da19b62b9 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 23 Apr 2015 04:57:03 -0400 Subject: [PATCH] Renames inventory slot string key defines --- .../objects/items/weapons/storage/backpack.dm | 24 +++++++++---------- .../mob/living/carbon/human/update_icons.dm | 20 ++++++++-------- code/modules/projectiles/gun.dm | 4 ++-- code/setup.dm | 9 +++---- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index 4072e49eb9..6969fdd386 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -7,15 +7,15 @@ name = "backpack" desc = "You wear this on your back and put items into it." item_icons = list( - slot_l_hand_key = 'icons/mob/items/lefthand_backpacks.dmi', - slot_r_hand_key = 'icons/mob/items/righthand_backpacks.dmi', + slot_l_hand_str = 'icons/mob/items/lefthand_backpacks.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_backpacks.dmi', ) icon_state = "backpack" item_state = null //most backpacks use the default backpack state for inhand overlays item_state_slots = list( - slot_l_hand_key = "backpack", - slot_r_hand_key = "backpack", + slot_l_hand_str = "backpack", + slot_r_hand_str = "backpack", ) w_class = 4 slot_flags = SLOT_BACK @@ -190,8 +190,8 @@ desc = "A tough satchel with extra pockets." icon_state = "satchel-eng" item_state_slots = list( - slot_l_hand_key = "engiepack", - slot_r_hand_key = "engiepack", + slot_l_hand_str = "engiepack", + slot_r_hand_str = "engiepack", ) /obj/item/weapon/storage/backpack/satchel_med @@ -199,8 +199,8 @@ desc = "A sterile satchel used in medical departments." icon_state = "satchel-med" item_state_slots = list( - slot_l_hand_key = "medicalpack", - slot_r_hand_key = "medicalpack", + slot_l_hand_str = "medicalpack", + slot_r_hand_str = "medicalpack", ) /obj/item/weapon/storage/backpack/satchel_vir @@ -228,8 +228,8 @@ desc = "A robust satchel for security related needs." icon_state = "satchel-sec" item_state_slots = list( - slot_l_hand_key = "securitypack", - slot_r_hand_key = "securitypack", + slot_l_hand_str = "securitypack", + slot_r_hand_str = "securitypack", ) /obj/item/weapon/storage/backpack/satchel_hyd @@ -250,8 +250,8 @@ desc = "A spacious backpack with lots of pockets, used by members of the Nanotrasen Emergency Response Team." icon_state = "ert_commander" item_state_slots = list( - slot_l_hand_key = "securitypack", - slot_r_hand_key = "securitypack", + slot_l_hand_str = "securitypack", + slot_r_hand_str = "securitypack", ) //Commander diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6433c9d943..6bf75b6834 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -757,8 +757,8 @@ var/global/list/damage_icon_parts = list() //determine state to use var/overlay_state - if(back.item_state_slots && back.item_state_slots[slot_back_key]) - overlay_state = back.item_state_slots[slot_back_key] + if(back.item_state_slots && back.item_state_slots[slot_back_str]) + overlay_state = back.item_state_slots[slot_back_str] else if(back.item_state) overlay_state = back.item_state else @@ -811,15 +811,15 @@ var/global/list/damage_icon_parts = list() var/icon/t_icon if(r_hand.icon_override) t_icon = r_hand.icon_override - else if(r_hand.item_icons && (slot_r_hand_key in r_hand.item_icons)) - t_icon = r_hand.item_icons[slot_r_hand_key] + else if(r_hand.item_icons && (slot_r_hand_str in r_hand.item_icons)) + t_icon = r_hand.item_icons[slot_r_hand_str] else t_icon = INV_R_HAND_DEF_ICON //determine icon state to use var/t_state - if(r_hand.item_state_slots && r_hand.item_state_slots[slot_r_hand_key]) - t_state = r_hand.item_state_slots[slot_r_hand_key] + if(r_hand.item_state_slots && r_hand.item_state_slots[slot_r_hand_str]) + t_state = r_hand.item_state_slots[slot_r_hand_str] else if(r_hand.item_state) t_state = r_hand.item_state else @@ -842,15 +842,15 @@ var/global/list/damage_icon_parts = list() var/icon/t_icon if(l_hand.icon_override) t_icon = l_hand.icon_override - else if(l_hand.item_icons && (slot_l_hand_key in l_hand.item_icons)) - t_icon = l_hand.item_icons[slot_l_hand_key] + else if(l_hand.item_icons && (slot_l_hand_str in l_hand.item_icons)) + t_icon = l_hand.item_icons[slot_l_hand_str] else t_icon = INV_L_HAND_DEF_ICON //determine icon state to use var/t_state - if(l_hand.item_state_slots && l_hand.item_state_slots[slot_l_hand_key]) - t_state = l_hand.item_state_slots[slot_l_hand_key] + if(l_hand.item_state_slots && l_hand.item_state_slots[slot_l_hand_str]) + t_state = l_hand.item_state_slots[slot_l_hand_str] else if(l_hand.item_state) t_state = l_hand.item_state else diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 6d1861822f..3cfb7f72dd 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -4,8 +4,8 @@ desc = "Its a gun. It's pretty terrible, though." icon = 'icons/obj/gun.dmi' item_icons = list( - slot_l_hand_key = 'icons/mob/items/lefthand_guns.dmi', - slot_r_hand_key = 'icons/mob/items/righthand_guns.dmi', + slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi', ) icon_state = "detective" item_state = "gun" diff --git a/code/setup.dm b/code/setup.dm index eedd8c70c0..bfbb223353 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -257,10 +257,11 @@ // Inventory slot strings. // since numbers cannot be used as associative list keys. -#define slot_l_hand_key "slot_l_hand" -#define slot_r_hand_key "slot_r_hand" -#define slot_w_uniform_key "w_uniform" -#define slot_back_key "back" +#define slot_l_hand_str "slot_l_hand" +#define slot_r_hand_str "slot_r_hand" +#define slot_w_uniform_str "w_uniform" +#define slot_back_str "back" +#define slot_w_uniform_str "w_uniform" // Bitflags for clothing parts. #define HEAD 1