This commit is contained in:
silicons
2020-11-26 23:37:27 -07:00
parent 8a2e996817
commit 5e965d099f
8 changed files with 90 additions and 131 deletions
@@ -3,35 +3,19 @@
/datum/keybinding/client/communication/say
hotkey_keys = list("CtrlT")
name = "say"
name = "Say"
full_name = "IC Say"
/datum/keybinding/client/communication/say/down(client/user)
var/mob/M = user.mob
var/speech = input(user, "", "say")
M.say_verb(speech)
/datum/keybinding/client/communication/ooc
hotkey_keys = list("O")
name = "OOC"
full_name = "Out Of Character Say (OOC)"
/datum/keybinding/client/communication/ooc/down(client/user)
var/speech = input(user, "", "OOC")
user.ooc(speech)
return TRUE
/datum/keybinding/client/communication/me
hotkey_keys = list("CtrlM")
name = "me"
name = "Me"
full_name = "Me (emote)"
/datum/keybinding/client/communication/me/down(client/user)
var/mob/M = user.mob
var/emote = input(user, "", "Me")
M.me_verb(emote)
return TRUE
//indicators
/datum/keybinding/client/communication/say_with_indicator
hotkey_keys = list("T")
@@ -53,4 +37,28 @@
/datum/keybinding/client/communication/me_with_indicator/down(client/user)
var/mob/M = user.mob
M.me_typing_indicator()
return TRUE
return TRUE
/datum/keybinding/client/communication/subtle
hotkey_keys = list("5")
classic_keys = list()
name = "Subtle"
full_name = "Subtle Emote"
/datum/keybinding/client/communication/subtler
hotkey_keys = list("6")
classic_keys = list()
name = "Subtler"
full_name = "Subtler Anti-Ghost Emote"
/datum/keybinding/client/communication/whisper
hotkey_keys = list("Y")
classic_keys = list()
name = "Whisper"
full_name = "Whisper"
/datum/keybinding/client/communication/looc
hotkey_keys = list("L")
classic_keys = list()
name = "LOOC"
full_name = "Local Out of Character chat"
-34
View File
@@ -76,37 +76,3 @@
else
user.mob.dropItemToGround(I)
return TRUE
/datum/keybinding/living/subtle
hotkey_keys = list("5")
classic_keys = list()
name = "subtle_emote"
full_name = "Subtle Emote"
/datum/keybinding/living/subtle/down(client/user)
var/mob/living/L = user.mob
L.subtle()
return TRUE
/datum/keybinding/living/subtler
hotkey_keys = list("6")
classic_keys = list()
name = "subtler_emote"
full_name = "Subtler Anti-Ghost Emote"
/datum/keybinding/living/subtler/down(client/user)
var/mob/living/L = user.mob
L.subtler()
return TRUE
/datum/keybinding/mob/whisper
hotkey_keys = list("Y")
classic_keys = list()
name = "whisper"
full_name = "Whisper"
/datum/keybinding/mob/whisper/down(client/user)
var/mob/M = user.mob
M.whisper_keybind()
return TRUE
+48
View File
@@ -45,3 +45,51 @@
winset(src, null, "map.focus=true input.background-color=[COLOR_INPUT_DISABLED] mainwindow.macro=[SKIN_MACROSET_HOTKEYS]")
else
winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=[SKIN_MACROSET_CLASSIC_INPUT]")
/client/proc/ensure_keys_set()
if(SSinput.initialized)
full_macro_assert()
/client/proc/full_macro_assert(datum/preferences/prefs_override = refs)
set_macros(prefs_override)
update_special_keybinds(prefs_override)
/**
* Updates the keybinds for special keys
*
* Handles adding macros for the keys that need it
* And adding movement keys to the clients movement_keys list
* At the time of writing this, communication(OOC, Say, IC) require macros
* Arguments:
* * direct_prefs - the preference we're going to get keybinds from
*/
/client/proc/update_special_keybinds(datum/preferences/direct_prefs)
var/datum/preferences/D = prefs || direct_prefs
if(!D?.key_bindings)
return
movement_keys = list()
for(var/key in D.key_bindings)
for(var/kb_name in D.key_bindings[key])
switch(kb_name)
if("North")
movement_keys[key] = NORTH
if("East")
movement_keys[key] = EAST
if("West")
movement_keys[key] = WEST
if("South")
movement_keys[key] = SOUTH
if("Say")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=say")
if("OOC")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=ooc")
if("Me")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=me")
if("Subtle")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=subtle")
if("Subtler")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=subtler")
if("Whisper")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=whisper")
if("LOOC")
winset(src, "default-[REF(key)]", "parent=default;name=[key];command=looc")