In-code key handling system

This commit is contained in:
ninjanomnom
2017-11-30 07:40:27 -05:00
parent c57cd6d6da
commit 7b7b67edd8
44 changed files with 421 additions and 1648 deletions
+2 -1
View File
@@ -195,7 +195,6 @@ GLOBAL_LIST(external_rsc_urls)
prefs.last_id = computer_id //these are gonna be used for banning
if(world.byond_version >= 511 && byond_version >= 511 && prefs.clientfps)
vars["fps"] = prefs.clientfps
sethotkeys(1) //set hoykeys from preferences (from_pref = 1)
log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[byond_version]")
var/alert_mob_dupe_login = FALSE
@@ -223,6 +222,8 @@ GLOBAL_LIST(external_rsc_urls)
. = ..() //calls mob.Login()
set_macros()
chatOutput.start() // Starts the chat
if(alert_mob_dupe_login)
-25
View File
@@ -1,25 +0,0 @@
/client/verb/sethotkeys(from_pref = 0 as num)
set name = "Set Hotkeys"
set hidden = TRUE
set waitfor = FALSE
set desc = "Used to set mob-specific hotkeys or load hoykey mode from preferences"
var/hotkey_default = "default"
var/hotkey_macro = "hotkeys"
var/current_setting
var/list/default_macros = list("default", "robot-default")
if(from_pref)
current_setting = (prefs.hotkeys ? hotkey_macro : hotkey_default)
else
current_setting = winget(src, "mainwindow", "macro")
if(mob)
hotkey_macro = mob.macro_hotkeys
hotkey_default = mob.macro_default
if(current_setting in default_macros)
winset(src, null, "mainwindow.macro=[hotkey_default] input.focus=true input.background-color=#d3b5b5")
else
winset(src, null, "mainwindow.macro=[hotkey_macro] mapwindow.map.focus=true input.background-color=#e0e0e0")