vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- update code by Brodrick (aka Kirov) |
2 | -- database based off of one posted here http://ui.worldofwar.net/users.php?id=163022, cleaned up duplicated links. |
||
3 | |||
4 | local function CopyTable(copyTable) |
||
5 | if ( not copyTable ) then return; end |
||
6 | if ( type(copyTable) ~= "table" ) then |
||
7 | return copyTable; |
||
8 | end |
||
9 | |||
10 | local returnTable = {}; |
||
11 | for k, v in copyTable do |
||
12 | if type(v) == "table" then |
||
13 | returnTable[k] = CopyTable(v); |
||
14 | else |
||
15 | returnTable[k] = v; |
||
16 | end |
||
17 | end |
||
18 | return returnTable; |
||
19 | end |
||
20 | |||
21 | function UpdateLootLinkDB() |
||
22 | ScriptErrors:Hide(); |
||
23 | LootLinkAddDB_Frame:Hide(); |
||
24 | if ( LootLinkState["DataVersion"] == 110 ) then |
||
25 | |||
26 | if ( not LLDBItemLinks ) then |
||
27 | message( "This has already been run once this session, it cannot be run a second time. Reenable mod and reload if you really want to use it again." ); |
||
28 | return; |
||
29 | end |
||
30 | |||
31 | |||
32 | local items, newitems, newvals, servers = 0, 0, 0; |
||
33 | if ( not LLS_SPOOF ) then |
||
34 | DEFAULT_CHAT_FRAME:AddMessage("LootLinkAddDB: Using LootLink Enhanced!"); |
||
35 | if ( LootLinkState.ServerNamesToIndices ) then |
||
36 | for k, v in LootLinkState.ServerNamesToIndices do |
||
37 | if ( servers ) then |
||
38 | servers = servers.." "..v; |
||
39 | else |
||
40 | servers = v; |
||
41 | end |
||
42 | end |
||
43 | end |
||
44 | end |
||
45 | |||
46 | for k, v in LLDBItemLinks do |
||
47 | items = items+1; |
||
48 | if ( not ItemLinks[k] ) then |
||
49 | ItemLinks[k] = CopyTable(v); |
||
50 | newitems = newitems + 1; |
||
51 | if ( servers ) then |
||
52 | ItemLinks[k].s = servers; |
||
53 | end |
||
54 | else |
||
55 | for key, val in LLDBItemLinks[k] do |
||
56 | if ( key == "s" and servers ) then |
||
57 | ItemLinks[k].s = servers; |
||
58 | elseif ( key == "m" and LSS_SPOOF ) then |
||
59 | ItemLinks[k].m = CopyTable(val); |
||
60 | newitems = newitems + getn(val); |
||
61 | elseif ( key == "t" ) then |
||
62 | if ( ItemLinks[k].t and ItemLinks[k].t == "" ) then |
||
63 | ItemLinks[k].t = val; |
||
64 | newvals = newvals + 1; |
||
65 | end |
||
66 | elseif ( not ItemLinks[k][key] ) then |
||
67 | ItemLinks[k][key] = CopyTable(val); |
||
68 | newvals = newvals + 1; |
||
69 | end |
||
70 | end |
||
71 | end |
||
72 | end |
||
73 | LootLinkAddDB_Saved = 1; |
||
74 | message( "|cffffffffDone updating LootLink 1.9+\n"..newitems.." new items added\nLootLink Database Adder should be removed or disabled." ) |
||
75 | DEFAULT_CHAT_FRAME:AddMessage("LootLinkAddDB: "..newitems.." new items added, updated "..newvals.." existing items with missing information.") |
||
76 | LLDBItemLinks = nil; |
||
77 | else |
||
78 | message( "Your LootLink is the wrong version, this addon will only work with LootLink 1.9 and compatible versions." ); |
||
79 | end |
||
80 | end |