Shestak UI
Go Back   Shestak UI > Interface Forums > Russian Community > Modified Versions

Modified Versions Your modified version of ShestakUI.

Advertising

 
Thread Tools
Old 08.04.2013, 08:16   #1
 Assistant User Information

Wetxius's Avatar
Lightbulb Разделение тысяч для инфо-панели золота

https://gist.github.com/Wetxius/5334590/revisions
Взял отсюда и прикрутил для нас. Скриншот можно поглядеть в исходном аддоне.
Если никто ничего не понял, приводит к виду: 245,345з 45с 23м
lua Code [Select]:
local function comma_value(n) -- credit [url]http://richard.warburton.it[/url]
    local left, num, right = string.match(n,"^([^%d]*%d)(%d*)(.-)$")
    return left..(num:reverse():gsub("(%d%d%d)","%1,"):reverse())..right
end

local function formatgold(style, amount)
    local gold, silver, copper = floor(amount * 0.0001), floor(mod(amount * 0.01, 100)), floor(mod(amount, 100))
    if style == 1 then
        return (gold > 0 and format("%s|cffffd700%s|r ", comma_value(gold), GOLD_AMOUNT_SYMBOL) or "")
            .. (silver > 0 and format("%s|cffc7c7cf%s|r ", silver, SILVER_AMOUNT_SYMBOL) or "")
            .. ((copper > 0 or (gold == 0 and silver == 0)) and format("%s|cffeda55f%s|r", copper, COPPER_AMOUNT_SYMBOL) or "")
    elseif style == 2 or not style then
        return format("%.1f|cffffd700%s|r", amount * 0.0001, GOLD_AMOUNT_SYMBOL)
    elseif style == 3 then
        return format("|cffffd700%s|r.|cffc7c7cf%s|r.|cffeda55f%s|r", gold, silver, copper)
    elseif style == 4 then
        return (gold > 0 and format(GOLD_AMOUNT_TEXTURE, gold, 12, 12) or "") .. (silver > 0 and format(SILVER_AMOUNT_TEXTURE, silver, 12, 12) or "")
            .. ((copper > 0 or (gold == 0 and silver == 0)) and format(COPPER_AMOUNT_TEXTURE, copper, 12, 12) or "") .. " "
    end
end
Says Thank:
Jarry (08.04.2013), Shestak (08.04.2013)
Old 08.04.2013, 08:16   #1.5 - Disable Ads

Advertise on this site


Tags
дата-текст, золото

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Fixed] Переключение правой панели команд m2jest1c Bugs Reports 1 09.11.2012 18:50
"Шаман" и панели dsctka General Discussion 7 27.12.2011 15:51
Дефолтные панели Mau Technical Support 6 16.08.2010 12:59


Mobile Style Русский English Deutsch Italian Chinese