Thread Tools Display Modes
01/03/16, 04:30 AM   #1
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Key bindings of an add-on lost after UI reload

Edit: So after some testing I found out that it's actually just one key that isn't remembered after reloadui.

Also before that I had a weird bug that the keybindings weren't recognised when I renamed/moved the lua that contains the ZO_CreateStringId (of course also updated the txt file accordingly) and got an assert error message...

Steps I did for testing:
  1. Relaunched game, problem still here
  2. Logged in with other char and all add-ons disabled, problem gone
  3. Logged back in with main char, disabled all add-ons, problem still here

Edit 2: Fixed by backing up all keybindings with Binder, then resetting all keybindings to default and finally restoring them again with Binder. Thanks circonian

Last edited by CaptainBlagbird : 01/09/16 at 10:30 AM.
  Reply With Quote
01/03/16, 02:07 PM   #2
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Let's see if I understand this correctly. Are you saing that:
  1. The setting shows up in the keybinds list
  2. It works when you bind a key to It
  3. When you reload the UI the key is no longer bound

Originally Posted by CaptainBlagbird View Post
Also before that I had a weird bug that the keybindings weren't recognised when I renamed/moved the lua that contains the ZO_CreateStringId (of course also updated the txt file accordingly) and got an assert error message...
What do you mean they weren't recognized? They just didn't work or they just didn't show up in the keybindings list?
  Reply With Quote
01/03/16, 02:52 PM   #3
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Originally Posted by circonian View Post
Let's see if I understand this correctly. Are you saing that:
  1. The setting shows up in the keybinds list
  2. It works when you bind a key to It
  3. When you reload the UI the key is no longer bound
Exactly. Also when there was another key assigned before (e.g. replacing [N] with [M] in step 2) after UI reload it is completely reset (unasigned, not [N]).

Originally Posted by circonian View Post
What do you mean they weren't recognized? They just didn't work or they just didn't show up in the keybindings list?
All keybindings of the Bindings.xml file, including the custom category, were missing in the keybindings list. The rest of the add-on worked as intended (as far as I could tell).

What I did that started it all was deleting the file lang/Strings.lua and creating a new one res/Bindings.lua with the old ZO_CreateStringId and some additional code (as said previously, I also made those changes in the .txt file). The add-on loaded fine but when I pressed the key [M] that I had set in the previous version I got an assertion error something. I then realised that the category/keybindings were missing in the list. For fixing it I tried several things, including moving and editing the original file instead of creating a new one, changing the file encoding to UTF-8, restarting the game, etc. Don't know anymore what exactly solved that problem, but now the key seems to be bugged.

Last edited by CaptainBlagbird : 01/03/16 at 02:54 PM.
  Reply With Quote
01/03/16, 06:56 PM   #4
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Have you tried resetting the keybindings to default by clicking the reset to default buttons in the keybindings window, restart the game, & see if it works then?


You said something about a lang/Strings.lua, are these in some kind of language file? I've not messed with any of this, I don't know anything about it or even if its live yet, but could this have anything to do with it? An incorrect folder/file structure of the language file causing problems?
Full thread here: http://www.esoui.com/forums/showthread.php?p=24321#post24321
Originally Posted by ZOS_ChipHilseberg View Post
Over the past few weeks we have implemented a secure system to supply custom localizations for ESO. Here are the steps for setting up a custom localization:
  1. Choose a prefix for your language. Any two letter string is valid, but we would recommend sticking to the official language codes.
  2. In the addons folder make an “EsoUI” folder, and then a “lang” folder inside of that.
  3. Inside the “lang” folder make <prefix>_pregame.str and <prefix>_client.str files. These files will contain UTF-8 encoded text.
  4. Fill out the .str files with lines of the form: [<stringId>] = “text”. For example: [SI_ACCOUNT_NAME] = “Translated Account Name”.
  5. In the addons folder make a “gamedata” folder, and then a “lang” folder inside of that.
  6. Inside the “lang” folder place a translated <prefix>.lang file.
  7. Set the game language to your new prefix and the game will load your localization files.
