shirsig / aux-addon

Auction House addOn for Classic (1.13) IMPORTANT: The folder name must be "aux-addon" IMPORTANT: The Vanilla (1.12) version moved here https://github.com/shirsig/aux-addon-vanilla
https://www.curseforge.com/wow/addons/aux
196 stars 42 forks source link

add dynamic filter dropdown #329

Closed Artur91425 closed 3 years ago

Artur91425 commented 3 years ago

Since the ability to select the slot depends on the selection of the subclass, and the selection of the subclass depends on the selection of the class, then there is no need to constantly display these dropdown lists. Therefore, I made their hide when they cannot be used. And to look beautifully I added changing the point for the dropdown list of quality.

Demonstration: https://youtu.be/dVb9fKFBeXY

Artur91425 commented 3 years ago

Oh, I pressed the wrong button xD. I wanted to add just a comment)

Artur91425 commented 3 years ago

So far, do not merge this PR. I did not make the handling after clicking "Exact" checkbutton.

Artur91425 commented 3 years ago

now it works correctly

Artur91425 commented 3 years ago

I do not know in the WoW 2.1.5 there is a SetShown method. As far as I know, all APIs have been moved from version 9.x (Shadowlends) so most likely there is this method. If so, then can simplify the code slightly: Instead this

    if class_dropdown:IsShown() and subclass_dropdown:GetIndex() then
        subclass_dropdown:Show()
    else
        subclass_dropdown:Hide()
    end

and this

    if subclass_dropdown:IsShown() and slot_dropdown:GetIndex() then
        slot_dropdown:Show()
    else
        slot_dropdown:Hide()
    end

Can be written one line subclass_dropdown:SetShown(class_dropdown:IsShown() and subclass_dropdown:GetIndex()) and slot_dropdown:SetShown(subclass_dropdown:IsShown() and slot_dropdown:GetIndex())

shirsig commented 3 years ago

Looks nice. Just one thing, I've been meaning to look into this for a while: In the vanilla version of aux it was possible to select a slot without selecting a subclass. I removed this when porting to classic, but I don't remember if I did that because it was not possible anymore or just because it was easier this way and I was in a hurry to get it done. Would you know by any chance? This has been requested before and I just recently found out myself that this would be quite useful, playing a healer with mail/plate and looking for boe items with healing that could also be cloth/leather/mail. If this is still possible somehow that would change the requirements for this dropdown logic.

shirsig commented 3 years ago

Checked and it doesn't seem to be possible. Merging this then. Thanks!