Skip to content

Commit

Permalink
initial (to test later)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeagleGaming1 committed Oct 2, 2023
1 parent 64070e7 commit be042f1
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 121 deletions.
28 changes: 20 additions & 8 deletions code/__DEFINES/keybinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
#define COMSIG_KG_CLIENT_RADIO_DOWN "keybinding_client_radio_down"

//Human
#define COMSIG_KB_HUMAN_QUICKEQUIP_DOWN "keybinding_human_quickequip_down"
#define COMSIG_KB_HUMAN_SECONDARY_DOWN "keybinding_human_secondary_down"
#define COMSIG_KB_HUMAN_TERTIARY_DOWN "keybinding_human_tertiary_down"
#define COMSIG_KB_HUMAN_QUATERNARY_DOWN "keybinding_human_quaternary_down"
#define COMSIG_KB_HUMAN_QUICK_EQUIP_DOWN "keybinding_human_quick_equip_down"

#define COMSIG_KB_HUMAN_ISSUE_ORDER "keybinding_human_issue_order"
#define COMSIG_KB_HUMAN_ISSUE_ORDER_MOVE "keybinding_human_issue_order_move"
#define COMSIG_KB_HUMAN_ISSUE_ORDER_HOLD "keybinding_human_issue_order_hold"
Expand All @@ -57,12 +51,29 @@
#define COMSIG_KB_HUMAN_SPECIALIST_ACTIVATION_ONE "keybinding_human_specialist_activation_one"
#define COMSIG_KB_HUMAN_SPECIALIST_ACTIVATION_TWO "keybinding_human_specialist_activation_two"

#define COMSIG_KB_HUMAN_PICK_UP "keybinding_human_pick_up"

#define COMSIG_KB_HUMAN_ROTATE_CHAIR "keybinding_human_rotate_chair"

#define COMSIG_KB_HUMAN_SHOW_HELD_ITEM "keybinding_human_show_held_item"

// Human Inventory Navigation
#define COMSIG_KB_HUMAN_INTERACT_OTHER_HAND "keybinding_human_interact_other_hand"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_BACK "keybinding_human_interact_slot_back"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_BELT "keybinding_human_interact_slot_belt"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_UNIFORM "keybinding_human_interact_slot_uniform"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_SUIT "keybinding_human_interact_slot_suit"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_HELMET "keybinding_human_interact_slot_helmet"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_LEFT_POUCH "keybinding_human_interact_slot_left_pouch"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_RIGHT_POUCH "keybinding_human_interact_slot_right_pouch"
#define COMSIG_KB_HUMAN_INTERACT_SUIT_S_STORE "keybinding_human_interact_slot_suit_storage"

#define COMSIG_KB_HUMAN_INTERACT_QUICKEQUIP_DOWN "keybinding_human_interact_quickequip_down"
#define COMSIG_KB_HUMAN_INTERACT_SECONDARY_DOWN "keybinding_human_interact_secondary_down"
#define COMSIG_KB_HUMAN_INTERACT_TERTIARY_DOWN "keybinding_human_interact_tertiary_down"
#define COMSIG_KB_HUMAN_INTERACT_QUATERNARY_DOWN "keybinding_human_interact_quaternary_down"
#define COMSIG_KB_HUMAN_INTERACT_QUICK_EQUIP_DOWN "keybinding_human_interact_quick_equip_down"

#define COMSIG_KB_HUMAN_INTERACT_PICK_UP "keybinding_human_interact_pick_up"

// Human Combat
#define COMSIG_KB_HUMAN_WEAPON_FIELDSTRIP "keybinding_human_weapon_fieldstrip"
#define COMSIG_KB_HUMAN_WEAPON_BURSTFIRE "keybinding_human_weapon_burstfire"
Expand Down Expand Up @@ -199,6 +210,7 @@
#define CATEGORY_CARBON "CARBON"
#define CATEGORY_HUMAN "HUMAN"
#define CATEGORY_HUMAN_COMBAT "HUMAN COMBAT"
#define CATEGORY_HUMAN_INVENTORY "HUMAN INVENTORY"
#define CATEGORY_ROBOT "ROBOT"
#define CATEGORY_YAUTJA "YAUTJA"
#define CATEGORY_MISC "MISC"
Expand Down
118 changes: 6 additions & 112 deletions code/datums/keybinding/human.dm
Original file line number Diff line number Diff line change
@@ -1,95 +1,10 @@
#define QUICK_EQUIP_PRIMARY 1
#define QUICK_EQUIP_SECONDARY 2
#define QUICK_EQUIP_TERTIARY 3
#define QUICK_EQUIP_QUATERNARY 4

