diff --git a/code/datums/action.dm b/code/datums/action.dm index e3d41c90028..323f81cb1eb 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -178,7 +178,7 @@ // If set, use the custom icon that we set instead // of the item appearence ..() - else if(target && current_button.appearance_cache != target.appearance) //replace with /ref comparison if this is not valid. + else if((target && current_button.appearance_cache != target.appearance) || force) //replace with /ref comparison if this is not valid. var/obj/item/I = target var/old_layer = I.layer var/old_plane = I.plane @@ -244,6 +244,14 @@ /datum/action/item_action/toggle_helmet_light name = "Toggle Helmet Light" +/datum/action/item_action/toggle_welding_screen + name = "Toggle Welding Screen" + +/datum/action/item_action/toggle_welding_screen/Trigger() + var/obj/item/clothing/head/hardhat/weldhat/H = target + if(istype(H)) + H.toggle_welding_screen(owner) + /datum/action/item_action/toggle_headphones name = "Toggle Headphones" desc = "UNTZ UNTZ UNTZ" diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm index f01e6c3dc8b..47d7c8e90ae 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm @@ -8,6 +8,7 @@ new /obj/item/clothing/neck/cloak/ce(src) new /obj/item/clothing/under/rank/chief_engineer(src) new /obj/item/clothing/head/hardhat/white(src) + new /obj/item/clothing/head/hardhat/weldhat/white(src) new /obj/item/clothing/head/welding(src) new /obj/item/clothing/gloves/color/yellow(src) new /obj/item/clothing/shoes/sneakers/brown(src) diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index 6c4b35a0011..ff49f131ed1 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -14,19 +14,27 @@ dog_fashion = /datum/dog_fashion/head -/obj/item/clothing/head/hardhat/attack_self(mob/user) - on = !on - icon_state = "hardhat[on]_[item_color]" - item_state = "hardhat[on]_[item_color]" - user.update_inv_head() //so our mob-overlays update +/obj/item/clothing/head/hardhat/attack_self(mob/living/user) + toggle_helmet_light(user) +/obj/item/clothing/head/hardhat/proc/toggle_helmet_light(mob/living/user) + on = !on if(on) turn_on(user) else turn_off(user) + update_icon() + +/obj/item/clothing/head/hardhat/update_icon() + icon_state = "hardhat[on]_[item_color]" + item_state = "hardhat[on]_[item_color]" + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + H.update_inv_head() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtonIcon(force = TRUE) + ..() /obj/item/clothing/head/hardhat/proc/turn_on(mob/user) set_light(brightness_on) @@ -81,4 +89,69 @@ heat_protection = HEAD max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT cold_protection = HEAD - min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT \ No newline at end of file + min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT + +/obj/item/clothing/head/hardhat/weldhat + name = "welding hard hat" + desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield! The bulb seems a little smaller though." + brightness_on = 3 //Needs a little bit of tradeoff + dog_fashion = null + actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_welding_screen) + flash_protect = 2 + tint = 2 + flags_inv = HIDEEYES | HIDEFACE + flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH + visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT + visor_flags_inv = HIDEEYES | HIDEFACE + visor_flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH + +/obj/item/clothing/head/hardhat/weldhat/Initialize() + . = ..() + update_icon() + +/obj/item/clothing/head/hardhat/weldhat/attack_self(mob/living/user) + toggle_helmet_light(user) + +/obj/item/clothing/head/hardhat/weldhat/AltClick(mob/user) + if(user.canUseTopic(src, BE_CLOSE)) + toggle_welding_screen(user) + +/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user) + if(weldingvisortoggle(user)) + playsound(src, 'sound/mecha/mechmove03.ogg', 50, 1) //Visors don't just come from nothing + update_icon() + +/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands) + . = ..() + if(!isinhands) + . += mutable_appearance('icons/mob/head.dmi', "weldhelmet") + if(!up) + . += mutable_appearance('icons/mob/head.dmi', "weldvisor") + +/obj/item/clothing/head/hardhat/weldhat/update_icon() + cut_overlays() + if(!up) + add_overlay("weldvisor") + ..() + +/obj/item/clothing/head/hardhat/weldhat/orange + icon_state = "hardhat0_orange" + item_state = "hardhat0_orange" + item_color = "orange" + +/obj/item/clothing/head/hardhat/weldhat/white + desc = "A piece of headgear used in dangerous working conditions to protect the head. Comes with a built-in flashlight AND welding shield!" //This bulb is not smaller + icon_state = "hardhat0_white" + item_state = "hardhat0_white" + brightness_on = 4 //Boss always takes the best stuff + item_color = "white" + clothing_flags = STOPSPRESSUREDAMAGE + heat_protection = HEAD + max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT + cold_protection = HEAD + min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT + +/obj/item/clothing/head/hardhat/weldhat/dblue + icon_state = "hardhat0_dblue" + item_state = "hardhat0_dblue" + item_color = "dblue" \ No newline at end of file diff --git a/code/modules/vending/wardrobes.dm b/code/modules/vending/wardrobes.dm index 869792498fd..847f9a1d8cd 100644 --- a/code/modules/vending/wardrobes.dm +++ b/code/modules/vending/wardrobes.dm @@ -77,7 +77,8 @@ /obj/item/clothing/under/rank/engineer/hazard = 3, /obj/item/clothing/suit/hazardvest = 3, /obj/item/clothing/shoes/workboots = 3, - /obj/item/clothing/head/hardhat = 3) + /obj/item/clothing/head/hardhat = 3, + /obj/item/clothing/head/hardhat/weldhat = 3) refill_canister = /obj/item/vending_refill/wardrobe/engi_wardrobe payment_department = ACCOUNT_ENG /obj/item/vending_refill/wardrobe/engi_wardrobe diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi index ce3ffef6b2b..c7e79d2d4c7 100644 Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi index 7f3c9fd83f2..2bc54cf25d5 100644 Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