随便打开一个插件的LUA后缀文件,把这个复制进去,就可以了
local f = function(v)
if (v <= 0) then
return ""
elseif (v >= 1e8) then
return (LOCALE_zhCN and "%d亿" or "%d億"):format(math.floor(v / 1e8))
elseif (v >= 1e4) then
return (LOCALE_zhCN and "%d万" or "%d萬"):format(math.floor(v / 1e4))
else
return ("%d"):format(math.floor(v)) -- 也可以直接使用 ("%d"):format(v),因为v已经是整数
end
end
local updateTextString = function(s)
if not GetCVarBool("statusTextPercentage") then
if s.TextString and s.currValue then
s.TextString:SetText(f(s:GetValue()))
end
if s.RightText and s.currValue then
s.RightText:SetText(f(s:GetValue()))
end
end
end