09-06-14, 07:41 PM | #1 |
Chicchai and docked chat frames
I was recently told one of my favorite AddOns, Chicchai, still worked. I downloaded and installed it, and it does! But, not without bugs as is expected of a 4 year old AddOn.
My problem is with docked chat frames, as the title says. The AddOn works perfectly fine if you undock every chat window, but the second you dock any you run into an error and the addon stops working correctly. This is the error Code:
Message: Interface\AddOns\Chicchai\core.lua:182: attempt to index local 'self' (a nil value) Time: 09/07/14 03:40:40 Count: 1 Stack: Interface\AddOns\Chicchai\core.lua:182: in function `updateHeight' Interface\AddOns\Chicchai\core.lua:224: in main chunk Lua Code:
Does anyone know how to fix this? EDIT: Found another error! When switching to the docked chat frames, it throws this error. And it throws it a lot. Code:
Message: Interface\AddOns\Chicchai\core.lua:155: attempt to index local 'self' (a nil value) Time: 09/07/14 03:42:21 Count: 166 Stack: [C]: ? Interface\AddOns\Chicchai\core.lua:155: in function <Interface\AddOns\Chicchai\core.lua:153>
__________________
All I see is strobe lights blinding me in my hindsight. |
|
09-07-14, 10:30 AM | #2 |
I'm not going to fine-tooth comb the code, but this chunk at line 180 doesn't look like it should work correctly.
Code:
local function updateHeight(self) local self = getChicchai(self) if(self.State ~= DOWN) then return end self.Frame:ScrollToBottom() self.Frame:SetHeight(getMinHeight(self.Frame)) end
If I understand that chunk correctly, using different names that are descriptive, it goes like this: Hey function, here is Bob. Now use a Star Trek transporter to make a copy of Bob, and assign Bob's copy the DNA of Bob's uncle Tony, but still call the copy Bob. Bob is still here, and we have a copy of Bob that looks like Tony. Bob isn't doing anything, so he sits down and reads a book. Tony looks around confused, thinking he is in the wrong home, and has no clue why. Meanwhile BobTony is feeling emotional, but only sticks around if he is feeling down. If he is feeling up, he bolts and goes plays some Diablo III. Smart guy, BobTony! On track, add some debug prints before and after line 181. Both should print out the value of self. See what you get. Last edited by myrroddin : 09-07-14 at 10:43 AM. Reason: Silly narrative? |
|
09-07-14, 10:42 AM | #3 | |
This chunk at line 151 throws an error sometimes too, and stops the chat frame from being maximized on mouseover. It works after a reload though, so I'm not sure what's wrong. Lua Code:
__________________
All I see is strobe lights blinding me in my hindsight. |
||
09-07-14, 10:50 AM | #4 |
Yeah, that line 151 bit is horrendous. That should be using OnEnter and OnLeave scripts.
I'm thinking this whole AddOn is an example of what not to do when writing code, and depending on what the AddOn does (sorry, haven't checked yet), might be worth rewriting from scratch. Hmm, it needs a complete rewrite regardless; I was musing the worthiness of the venture. |
|
09-07-14, 10:55 AM | #5 |
I think this AddOn will have to be rewritten for WoD, as I seem to recall there will be enough changes to various APIs such as animation that it won't work in its current state.
|
|
09-07-14, 12:23 PM | #6 | ||
To save you the trouble, the addon minimizes the chat to only show 1 message at a time, unless you get a message in a specified channel (Party chat, for example) or on mouseover at which point it maximizes. Like so: http://gyazo.com/48a052d00ae238ae044634b94bb371a3 I recommend switching to MP4 at the top.
__________________
All I see is strobe lights blinding me in my hindsight. Last edited by Wimpface : 09-07-14 at 12:29 PM. |
|||
10-11-14, 03:47 PM | #7 |
I don't know how relevant this still is; I use Chiccai as well - without errors. And it worked on WoD as well... Just saying
Attached my version... Yes I do intend to rewrite it one of these days. |
|
WoWInterface » Developer Discussions » Lua/XML Help » Chicchai and docked chat frames |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|