Skip to content

Commit

Permalink
simple adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyrivers committed Jun 6, 2021
1 parent 754579d commit 84a96c6
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 41 deletions.
1 change: 0 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -7148,7 +7148,6 @@ globals = {
"CHAT_MSG_WHISPER_INFORM",
"CHAT_MSG_WORLDDEFENSE_FORMAT",
"CHAT_MSG_YELL",
"aura_env",
"CHAT_MUTED_NOTICE",
"CHAT_MUTED_NOTICE_BN",
"CHAT_NAME_TEMPLATE",
Expand Down
5 changes: 1 addition & 4 deletions WeakAuras/RegionTypes/DynamicGroup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ local function modify(parent, region, data)
Private.Animate("controlPoint", data.uid, "controlPoint", anim, regionData.controlPoint, true)
end
end
regionData.xOffset = xq
regionData.xOffset = x
regionData.yOffset = y
regionData.shown = show
end
Expand All @@ -1151,9 +1151,6 @@ local function modify(parent, region, data)
self:Resize()
end

function region:ApplyUpdates()
end

function region:Resize()
-- Resizes the dynamic group, for background and border purposes
if not self:IsSuspended() and false then
Expand Down
2 changes: 1 addition & 1 deletion WeakAuras/Transmission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ local function importPendingData()
tinsert(parentData.controlledChildren, installedChild.id)
WeakAuras.NewDisplayButton(installedChild)
local childButton = WeakAuras.GetDisplayButton(installedChild.id)
childButton:SetGroup(parentData.id, parentData.regionType:find("dynamicgroup"))
childButton:SetGroup(parentData.id)
childButton:SetGroupOrder(index, #parentData.controlledChildren)
coroutine.yield()
end
Expand Down
12 changes: 6 additions & 6 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2351,12 +2351,12 @@ function WeakAuras.AddMany(table, takeSnapshots)
local groups = {}
for id, data in pairs(idtable) do
load(id, {});
if data.regionType:find("group") then
if data.controlledChildren then
groups[data] = true
end
end
for data in pairs(groups) do
if data.regionType:find("dynamicgroup") then
if data.regionType:find("dynamicgroup", 1, true) then
regions[data.id].region:ReloadControlledChildren()
else
WeakAuras.Add(data)
Expand Down Expand Up @@ -2856,11 +2856,11 @@ function WeakAuras.SetRegion(data, cloneId)
regionType = regionType,
region = region
};
if not regionType:find("group") then
if data.controlledChildren then
region.toShow = true
else
region.toShow = false
region:Hide()
else
region.toShow = true
end
else
region = regions[id].region;
Expand Down Expand Up @@ -4990,7 +4990,7 @@ local anchorFrameDeferred = {}

function Private.AnchorFrame(data, region, parent)
if data.anchorFrameType == "CUSTOM"
and (data.regionType:find("group"))
and data.controlledChildren
and not WeakAuras.IsLoginFinished()
and not anchorFrameDeferred[data.id]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local fullName;
local clipboard = {};

local function IsRegionAGroup(data)
return data and (data.regionType:find("group"));
return data and data.controlledChildren;
end

local ignoreForCopyingDisplay = {
Expand Down Expand Up @@ -596,7 +596,7 @@ local methods = {
if childData.parent then
childButton:Ungroup();
end
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
childButton:SetGroup(data.id);
childButton:SetGroupOrder(#data.controlledChildren, #data.controlledChildren);
childData.parent = data.id;
WeakAuras.Add(childData);
Expand All @@ -605,13 +605,13 @@ local methods = {
else
tinsert(data.controlledChildren, self.grouping.id);
local childButton = WeakAuras.GetDisplayButton(self.grouping.id);
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
childButton:SetGroup(data.id);
childButton:SetGroupOrder(#data.controlledChildren, #data.controlledChildren);
self.grouping.parent = data.id;
WeakAuras.Add(self.grouping);
WeakAuras.ClearAndUpdateOptions(self.grouping.id);
end
if (data.regionType:find("dynamicgroup")) then
if (data.regionType:find("dynamicgroup", 1, true)) then
self.grouping.xOffset = 0;
self.grouping.yOffset = 0;
end
Expand Down Expand Up @@ -925,7 +925,7 @@ local methods = {
if (not data.controlledChildren) then
local convertMenu = {};
for regionType, regionData in pairs(WeakAuras.regionOptions) do
if(not regionType:find("group") and regionType ~= "timer" and regionType ~= data.regionType) then
if(regionType ~= data.regionType) then
tinsert(convertMenu, {
text = regionData.displayName,
notCheckable = true,
Expand Down Expand Up @@ -1139,7 +1139,7 @@ local methods = {
self.frame:SetScript("OnClick", self.callbacks.OnClickGroupingSelf);
self:SetDescription(L["Cancel"], L["Do not group this display"]);
else
if(self.data.regionType:find("group")) then
if(self.data.controlledChildren) then
self.frame:SetScript("OnClick", self.callbacks.OnClickGrouping);
self:SetDescription(self.data.id, L["Add to group %s"]:format(self.data.id));
else
Expand Down Expand Up @@ -1383,7 +1383,7 @@ local methods = {
return self.frame.dgroup;
end,
["IsGroup"] = function(self)
return self.data.regionType:find("group")
return self.data.controlledChildren
end,
["SetData"] = function(self, data)
self.data = data;
Expand Down
2 changes: 1 addition & 1 deletion WeakAurasOptions/AnimationOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function filterAnimPresetTypes(intable, id)
for key, value in pairs(intable) do
local preset = OptionsPrivate.Private.anim_presets[key];
if(preset) then
if(regionType:find("group")) then
if(data.controlledChildren) then
local valid = true;
for index, childId in pairs(data.controlledChildren) do
local childRegion = WeakAuras.regions[childId] and WeakAuras.regions[childId].region
Expand Down
4 changes: 2 additions & 2 deletions WeakAurasOptions/CommonOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
local function IsParentDynamicGroup()
if data.parent then
local parentData = WeakAuras.GetData(data.parent)
return parentData and parentData.regionType:find("dynamicgroup")
return parentData and parentData.regionType:find("dynamicgroup", 1, true)
end
end

Expand Down Expand Up @@ -1065,7 +1065,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
name = L["Anchored To"],
order = 72,
hidden = IsParentDynamicGroup,
values = (data.regionType:find("group")) and OptionsPrivate.Private.anchor_frame_types_group or OptionsPrivate.Private.anchor_frame_types,
values = data.controlledChildren and OptionsPrivate.Private.anchor_frame_types_group or OptionsPrivate.Private.anchor_frame_types,
},
-- Input field to select frame to anchor on
anchorFrameFrame = {
Expand Down
4 changes: 2 additions & 2 deletions WeakAurasOptions/ExternalAddons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function OptionsPrivate.CreateImportButtons()
if(data) then
for index, childId in pairs(data.controlledChildren) do
local childButton = WeakAuras.GetDisplayButton(childId);
childButton:SetGroup(groupId, data.regionType:find("dynamicgroup"));
childButton:SetGroup(groupId);
childButton:SetGroupOrder(index, #data.controlledChildren);
end

Expand Down Expand Up @@ -163,7 +163,7 @@ function OptionsPrivate.CreateImportButtons()
if(data) then
for index, childId in pairs(data.controlledChildren) do
local childButton = WeakAuras.GetDisplayButton(childId);
childButton:SetGroup(id, data.regionType:find("dynamicgroup"));
childButton:SetGroup(id);
childButton:SetGroupOrder(index, #data.controlledChildren);
end

Expand Down
2 changes: 1 addition & 1 deletion WeakAurasOptions/OptionsFrames/FrameChooser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function OptionsPrivate.StartFrameChooser(data, path)
local focusIsGroup = false;
for id, regionData in pairs(WeakAuras.regions) do
if(regionData.region:IsVisible() and MouseIsOver(regionData.region)) then
local isGroup = regionData.regionType:find("group");
local isGroup = regionData.data.controlledChildren;
if (not focusName or (not isGroup and focusIsGroup)) then
focus = regionData.region;
focusName = "WeakAuras:"..id;
Expand Down
4 changes: 2 additions & 2 deletions WeakAurasOptions/OptionsFrames/MoverSizer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ local function ConstructMoverSizer(parent)
frame.lineX:Hide()
end

if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup") then
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup", 1, true) then
mover:SetScript("OnMouseDown", nil)
mover:SetScript("OnMouseUp", nil)
mover:SetScript("OnEvent", nil)
Expand Down Expand Up @@ -903,7 +903,7 @@ local function ConstructMoverSizer(parent)
self.anchorPointIcon:SetPoint("CENTER", self.anchor, self.anchorPoint)
local anchorX, anchorY = self.anchorPointIcon:GetCenter()
anchorX, anchorY = anchorX or 0, anchorY or 0
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup") then
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup", 1, true) then
self.selfPointIcon:Hide()
self.anchorPointIcon:Hide()
else
Expand Down
10 changes: 0 additions & 10 deletions WeakAurasOptions/RegionOptions/Group.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ local AddonName, OptionsPrivate = ...

local L = WeakAuras.L;

local aura_env = aura_env;
hooksecurefunc("ToggleRun", function()
if aura_env.walking then
aura_env.walking = false;
else
aura_env.walking = true;
end
end)


-- Calculate bounding box
local function getRect(data)
-- Temp variables
Expand Down
8 changes: 4 additions & 4 deletions WeakAurasOptions/WeakAurasOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function OptionsPrivate.DuplicateAura(data, newParent, massEdit)

for index, id in pairs(parentData.controlledChildren) do
local childButton = WeakAuras.GetDisplayButton(id)
childButton:SetGroup(parentData.id, parentData.regionType:find("dynamicgroup"))
childButton:SetGroup(parentData.id)
childButton:SetGroupOrder(index, #parentData.controlledChildren)
end

Expand Down Expand Up @@ -251,7 +251,7 @@ function OptionsPrivate.MultipleDisplayTooltipMenu()

for index, id in pairs(data.controlledChildren) do
local childButton = WeakAuras.GetDisplayButton(id);
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
childButton:SetGroup(data.id);
childButton:SetGroupOrder(index, #data.controlledChildren);
end

Expand Down Expand Up @@ -288,7 +288,7 @@ function OptionsPrivate.MultipleDisplayTooltipMenu()

for index, id in pairs(data.controlledChildren) do
local childButton = WeakAuras.GetDisplayButton(id);
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
childButton:SetGroup(data.id);
childButton:SetGroupOrder(index, #data.controlledChildren);
end

Expand Down Expand Up @@ -1406,7 +1406,7 @@ function WeakAuras.NewAura(sourceData, regionType, targetId)

AddDefaultSubRegions(data)

if (not data.regionType:find("group") and targetId) then
if (not data.controlledChildren and targetId) then
local target = WeakAuras.GetDisplayButton(targetId);
local group
if (target) then
Expand Down

0 comments on commit 84a96c6

Please sign in to comment.