Rebindable Hotkeys (#12138)

* demodularize interface

* keybindings

* binds

* prefs

* loose ends

* globals

* changes

* s

* datum ref lists

* ok

* fixes

* fixes

* fix

* ok

* sigh

* sigh

* indicators

* let's play the move code around game

* let's play the i didn't comma my lists game

* let's play the indent game

* let's play hte spelling bee

* let's fail the spelling bee

* LET'S PLAY THe HOW HARd  IS  IT TO SPELL A PROC GAME

* let's play the bugfix game

* bugfixes

* improvements

* Update bindings_client.dm

* pixel shift

* A

* wups
This commit is contained in:
kevinz000
2020-05-20 14:40:20 -07:00
committed by GitHub
parent f73f5211f9
commit b57e1c1e93
41 changed files with 1346 additions and 879 deletions

View File

@@ -265,6 +265,9 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
else
prefs = new /datum/preferences(src)
GLOB.preferences_datums[ckey] = prefs
if(SSinput.initialized)
set_macros()
update_movement_keys(prefs)
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
@@ -328,9 +331,6 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
qdel(src)
return
if(SSinput.initialized)
set_macros()
chatOutput.start() // Starts the chat
if(alert_mob_dupe_login)
@@ -892,6 +892,23 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
y = clamp(y+change, min,max)
change_view("[x]x[y]")
/client/proc/update_movement_keys(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
/client/proc/change_view(new_size)
if (isnull(new_size))
CRASH("change_view called without argument.")