mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-17 05:03:28 +00:00
## About The Pull Request <img src="https://i.ibb.co/0cM6NHQ/Hotkey-PRImage2.png"> What it says on the tin. Gives the AI hotkeys to connect and disconnect from its shell. I'm open to suggestions for better default hotkeys, I made sure to choose out-of-the-way keys with no overlaps because I have a vague memory about code-side keybind conflicts leading to a threatened forkening and I don't want that. Also this is my first PR with more than 2 lines changed so I would appreciate a thorough and critical review of my code. ## Why It's Good For The Game Since there are so many AI player admins (Who are all universally gigachads btw) it would be convenient to them to have an aghost-hotkey analogue for the AI. This change was specifically requested of me by one of these admins in fact. I'm sure non-admin AIs would appreciate this convenience as well though. ## Changelog 🆑 qol: The AI now has hotkeys for its shells, make sure to bind them to your preferred keys in your keybindings menu, under game preferences. /🆑
22 lines
643 B
Plaintext
22 lines
643 B
Plaintext
/datum/keybinding/artificial_intelligence
|
|
category = CATEGORY_AI
|
|
weight = WEIGHT_AI
|
|
|
|
/datum/keybinding/artificial_intelligence/can_use(client/user)
|
|
return isAI(user.mob)
|
|
|
|
/datum/keybinding/artificial_intelligence/reconnect
|
|
hotkey_keys = list("-")
|
|
name = "reconnect"
|
|
full_name = "Reconnect to shell"
|
|
description = "Reconnects you to your most recently used AI shell"
|
|
keybind_signal = COMSIG_KB_SILICON_RECONNECT_DOWN
|
|
|
|
/datum/keybinding/artificial_intelligence/reconnect/down(client/user)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
var/mob/living/silicon/ai/our_ai = user.mob
|
|
our_ai.deploy_to_shell(our_ai.redeploy_action.last_used_shell)
|
|
return TRUE
|