Skip to content

Commit

Permalink
Check_keybindings now only saves keybinds rather than everything (#5120)
Browse files Browse the repository at this point in the history
# 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
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl: Drathek
code: Reduced most preference re-saving when preferences are initially
loaded
/:cl:
  • Loading branch information
Drulikar authored Dec 6, 2023
1 parent 464bae1 commit 8152651
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 8152651

Please sign in to comment.