localized durability parsing

This commit is contained in:
Manuel Simon Hirsig
2016-03-05 14:00:36 +01:00
parent b70ad90b60
commit e62b5c8939
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
Aux = {
version = '2.6.8',
version = '2.6.9',
blizzard_ui_shown = false,
orig = {},
}
+3 -3
View File
@@ -307,8 +307,8 @@ function private.item_charges(tooltip)
end
for _, line in ipairs(tooltip) do
local pattern1 = '^'..gsub(ITEM_SPELL_CHARGES, '%%d', '(%%d)')..'$'
local pattern2 = '^'..gsub(ITEM_SPELL_CHARGES_P1, '%%d', '(%%d)')..'$'
local pattern1 = '^'..gsub(ITEM_SPELL_CHARGES, '%%d', '(%%d+)')..'$'
local pattern2 = '^'..gsub(ITEM_SPELL_CHARGES_P1, '%%d', '(%%d+)')..'$'
local _, _, left_charges_string1 = strfind(line.left_text or '', pattern1)
local _, _, left_charges_string2 = strfind(line.left_text or '', pattern2)
@@ -325,7 +325,7 @@ end
function public.durability(tooltip)
for _, line in ipairs(tooltip) do
local pattern = '^Durability (%d+) / (%d+)$'
local pattern = '^'..gsub(DURABILITY_TEMPLATE, '%%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)
local durability = tonumber(left_durability_string) or tonumber(right_durability_string)