Reverts implementing server side hotkey tracking (and also reverts the renaming of hotkey names).

Reverts TAB changes.

Renames hotkey verb to "Set Hotkeys" and makes it hidden (since it uses a parameter, trying to call it in-game is ass).
This commit is contained in:
X-TheDark
2016-07-03 13:07:23 +03:00
parent dbbef9408f
commit 2b8e30ae1b
9 changed files with 50 additions and 47 deletions
+1 -2
View File
@@ -51,5 +51,4 @@
var/datum/tooltip/tooltips
//Used for var edit flagging, also defined in datums (clients are not a child of datums for some reason)
var/var_edited = 0
var/hotkeys = FALSE
var/var_edited = 0
+1 -1
View File
@@ -143,7 +143,7 @@ var/next_external_rsc = 0
preferences_datums[ckey] = prefs
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
hotkeys = prefs.hotkey_preference //hotkey setting when client connects
sethotkeys(1) //set hoykeys from preferences (from_pref = 1)
. = ..() //calls mob.Login()
+4 -4
View File
@@ -27,7 +27,7 @@ var/list/preferences_datums = list()
var/UI_style = "Midnight"
var/hotkey_preference = FALSE
var/hotkeys = FALSE
var/tgui_fancy = TRUE
var/tgui_lock = TRUE
var/toggles = TOGGLES_DEFAULT
@@ -336,7 +336,7 @@ var/list/preferences_datums = list()
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>General Settings</h2>"
dat += "<b>UI Style:</b> <a href='?_src_=prefs;preference=ui'>[UI_style]</a><br>"
dat += "<b>Keybindings:</b> <a href='?_src_=prefs;preference=hotkey_preference'>[(hotkey_preference) ? "Hotkeys" : "Default"]</a><br>"
dat += "<b>Keybindings:</b> <a href='?_src_=prefs;preference=hotkeys'>[(hotkeys) ? "Hotkeys" : "Default"]</a><br>"
dat += "<b>tgui Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(tgui_fancy) ? "Fancy" : "No Frills"]</a><br>"
dat += "<b>tgui Monitors:</b> <a href='?_src_=prefs;preference=tgui_lock'>[(tgui_lock) ? "Primary" : "All"]</a><br>"
dat += "<b>Play admin midis:</b> <a href='?_src_=prefs;preference=hear_midis'>[(toggles & SOUND_MIDI) ? "Yes" : "No"]</a><br>"
@@ -1077,8 +1077,8 @@ var/list/preferences_datums = list()
else
UI_style = "Midnight"
if("hotkey_preference")
hotkey_preference = !hotkey_preference
if("hotkeys")
hotkeys = !hotkeys
if("tgui_fancy")
tgui_fancy = !tgui_fancy
+14 -14
View File
@@ -199,7 +199,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["ooccolor"] >> ooccolor
S["lastchangelog"] >> lastchangelog
S["UI_style"] >> UI_style
S["hotkeys"] >> hotkey_preference
S["hotkeys"] >> hotkeys
S["tgui_fancy"] >> tgui_fancy
S["tgui_lock"] >> tgui_lock
@@ -227,18 +227,18 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
update_antagchoices(needs_update)
//Sanitize
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative"), initial(UI_style))
hotkey_preference = sanitize_integer(hotkey_preference, 0, 1, initial(hotkey_preference))
tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy))
tgui_lock = sanitize_integer(tgui_lock, 0, 1, initial(tgui_lock))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
ghost_form = sanitize_inlist(ghost_form, ghost_forms, initial(ghost_form))
ghost_orbit = sanitize_inlist(ghost_orbit, ghost_orbits, initial(ghost_orbit))
ghost_accs = sanitize_inlist(ghost_accs, ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION)
ghost_others = sanitize_inlist(ghost_others, ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION)
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative"), initial(UI_style))
hotkeys = sanitize_integer(hotkeys, 0, 1, initial(hotkeys))
tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy))
tgui_lock = sanitize_integer(tgui_lock, 0, 1, initial(tgui_lock))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
ghost_form = sanitize_inlist(ghost_form, ghost_forms, initial(ghost_form))
ghost_orbit = sanitize_inlist(ghost_orbit, ghost_orbits, initial(ghost_orbit))
ghost_accs = sanitize_inlist(ghost_accs, ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION)
ghost_others = sanitize_inlist(ghost_others, ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION)
return 1
@@ -256,7 +256,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["ooccolor"] << ooccolor
S["lastchangelog"] << lastchangelog
S["UI_style"] << UI_style
S["hotkeys"] << hotkey_preference
S["hotkeys"] << hotkeys
S["tgui_fancy"] << tgui_fancy
S["tgui_lock"] << tgui_lock
S["be_special"] << be_special
+24
View File
@@ -0,0 +1,24 @@
/client/verb/sethotkeys(from_pref = 0 as num)
set name = "Set Hotkeys"
set hidden = 1
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")
@@ -1,20 +0,0 @@
/client/verb/togglehotkeys(notoggle = 0 as num)
set name = "Toggle Hotkey Mode"
set category = "OOC"
set desc = "Switches input mode betweeen regular and hotkey mode."
//fallback
var/hotkey_default = "default"
var/hotkey_macro = "hotkeys"
if(!notoggle)
hotkeys = !hotkeys
if(mob)
hotkey_macro = mob.macro_hotkeys
hotkey_default = mob.macro_default
if(hotkeys)
winset(src, null, "mainwindow.macro=[hotkey_macro] mapwindow.map.focus=true input.background-color=#e0e0e0")
else
winset(src, null, "mainwindow.macro=[hotkey_default] input.focus=true input.background-color=#d3b5b5")