From b677547e13b949d18947d8a1010359154009b841 Mon Sep 17 00:00:00 2001 From: ThePooba <81843097+ThePooba@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:37:28 -0600 Subject: [PATCH] Added Button for Thermoregulator to hardsuits (#2322) --- .../clothing/spacesuits/hardsuits/_hardsuit.dm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/monkestation/code/modules/clothing/spacesuits/hardsuits/_hardsuit.dm b/monkestation/code/modules/clothing/spacesuits/hardsuits/_hardsuit.dm index 60d134996607..cafeeeebb263 100644 --- a/monkestation/code/modules/clothing/spacesuits/hardsuits/_hardsuit.dm +++ b/monkestation/code/modules/clothing/spacesuits/hardsuits/_hardsuit.dm @@ -1,5 +1,6 @@ /// How much damage you take from an emp when wearing a hardsuit #define HARDSUIT_EMP_BURN 2 // a very orange number +#define THERMAL_REGULATOR_COST 6 // this runs out fast if 18 /obj/item/clothing/suit/space/hardsuit name = "hardsuit" @@ -12,7 +13,7 @@ armor_type = /datum/armor/hardsuit allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/t_scanner, /obj/item/construction/rcd, /obj/item/pipe_dispenser) siemens_coefficient = 0 - actions_types = list(/datum/action/item_action/toggle_helmet) + actions_types = list(/datum/action/item_action/toggle_helmet, /datum/action/item_action/toggle_spacesuit) var/obj/item/clothing/head/helmet/space/hardsuit/helmet var/helmettype = /obj/item/clothing/head/helmet/space/hardsuit @@ -80,8 +81,12 @@ else RemoveHelmet() -/obj/item/clothing/suit/space/hardsuit/ui_action_click() - ToggleHelmet() +/// implements button for thermoregulamators, checks if helmet or regulator is being toggled +/obj/item/clothing/suit/space/hardsuit/ui_action_click(mob/user, actiontype) + if(istype(actiontype, /datum/action/item_action/toggle_spacesuit)) + toggle_spacesuit(user) + else if(istype(actiontype, /datum/action/item_action/toggle_helmet)) + ToggleHelmet() /obj/item/clothing/suit/space/hardsuit/attack_self(mob/user) user.changeNext_move(CLICK_CD_MELEE)