from retail

This commit is contained in:
Bunny67
2020-07-11 00:19:17 +03:00
parent bbb4ac1c37
commit 6a7003b535
27 changed files with 2317 additions and 647 deletions
+9 -4
View File
@@ -6,7 +6,6 @@ local L = WeakAuras.L;
local defaultFont = WeakAuras.defaultFont
local defaultFontSize = WeakAuras.defaultFontSize
local default = {
displayText = "%p",
outline = "OUTLINE",
@@ -76,8 +75,6 @@ local function modify(parent, region, data)
local text = region.text;
region.useAuto = WeakAuras.CanHaveAuto(data);
region.progressPrecision = data.progressPrecision;
region.totalPrecision = data.totalPrecision;
local fontPath = SharedMedia:Fetch("font", data.font);
text:SetFont(fontPath, data.fontSize, data.outline);
@@ -161,9 +158,17 @@ local function modify(parent, region, data)
local UpdateText
if WeakAuras.ContainsAnyPlaceHolders(data.displayText) then
local getter = function(key, default)
local fullKey = "displayText_format_" .. key
if (data[fullKey] == nil) then
data[fullKey] = default
end
return data[fullKey]
end
local formatters = WeakAuras.CreateFormatters(data.displayText, getter)
UpdateText = function()
local textStr = data.displayText;
textStr = WeakAuras.ReplacePlaceHolders(textStr, region, nil);
textStr = WeakAuras.ReplacePlaceHolders(textStr, region, nil, false, formatters);
if (textStr == nil or textStr == "") then
textStr = " ";
end