From 1b978f9570446dc7a90c5560fc13ede54b05f63a Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 26 Jun 2015 01:34:15 -0400 Subject: [PATCH 1/3] Makes update_inv_head() respect item_state and item_icons Fixes #9873 --- code/modules/clothing/head/misc_special.dm | 15 ++++------ .../mob/living/carbon/human/update_icons.dm | 29 ++++++++++++------- code/modules/mob/update_icons.dm | 1 + code/modules/paperwork/paper.dm | 1 + code/setup.dm | 1 + 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 5eb7e0c65bc..39d75a83920 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -138,21 +138,18 @@ desc = "A pair of kitty ears. Meow!" icon_state = "kitty" body_parts_covered = 0 - var/icon/mob - var/icon/mob2 siemens_coefficient = 1.5 + item_icons = list() update_icon(var/mob/living/carbon/human/user) if(!istype(user)) return - mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") - mob2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty2") - mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) - mob2.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) + var/icon/ears = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") + ears.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner") - var/icon/earbit2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner2") - mob.Blend(earbit, ICON_OVERLAY) - mob2.Blend(earbit2, ICON_OVERLAY) + ears.Blend(earbit, ICON_OVERLAY) + + item_icons[icon_head] = ears /obj/item/clothing/head/richard name = "chicken mask" diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index b33980f4b95..d25802b2f7a 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -686,17 +686,24 @@ proc/get_damage_icon_part(damage_state, body_part) /mob/living/carbon/human/update_inv_head(var/update_icons=1) if(head) head.screen_loc = ui_head //TODO - var/image/standing - if(istype(head,/obj/item/clothing/head/kitty)) - standing = image("icon" = head:mob) - else - if(head.icon_override) - standing = image("icon" = head.icon_override, "icon_state" = "[head.icon_state]") - else if(head.sprite_sheets && head.sprite_sheets[species.name]) - standing = image("icon" = head.sprite_sheets[species.name], "icon_state" = "[head.icon_state]") - else - standing = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]") - + + //Determine the icon to use + var/t_icon = INV_HEAD_DEF_ICON + if(head.icon_override) + t_icon = head.icon_override + else if(head.sprite_sheets && head.sprite_sheets[species.name]) + t_icon = head.sprite_sheets[species.name] + else if(head.item_icons && (icon_head in head.item_icons)) + t_icon = head.item_icons[icon_head] + + //Determine the state to use + var/t_state = head.icon_state + if(head.item_state) + t_state = head.item_state + + //Create the image + var/image/standing = image(icon = t_icon, icon_state = t_state) + if(head.blood_DNA) var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood") bloodsies.color = head.blood_color diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index 480c4be3223..572fe17737a 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -2,6 +2,7 @@ //Having them here also makes for a nice reference list of the various overlay-updating procs available //default item on-mob icons +#define INV_HEAD_DEF_ICON 'icons/mob/head.dmi' #define INV_L_HAND_DEF_ICON 'icons/mob/items/lefthand.dmi' #define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi' diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 87d5f002eeb..75fb65a2af6 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -8,6 +8,7 @@ gender = PLURAL icon = 'icons/obj/bureaucracy.dmi' icon_state = "paper" + item_state = "paper" throwforce = 0 w_class = 1.0 throw_range = 1 diff --git a/code/setup.dm b/code/setup.dm index 7faa91e45a2..7f0d550173d 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -247,6 +247,7 @@ // cannot be used as associative list keys. #define icon_l_hand "slot_l_hand" #define icon_r_hand "slot_r_hand" +#define icon_head "slot_head" // Bitflags for clothing parts. #define HEAD 1 From 242f5c5dfdf6a61fd63ab986ceda532d1f8fafce Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 26 Jun 2015 01:35:35 -0400 Subject: [PATCH 2/3] Fixes #9928 --- code/game/machinery/recharger.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 8a949f72729..b533015c669 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -13,6 +13,7 @@ obj/machinery/recharger var/icon_state_charged = "recharger2" var/icon_state_charging = "recharger1" var/icon_state_idle = "recharger0" //also when unpowered + var/portable = 1 obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) if(istype(user,/mob/living/silicon)) @@ -45,7 +46,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) G.loc = src charging = G update_icon() - else if(istype(G, /obj/item/weapon/wrench)) + else if(portable && istype(G, /obj/item/weapon/wrench)) if(charging) user << "\red Remove [charging] first!" return @@ -155,3 +156,4 @@ obj/machinery/recharger/wallcharger icon_state_charged = "wrecharger2" icon_state_charging = "wrecharger1" icon_state_idle = "wrecharger0" + portable = 0 From c6c200c12789f7fc263373bde94a35c1b21fc05a Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 26 Jun 2015 01:38:04 -0400 Subject: [PATCH 3/3] Fixes #9251 --- code/modules/shuttles/escape_pods.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index 289cf4d7b01..3fbc03b0aee 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -111,8 +111,9 @@ var/closing = 0 /datum/computer/file/embedded_program/docking/simple/escape_pod/proc/arm() - armed = 1 - open_door() + if(!armed) + armed = 1 + open_door() /datum/computer/file/embedded_program/docking/simple/escape_pod/receive_user_command(command)