UI failure
I've been experiencing some partial UI failure with an addon I've been working on, but I was able to reproduce the issue in a much smaller example. Using the example's functionality:
Test.txt Code:
;Test Code:
local Test = { |
This is a problem of leaking variables.
When an addon break something which have no relation with the thing which is broken, it's 99% times this. Here is a better code, even untested you were leaking Test, i, out variables. also please avoid using ";" in lua. it's accepted, but not recommended for readibility. I know that 99% of new devs come from php or webdev.. but in this language ";" is not mandatory, just use carriage return as other good practice, I would not capitalize var names, but only functions names avoid t, i, j, k and other tiny names. we're in a world where you have 75% chances that your project will be looked / used / served as reference / rewrited by someone else. avoid doing function xxx.yyy() byt only local function yyy() when this function is not required to be used in another file. even if for those two, it's my personal choices :) Lua Code:
|
Thanks for the pointers, but the failure still happens. I updated the first post with several mentioned changes, so if you see anything that would be leaking now, that'd be appreciated.
|
What exactly do you mean with a "partial UI failure"? do you get an error message, or does it change its look? Can you post some screenshots/videos please?
p.s. sidTools has a command "/st items" which allows you to manipulate item links freely. Maybe you should take a look at that. |
I'm not actually concerned with messing with the item link, it was just a way of reproducing the issue. There isn't a visible error, but part of the keyboard (e.g. Esc, F, X, R functionality) and clicking (trying to tele to a wayshrine, click on mail) stops registering. Nothing happens, at all. So in order to fix it, you have to use "/reloadui" or "/logout" since you can't even access the logout option in the menu.
|
Are you sure it's your code doing this ? The whole addon could help too.
|
The main addon is much larger, but this piece of code as its own addon can cause the same failure. It also only happens after executing the code (not by simply having the addon enabled) and it is 100% reproducable.
|
Try to remove the chat_system function (comment it) and see if it's related to the chat output.
Decomment line for line or change the variable contents to simple values (like "hello") and see if this changes anything. From the code snippet we are not able to find this error. We'd need the whole addon code to test it and "debug". Did you turn off all other addons and the error will occur too? |
I'll try those suggestions tonight.
Quote:
|
I just did a 10min vid long to figure that .. this code don't break anything.
A vid, some clues ? this code can't break ui. |
None of the other addons I'm using have ever caused this issue directly themselves, but tonight I'll disable them all one by one and see if this addon will still cause the issue.
Edit: Has there been maintenance since I first posted this thread? I can't reproduce the problem anymore either. I'll post if it comes back, but I've been trying to cause it repeatedly and it doesn't happen. |
All times are GMT -6. The time now is 05:22 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI