Skip to content

Commit 84a96c6

Browse files
committed
simple adjustments
1 parent 754579d commit 84a96c6

12 files changed

Lines changed: 27 additions & 41 deletions

File tree

.luacheckrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7148,7 +7148,6 @@ globals = {
71487148
"CHAT_MSG_WHISPER_INFORM",
71497149
"CHAT_MSG_WORLDDEFENSE_FORMAT",
71507150
"CHAT_MSG_YELL",
7151-
"aura_env",
71527151
"CHAT_MUTED_NOTICE",
71537152
"CHAT_MUTED_NOTICE_BN",
71547153
"CHAT_NAME_TEMPLATE",

WeakAuras/RegionTypes/DynamicGroup.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ local function modify(parent, region, data)
11391139
Private.Animate("controlPoint", data.uid, "controlPoint", anim, regionData.controlPoint, true)
11401140
end
11411141
end
1142-
regionData.xOffset = xq
1142+
regionData.xOffset = x
11431143
regionData.yOffset = y
11441144
regionData.shown = show
11451145
end
@@ -1151,9 +1151,6 @@ local function modify(parent, region, data)
11511151
self:Resize()
11521152
end
11531153

1154-
function region:ApplyUpdates()
1155-
end
1156-
11571154
function region:Resize()
11581155
-- Resizes the dynamic group, for background and border purposes
11591156
if not self:IsSuspended() and false then

WeakAuras/Transmission.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ local function importPendingData()
573573
tinsert(parentData.controlledChildren, installedChild.id)
574574
WeakAuras.NewDisplayButton(installedChild)
575575
local childButton = WeakAuras.GetDisplayButton(installedChild.id)
576-
childButton:SetGroup(parentData.id, parentData.regionType:find("dynamicgroup"))
576+
childButton:SetGroup(parentData.id)
577577
childButton:SetGroupOrder(index, #parentData.controlledChildren)
578578
coroutine.yield()
579579
end

WeakAuras/WeakAuras.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,12 +2351,12 @@ function WeakAuras.AddMany(table, takeSnapshots)
23512351
local groups = {}
23522352
for id, data in pairs(idtable) do
23532353
load(id, {});
2354-
if data.regionType:find("group") then
2354+
if data.controlledChildren then
23552355
groups[data] = true
23562356
end
23572357
end
23582358
for data in pairs(groups) do
2359-
if data.regionType:find("dynamicgroup") then
2359+
if data.regionType:find("dynamicgroup", 1, true) then
23602360
regions[data.id].region:ReloadControlledChildren()
23612361
else
23622362
WeakAuras.Add(data)
@@ -2856,11 +2856,11 @@ function WeakAuras.SetRegion(data, cloneId)
28562856
regionType = regionType,
28572857
region = region
28582858
};
2859-
if not regionType:find("group") then
2859+
if data.controlledChildren then
2860+
region.toShow = true
2861+
else
28602862
region.toShow = false
28612863
region:Hide()
2862-
else
2863-
region.toShow = true
28642864
end
28652865
else
28662866
region = regions[id].region;
@@ -4990,7 +4990,7 @@ local anchorFrameDeferred = {}
49904990

49914991
function Private.AnchorFrame(data, region, parent)
49924992
if data.anchorFrameType == "CUSTOM"
4993-
and (data.regionType:find("group"))
4993+
and data.controlledChildren
49944994
and not WeakAuras.IsLoginFinished()
49954995
and not anchorFrameDeferred[data.id]
49964996
then

WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local fullName;
1414
local clipboard = {};
1515

1616
local function IsRegionAGroup(data)
17-
return data and (data.regionType:find("group"));
17+
return data and data.controlledChildren;
1818
end
1919

2020
local ignoreForCopyingDisplay = {
@@ -596,7 +596,7 @@ local methods = {
596596
if childData.parent then
597597
childButton:Ungroup();
598598
end
599-
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
599+
childButton:SetGroup(data.id);
600600
childButton:SetGroupOrder(#data.controlledChildren, #data.controlledChildren);
601601
childData.parent = data.id;
602602
WeakAuras.Add(childData);
@@ -605,13 +605,13 @@ local methods = {
605605
else
606606
tinsert(data.controlledChildren, self.grouping.id);
607607
local childButton = WeakAuras.GetDisplayButton(self.grouping.id);
608-
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
608+
childButton:SetGroup(data.id);
609609
childButton:SetGroupOrder(#data.controlledChildren, #data.controlledChildren);
610610
self.grouping.parent = data.id;
611611
WeakAuras.Add(self.grouping);
612612
WeakAuras.ClearAndUpdateOptions(self.grouping.id);
613613
end
614-
if (data.regionType:find("dynamicgroup")) then
614+
if (data.regionType:find("dynamicgroup", 1, true)) then
615615
self.grouping.xOffset = 0;
616616
self.grouping.yOffset = 0;
617617
end
@@ -925,7 +925,7 @@ local methods = {
925925
if (not data.controlledChildren) then
926926
local convertMenu = {};
927927
for regionType, regionData in pairs(WeakAuras.regionOptions) do
928-
if(not regionType:find("group") and regionType ~= "timer" and regionType ~= data.regionType) then
928+
if(regionType ~= data.regionType) then
929929
tinsert(convertMenu, {
930930
text = regionData.displayName,
931931
notCheckable = true,
@@ -1139,7 +1139,7 @@ local methods = {
11391139
self.frame:SetScript("OnClick", self.callbacks.OnClickGroupingSelf);
11401140
self:SetDescription(L["Cancel"], L["Do not group this display"]);
11411141
else
1142-
if(self.data.regionType:find("group")) then
1142+
if(self.data.controlledChildren) then
11431143
self.frame:SetScript("OnClick", self.callbacks.OnClickGrouping);
11441144
self:SetDescription(self.data.id, L["Add to group %s"]:format(self.data.id));
11451145
else
@@ -1383,7 +1383,7 @@ local methods = {
13831383
return self.frame.dgroup;
13841384
end,
13851385
["IsGroup"] = function(self)
1386-
return self.data.regionType:find("group")
1386+
return self.data.controlledChildren
13871387
end,
13881388
["SetData"] = function(self, data)
13891389
self.data = data;

WeakAurasOptions/AnimationOptions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ local function filterAnimPresetTypes(intable, id)
2323
for key, value in pairs(intable) do
2424
local preset = OptionsPrivate.Private.anim_presets[key];
2525
if(preset) then
26-
if(regionType:find("group")) then
26+
if(data.controlledChildren) then
2727
local valid = true;
2828
for index, childId in pairs(data.controlledChildren) do
2929
local childRegion = WeakAuras.regions[childId] and WeakAuras.regions[childId].region

WeakAurasOptions/CommonOptions.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
972972
local function IsParentDynamicGroup()
973973
if data.parent then
974974
local parentData = WeakAuras.GetData(data.parent)
975-
return parentData and parentData.regionType:find("dynamicgroup")
975+
return parentData and parentData.regionType:find("dynamicgroup", 1, true)
976976
end
977977
end
978978

@@ -1065,7 +1065,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
10651065
name = L["Anchored To"],
10661066
order = 72,
10671067
hidden = IsParentDynamicGroup,
1068-
values = (data.regionType:find("group")) and OptionsPrivate.Private.anchor_frame_types_group or OptionsPrivate.Private.anchor_frame_types,
1068+
values = data.controlledChildren and OptionsPrivate.Private.anchor_frame_types_group or OptionsPrivate.Private.anchor_frame_types,
10691069
},
10701070
-- Input field to select frame to anchor on
10711071
anchorFrameFrame = {

WeakAurasOptions/ExternalAddons.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function OptionsPrivate.CreateImportButtons()
6161
if(data) then
6262
for index, childId in pairs(data.controlledChildren) do
6363
local childButton = WeakAuras.GetDisplayButton(childId);
64-
childButton:SetGroup(groupId, data.regionType:find("dynamicgroup"));
64+
childButton:SetGroup(groupId);
6565
childButton:SetGroupOrder(index, #data.controlledChildren);
6666
end
6767

@@ -163,7 +163,7 @@ function OptionsPrivate.CreateImportButtons()
163163
if(data) then
164164
for index, childId in pairs(data.controlledChildren) do
165165
local childButton = WeakAuras.GetDisplayButton(childId);
166-
childButton:SetGroup(id, data.regionType:find("dynamicgroup"));
166+
childButton:SetGroup(id);
167167
childButton:SetGroupOrder(index, #data.controlledChildren);
168168
end
169169

WeakAurasOptions/OptionsFrames/FrameChooser.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function OptionsPrivate.StartFrameChooser(data, path)
5454
local focusIsGroup = false;
5555
for id, regionData in pairs(WeakAuras.regions) do
5656
if(regionData.region:IsVisible() and MouseIsOver(regionData.region)) then
57-
local isGroup = regionData.regionType:find("group");
57+
local isGroup = regionData.data.controlledChildren;
5858
if (not focusName or (not isGroup and focusIsGroup)) then
5959
focus = regionData.region;
6060
focusName = "WeakAuras:"..id;

WeakAurasOptions/OptionsFrames/MoverSizer.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ local function ConstructMoverSizer(parent)
669669
frame.lineX:Hide()
670670
end
671671

672-
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup") then
672+
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup", 1, true) then
673673
mover:SetScript("OnMouseDown", nil)
674674
mover:SetScript("OnMouseUp", nil)
675675
mover:SetScript("OnEvent", nil)
@@ -903,7 +903,7 @@ local function ConstructMoverSizer(parent)
903903
self.anchorPointIcon:SetPoint("CENTER", self.anchor, self.anchorPoint)
904904
local anchorX, anchorY = self.anchorPointIcon:GetCenter()
905905
anchorX, anchorY = anchorX or 0, anchorY or 0
906-
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup") then
906+
if data.parent and db.displays[data.parent] and db.displays[data.parent].regionType:find("dynamicgroup", 1, true) then
907907
self.selfPointIcon:Hide()
908908
self.anchorPointIcon:Hide()
909909
else

0 commit comments

Comments
 (0)