From 5596813a206f9bbb4a7136c4c6ed993fcc9c881d Mon Sep 17 00:00:00 2001 From: Blundir Date: Sat, 28 Oct 2023 00:16:15 +0300 Subject: [PATCH 1/3] initial --- code/__DEFINES/keybinding.dm | 1 + code/datums/keybinding/human_combat.dm | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index 88f194bb33df..5a0809d83ac1 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -87,6 +87,7 @@ #define COMSIG_KB_HUMAN_WEAPON_UNLOAD "keybinding_human_weapon_unload" #define COMSIG_KB_HUMAN_WEAPON_ATTACHMENT "keybinding_human_weapon_attachment" #define COMSIG_KB_HUMAN_WEAPON_ATTACHMENT_RAIL "keybinding_human_weapon_attachment_rail" +#define COMSIG_KB_HUMAN_WEAPON_SHOTGUN_TUBE "keybinding_human_weapon_shotgun_tube" #define COMSIG_KB_HUMAN_WEAPON_TOGGLE_IFF "keybinding_human_weapon_toggle_iff" diff --git a/code/datums/keybinding/human_combat.dm b/code/datums/keybinding/human_combat.dm index 2f37efc61438..39b1386f8bcd 100644 --- a/code/datums/keybinding/human_combat.dm +++ b/code/datums/keybinding/human_combat.dm @@ -190,3 +190,19 @@ var/obj/item/weapon/gun/rifle/m46c/COgun = held_item COgun.toggle_iff(human) return TRUE + +/datum/keybinding/human/combat/toggle_shotgun_tube + hotkey_keys = list("Unbound") + classic_keys = list("Unbound") + name = "toggle_shotgun_tube" + full_name = "Toggle Shotgun Tube" + keybind_signal = COMSIG_KB_HUMAN_WEAPON_SHOTGUN_TUBE + +/datum/keybinding/human/combat/toggle_shotgun_tube/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human = user.mob + var/obj/item/weapon/gun/shotgun/pump/dual_tube/held_item = human.get_held_item() + held_item.toggle_tube() + return TRUE From 65884aaf3d7dcdbbf288427a00be875d1be427fc Mon Sep 17 00:00:00 2001 From: Blundir Date: Tue, 7 Nov 2023 00:30:41 +0200 Subject: [PATCH 2/3] Update human_combat.dm --- code/datums/keybinding/human_combat.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/datums/keybinding/human_combat.dm b/code/datums/keybinding/human_combat.dm index 39b1386f8bcd..642515824e2d 100644 --- a/code/datums/keybinding/human_combat.dm +++ b/code/datums/keybinding/human_combat.dm @@ -204,5 +204,6 @@ return var/mob/living/carbon/human/human = user.mob var/obj/item/weapon/gun/shotgun/pump/dual_tube/held_item = human.get_held_item() - held_item.toggle_tube() - return TRUE + if(istype(held_item, /obj/item/weapon/gun/shotgun/pump/dual_tube)) + held_item.toggle_tube() + return TRUE From 303ce8722db812277aa9fc43f0fa44c1ced4e5a6 Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:51:41 -0800 Subject: [PATCH 3/3] Update code/datums/keybinding/human_combat.dm --- code/datums/keybinding/human_combat.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/keybinding/human_combat.dm b/code/datums/keybinding/human_combat.dm index 642515824e2d..d30414d68563 100644 --- a/code/datums/keybinding/human_combat.dm +++ b/code/datums/keybinding/human_combat.dm @@ -204,6 +204,6 @@ return var/mob/living/carbon/human/human = user.mob var/obj/item/weapon/gun/shotgun/pump/dual_tube/held_item = human.get_held_item() - if(istype(held_item, /obj/item/weapon/gun/shotgun/pump/dual_tube)) + if(istype(held_item)) held_item.toggle_tube() return TRUE