From 8152651ec39936722c9e60362877b935e3a865c0 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Wed, 6 Dec 2023 01:56:48 -0800 Subject: [PATCH] Check_keybindings now only saves keybinds rather than everything (#5120) # About the pull request This PR is a followup to #5110 and #2926 making it so we only save the `key_bindings` value rather than all preferences. I'd be inclined to just not save at all, but the initial commit on the ported input system has us saving `remembered_key_bindings` just a few lines down anyways so no matter what we're writing something. # Explain why it's good for the game Should better future proof this trampling preferences, but still retain existing behavior where any automatically rebound keys are immediately saved. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: Drathek code: Reduced most preference re-saving when preferences are initially loaded /:cl: --- code/modules/client/preferences_savefile.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 4ba42c0e39c3..c67effe90eb1 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -274,6 +274,7 @@ vars["fps"] = fps check_keybindings() + S["key_bindings"] << key_bindings if(remembered_key_bindings) for(var/i in GLOB.keybindings_by_name) @@ -652,7 +653,7 @@ addedbind = TRUE if(!addedbind) notadded += kb - save_preferences() + if(length(notadded)) addtimer(CALLBACK(src, PROC_REF(announce_conflict), notadded), 5 SECONDS)