/datum/keybinding/human
category = CATEGORY_HUMAN
weight = WEIGHT_MOB

/datum/keybinding/human/can_use(client/user)
return ishuman(user.mob)

/datum/keybinding/human/quick_equip
hotkey_keys = list("E")
classic_keys = list("E")
name = "quick_equip"
full_name = "Unholster"
description = "Take out an available weapon"
keybind_signal = COMSIG_KB_HUMAN_QUICKEQUIP_DOWN

/datum/keybinding/human/quick_equip/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_PRIMARY)
return TRUE

/datum/keybinding/human/quick_equip_secondary
hotkey_keys = list("Shift+E")
classic_keys = list("Shift+E")
name = "quick_equip_secondary"
full_name = "Unholster secondary"
description = "Take out your secondary weapon"
keybind_signal = COMSIG_KB_HUMAN_SECONDARY_DOWN

/datum/keybinding/human/quick_equip_secondary/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_SECONDARY)
return TRUE

/datum/keybinding/human/quick_equip_tertiary
hotkey_keys = list("Ctrl+E", "Alt+E")
classic_keys = list("Ctrl+E", "Alt+E")
name = "quick_equip_tertiary"
full_name = "Unholster tertiary"
description = "Take out your tertiary item."
keybind_signal = COMSIG_KB_HUMAN_TERTIARY_DOWN

/datum/keybinding/human/quick_equip_tertiary/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_TERTIARY)
return TRUE

/datum/keybinding/human/quick_equip_quaternary
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "quick_equip_quaternary"
full_name = "Unholster quaternary"
description = "Take out your quaternary item."
keybind_signal = COMSIG_KB_HUMAN_QUATERNARY_DOWN

/datum/keybinding/human/quick_equip_quaternary/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_QUATERNARY)
return TRUE

/datum/keybinding/human/quick_equip_inventory
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "quick_equip_inventory"
full_name = "Quick equip inventory"
description = "Quickly puts an item in the best slot available"
keybind_signal = COMSIG_KB_HUMAN_QUICK_EQUIP_DOWN

/datum/keybinding/human/quick_equip_inventory/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.quick_equip()
return TRUE

/datum/keybinding/human/issue_order
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
Expand All @@ -103,8 +18,8 @@
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.issue_order(order)
var/mob/living/carbon/human/human_mob = user.mob
human_mob.issue_order(order)
return TRUE

/datum/keybinding/human/issue_order/move
Expand Down Expand Up @@ -139,8 +54,8 @@
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.spec_activation_one()
var/mob/living/carbon/human/human_mob = user.mob
human_mob.spec_activation_one()
return TRUE

/datum/keybinding/human/specialist_two
Expand All @@ -154,24 +69,8 @@
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.spec_activation_two()
return TRUE

/datum/keybinding/human/pick_up
hotkey_keys = list("F")
classic_keys = list("Unbound")
name = "pick_up"
full_name = "Pick Up Dropped Items"
keybind_signal = COMSIG_KB_HUMAN_PICK_UP

/datum/keybinding/human/pick_up/down(client/user)
. = ..()
if(.)
return

var/mob/living/carbon/human/human_user = user.mob
human_user.pickup_recent()
var/mob/living/carbon/human/human_mob = user.mob
human_mob.spec_activation_two()
return TRUE

/datum/keybinding/human/rotate_chair
Expand Down Expand Up @@ -208,8 +107,3 @@
if(shown_item && !(shown_item.flags_item & ITEM_ABSTRACT))
shown_item.showoff(human_user)
return TRUE

#undef QUICK_EQUIP_PRIMARY
#undef QUICK_EQUIP_SECONDARY
#undef QUICK_EQUIP_TERTIARY
#undef QUICK_EQUIP_QUATERNARY
1 change: 0 additions & 1 deletion code/datums/keybinding/human_combat.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/datum/keybinding/human/combat
category = CATEGORY_HUMAN_COMBAT
weight = WEIGHT_MOB

/datum/keybinding/human/combat/can_use(client/user)
. = ..()
Expand Down
Loading

0 comments on commit be042f1

Please sign in to comment.