diff --git a/code/datums/actions/item_action.dm b/code/datums/actions/item_action.dm index 5a4dbe99115..a23818115a5 100644 --- a/code/datums/actions/item_action.dm +++ b/code/datums/actions/item_action.dm @@ -73,7 +73,7 @@ /datum/action/item_action/firemode // just here so players see what key is it bound to keybinding_signals = list( - KEYBINDING_ALTERNATE = COMSIG_KB_FIREMODE, + KEYBINDING_NORMAL = COMSIG_KB_FIREMODE, ) use_obj_appeareance = FALSE var/action_firemode diff --git a/code/datums/components/deployable_item.dm b/code/datums/components/deployable_item.dm index 92992defdd1..1ad8128b47e 100644 --- a/code/datums/components/deployable_item.dm +++ b/code/datums/components/deployable_item.dm @@ -101,7 +101,7 @@ return user.temporarilyRemoveItemFromInventory(item_to_deploy) - item_to_deploy.UnregisterSignal(user, list(COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEUP, COMSIG_MOB_MOUSEDRAG, COMSIG_KB_RAILATTACHMENT, COMSIG_KB_UNDERRAILATTACHMENT, COMSIG_KB_UNLOADGUN, COMSIG_KB_FIREMODE, COMSIG_KB_AUTOEJECT, COMSIG_MOB_CLICK_RIGHT)) //This unregisters Signals related to guns, its for safety + item_to_deploy.UnregisterSignal(user, list(COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEUP, COMSIG_MOB_MOUSEDRAG, COMSIG_KB_RAILATTACHMENT, COMSIG_KB_UNDERRAILATTACHMENT, COMSIG_KB_UNLOADGUN, COMSIG_KB_AUTOEJECT, COMSIG_MOB_CLICK_RIGHT)) //This unregisters Signals related to guns, its for safety direction_to_deploy = newdir diff --git a/code/modules/projectiles/attachables/_attachable.dm b/code/modules/projectiles/attachables/_attachable.dm index baa15e3eff4..0e464800f79 100644 --- a/code/modules/projectiles/attachables/_attachable.dm +++ b/code/modules/projectiles/attachables/_attachable.dm @@ -333,7 +333,7 @@ inaccurate. Don't worry if force is ever negative, it won't runtime. master_gun = attached_to master_gun.wield_delay += wield_delay_mod if(gun_user) - UnregisterSignal(gun_user, list(COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEUP, COMSIG_ITEM_ZOOM, COMSIG_ITEM_UNZOOM, COMSIG_MOB_MOUSEDRAG, COMSIG_KB_RAILATTACHMENT, COMSIG_KB_UNDERRAILATTACHMENT, COMSIG_KB_UNLOADGUN, COMSIG_KB_FIREMODE, COMSIG_KB_GUN_SAFETY, COMSIG_KB_AUTOEJECT, COMSIG_KB_UNIQUEACTION, COMSIG_QDELETING, COMSIG_MOB_CLICK_RIGHT)) + UnregisterSignal(gun_user, list(COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEUP, COMSIG_ITEM_ZOOM, COMSIG_ITEM_UNZOOM, COMSIG_MOB_MOUSEDRAG, COMSIG_KB_RAILATTACHMENT, COMSIG_KB_UNDERRAILATTACHMENT, COMSIG_KB_UNLOADGUN, COMSIG_KB_GUN_SAFETY, COMSIG_KB_AUTOEJECT, COMSIG_KB_UNIQUEACTION, COMSIG_QDELETING, COMSIG_MOB_CLICK_RIGHT)) var/datum/action/item_action/toggle/new_action = new /datum/action/item_action/toggle(src, master_gun) if(!isliving(user)) return diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index 864dfc51260..0fb31ace2b9 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -236,93 +236,17 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w activate(user) return return ..() - do_toggle_firemode() - user.update_action_buttons() - - -/mob/living/carbon/human/verb/toggle_autofire() - set category = "Weapons" - set name = "Toggle Auto Fire" - set desc = "Toggle automatic firemode, if the gun has it." - - var/obj/item/weapon/gun/G = get_active_firearm(usr) - if(!G) - return - G.toggle_autofire() - - -/obj/item/weapon/gun/verb/toggle_autofire() - set category = null - set name = "Toggle Auto Fire (Weapon)" - set desc = "Toggle automatic firemode, if the gun has it." - - var/new_firemode - switch(gun_firemode) - if(GUN_FIREMODE_SEMIAUTO) - new_firemode = GUN_FIREMODE_AUTOMATIC - if(GUN_FIREMODE_BURSTFIRE) - new_firemode = GUN_FIREMODE_AUTOBURST - if(GUN_FIREMODE_AUTOMATIC) - new_firemode = GUN_FIREMODE_SEMIAUTO - if(GUN_FIREMODE_AUTOBURST) - new_firemode = GUN_FIREMODE_BURSTFIRE - if(!(new_firemode in gun_firemode_list)) - to_chat(usr, span_warning("[src] lacks a [new_firemode]!")) - return - do_toggle_firemode(new_firemode = new_firemode) - - -/mob/living/carbon/human/verb/toggle_burstfire() - set category = "Weapons" - set name = "Toggle Burst Fire" - set desc = "Toggle burst firemode, if the gun has it." - - var/obj/item/weapon/gun/G = get_active_firearm(usr) - if(!G) - return - G.toggle_burstfire() - - -/obj/item/weapon/gun/verb/toggle_burstfire() - set category = null - set name = "Toggle Burst Fire (Weapon)" - set desc = "Toggle burst firemode, if the gun has it." - - var/new_firemode - switch(gun_firemode) - if(GUN_FIREMODE_SEMIAUTO) - new_firemode = GUN_FIREMODE_BURSTFIRE - if(GUN_FIREMODE_BURSTFIRE) - new_firemode = GUN_FIREMODE_SEMIAUTO - if(GUN_FIREMODE_AUTOMATIC) - new_firemode = GUN_FIREMODE_AUTOBURST - if(GUN_FIREMODE_AUTOBURST) - new_firemode = GUN_FIREMODE_AUTOMATIC - if(!(new_firemode in gun_firemode_list)) - to_chat(usr, span_warning("[src] lacks a [new_firemode]!")) - return - do_toggle_firemode(new_firemode = new_firemode) - - -/mob/living/carbon/human/verb/toggle_firemode() - set category = "Weapons" - set name = "Toggle Fire Mode" - set desc = "Toggle between fire modes, if the gun has more than has one." - - var/obj/item/weapon/gun/G = get_active_firearm(usr) - if(!G) - return - G.toggle_firemode() - + return do_toggle_firemode(user) +/// A verb in the right click context menu of the weapon for toggling firemode /obj/item/weapon/gun/verb/toggle_firemode() set category = null set name = "Toggle Fire Mode (Weapon)" - set desc = "Toggle between fire modes, if the gun has more than has one." - - do_toggle_firemode() + set desc = "Toggle between fire modes, if the gun has more than one." + do_toggle_firemode(usr) +/// Actually does the toggling of the fire mode /obj/item/weapon/gun/proc/do_toggle_firemode(datum/source, datum/keybinding, new_firemode) SIGNAL_HANDLER if(HAS_TRAIT(src, TRAIT_GUN_BURST_FIRING))//can't toggle mid burst diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 3ddb7ac80b3..daf9175bf14 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -453,7 +453,6 @@ COMSIG_KB_RAILATTACHMENT, COMSIG_KB_UNDERRAILATTACHMENT, COMSIG_KB_UNLOADGUN, - COMSIG_KB_FIREMODE, COMSIG_KB_GUN_SAFETY, COMSIG_KB_UNIQUEACTION, COMSIG_KB_AUTOEJECT, @@ -496,7 +495,6 @@ RegisterSignal(gun_user, COMSIG_KB_RAILATTACHMENT, PROC_REF(activate_rail_attachment)) RegisterSignal(gun_user, COMSIG_KB_UNDERRAILATTACHMENT, PROC_REF(activate_underrail_attachment)) RegisterSignal(gun_user, COMSIG_KB_UNLOADGUN, PROC_REF(unload_gun)) - RegisterSignal(gun_user, COMSIG_KB_FIREMODE, PROC_REF(do_toggle_firemode)) RegisterSignal(gun_user, COMSIG_KB_GUN_SAFETY, PROC_REF(toggle_gun_safety_keybind)) RegisterSignal(gun_user, COMSIG_KB_AUTOEJECT, PROC_REF(toggle_auto_eject_keybind))