Clean up WeakAuras table and remove members that no one should touch
This commit is contained in:
@@ -17,7 +17,7 @@ local frameChooserBox
|
||||
local oldFocus
|
||||
local oldFocusName
|
||||
function OptionsPrivate.StartFrameChooser(data, path)
|
||||
local frame = WeakAuras.OptionsFrame();
|
||||
local frame = OptionsPrivate.Private.OptionsFrame();
|
||||
if not(frameChooserFrame) then
|
||||
frameChooserFrame = CreateFrame("Frame");
|
||||
frameChooserBox = CreateFrame("Frame", nil, frameChooserFrame);
|
||||
@@ -50,7 +50,7 @@ function OptionsPrivate.StartFrameChooser(data, path)
|
||||
if(focusName == "WorldFrame" or not focusName) then
|
||||
focusName = nil;
|
||||
local focusIsGroup = false;
|
||||
for id, regionData in pairs(WeakAuras.regions) do
|
||||
for id, regionData in pairs(OptionsPrivate.Private.regions) do
|
||||
if(regionData.region:IsVisible() and MouseIsOver(regionData.region)) then
|
||||
local isGroup = regionData.regionType == "group" or regionData.regionType == "dynamicgroup";
|
||||
if (not focusName or (not isGroup and focusIsGroup)) then
|
||||
|
||||
@@ -380,7 +380,7 @@ local function BuildAlignLines(mover)
|
||||
skipIds[child.id] = true
|
||||
end
|
||||
|
||||
for k, v in pairs(WeakAuras.displayButtons) do
|
||||
for k, v in pairs(OptionsPrivate.displayButtons) do
|
||||
local region = WeakAuras.GetRegion(v.data.id)
|
||||
if not skipIds[k] and v.view.visibility ~= 0 and region then
|
||||
local scale = region:GetEffectiveScale() / UIParent:GetEffectiveScale()
|
||||
|
||||
@@ -17,8 +17,7 @@ local AceConfigRegistry = LibStub("AceConfigRegistry-3.0")
|
||||
local WeakAuras = WeakAuras
|
||||
local L = WeakAuras.L
|
||||
|
||||
local displayButtons = WeakAuras.displayButtons
|
||||
local regionOptions = WeakAuras.regionOptions
|
||||
local displayButtons = OptionsPrivate.displayButtons
|
||||
local tempGroup = OptionsPrivate.tempGroup
|
||||
local aceOptions = {}
|
||||
|
||||
@@ -138,11 +137,11 @@ function OptionsPrivate.CreateFrame()
|
||||
OptionsPrivate.Private.ClearFakeStates()
|
||||
|
||||
|
||||
for id, data in pairs(WeakAuras.regions) do
|
||||
for id, data in pairs(OptionsPrivate.Private.regions) do
|
||||
data.region:Collapse()
|
||||
data.region:OptionsClosed()
|
||||
if WeakAuras.clones[id] then
|
||||
for _, cloneRegion in pairs(WeakAuras.clones[id]) do
|
||||
if OptionsPrivate.Private.clones[id] then
|
||||
for _, cloneRegion in pairs(OptionsPrivate.Private.clones[id]) do
|
||||
cloneRegion:Collapse()
|
||||
cloneRegion:OptionsClosed()
|
||||
end
|
||||
@@ -1126,7 +1125,7 @@ function OptionsPrivate.CreateFrame()
|
||||
end
|
||||
|
||||
if targetId then
|
||||
local pickedButton = WeakAuras.GetDisplayButton(targetId)
|
||||
local pickedButton = OptionsPrivate.GetDisplayButton(targetId)
|
||||
if pickedButton.data.controlledChildren then
|
||||
targetIsDynamicGroup = pickedButton.data.regionType == "dynamicgroup"
|
||||
else
|
||||
@@ -1180,7 +1179,7 @@ function OptionsPrivate.CreateFrame()
|
||||
end
|
||||
|
||||
local regionTypesSorted = {}
|
||||
for regionType, regionData in pairs(regionOptions) do
|
||||
for regionType, regionData in pairs(OptionsPrivate.Private.regionOptions) do
|
||||
tinsert(regionTypesSorted, regionType)
|
||||
end
|
||||
|
||||
@@ -1201,14 +1200,14 @@ function OptionsPrivate.CreateFrame()
|
||||
return false
|
||||
end
|
||||
|
||||
return regionOptions[a].displayName < regionOptions[b].displayName
|
||||
return OptionsPrivate.Private.regionOptions[a].displayName < OptionsPrivate.Private.regionOptions[b].displayName
|
||||
end)
|
||||
|
||||
for index, regionType in ipairs(regionTypesSorted) do
|
||||
if (targetIsDynamicGroup and (regionType == "group" or regionType == "dynamicgroup")) then
|
||||
-- Dynamic groups can't contain group/dynamic groups
|
||||
else
|
||||
local regionData = regionOptions[regionType]
|
||||
local regionData = OptionsPrivate.Private.regionOptions[regionType]
|
||||
local button = AceGUI:Create("WeakAurasNewButton")
|
||||
button:SetTitle(regionData.displayName)
|
||||
if(type(regionData.icon) == "string" or type(regionData.icon) == "table") then
|
||||
@@ -1262,8 +1261,8 @@ function OptionsPrivate.CreateFrame()
|
||||
}
|
||||
|
||||
if not frame.importThumbnail then
|
||||
local thumbnail = regionOptions["text"].createThumbnail(UIParent)
|
||||
regionOptions["text"].modifyThumbnail(UIParent, thumbnail, data)
|
||||
local thumbnail = OptionsPrivate.Private.regionOptions["text"].createThumbnail(UIParent)
|
||||
OptionsPrivate.Private.regionOptions["text"].modifyThumbnail(UIParent, thumbnail, data)
|
||||
thumbnail.mask:SetPoint("BOTTOMLEFT", thumbnail, "BOTTOMLEFT", 3, 3)
|
||||
thumbnail.mask:SetPoint("TOPRIGHT", thumbnail, "TOPRIGHT", -3, -3)
|
||||
frame.importThumbnail = thumbnail
|
||||
|
||||
@@ -1676,7 +1676,7 @@ local methods = {
|
||||
uidMap:ChangeId(uid, existingData.id)
|
||||
else
|
||||
if WeakAuras.GetData(uidMap:GetIdFor(uid)) then
|
||||
local newId = WeakAuras.FindUnusedId(uidMap:GetIdFor(uid))
|
||||
local newId = OptionsPrivate.Private.FindUnusedId(uidMap:GetIdFor(uid))
|
||||
uidMap:ChangeId(uid, newId)
|
||||
end
|
||||
end
|
||||
@@ -1731,7 +1731,7 @@ local methods = {
|
||||
if string.sub(data.id, 1, #targetName) == targetName then
|
||||
-- Our name is already prefixed with targetName, don't try to improve
|
||||
else
|
||||
local newId = WeakAuras.FindUnusedId(targetName)
|
||||
local newId = OptionsPrivate.Private.FindUnusedId(targetName)
|
||||
local oldid = data.id
|
||||
WeakAuras.Rename(data, newId)
|
||||
if targetName[aura.uid] then -- We can hope that the aura the squatter renames itself, so try again
|
||||
@@ -1851,7 +1851,7 @@ local methods = {
|
||||
data.authorMode = nil
|
||||
WeakAuras.Add(data)
|
||||
OptionsPrivate.Private.SetHistory(data.uid, data, "import")
|
||||
local button = WeakAuras.GetDisplayButton(data.id)
|
||||
local button = OptionsPrivate.GetDisplayButton(data.id)
|
||||
button:SetData(data)
|
||||
if (data.parent) then
|
||||
local parentIsDynamicGroup = structureUidMap:GetParentIsDynamicGroup(uid)
|
||||
@@ -1875,14 +1875,14 @@ local methods = {
|
||||
for i = #phase2Order, 1, -1 do
|
||||
local uid = phase2Order[i]
|
||||
local data = OptionsPrivate.Private.GetDataByUID(uid)
|
||||
local displayButton = WeakAuras.GetDisplayButton(data.id)
|
||||
local displayButton = OptionsPrivate.GetDisplayButton(data.id)
|
||||
displayButton:UpdateOffset()
|
||||
end
|
||||
end,
|
||||
ImportPhase1 = function(self, uidMap, uid, phase2Order)
|
||||
tinsert(phase2Order, uid)
|
||||
local data = uidMap:GetPhase1Data(uid)
|
||||
local newId = WeakAuras.FindUnusedId(data.id)
|
||||
local newId = OptionsPrivate.Private.FindUnusedId(data.id)
|
||||
uidMap:ChangeId(uid, newId)
|
||||
|
||||
data.preferToUpdate = false
|
||||
@@ -1913,7 +1913,7 @@ local methods = {
|
||||
WeakAuras.Add(data)
|
||||
OptionsPrivate.Private.SetHistory(data.uid, data, "import")
|
||||
|
||||
local button = WeakAuras.GetDisplayButton(data.id)
|
||||
local button = OptionsPrivate.GetDisplayButton(data.id)
|
||||
button:SetData(data)
|
||||
if (data.parent) then
|
||||
local parentIsDynamicGroup = uidMap:GetParentIsDynamicGroup(uid)
|
||||
@@ -1936,7 +1936,7 @@ local methods = {
|
||||
for i = #phase2Order, 1, -1 do
|
||||
local uid = phase2Order[i]
|
||||
local data = OptionsPrivate.Private.GetDataByUID(uid)
|
||||
local displayButton = WeakAuras.GetDisplayButton(data.id)
|
||||
local displayButton = OptionsPrivate.GetDisplayButton(data.id)
|
||||
displayButton:UpdateOffset()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user