vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- MetaKB 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_LoadImportsButton:Disable();
16 MetaMap_ConfirmationHeader:SetText(METAMAPBLT_CONFIRM_EXPORT);
17 MetaMap_SelectionButton1:SetText(MMEXP_USERKB);
18 MetaMap_SelectionButton2:SetText(MMEXP_USERNOTES);
19 MetaMap_SelectionButton3:SetText("Both");
20 MetaMap_ConfirmationDialog:Show();
21 end
22  
23 function MetaMap_SelectedExport(mode)
24 local msg = "";
25 if(mode == MMEXP_USERKB) then
26 MyNotes_Data = nil;
27 MyLines_Data = nil;
28 MetaMap_ExportKB();
29 msg = format(METAMAPEXP_KB_EXPORTED, KBcount);
30 elseif(mode == MMEXP_USERNOTES) then
31 MyKB_Data = nil;
32 MetaMap_ExportMetaNotes();
33 msg = format(METAMAPEXP_NOTES_EXPORTED, Notecount);
34 elseif(mode == "Both") then
35 MetaMap_ExportKB();
36 MetaMap_ExportMetaNotes();
37 msg = format(METAMAPEXP_KB_EXPORTED, KBcount).."\n"..format(METAMAPEXP_NOTES_EXPORTED, Notecount);
38 end
39 MetaMap_ConfirmationDialog:Hide();
40 MetaMap_ImportHeader:SetTextColor(0,1,0);
41 MetaMap_ImportHeader:SetText(msg);
42 MetaMap_LoadExportsButton:Disable();
43 end
44  
45 function MetaMap_ExportKB()
46 MyKB_Data = {};
47 MyKB_Data[MetaKB_dbID] = {};
48 for name, zone in MetaKB_Data[MetaKB_dbID] do
49 MyKB_Data[MetaKB_dbID][name] = MetaKB_Data[MetaKB_dbID][name];
50 KBcount = KBcount +1;
51 end
52 end
53  
54 function MetaMap_ExportMetaNotes()
55 MyNotes_Data = {};
56 MyLines_Data = {};
57 for continent=1, 2, 1 do
58 MyNotes_Data[continent] = {};
59 for zone, zoneTable in MetaMapNotes_Data[continent] do
60 MyNotes_Data[continent][zone] = {};
61 for i, value in MetaMapNotes_Data[continent][zone] do
62 MyNotes_Data[continent][zone][i] = MetaMapNotes_Data[continent][zone][i];
63 Notecount = Notecount +1;
64 end
65 end
66 end
67 for continent=1, 2, 1 do
68 MyLines_Data[continent] = {};
69 for zone, zoneTable in MetaMapNotes_Lines[continent] do
70 MyLines_Data[continent][zone] = {};
71 for i, value in MetaMapNotes_Lines[continent][zone] do
72 MyLines_Data[continent][zone][i] = MetaMapNotes_Lines[continent][zone][i];
73 end
74 end
75 end
76 end