vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | |||
3 | FilterKnown |
||
4 | By Robert Jenkins (Merrem@Perenolde) |
||
5 | |||
6 | Colors "Already known" items blue in the auction house. |
||
7 | |||
8 | ]] |
||
9 | |||
10 | FILTERKNOWN_VERSION = "1.03"; |
||
11 | |||
12 | AlreadyKnown_ORIG_AuctionFrameBrowse_Update = nil; |
||
13 | |||
14 | function FilterKnown_Update() |
||
15 | |||
16 | -- Do original update. |
||
17 | if ( AlreadyKnown_ORIG_AuctionFrameBrowse_Update ) then |
||
18 | AlreadyKnown_ORIG_AuctionFrameBrowse_Update(); |
||
19 | end |
||
20 | |||
21 | local offset = FauxScrollFrame_GetOffset(BrowseScrollFrame); |
||
22 | local index, x, i; |
||
23 | local info, num_lines; |
||
24 | |||
25 | for i=1, NUM_BROWSE_TO_DISPLAY do |
||
26 | index = offset + i; |
||
27 | |||
28 | FilterKnownTooltip:SetAuctionItem("list", index); |
||
29 | |||
30 | info = ""; |
||
31 | num_lines = FilterKnownTooltip:NumLines(); |
||
32 | |||
33 | -- Check at most 4 lines. |
||
34 | if num_lines > 4 then |
||
35 | num_lines = 4; |
||
36 | end |
||
37 | |||
38 | for x=2, num_lines do |
||
39 | info = info .. "\n" .. getglobal("FilterKnownTooltipTextLeft" .. x):GetText(); |
||
40 | end |
||
41 | |||
42 | if info ~= "" and string.find(info, ITEM_SPELL_KNOWN) then |
||
43 | -- Set color of icon to blue to make it easy to see that you already know it. |
||
44 | iconTexture = getglobal("BrowseButton"..i.."ItemIconTexture"); |
||
45 | iconTexture:SetVertexColor(0.1, 0.1, 1.0); |
||
46 | end |
||
47 | end |
||
48 | end |
||
49 | |||
50 | function FilterKnown_OnLoad() |
||
51 | AlreadyKnown_ORIG_AuctionFrameBrowse_Update = AuctionFrameBrowse_Update; |
||
52 | AuctionFrameBrowse_Update = FilterKnown_Update; |
||
53 | end |