vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- these are used for KeyBindings:
2 BINDING_HEADER_TRADEDISPENSER=tD_Loc.KeyBindings.header;
3 BINDING_NAME_TRADEDISPENSER1=tD_Loc.KeyBindings[1];
4 BINDING_NAME_TRADEDISPENSER2=tD_Loc.KeyBindings[2];
5 BINDING_NAME_TRADEDISPENSER3=tD_Loc.KeyBindings[3];
6 BINDING_NAME_TRADEDISPENSER4=tD_Loc.KeyBindings[4];
7  
8  
9 -- these blocks are used to initialize tradeDispenser.
10 if (not tradeDispenserProfileColors) then
11 tradeDispenserProfileColors = { -- used to colorize the select-profile-buttons
12 [1] = { ["r"] = 1, ["g"] = 1, ["b"] = 1, }, -- all classes = white
13 [2] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, }, -- classes = light blue
14 [3] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
15 [4] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
16 [5] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
17 [6] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
18 [7] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
19 [8] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
20 [9] = { ["r"] = 0.5,["g"] = 0.5,["b"] = 1, },
21 [10] = { ["r"] = 1, ["g"] = 0.6,["b"] = 0, }, -- groups = orange
22 [11] = { ["r"] = 1, ["g"] = 0.6,["b"] = 0, },
23 [12] = { ["r"] = 1, ["g"] = 0.6,["b"] = 0, },
24 }
25 end
26  
27 if (not tradeDispenserRackColor) then
28 tradeDispenserRackColor = {
29 [1] = {
30 ["text"] = "|cFF00FF00",
31 ["r"] = 0.65, ["g"]= 1, ["b"] = 0.65,
32 },
33 [2] = {
34 ["text"] = "|cFFFFFF33",
35 ["r"] = 1, ["g"]= 1, ["b"] = 0.33,
36 },
37 [3] = {
38 ["text"] = "|cFFFF1100",
39 ["r"] = 1, ["g"]= 0.7, ["b"] = 0.7,
40 },
41 }
42 end
43  
44  
45 if (not tradeDispenserChannelColors) then
46 tradeDispenserChannelColors = {
47 [1] = { ["r"] = 1, ["g"] = 1, ["b"]=1, ["text"]=tD_Loc.channel.say },
48 [2] = { ["r"] = 1, ["g"] = 0, ["b"]=0, ["text"]=tD_Loc.channel.yell },
49 [3] = { ["r"] = 1, ["g"] = 0.5, ["b"]=0, ["text"]=tD_Loc.channel.raid },
50 [4] = { ["r"] = 0.4, ["g"] = 0.4, ["b"]=1, ["text"]=tD_Loc.channel.party },
51 [5] = { ["r"] = 0.1, ["g"] = 1, ["b"]=0.1, ["text"]=tD_Loc.channel.guild },
52 }
53 end
54  
55 tradeDispenser_MaxBroadcastLength = 30; -- minutes
56  
57  
58  
59 if (not tD_Temp) then
60 tD_Temp = {} -- this datafield is used to store all the temporary datas - they should be erased after relog / logout / reloadui
61 tD_Temp.Slot = {
62 [1]=nil, [2]=nil, [3]=nil, [4]=nil, [5]=nil, [6]=nil
63 }
64 tD_Temp.Scroll = { }
65 tD_Temp.Scroll.start = 1;
66 tD_Temp.RegUser = {
67 [0] = { ["name"]="empty", ["trades"]=0 }
68 };
69 end
70  
71  
72 if (not tD_GlobalDatas) then
73 tD_GlobalDatas = {} -- defines an empty datafield
74 tD_CharDatas = {}
75 tD_CharDatas.OSD={}
76 end
77  
78  
79  
80 function tradeDispenser_OnVariablesLoaded()
81 local tD_Name=UnitName("player").." of "..GetRealmName();
82 if (tD_Datas~=nil) then
83 if (tD_Datas[tD_Name]~=nil) then
84 tD_CharDatas = tD_Datas[tD_Name];
85 tD_Datas[tD_Name]=nil;
86 end
87 if (tD_Datas.Verbose~=nil) then
88 tD_GlobalDatas.Verbose = tD_Datas.Verbose;
89 tD_Datas.Verbose=nil;
90 end
91 if (tD_Datas.Bannlist~=nil) then
92 tD_GlobalDatas.Bannlist = tD_Datas.Bannlist;
93 tD_Datas.Bannlist=nil;
94 end
95 if (tD_Datas.whisper~=nil) then
96 tD_GlobalDatas.whisper = tD_Datas.whisper;
97 tD_Datas.whisper=nil;
98 end
99 end
100 if (tD_GlobalDatas.dataVersion ~= configDataVersion) then tD_GlobalDatas.dataVersion=configDataVersion; end
101 if (not tD_GlobalDatas.Verbose) then tD_GlobalDatas.Verbose=0 end
102 if (not tD_GlobalDatas.Bannlist) then tD_GlobalDatas.Bannlist = { } end
103  
104 if (tD_CharDatas.profile and tD_CharDatas.profile[1] and tD_CharDatas.profile[1]["Charge"]) then
105 local i, temp;
106 temp = {}
107 for i=1,12 do
108 temp[i] = {
109 ["Charge"] = 0,
110 [1] = {}, [2] = {}, [3]= {}, [4]={}, [5]={}, [6]={}
111 }
112 end
113 tD_CharDatas.profile = {
114 [1] = tD_CharDatas.profile,
115 [2] = temp,
116 [3] = temp,
117 }
118 end
119  
120  
121 if (tD_CharDatas.OSD.g==nil) then
122 tD_CharDatas = {}
123 -- set DEFAULT settings
124  
125 tD_CharDatas.ChannelID=1;
126 tD_CharDatas.OSD = {
127 ["scale"] = 1,
128 ["alpha"] = 1,
129 ["r"] = 0,
130 ["g"] = 0,
131 ["b"] = 0,
132 ["isEnabled"] = true,
133 ["border"] = true,
134 ["horiz"] = false,
135 ["locked"] = false,
136 };
137 tD_CharDatas.TimelimitCheck=true;
138 tD_CharDatas.Timelimit = 20;
139 tD_CharDatas.BanlistActive=false;
140 tD_CharDatas.Raid=true;
141 tD_CharDatas.Guild=true;
142 tD_CharDatas.Free4Guild=true;
143 tD_CharDatas.AutoAccept=true;
144 tD_CharDatas.ClientInfos=true;
145 tD_CharDatas.LevelCheck=true;
146 tD_CharDatas.LevelValue=55;
147 tD_CharDatas.RegisterCheck=true;
148 tD_CharDatas.RegisterValue=1;
149 tD_CharDatas.broadcastSlice=math.floor(tradeDispenser_MaxBroadcastLength/2)*60;
150 tD_CharDatas.Random=1;
151 tD_CharDatas.ActualProfile=1;
152 tD_CharDatas.profile = {};
153 local i,j;
154 for j=1,3 do
155 tD_CharDatas.profile[j]={}
156 for i=1,12 do
157 tD_CharDatas.profile[j][i] = {
158 ["Charge"] = 0,
159 [1] = {}, [2] = {}, [3]= {}, [4]={}, [5]={}, [6]={}
160 }
161 end
162 end
163  
164 tD_CharDatas.RndText = {
165 [1] = tD_Loc.Broadcast[1], [2] = tD_Loc.Broadcast[2],
166 [3] = tD_Loc.Broadcast[3], [4] = tD_Loc.Broadcast[4],
167 [5] = tD_Loc.Broadcast[4], [6] = tD_Loc.Broadcast[4],
168 [7] = tD_Loc.Broadcast[4], [8] = tD_Loc.Broadcast[4],
169 };
170 end
171 --for users with Version 0.60 - 0.70
172 if (not tD_CharDatas.TimelimitCheck or not tD_CharDatas.Timelimit) then
173 tD_CharDatas.TimelimitCheck=false;
174 tD_CharDatas.Timelimit = 20;
175 tD_CharDatas.BanlistActive=false;
176 end
177 if (not tD_CharDatas.ActualRack) then tD_CharDatas.ActualRack=1 end
178  
179 tradeDispenserSettingsOSDscale:SetValue(tD_CharDatas.OSD.scale);
180 tradeDispenserSettingsOSDCheck:SetChecked(tD_CharDatas.OSD.isEnabled);
181 tradeDispenserSettingsOSDborder:SetChecked(tD_CharDatas.OSD.border);
182 tradeDispenserSettingsOSDhoriz:SetChecked(tD_CharDatas.OSD.horiz);
183 tradeDispenserSettingsRandom:SetValue(tD_CharDatas.Random);
184 tD_CharDatas.OnBroadcastText=nil;
185  
186 tD_Temp.isEnabled = false;
187 tradeDispenserUpdate();
188 tradeDispenserSettings_OnUpdate();
189 tradeDispenserOSD_OnUpdate();
190 tradeDispenser_TradeControl_Update();
191 tradeDispenser_EditBoxUpdate();
192  
193 if (not tD_GlobalDatas.whisper) then
194 tD_GlobalDatas.whisper={};
195 local i;
196 for i=1,11 do
197 tD_GlobalDatas.whisper[i]=tD_Loc.whisper[i].default;
198 end
199 end
200 end
201