tbc loop change part 1
This commit is contained in:
+6
-6
@@ -220,7 +220,7 @@ end
|
||||
|
||||
function M.tooltip_find(pattern, tooltip)
|
||||
local count = 0
|
||||
for _, line in tooltip do
|
||||
for _, line in pairs(tooltip) do
|
||||
if line.left_text and strfind(line.left_text, pattern) then
|
||||
count = count + 1
|
||||
end
|
||||
@@ -297,7 +297,7 @@ function M.tooltip(setter, arg1, arg2)
|
||||
end
|
||||
|
||||
function item_charges(tooltip)
|
||||
for _, line in tooltip do
|
||||
for _, line in pairs(tooltip) do
|
||||
local pattern = '^' .. gsub(gsub(ITEM_SPELL_CHARGES_P1, '%%d', '(%%d+)'), '%%%d+%$d', '(%%d+)') .. '$'
|
||||
|
||||
local _, _, left_charges_string = strfind(line.left_text or '', pattern)
|
||||
@@ -343,7 +343,7 @@ do
|
||||
end
|
||||
|
||||
function M.durability(tooltip)
|
||||
for _, line in tooltip do
|
||||
for _, line in pairs(tooltip) do
|
||||
local pattern = '^' .. gsub(gsub(DURABILITY_TEMPLATE, '%%d', '(%%d+)'), '%%%d+%$d', '(%%d+)') .. '$'
|
||||
local _, _, left_durability_string, left_max_durability_string = strfind(line.left_text or '', pattern)
|
||||
local _, _, right_durability_string, right_max_durability_string = strfind(line.right_text or '', pattern)
|
||||
@@ -386,7 +386,7 @@ function M.item(item_id, suffix_id)
|
||||
end
|
||||
|
||||
function M.item_class_index(item_class)
|
||||
for i, class in temp-A(GetAuctionItemClasses()) do
|
||||
for i, class in pairs(temp-A(GetAuctionItemClasses())) do
|
||||
if strupper(class) == strupper(item_class) then
|
||||
return i, class
|
||||
end
|
||||
@@ -394,7 +394,7 @@ function M.item_class_index(item_class)
|
||||
end
|
||||
|
||||
function M.item_subclass_index(class_index, item_subclass)
|
||||
for i, subclass in temp-A(GetAuctionItemSubClasses(class_index)) do
|
||||
for i, subclass in pairs(temp-A(GetAuctionItemSubClasses(class_index))) do
|
||||
if strupper(subclass) == strupper(item_subclass) then
|
||||
return i, subclass
|
||||
end
|
||||
@@ -402,7 +402,7 @@ function M.item_subclass_index(class_index, item_subclass)
|
||||
end
|
||||
|
||||
function M.item_slot_index(class_index, subclass_index, slot_name)
|
||||
for i, slot in temp-A(GetAuctionInvTypes(class_index, subclass_index)) do
|
||||
for i, slot in pairs(temp-A(GetAuctionInvTypes(class_index, subclass_index))) do
|
||||
if strupper(_G[slot]) == strupper(slot_name) then
|
||||
return i, _G[slot]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user