Thread Tools Display Modes
12/03/14, 01:32 PM   #61
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Ok, thanks again, I'll give it a try this way.

After my tries:
I'm not able to prehook the function SetMode of ZO_Smithing or SMITHING.

I've tried it in several ways, searched for aliases to use. But there are none as it seems.
The way I know it should work does nothing:
Lua Code:
  1. ZO_PreHook("ZO_Smithing", "SetMode", function(mode)
  2. ...
  3. end)

Ok, my fault. Or let's say another feature
I forgot to remove the "" around ZO_Smithing :-(
And the function needs another parameter before mode (holding the SMITHING object).


Correct call:

Lua Code:
  1. --Prehook the smithing function SetMode() which gets executed as the smithing tabs are changed
  2.     ZO_PreHook(ZO_Smithing, "SetMode", function(smithing_obj, mode)
  3.  
  4.         d("[ZO_Smithing:SetMode] Mode: " .. tostring(mode), true)
  5.         if     mode == SMITHING_MODE_REFINMENT then
  6.             d("REFINEMENT")
  7.         elseif mode == SMITHING_MODE_CREATION then
  8.             d("CREATION")
  9.         elseif mode == SMITHING_MODE_IMPROVEMENT then
  10.             d("IMPROVEMENT")
  11.         elseif mode == SMITHING_MODE_DECONSTRUCTION then
  12.             d("DECONSTRUCTION")
  13.         elseif mode == SMITHING_MODE_RESEARCH then
  14.             d("RESEARCH")
  15.         else
  16.             d("SMITHING")
  17.         end
  18.         return false
  19.     end)

Last edited by Baertram : 12/03/14 at 02:40 PM.
  Reply With Quote
12/03/14, 04:30 PM   #62
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by merlight View Post
@Randactyl
I'm running out of ideas. Tried to reproduce what BigM wrote about Sell in comments, but for me it works (now). It'll be some stupid obvious bug, obvious bugs are hard to find, they look like features
I am too. Obvious things are the worst :P

Originally Posted by merlight View Post
Repeated, only instead of Zgoo I dumped the values to debug window. (summary: everything looks ok to me)

I see correct values there. For me AF now works in bank, sell, mail.
The only issue I'm aware of now is that when I switch the top filter from e.g. Weapons to All and back to Weapons, subfilter dropdown doesn't appear.
Okay, so this is the latest available release of AF that works along with libFilters 11.2 (which will be 12 moving forward) that was included? No modifications?

And yeah, I've been wrestling with that Houdini dropdown for a while but no one has really reported it.
  Reply With Quote
12/03/14, 04:58 PM   #63
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by merlight View Post
... obvious bugs are hard to find, they look like features
What I said, a LibStub feature we were not aware of got us
  Reply With Quote
12/03/14, 05:07 PM   #64
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
Yes and no. Advanced Filters change filters when the tab changes, in which case the inventory list is rebuilt anyway, so in AF this step could be avoided. But Item Saver has icons in the bottom of the inventory, which when toggled change the rules, and so they need to force inventory refresh.
Ah i see now. I didn't think of that.
  Reply With Quote
12/03/14, 06:00 PM   #65
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Originally Posted by merlight View Post
What I said, a LibStub feature we were not aware of got us
Stupid and too simple to catch by eye
  Reply With Quote
12/03/14, 07:25 PM   #66
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Originally Posted by Randactyl View Post
And yeah, I've been wrestling with that Houdini dropdown for a while but no one has really reported it.
The dropdownbox seems only to hide if you:
I've tested the following at a vendor's sell panel:

1. Click on any of the inventory buttons, e.g. "Weapons" (the "All" subfilter button of AdvancedFilters will be automatically selected) except the "All" inventory button
2. Click on the "All" inventory button
3. Click again on the SAME inventory button you have been at 1. (in my example "Weapons")

or

1. Click on any of the inventory buttons, e.g. "Weapons" (the "All" subfilter button of AdvancedFilters will be automatically selected) except the "All" inventory button
2. Close the vendor
3. Talk to the same vendor again -> The sell panel will be opened automatically at the last inventory button you have chosen at 1. (in my example "Weapons")

Checking your source code the dropdown is created and made invisible.
As someone clicks the button of a subfilter the dropdown will change the content and will be made visible.
But only if the button is not the last pressed button from before and some other stuff applies.

I modified your function AdvancedFilterGroup:AddSubfilter a bit:
Lua Code:
  1. function AdvancedFilterGroup:AddSubfilter( name, icon, callback, dropdownCallbacks, dropdownWidth )
  2. ...
  3.  
  4.     subfilter.dropdown = nil
  5.  
  6. --Dropdown will be created and made invisible here
  7.     if(dropdownCallbacks) then
  8.         dropdown = self:AddDropdownFilter( subfilter, dropdownCallbacks, dropdownWidth )
  9.     end
  10.  
  11.     local button = WINDOW_MANAGER:CreateControl( subfilter:GetName() .. "Button", subfilter, CT_BUTTON )
  12.     button:SetAnchor(TOPLEFT, subfilter, TOPLEFT)
  13.     button:SetDimensions(ICON_SIZE, ICON_SIZE)
  14.  
  15. --I modified the handler callback function. The dropdown SetHidden(false) was moved before the
  16. --check against "innerSelf == currentSelected", and was asked to only show if hidden
  17.     button:SetHandler("OnClicked", function(innerSelf)
  18.             if(not subfilter.isActive) then return end
  19. --Moved up and enhanced by IsHidden() check here           
  20. if(subfilter.dropdown and subfilter.dropdown:IsHidden()) then
  21.                 subfilter.dropdown:SetHidden(false)
  22.             end
  23.             if(innerSelf == currentSelected) then return end
  24.             self:ChangeLabel(tooltipSet[name])
  25.             MoveHighlightToMe(innerSelf)
  26.             OnClickedCallback(innerSelf)
  27.         end)
  28.     button.filterCallback = callback

It seems to work now. The dropdownbox is shown properly for the subfilters in both scenarios i've tested above. But it was not tested everywhere!
Maybe it helps you find the bug.

Last edited by Baertram : 12/03/14 at 07:51 PM.
  Reply With Quote
12/03/14, 07:28 PM   #67
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by Baertram View Post
I modified your function AdvancedFilterGroup:AddSubfilter a bit
Hey thanks, I'll check this out.

edit: seems to work

Last edited by Randactyl : 12/04/14 at 01:14 PM.
  Reply With Quote
12/05/14, 08:58 AM   #68
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Originally Posted by Randactyl View Post
Hey thanks, I'll check this out.

edit: seems to work
Good, glad I could help.
  Reply With Quote
12/30/14, 05:18 PM   #69
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Thumbs up Very Interesting Stuff!

So I've been following the thread since it was first posted, until today & yesterday most of it was flying over my head due to lack of understanding in lua. You guys however have helped immensely in that respect just from this discussion!

Out of curiosity, more to make sure I haven't missed anything, what is the current state of the performance issue in which this thread was created?
  Reply With Quote
12/31/14, 12:12 PM   #70
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by BornDownUnder View Post
So I've been following the thread since it was first posted, until today & yesterday most of it was flying over my head due to lack of understanding in lua. You guys however have helped immensely in that respect just from this discussion!

Out of curiosity, more to make sure I haven't missed anything, what is the current state of the performance issue in which this thread was created?
Glad it helped!

To my knowledge, the issue is more or less resolved. Advanced Filters and FCO ItemSaver are no longer at odds - credit for which goes to those who helped me fix things in libFilters, the full rewrite of FCO, and other fixes in Advanced Filters.
  Reply With Quote
01/01/15, 07:32 PM   #71
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Thumbs up

Originally Posted by Randactyl View Post
Glad it helped!

To my knowledge, the issue is more or less resolved. Advanced Filters and FCO ItemSaver are no longer at odds - credit for which goes to those who helped me fix things in libFilters, the full rewrite of FCO, and other fixes in Advanced Filters.
That is great to hear! And glad that my thoughts were pretty much spot on in regards to the state of the issue.
  Reply With Quote
01/02/15, 03:17 PM   #72
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Hey BornDownUnder,

glad to read it helped you too somwhow.

I copy Randactyl: The performance issues were solved after a rewrite of libFilters and changes to AdvancedFilters + FCOItemSaver.

There might be still some smaller issues with the addons sometimes but as far as I know they run stable and much faster then they did some weeks ago.

Happy new year :-)
  Reply With Quote
01/02/15, 07:20 PM   #73
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Thumbs up

Originally Posted by Baertram View Post
... they run stable and much faster then they did some weeks ago.
I have noticed with AF and Randactyls ItemSaver (I haven't bothered porting to FCO yet as am playing around with current group addon maintenance in preperation for a stand-alone creation) that the switch between filters whilst it wasn't bad during fast multiple switches there was a slight hitching when there were alot of items. That hitching is no longer present at all though I haven't really pushed the code...

Originally Posted by Baertram View Post
glad to read it helped you too somwhow.
Been trying to stretch my neurons to work with lua and this particular api, haven't done anything like this for years and back then was on a really really small scale.

It has helped immensely as I've been reading code instead of trying to implement code, with the constant updating of this thread whilst you guys were working it out... Especially with the posting of code and changes.

Last edited by BornDownUnder : 01/02/15 at 07:22 PM. Reason: Typos and grammar nazi got the better of me
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » [Need help pls] Find slowdown bug at Advanced Filters & FCOItemSaver addons


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