comparison Modules/Scanner.lua @ 106:d3fbb5676a5e

Added tooltips to the item refill window headers. Now color coding the availibility of items at the item refill window. Added a hide help text option (which is off by default). Renamed all premade groups to a new naming pattern; ?Profession - Category - Detail?, e.g. ?Inscription - Glyphs by class - Death Knight?. To continue getting notified about updates to a selected premade group, you must re-add them. Repositioned elements of the item refill frame to fit better. No longer using colorsargs to remember the index of a queued move, but instead providing a reference to the move itself in the new ?rowData? property of each row. Added tooltips to the headers of the sort table. Merged missing and available columns together (showing available / missing) and sorting on available now sorts on percentage of how many of the missing items are available. Moving and available columns are now aligned to the right. Added an ?extra? config group which contains the additional (but completely optional) settings. Moved color codes adjustments, forget character, auto refill skip confirm and hide help info options to this group.
author Zerotorescue
date Wed, 12 Jan 2011 19:58:39 +0100
parents 6ae44d372360
children 3bbad0429d87
comparison
equal deleted inserted replaced
105:4efbaf069ddb 106:d3fbb5676a5e
170 170
171 if Mover:HasMoves() then 171 if Mover:HasMoves() then
172 if addon.db.profile.defaults.autoRefillSkipConfirm then 172 if addon.db.profile.defaults.autoRefillSkipConfirm then
173 OnMoveAccept(true); 173 OnMoveAccept(true);
174 else 174 else
175 local data = {}; 175 -- This table is never copied, just referenced. It is the same for every row.
176
177 local columns = { 176 local columns = {
178 { 177 {
179 value = function(d, cols, realrow, column, table) 178 value = function(data, cols, realrow, column, table)
180 return IdToItemLink(d[realrow].colorargs[2]); 179 return IdToItemLink(data[realrow].rowData.id);
181 end, 180 end,
182 }, -- item 181 }, -- item
183 { 182 {
184 value = function(d, cols, realrow, column, table) 183 value = function(data, cols, realrow, column, table)
185 local queue = Mover:GetMoves(); 184 return data[realrow].rowData.num;
186 return queue[d[realrow].colorargs[1]].num;
187 end, 185 end,
188 }, -- moving 186 }, -- moving
189 { 187 {
190 value = function(d, cols, realrow, column, table) 188 value = function(data, cols, realrow, column, table)
191 local queue = Mover:GetMoves(); 189 return addon:DisplayItemCount(data[realrow].rowData.available, data[realrow].rowData.missing); -- available / missing
192 return queue[d[realrow].colorargs[1]].missing;
193 end, 190 end,
194 }, -- missing 191 color = function(data, cols, realrow, column, table)
195 { 192 return ((data[realrow].rowData.available < data[realrow].rowData.missing) and { r = 1, g = 0, b = 0, a = 1 }) or { r = 1, g = 1, b = 1, a = 1 };
196 value = function(d, cols, realrow, column, table)
197 local queue = Mover:GetMoves();
198 return queue[d[realrow].colorargs[1]].available;
199 end, 193 end,
200 color = function(d, cols, realrow, column, table) 194 }, -- missing / available
201 local queue = Mover:GetMoves();
202 return ((queue[d[realrow].colorargs[1]].available < queue[d[realrow].colorargs[1]].missing) and { r = 1, g = 0, b = 0, a = 1 }) or { r = 1, g = 1, b = 1, a = 1 };
203 end,
204 }, -- available
205 }; 195 };
206 196
207 local queue = Mover:GetMoves(); 197 -- Store the list with rows in this
198 local data = {};
208 199
209 for i, move in pairs(Mover:GetMoves()) do 200 for i, move in pairs(Mover:GetMoves()) do
210 local row = { 201 table.insert(data, {
211 ["colorargs"] = { i, queue[i].id }, 202 ["rowData"] = move, -- this is not a key usually found in a row item and ignored by the library
212 ["cols"] = columns, 203 ["cols"] = columns,
213 }; 204 });
214
215 table.insert(data, row);
216 end 205 end
217 206
218 addon:SetMoverFrameData(data); 207 addon:SetMoverFrameData(data);
219
220 --[[
221 StaticPopupDialogs["InventoriumRefill"] = {
222 text = "There are items that can be refilled from this location, do you wish to proceed?",
223 button1 = YES,
224 button2 = NO,
225 OnAccept = function()
226 mod:Pause();
227 Mover:BeginMove(location, self.Unpause);
228 end,
229 timeout = 0,
230 whileDead = 1,
231 hideOnEscape = 1,
232 exclusive = 1,
233 };
234 StaticPopup_Show("InventoriumRefill");]]
235 end 208 end
236 end 209 end
237 end 210 end
238 211
239 212
256 229
257 self:ClearCache(); 230 self:ClearCache();
258 231
259 mod:UnregisterEvent("BANKFRAME_CLOSED"); 232 mod:UnregisterEvent("BANKFRAME_CLOSED");
260 233
261 --StaticPopup_Hide("InventoriumRefill");
262 InventoriumItemMover:Hide(); 234 InventoriumItemMover:Hide();
263 Mover:ResetQueue(); 235 Mover:ResetQueue();
264 end 236 end
265 237
266 -- Guild bank 238 -- Guild bank
293 self:UnregisterEvent("GUILDBANKFRAME_CLOSED"); 265 self:UnregisterEvent("GUILDBANKFRAME_CLOSED");
294 self:UnregisterEvent("GUILDBANKBAGSLOTS_CHANGED"); 266 self:UnregisterEvent("GUILDBANKBAGSLOTS_CHANGED");
295 267
296 self:CancelTimer(tmrScanGuild, true); -- silent 268 self:CancelTimer(tmrScanGuild, true); -- silent
297 269
298 --StaticPopup_Hide("InventoriumRefill");
299 InventoriumItemMover:Hide(); 270 InventoriumItemMover:Hide();
300 Mover:ResetQueue(); 271 Mover:ResetQueue();
301 end 272 end
302 273
303 function mod:GUILDBANKFRAME_OPENED() 274 function mod:GUILDBANKFRAME_OPENED()