View Single Post
09-10-20, 06:37 PM   #1
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Save default keybinding in Keybinding UI

Hi all

I have set up a number of keybinds in the Binding UI; 4 of these bindings have default bindings.
Whene I first login they work without an issue; however if I /reload the default bindings disappear.
If I /logout and then log back in the defaults are once again working.

The none default bindings can be set and they will always be available; they are written to the bindings-cache.wtf file.

Here is my xml.
Lua Code:
  1. <Bindings>
  2.     <Binding name="AVKRUNSHOWAARDVARKUIFUNCTION" category="Aardvark">
  3.     print("Keybinding destroy function")
  4.         AVKRUNSHOWAARDVARKUIFUNCTION()
  5.     </Binding>
  6.     <Binding name="AVKRUNRESETAARDVARKUIFUNCTION" category="Aardvark">
  7.         print("Keybinding reset aardvark UI")
  8.     </Binding>
  9.     <Binding name="AVKRUNCLEARALLLISTSFUNCTION" category="Aardvark">
  10.         print("Keybinding clear all lists")
  11.     </Binding>
  12.     <Binding name="AVKRUNDESTROYFUNCTION" category="Aardvark">
  13.         print("Keybinding destroy function")
  14.     </Binding>
  15.     <Binding name="AVKRUNADDITEMTOGLOBALLISTFUNCTION" default="ALT-F9" category="Aardvark">
  16.         print("Keybinding add to global list")
  17.         AVKRUNADDITEMTOGLOBALLISTFUNCTION()
  18.     </Binding>
  19.     <Binding name="AVKRUNADDITEMTOCHARACTERLISTFUNCTION" default="ALT-F10" category="Aardvark">
  20.         print("Keybinding add to character list")
  21.         AVKRUNADDITEMTOCHARACTERLISTFUNCTION()
  22.     </Binding>
  23.     <Binding name="AVKRUNADDITEMTOGLOBALPROTECTLISTFUNCTION" default="ALT-F11" category="Aardvark">
  24.         print("Keybinding add to global protect list")
  25.         AVKRUNADDITEMTOGLOBALPROTECTLISTFUNCTION()
  26.     </Binding>
  27.     <Binding name="AVKRUNADDITEMTOCHARACTERPROTECTLISTFUNCTION" default="ALT-F12" category="Aardvark">
  28.         print("Keybinding add to character protect list")
  29.         AVKRUNADDITEMTOCHARACTERPROTECTLISTFUNCTION()
  30.     </Binding>
  31. </Bindings>

Is there a way to have the defaults saved to the bindings-cache.wtf file as well to ensure they are not wiped on /reload?
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote