vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- MetaMapZSM (ZoneShifter for German and French clients)
2 -- Written by MetaHawk - aka Urshurak
3  
4 function MetaMapZSM_Init()
5 MetaMapZSM_InfoHeader:SetText(METAMAPZSM_NEW_VERSION);
6 for index, versions in MetaMapZSM_VersionData do
7 for version, value in versions do
8 local setButton = false;
9 if(GetLocale() == "deDE") then
10 if(DE_ZoneShift[version] ~= nil) then
11 setButton = true;
12 end
13 elseif(GetLocale() == "frFR") then
14 if(FR_ZoneShift[version] ~= nil) then
15 setButton = true;
16 end
17 end
18 if(setButton) then
19 getglobal("MetaMapZSM_ZoneShiftButton"..index):SetText("ZoneShift from "..value.old.." to "..value.new);
20 getglobal("MetaMapZSM_ZoneShiftButton"..index.."Version"):SetText(value.old);
21 getglobal("MetaMapZSM_ZoneShiftButton"..index):Show();
22 if(MetaMapOptions.ZoneShiftVersion >= value.new) then
23 getglobal("MetaMapZSM_ZoneShiftButton"..index):Disable();
24 getglobal("MetaMapZSM_ZoneShiftButton"..index.."SkipShift"):Hide();
25 else
26 getglobal("MetaMapZSM_ZoneShiftButton"..index):Enable();
27 getglobal("MetaMapZSM_ZoneShiftButton"..index.."SkipShift"):Show();
28 end
29 end
30 end
31 end
32 if(MetaMapOptions.ZoneShiftVersion == METAMAP_TOC) then
33 MetaMapZSM_InfoHeader:SetText(METAMAPZSM_NO_SHIFT);
34 MetaMapZSM_Update:Disable();
35 end
36 end
37  
38 function MetaMapZSM_OnClick(id, button)
39 if(not IsAddOnLoaded("MetaMapWKB")) then
40 LoadAddOn("MetaMapWKB");
41 end
42 local newShift = MetaMapZSM_VersionData[button][id].new;
43 MetaMapZSM_Convert(newShift);
44 MetaMapOptions.ZoneShiftVersion = newShift;
45 MetaMapZSM_Init();
46 end
47  
48 function MetaMapZSM_Convert(newShift)
49 local temp = {}
50 for z=1, 2, 1 do
51 for index, value in MetaMapNotes_Data[z] do
52 if(GetLocale() == "deDE" and type(z) ~= "string") then
53 temp[DE_ZoneShift[newShift][z][index]] = value;
54 elseif(GetLocale() == "frFR" and type(z) ~= "string") then
55 temp[FR_ZoneShift[newShift][z][index]] = value;
56 end
57 end
58 MetaMapNotes_Data[z] = {};
59 for index, value in temp do
60 MetaMapNotes_Data[z][index] = value;
61 end
62 temp = {};
63 end
64 temp = {};
65 for z=1, 2, 1 do
66 for index, value in MetaMapNotes_Lines[z] do
67 if(GetLocale() == "deDE") then
68 temp[DE_ZoneShift[newShift][z][index]] = value;
69 elseif(GetLocale() == "frFR") then
70 temp[FR_ZoneShift[newShift][z][index]] = value;
71 end
72 end
73 MetaMapNotes_Lines[z] = {};
74 for index, value in temp do
75 MetaMapNotes_Lines[z][index] = value;
76 end
77 temp = {};
78 end
79 temp = {};
80 if(MetaKB_Data) then
81 for name, continentTable in MetaKB_Data[MetaKB_dbID] do
82 for continent, zoneTable in continentTable do
83 for zone, value in zoneTable do
84 if(GetLocale() ~= "deDE") then
85 temp[DE_ZoneShift[newShift][continent][zone]] = value;
86 elseif(GetLocale() == "frFR") then
87 temp[FR_ZoneShift[newShift][continent][zone]] = value;
88 end
89 end
90 MetaKB_Data[MetaKB_dbID][name][continent] = {};
91 for index, value in temp do
92 MetaKB_Data[MetaKB_dbID][name][continent][index] = value;
93 end
94 temp = {};
95 end
96 end
97 end
98 MetaMapZSM_InfoHeader:SetText(format(METAMAPZSM_UPDATE_DONE, newShift));
99 end
100  
101 MetaMapZSM_VersionData = {
102 [1] = {
103 [11000] = {
104 ["old"] = 11000,
105 ["new"] = 11100,
106 },
107 },
108 [2] = {
109 [11100] = {
110 ["old"] = 11100,
111 ["new"] = 11200,
112 },
113 },
114 }
115  
116 -- German ZoneShift
117 DE_ZoneShift = {
118 [11000] = {
119 [0] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },
120 [1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 },
121 [2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },
122 },
123 [11100] = {
124 [0] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },
125 [1] = { 1, 2, 4, 3, 14, 20, 5, 9, 6, 7, 8, 10, 11, 12, 13, 15, 17, 18, 16 ,19, 21 },
126 [2] = { 1, 2, 7, 10, 15, 24, 6, 13, 21, 16, 20, 3, 12, 19, 23, 25, 4, 5, 8, 9, 14, 11, 17, 18, 22 },
127 },
128 [11200] = {
129 [0] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },
130 [1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 },
131 [2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },
132 },
133 }
134 -- French ZoneShift
135 FR_ZoneShift = {
136 [11000] = {
137 [0] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },
138 [1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 },
139 [2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },
140 },
141 [11100] = {
142 [0] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },
143 [1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 },
144 [2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },
145 },
146 [11200] = {
147 [0] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },
148 [1] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 },
149 [2] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 },
150 },
151 }