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
-37
View File
@@ -443,7 +443,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
to_chat(src, "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>")
//This is down here because of the browse() calls in tooltip/New()
if(!tooltips)
tooltips = new /datum/tooltip(src)
@@ -475,10 +474,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
fit_viewport()
Master.UpdateTickRate()
/client/proc/ensure_keys_set()
if(SSinput.initialized)
set_macros()
//////////////
//DISCONNECT//
//////////////
@@ -936,38 +931,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
y = clamp(y+change, min,max)
view_size.setDefault("[x]x[y]")
/**
* 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")
/client/proc/change_view(new_size)
if (isnull(new_size))
CRASH("change_view called without argument.")
+10 -6
View File
@@ -219,7 +219,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//we couldn't load character data so just randomize the character appearance + name
random_character() //let's create a random character then - rather than a fat, bald and naked man.
key_bindings = deepCopyList(GLOB.hotkey_keybinding_list_by_key) // give them default keybinds and update their movement keys
C?.set_macros()
C?.full_macro_assert()
real_name = pref_species.random_name(gender,1)
if(!loaded_preferences_successfully)
save_preferences()
@@ -2382,7 +2382,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(!length(key_bindings[old_key]))
key_bindings -= old_key
user << browse(null, "window=capturekeypress")
user.client.set_macros()
user.client.full_macro_assert()
save_preferences()
ShowChoices(user)
return
@@ -2417,7 +2417,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
key_bindings -= old_key
key_bindings[full_key] += list(kb_name)
key_bindings[full_key] = sortList(key_bindings[full_key])
user.client.set_macros()
user.client.full_macro_assert()
user << browse(null, "window=capturekeypress")
save_preferences()
@@ -2429,7 +2429,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
hotkeys = (choice == "Hotkey")
key_bindings = (hotkeys) ? deepCopyList(GLOB.hotkey_keybinding_list_by_key) : deepCopyList(GLOB.classic_keybinding_list_by_key)
modless_key_bindings = list()
user.client.set_macros()
user.client.full_macro_assert()
if("chat_on_map")
chat_on_map = !chat_on_map
@@ -2829,17 +2829,21 @@ GLOBAL_LIST_EMPTY(preferences_datums)
cached_holoform_icons[filter_type] = process_holoform_icon_filter(custom_holoform_icon, filter_type)
return cached_holoform_icons[filter_type]
//Used in savefile update 32, can be removed once that is no longer relevant.
/// Resets the client's keybindings. Asks them for which
/datum/preferences/proc/force_reset_keybindings()
var/choice = tgalert(parent.mob, "Your basic keybindings need to be reset, emotes will remain as before. Would you prefer 'hotkey' or 'classic' mode?", "Reset keybindings", "Hotkey", "Classic")
hotkeys = (choice != "Classic")
force_reset_keybindings_direct(hotkeys)
/// Does the actual reset
/datum/preferences/proc/force_reset_keybindings_direct(hotkeys = TRUE)
var/list/oldkeys = key_bindings
key_bindings = (hotkeys) ? deepCopyList(GLOB.hotkey_keybinding_list_by_key) : deepCopyList(GLOB.classic_keybinding_list_by_key)
for(var/key in oldkeys)
if(!key_bindings[key])
key_bindings[key] = oldkeys[key]
parent.update_special_keybinds()
parent.full_macro_assert(src)
/datum/preferences/proc/is_loadout_slot_available(slot)
var/list/L
+3 -20
View File
@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 44
#define SAVEFILE_VERSION_MAX 45
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -42,7 +42,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//if your savefile is 3 months out of date, then 'tough shit'.
/datum/preferences/proc/update_preferences(current_version, savefile/S)
if(current_version < 32) //If you remove this, remove force_reset_keybindings() too.
if(current_version < 45) //If you remove this, remove force_reset_keybindings() too.
force_reset_keybindings_direct(TRUE)
addtimer(CALLBACK(src, .proc/force_reset_keybindings), 30) //No mob available when this is run, timer allows user choice.
/datum/preferences/proc/update_character(current_version, savefile/S)
@@ -261,24 +262,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
features["color_scheme"] = OLD_CHARACTER_COLORING //advanced is off by default
if(current_version < 44)
var/ctrl_t_binding = S["key_bindings"]["CtrlT"]
var/ctrl_m_binding = S["key_bindings"]["CtrlM"]
if(length(ctrl_t_binding) && ("say_with_indicator" in ctrl_t_binding))
if(!length(S["key_bindings"]["T"]))
S["key_bindings"]["T"] = list("say_with_indicator")
else
S["key_bindings"]["T"] += "say_with_indicator"
S["key_bindings"]["CtrlT"] -= "say_with_indicator"
S["key_bindings"]["CtrlT"] += "say"
if(length(ctrl_m_binding) && ("me_with_indicator" in ctrl_m_binding))
if(!length(S["key_bindings"]["M"]))
S["key_bindings"]["M"] = list("me_with_indicator")
else
S["key_bindings"]["M"] += "me_with_indicator"
S["key_bindings"]["CtrlM"] -= "me_with_indicator"
S["key_bindings"]["CtrlM"] = "me"
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
if(!ckey)
return