vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- MetaMap Export Module |
2 | -- Written by MetaHawk aka Urshurak |
||
3 | |||
4 | MMEXP_USERKB = "UserKB"; |
||
5 | MMEXP_USERNOTES = "UserNotes"; |
||
6 | |||
7 | local Export_KB = "MetaKB"; |
||
8 | local Export_Notes = "MetaNotes"; |
||
9 | local KBcount = 0; |
||
10 | local Notecount = 0; |
||
11 | |||
12 | function MetaMapEXP_CheckData() |
||
13 | MetaMap_ImportHeader:SetTextColor(1,1,1); |
||
14 | MetaMap_ImportHeader:SetText("MetaMap Exports module loaded"); |
||
15 | MetaMap_ConfirmationHeader:SetText(METAMAPBLT_CONFIRM_EXPORT); |
||
16 | MetaMap_SelectionButton1:SetText(MMEXP_USERKB); |
||
17 | MetaMap_SelectionButton2:SetText(MMEXP_USERNOTES); |
||
18 | MetaMap_SelectionButton3:SetText("Both"); |
||
19 | if(not IsAddOnLoaded("MetaMapWKB")) then |
||
20 | LoadAddOn("MetaMapWKB"); |
||
21 | end |
||
22 | if(not IsAddOnLoaded("MetaMapWKB")) then |
||
23 | MetaMap_SelectionButton1:Disable(); |
||
24 | MetaMap_SelectionButton3:Disable(); |
||
25 | end |
||
26 | MetaMap_ConfirmationDialog:Show(); |
||
27 | end |
||
28 | |||
29 | function MetaMap_SelectedExport(mode) |
||
30 | local msg = ""; KBcount = 0; Notecount = 0; |
||
31 | if(mode == MMEXP_USERKB) then |
||
32 | MyNotes_Data = nil; |
||
33 | MyLines_Data = nil; |
||
34 | MetaMap_ExportKB(); |
||
35 | msg = format(METAMAPEXP_KB_EXPORTED, KBcount); |
||
36 | elseif(mode == MMEXP_USERNOTES) then |
||
37 | MyKB_Data = nil; |
||
38 | MetaMap_ExportMetaNotes(); |
||
39 | msg = format(METAMAPEXP_NOTES_EXPORTED, Notecount); |
||
40 | elseif(mode == "Both") then |
||
41 | MetaMap_ExportKB(); |
||
42 | MetaMap_ExportMetaNotes(); |
||
43 | msg = format(METAMAPEXP_KB_EXPORTED, KBcount).."\n"..format(METAMAPEXP_NOTES_EXPORTED, Notecount); |
||
44 | end |
||
45 | MetaMap_ConfirmationDialog:Hide(); |
||
46 | MetaMap_ImportHeader:SetTextColor(0,1,0); |
||
47 | MetaMap_ImportHeader:SetText(msg); |
||
48 | end |
||
49 | |||
50 | function MetaMap_ExportKB() |
||
51 | MyKB_Data = {}; |
||
52 | MyKB_Data[MetaKB_dbID] = {}; |
||
53 | for name, zone in MetaKB_Data[MetaKB_dbID] do |
||
54 | MyKB_Data[MetaKB_dbID][name] = MetaKB_Data[MetaKB_dbID][name]; |
||
55 | KBcount = KBcount +1; |
||
56 | end |
||
57 | end |
||
58 | |||
59 | function MetaMap_ExportMetaNotes() |
||
60 | MyNotes_Data = {}; |
||
61 | MyLines_Data = {}; |
||
62 | for continent=1, 2, 1 do |
||
63 | MyNotes_Data[continent] = {}; |
||
64 | for zone, zoneTable in MetaMapNotes_Data[continent] do |
||
65 | MyNotes_Data[continent][zone] = {}; |
||
66 | for i, value in MetaMapNotes_Data[continent][zone] do |
||
67 | MyNotes_Data[continent][zone][i] = MetaMapNotes_Data[continent][zone][i]; |
||
68 | Notecount = Notecount +1; |
||
69 | end |
||
70 | end |
||
71 | end |
||
72 | for continent=1, 2, 1 do |
||
73 | MyLines_Data[continent] = {}; |
||
74 | for zone, zoneTable in MetaMapNotes_Lines[continent] do |
||
75 | MyLines_Data[continent][zone] = {}; |
||
76 | for i, value in MetaMapNotes_Lines[continent][zone] do |
||
77 | MyLines_Data[continent][zone][i] = MetaMapNotes_Lines[continent][zone][i]; |
||
78 | end |
||
79 | end |
||
80 | end |
||
81 | end |