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
+77 -30
View File
@@ -1064,35 +1064,7 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon)
odb.idCache = nil;
end
odb.spellCache = odb.spellCache or {};
spellCache.Load(odb.spellCache);
local _, build = GetBuildInfo();
local locale = GetLocale();
local version = WeakAuras.versionString
local num = 0;
for i,v in pairs(odb.spellCache) do
num = num + 1;
end
if(num < 39000 or odb.locale ~= locale or odb.build ~= build or odb.version ~= version) then
spellCache.Build();
odb.build = build;
odb.locale = locale;
odb.version = version;
end
-- Updates the icon cache with whatever icons WeakAuras core has actually used.
-- This helps keep name<->icon matches relevant.
for name, icons in pairs(db.dynamicIconCache) do
if db.dynamicIconCache[name] then
for spellId, icon in pairs(db.dynamicIconCache[name]) do
spellCache.AddIcon(name, spellId, icon)
end
end
end
spellCache.Load(odb);
if odb.magnetAlign == nil then
odb.magnetAlign = true
@@ -1392,6 +1364,8 @@ function WeakAuras.ShowOptions(msg)
WeakAuras.Pause();
WeakAuras.SetFakeStates()
WeakAuras.spellCache.Build()
if (firstLoad) then
frame = WeakAuras.CreateFrame();
frame.buttonsScroll.frame:Show();
@@ -2551,7 +2525,7 @@ local function flattenRegionOptions(allOptions, isGroupTab)
end
local function parsePrefix(input, data, create)
local subRegionIndex, property = string.match(input, "^sub%.(%d+)%..+%.(.+)")
local subRegionIndex, property = string.match(input, "^sub%.(%d+)%..-%.(.+)")
subRegionIndex = tonumber(subRegionIndex)
if subRegionIndex then
if create then
@@ -4837,3 +4811,76 @@ end
function WeakAuras.DeleteCollapsedData(id)
collapsedOptions[id] = nil
end
function WeakAuras.AddTextFormatOption(input, withHeader, get, addOption, hidden, setHidden)
local headerOption
if withHeader then
headerOption = {
type = "execute",
control = "WeakAurasExpandSmall",
name = function()
return L["|cFFffcc00Format Options|r"]
end,
width = WeakAuras.doubleWidth,
func = function()
setHidden(not hidden())
end,
image = function()
return hidden() and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\edit" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\editdown"
end,
imageWidth = 24,
imageHeight = 24
}
addOption("header", headerOption)
else
hidden = false
end
local seenSymbols = {}
WeakAuras.ParseTextStr(input, function(symbol)
if not seenSymbols[symbol] then
local triggerNum, sym = string.match(symbol, "(.+)%.(.+)")
sym = sym or symbol
addOption(symbol .. "desc", {
type = "description",
name = L["Format for %s"]:format("%" .. symbol),
width = WeakAuras.normalWidth,
hidden = hidden
})
if sym == "c" or sym == "i" then
-- No special options for these
else
addOption(symbol .. "_format", {
type = "select",
name = L["Format"],
width = WeakAuras.normalWidth,
values = WeakAuras.format_types_display,
hidden = hidden,
reloadOptions = true
})
local selectedFormat = get(symbol .. "_format")
if (WeakAuras.format_types[selectedFormat]) then
WeakAuras.format_types[selectedFormat].AddOptions(symbol, hidden, addOption, get)
end
end
end
seenSymbols[symbol] = true
end)
if next(seenSymbols) then
local footerOption = {
type = "header",
name = "",
}
addOption("footer", footerOption)
end
if not next(seenSymbols) and withHeader then
headerOption.hidden = true
end
end