[MIRROR] Keybinding Conflicts now wait 5 seconds before being announced (#1146)

* Keybinding Conflicts now wait 5 seconds before being announced (#54152)

* Keybinding Conflicts now wait 5 seconds before being announced

* Update preferences_savefile.dm

Co-authored-by: Couls <coul422@gmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
SkyratBot
2020-10-04 05:09:27 +02:00
committed by GitHub
co-authored by Couls Azarak
parent 5efe748920
commit 271705c7a0
2 changed files with 19 additions and 14 deletions
+9 -7
View File
@@ -119,14 +119,16 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(!addedbind)
notadded += kb
if(length(notadded))
to_chat(parent, "<span class='userdanger'>KEYBINDING CONFLICT!!!\n \
There are new keybindings that have defaults bound to keys you already set, They will default to Unbound. You can bind them in Setup Character or Game Preferences\n \
<a href='?_src_=prefs;preference=tab;tab=3'>Or you can click here to go straight to the keybindings page</a></span>")
for(var/item in notadded)
var/datum/keybinding/conflicted = item
to_chat(parent, "<span class='userdanger'>[conflicted.category]: [conflicted.full_name] needs updating")
LAZYADD(key_bindings["Unbound"], conflicted.name) // set it to unbound to prevent this from opening up again in the future
addtimer(CALLBACK(src, .proc/announce_conflict, notadded), 5 SECONDS)
/datum/preferences/proc/announce_conflict(list/notadded)
to_chat(parent, "<span class='userdanger'>KEYBINDING CONFLICT!!!\n\
There are new keybindings that have defaults bound to keys you already set, They will default to Unbound. You can bind them in Setup Character or Game Preferences\n\
<a href='?_src_=prefs;preference=tab;tab=3'>Or you can click here to go straight to the keybindings page</a></span>")
for(var/item in notadded)
var/datum/keybinding/conflicted = item
to_chat(parent, "<span class='userdanger'>[conflicted.category]: [conflicted.full_name] needs updating")
LAZYADD(key_bindings["Unbound"], conflicted.name) // set it to unbound to prevent this from opening up again in the future