mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Port Custom hotkeys from TGMC (#47003)
* custom keybindings * Update _lists.dm * Update robot.dm * modify weights and clean up some vars * Update say.dm * Apply suggestions from code review Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com> * some review changes * formatting * include focus hack, remove me_wrapper, give default keybinds to new characters, misc fixes * revert hack and more reviews * remove another focus hack this was causing issues with the keydown proc returning early
This commit is contained in:
committed by
Rob Bailey
co-authored by
Emmett Gaines
parent
36643ddf36
commit
070bb5e69c
@@ -0,0 +1,16 @@
|
||||
#define CATEGORY_CLIENT "CLIENT"
|
||||
#define CATEGORY_ADMIN "ADMIN"
|
||||
#define CATEGORY_XENO "XENO"
|
||||
#define CATEGORY_CARBON "CARBON"
|
||||
#define CATEGORY_HUMAN "HUMAN"
|
||||
#define CATEGORY_ROBOT "ROBOT"
|
||||
#define CATEGORY_MISC "MISC"
|
||||
|
||||
#define WEIGHT_HIGHEST 0
|
||||
#define WEIGHT_ADMIN 10
|
||||
#define WEIGHT_CLIENT 20
|
||||
#define WEIGHT_ROBOT 30
|
||||
#define WEIGHT_MOB 40
|
||||
#define WEIGHT_LIVING 50
|
||||
#define WEIGHT_DEAD 60
|
||||
#define WEIGHT_LOWEST 999
|
||||
@@ -0,0 +1,13 @@
|
||||
/datum/keybinding
|
||||
var/key
|
||||
var/name
|
||||
var/full_name
|
||||
var/description = ""
|
||||
var/category = CATEGORY_MISC
|
||||
var/weight = WEIGHT_LOWEST
|
||||
|
||||
/datum/keybinding/proc/down(client/user)
|
||||
return FALSE
|
||||
|
||||
/datum/keybinding/proc/up(client/user)
|
||||
return FALSE
|
||||
@@ -0,0 +1,74 @@
|
||||
/datum/keybinding/admin
|
||||
category = CATEGORY_ADMIN
|
||||
weight = WEIGHT_ADMIN
|
||||
|
||||
|
||||
/datum/keybinding/admin/admin_say
|
||||
key = "F3"
|
||||
name = "admin_say"
|
||||
full_name = "Admin say"
|
||||
description = "Talk with other admins."
|
||||
|
||||
/datum/keybinding/admin/admin_say/down(client/user)
|
||||
user.get_admin_say()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/admin/admin_ghost
|
||||
key = "F5"
|
||||
name = "admin_ghost"
|
||||
full_name = "Aghost"
|
||||
description = "Go ghost"
|
||||
|
||||
/datum/keybinding/admin/admin_ghost/down(client/user)
|
||||
user.admin_ghost()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/admin/player_panel_new
|
||||
key = "F6"
|
||||
name = "player_panel_new"
|
||||
full_name = "Player Panel New"
|
||||
description = "Opens up the new player panel"
|
||||
|
||||
/datum/keybinding/admin/player_panel_new/down(client/user)
|
||||
user.holder.player_panel_new()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/admin/toggle_buildmode_self
|
||||
key = "F7"
|
||||
name = "toggle_buildmode_self"
|
||||
full_name = "Toggle Buildmode Self"
|
||||
description = "Toggles buildmode"
|
||||
|
||||
/datum/keybinding/admin/toggle_buildmode_self/down(client/user)
|
||||
user.togglebuildmodeself()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/admin/stealthmode
|
||||
key = "Ctrl-F8"
|
||||
name = "stealth_mode"
|
||||
full_name = "Stealth mode"
|
||||
description = "Enters stealth mode"
|
||||
|
||||
/datum/keybinding/admin/stealthmode/down(client/user)
|
||||
user.stealth()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/admin/invisimin
|
||||
key = "F8"
|
||||
name = "invisimin"
|
||||
full_name = "Admin invisibility"
|
||||
description = "Toggles ghost-like invisibility (Don't abuse this)"
|
||||
|
||||
/datum/keybinding/admin/invisimin/down(client/user)
|
||||
user.invisimin()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/admin/deadsay
|
||||
key = "F10"
|
||||
name = "dsay"
|
||||
full_name = "deadsay"
|
||||
description = "Allows you to send a message to dead chat"
|
||||
|
||||
/datum/keybinding/admin/deadsay/down(client/user)
|
||||
user.get_dead_say()
|
||||
return TRUE
|
||||
@@ -0,0 +1,66 @@
|
||||
/datum/keybinding/carbon
|
||||
category = CATEGORY_CARBON
|
||||
weight = WEIGHT_MOB
|
||||
|
||||
|
||||
/datum/keybinding/carbon/toggle_throw_mode
|
||||
key = "R"
|
||||
name = "toggle_throw_mode"
|
||||
full_name = "Toggle throw mode"
|
||||
description = "Toggle throwing the current item or not."
|
||||
category = CATEGORY_CARBON
|
||||
|
||||
/datum/keybinding/carbon/toggle_throw_mode/down(client/user)
|
||||
if (!iscarbon(user.mob))
|
||||
return FALSE
|
||||
var/mob/living/carbon/C = user.mob
|
||||
C.toggle_throw_mode()
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/carbon/select_help_intent
|
||||
key = "1"
|
||||
name = "select_help_intent"
|
||||
full_name = "Select help intent"
|
||||
description = ""
|
||||
category = CATEGORY_CARBON
|
||||
|
||||
/datum/keybinding/carbon/select_help_intent/down(client/user)
|
||||
user.mob?.a_intent_change(INTENT_HELP)
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/carbon/select_disarm_intent
|
||||
key = "2"
|
||||
name = "select_disarm_intent"
|
||||
full_name = "Select disarm intent"
|
||||
description = ""
|
||||
category = CATEGORY_CARBON
|
||||
|
||||
/datum/keybinding/carbon/select_disarm_intent/down(client/user)
|
||||
user.mob?.a_intent_change(INTENT_DISARM)
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/carbon/select_grab_intent
|
||||
key = "3"
|
||||
name = "select_grab_intent"
|
||||
full_name = "Select grab intent"
|
||||
description = ""
|
||||
category = CATEGORY_CARBON
|
||||
|
||||
/datum/keybinding/carbon/select_grab_intent/down(client/user)
|
||||
user.mob?.a_intent_change(INTENT_GRAB)
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/carbon/select_harm_intent
|
||||
key = "4"
|
||||
name = "select_harm_intent"
|
||||
full_name = "Select harm intent"
|
||||
description = ""
|
||||
category = CATEGORY_CARBON
|
||||
|
||||
/datum/keybinding/carbon/select_harm_intent/down(client/user)
|
||||
user.mob?.a_intent_change(INTENT_HARM)
|
||||
return TRUE
|
||||
@@ -0,0 +1,45 @@
|
||||
/datum/keybinding/client
|
||||
category = CATEGORY_CLIENT
|
||||
weight = WEIGHT_HIGHEST
|
||||
|
||||
|
||||
/datum/keybinding/client/admin_help
|
||||
key = "F1"
|
||||
name = "admin_help"
|
||||
full_name = "Admin Help"
|
||||
description = "Ask an admin for help."
|
||||
|
||||
/datum/keybinding/client/admin_help/down(client/user)
|
||||
user.get_adminhelp()
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/client/screenshot
|
||||
key = "F2"
|
||||
name = "screenshot"
|
||||
full_name = "Screenshot"
|
||||
description = "Take a screenshot."
|
||||
|
||||
/datum/keybinding/client/screenshot/down(client/user)
|
||||
winset(user, null, "command=.screenshot [!user.keys_held["shift"] ? "auto" : ""]")
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/client/minimal_hud
|
||||
key = "F12"
|
||||
name = "minimal_hud"
|
||||
full_name = "Minimal HUD"
|
||||
description = "Hide most HUD features"
|
||||
|
||||
/datum/keybinding/client/minimal_hud/down(client/user)
|
||||
user.mob.button_pressed_F12()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/client/ooc
|
||||
key = "O"
|
||||
name = "ooc"
|
||||
full_name = "OOC"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/client/ooc/down(client/user)
|
||||
user.ooc_wrapper()
|
||||
return TRUE
|
||||
@@ -0,0 +1,37 @@
|
||||
/datum/keybinding/human
|
||||
category = CATEGORY_HUMAN
|
||||
weight = WEIGHT_MOB
|
||||
|
||||
|
||||
/datum/keybinding/human/quick_equip
|
||||
key = "E"
|
||||
name = "quick_equip"
|
||||
full_name = "Quick Equip"
|
||||
description = "Quickly puts an item in the best slot available"
|
||||
|
||||
/datum/keybinding/human/quick_equip/down(client/user)
|
||||
var/mob/living/carbon/human/H = user.mob
|
||||
H.quick_equip()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/human/quick_equipbelt
|
||||
key = "Shift-E"
|
||||
name = "quick_equipbelt"
|
||||
full_name = "Quick equip belt"
|
||||
description = "Put held thing in belt or take out most recent thing from belt"
|
||||
|
||||
/datum/keybinding/human/quick_equipbelt/down(client/user)
|
||||
var/mob/living/carbon/human/H = user.mob
|
||||
H.smart_equipbelt()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/human/bag_equip
|
||||
key = "Shift-B"
|
||||
name = "bag_equip"
|
||||
full_name = "Bag equip"
|
||||
description = "Put held thing in backpack or take out most recent thing from backpack"
|
||||
|
||||
/datum/keybinding/human/bag_equip/down(client/user)
|
||||
var/mob/living/carbon/human/H = user.mob
|
||||
H.smart_equipbag()
|
||||
return TRUE
|
||||
@@ -0,0 +1,15 @@
|
||||
/datum/keybinding/living
|
||||
category = CATEGORY_HUMAN
|
||||
weight = WEIGHT_MOB
|
||||
|
||||
|
||||
/datum/keybinding/living/resist
|
||||
key = "B"
|
||||
name = "resist"
|
||||
full_name = "Resist"
|
||||
description = "Break free of your current state. Handcuffed? on fire? Resist!"
|
||||
|
||||
/datum/keybinding/living/resist/down(client/user)
|
||||
var/mob/living/L = user.mob
|
||||
L.resist()
|
||||
return TRUE
|
||||
@@ -0,0 +1,233 @@
|
||||
/datum/keybinding/mob
|
||||
category = CATEGORY_HUMAN
|
||||
weight = WEIGHT_MOB
|
||||
|
||||
|
||||
/datum/keybinding/mob/face_north
|
||||
key = "Ctrl-W"
|
||||
name = "face_north"
|
||||
full_name = "Face North"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/face_north/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.northface()
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/mob/face_east
|
||||
key = "Ctrl-D"
|
||||
name = "face_east"
|
||||
full_name = "Face East"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/face_east/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.eastface()
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/keybinding/mob/face_south
|
||||
key = "Ctrl-S"
|
||||
name = "face_south"
|
||||
full_name = "Face South"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/face_south/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.southface()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/face_west
|
||||
key = "Ctrl-A"
|
||||
name = "face_west"
|
||||
full_name = "Face West"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/face_west/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.westface()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/stop_pulling
|
||||
key = "H"
|
||||
name = "stop_pulling"
|
||||
full_name = "Stop pulling"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/stop_pulling/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
if (M.pulling)
|
||||
to_chat(user, "<span class='notice'>You are not pulling anything.</span>")
|
||||
else
|
||||
M.stop_pulling()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/cycle_intent_right
|
||||
key = "Home"
|
||||
name = "cycle_intent_right"
|
||||
full_name = "cycle intent right"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/cycle_intent_right/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.a_intent_change(INTENT_HOTKEY_RIGHT)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/cycle_intent_left
|
||||
key = "Insert"
|
||||
name = "cycle_intent_left"
|
||||
full_name = "cycle intent left"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/cycle_intent_left/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.a_intent_change(INTENT_HOTKEY_LEFT)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/swap_hands
|
||||
key = "X"
|
||||
name = "swap_hands"
|
||||
full_name = "Swap hands"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/swap_hands/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.swap_hand()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/say
|
||||
key = "T"
|
||||
name = "say"
|
||||
full_name = "Say"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/say/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.say_wrapper()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/me
|
||||
key = "M"
|
||||
name = "me"
|
||||
full_name = "Me"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/me/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.me_verb()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/activate_inhand
|
||||
key = "Z"
|
||||
name = "activate_inhand"
|
||||
full_name = "Activate in-hand"
|
||||
description = "Uses whatever item you have inhand"
|
||||
|
||||
/datum/keybinding/mob/activate_inhand/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.mode()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/drop_item
|
||||
key = "Q"
|
||||
name = "drop_item"
|
||||
full_name = "Drop Item"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/drop_item/down(client/user)
|
||||
if(iscyborg(user.mob)) //cyborgs can't drop items
|
||||
return FALSE
|
||||
var/mob/M = user.mob
|
||||
var/obj/item/I = M.get_active_held_item()
|
||||
if(!I)
|
||||
to_chat(user, "<span class='warning'>You have nothing to drop in your hand!</span>")
|
||||
else
|
||||
user.mob.dropItemToGround(I)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/toggle_move_intent
|
||||
key = "Alt"
|
||||
name = "toggle_move_intent"
|
||||
full_name = "Hold to toggle move intent"
|
||||
description = "Held down to cycle to the other move intent, release to cycle back"
|
||||
|
||||
/datum/keybinding/mob/toggle_move_intent/down(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.toggle_move_intent()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/toggle_move_intent/up(client/user)
|
||||
var/mob/M = user.mob
|
||||
M.toggle_move_intent()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_head_cycle
|
||||
key = "Numpad8"
|
||||
name = "target_head_cycle"
|
||||
full_name = "Target: Cycle head"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_head_cycle/down(client/user)
|
||||
user.body_toggle_head()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_r_arm
|
||||
key = "Numpad4"
|
||||
name = "target_r_arm"
|
||||
full_name = "Target: right arm"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_r_arm/down(client/user)
|
||||
user.body_r_arm()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_body_chest
|
||||
key = "Numpad5"
|
||||
name = "target_body_chest"
|
||||
full_name = "Target: Body"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_body_chest/down(client/user)
|
||||
user.body_chest()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_left_arm
|
||||
key = "Numpad6"
|
||||
name = "target_left_arm"
|
||||
full_name = "Target: left arm"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_left_arm/down(client/user)
|
||||
user.body_l_arm()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_right_leg
|
||||
key = "Numpad1"
|
||||
name = "target_right_leg"
|
||||
full_name = "Target: Right leg"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_right_leg/down(client/user)
|
||||
user.body_r_leg()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_body_groin
|
||||
key = "Numpad2"
|
||||
name = "target_body_groin"
|
||||
full_name = "Target: Groin"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_body_groin/down(client/user)
|
||||
user.body_groin()
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/mob/target_left_leg
|
||||
key = "Numpad3"
|
||||
name = "target_left_leg"
|
||||
full_name = "Target: left leg"
|
||||
description = ""
|
||||
|
||||
/datum/keybinding/mob/target_left_leg/down(client/user)
|
||||
user.body_l_leg()
|
||||
return TRUE
|
||||
@@ -0,0 +1,69 @@
|
||||
/datum/keybinding/robot
|
||||
category = CATEGORY_ROBOT
|
||||
weight = WEIGHT_ROBOT
|
||||
|
||||
|
||||
/datum/keybinding/robot/moduleone
|
||||
key = "1"
|
||||
name = "module_one"
|
||||
full_name = "Toggle module 1"
|
||||
description = "Equips or unequips the first module"
|
||||
|
||||
/datum/keybinding/robot/moduleone/down(client/user)
|
||||
if(!iscyborg(user.mob))
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user.mob
|
||||
R.toggle_module(1)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/robot/moduletwo
|
||||
key = "2"
|
||||
name = "module_two"
|
||||
full_name = "Toggle module 2"
|
||||
description = "Equips or unequips the second module"
|
||||
|
||||
/datum/keybinding/robot/moduletwo/down(client/user)
|
||||
if(!iscyborg(user.mob))
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user.mob
|
||||
R.toggle_module(2)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/robot/modulethree
|
||||
key = "3"
|
||||
name = "module_three"
|
||||
full_name = "Toggle module 3"
|
||||
description = "Equips or unequips the third module"
|
||||
|
||||
/datum/keybinding/robot/modulethree/down(client/user)
|
||||
if(!iscyborg(user.mob))
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user.mob
|
||||
R.toggle_module(3)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/robot/intent_cycle
|
||||
key = "4"
|
||||
name = "cycle_intent"
|
||||
full_name = "Cycle intent left"
|
||||
description = "Cycles the intent left"
|
||||
|
||||
/datum/keybinding/robot/intent_cycle/down(client/user)
|
||||
if(!iscyborg(user.mob))
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user.mob
|
||||
R.a_intent_change(INTENT_HOTKEY_LEFT)
|
||||
return TRUE
|
||||
|
||||
/datum/keybinding/robot/unequip_module
|
||||
key = "Q"
|
||||
name = "unequip_module"
|
||||
full_name = "Unequip module"
|
||||
description = "Unequips the active module"
|
||||
|
||||
/datum/keybinding/robot/unequip_module/down(client/user)
|
||||
if(!iscyborg(user.mob))
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user.mob
|
||||
R.uneq_active()
|
||||
return TRUE
|
||||
Reference in New Issue
Block a user