The goal is to get this into the next patch right now. Please leave any questions or feedback here.

Last edited by circonian : 01/03/16 at 06:59 PM.
  Reply With Quote
01/04/16, 12:49 PM   #5
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Originally Posted by circonian View Post
Have you tried resetting the keybindings to default by clicking the reset to default buttons in the keybindings window, restart the game, & see if it works then?
Ah yes, thanks that fixed it. Haven't even thought of that xD

Originally Posted by circonian View Post
You said something about a lang/Strings.lua, are these in some kind of language file?
Ah sorry should have explained better, those were/are files in my add-on I was changing and that I meant in the thread title.
  Reply With Quote
01/09/16, 04:12 AM   #6
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Ok, now I have the original problem. Yesterday everything worked great, but when I logged in today (without changing the add-on code) the game didn't load one of the lua files anymore.

The add-on I'm talking about is Map Tools. All the lua files get loaded except res/Bindings.lua. (I checked this by using the slash comand /tp which is defined in src/SlashTravel.lua, /ping which is defined in src/MapPing.lua and also uses KeepPatterns.lua, /script d(GetString(SI_KEYBINDINGS_CATEGORY_MAPTOOLS)) for res/Bindings.lua and /script d(MapTools.name) for Init.lua.)

UI reload didn't help, moving/renaming the file dosn't help either and neither does downloading the add-on again with minion. Any idea what the problem could be? I don't think there is something wrong with the code, but maybe with the file itself or my client. I also converted each file to ANSI and UTF-8 (with and without BOM) but it made no difference.


Last edited by CaptainBlagbird : 01/09/16 at 04:23 AM.
  Reply With Quote
01/09/16, 06:40 AM   #7
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
Try to create a new MapTools.txt and only add the bare minimum on lines to see if it makes a difference. I had a similar problem in the past and after I created a new meta file it just went away.
  Reply With Quote
01/09/16, 07:26 AM   #8
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
I'm stupid

I did as you said, created a new MapTools.txt file, only containing the file list and nothing else (no copyright notice or manifest info). Reloaded ui. Oddly enough in the AddOn list the title was still formatted and there was a description/author etc...

Pretty obvious what the problem was, I had made a copy of the MapTools folder and renamed it for creating a new add-on based on the code. I guess I was interrupted right then and never continued, so there were still the original files in that folder. Then when I recently changed the file structure those two files weren't the same anymore obviously. So depending on which MapTools.txt ESO loaded first I got the bug or not

Well at least now I know that ESO wont compare folder and txt file name, and will use relative paths based on the manifest name. I think that even something like this would be possible:

Code:
AddOns/
│
├── MyManifests/
│   ├── MyAddOn1.txt
│   └── MyAddOn2.txt
│
├── MyAddOn1/
│   └── src.lua
│
└── MyAddOn2/
    └── src.lua

Edit:

Haha, check this out (attachment), multiple saved variables for "one add-on" (still multiple add-ons listed under ADDONS though)
Attached Files
File Type: zip MyMaster.zip (1.5 KB, 408 views)

Last edited by CaptainBlagbird : 01/09/16 at 08:10 AM.
  Reply With Quote
01/09/16, 10:01 AM   #9
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
Not what I expected, but as long as it works now.

Originally Posted by CaptainBlagbird View Post
Haha, check this out (attachment), multiple saved variables for "one add-on" (still multiple add-ons listed under ADDONS though)
Maybe Philgo can use it for MasterMerchant to reduce the amount of folders and duplicate files?
  Reply With Quote
01/09/16, 10:14 AM   #10
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Yeah, I also thought about that. He uses Lua files too though which have to be in the folder (or maybe .. is allowed in the file list?).

Edit:
yeah .. works too, e.g.:

Code:
../MyMaster/src.lua
I'll pm him.

Last edited by CaptainBlagbird : 01/09/16 at 10:20 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Key bindings of an add-on lost after UI reload


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off