WoWInterface SVN UrbanAchiever

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 34 to Rev 35
    Reverse comparison

Rev 34 → Rev 35

trunk/Main.lua
410,7 → 410,33
end
 
function self:FormatMoney(quantityStr, compMin, compMax)
--quantityStr = "139|TInterface\\MoneyFrame\\UI-GoldIcon:14:14:2:0|t
-- 91|TInterface\\MoneyFrame\\UI-SilverIcon:14:14:2:0|t
-- 19|TInterface\\MoneyFrame\\UI-CopperIcon:14:14:2:0|t
-- / 1000|TInterface\\MoneyFrame\\UI-GoldIcon:14:14:2:0|t"
--compMin = 1368980
--compMax = 10000000
compMin = tostring(compMin)
compMax = tostring(compMax)
local length = compMin:len()
local gold, silver, copper = 0, 0, 0
if length <= 2 then -- 1-2
copper = compMin
elseif length <= 4 then -- 3-4
silver = compMin:sub(1, length - 2)
copper = compMin:sub(length-1)
else -- 5+
gold = compMin:sub(1, length-4)
silver = compMin:sub(length-3, length-2)
copper = compMin:sub(length-1)
end
 
compMin = gold .. "|TInterface\\MoneyFrame\\UI-GoldIcon:14:14:2:0|t " ..
silver .. "|TInterface\\MoneyFrame\\UI-GoldIcon:14:14:2:0|t " ..
copper .. "|TInterface\\MoneyFrame\\UI-GoldIcon:14:14:2:0|t"
compMax = compMax:sub(1, compMax:len() - 4) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:14:14:2:0|t"
 
return compMin, compMax
end
-------------------------------------------------------------
--Frame Stuff
1548,6 → 1574,10
else
local _,_,min, max = string.find(compCriteriaText, "(%d+)/(%d+)")
self.frame.display.compareBar:SetValue(min)
--If theres money textures in the string, we're gonna need to format it.
if quantityStr:find("|T") then
min, criteriaReqQuantity = self:FormatMoney(quantityStr, min, criteriaReqQuantity)
end
self.frame.display.compareBar.text:SetText(min .. " / " .. criteriaReqQuantity)
self.frame.display.compareBar.nameText:SetText(self.comparisonUnitName .. ":")
end