Skip to content

Commit c271229

Browse files
committed
simple adjustments
1 parent 42fa889 commit c271229

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
@@ -1146,7 +1146,7 @@ local function modify(parent, region, data)
11461146
Private.Animate("controlPoint", data.uid, "controlPoint", anim, regionData.controlPoint, true)
11471147
end
11481148
end
1149-
regionData.xOffset = xq
1149+
regionData.xOffset = x
11501150
regionData.yOffset = y
11511151
regionData.shown = show
11521152
end
@@ -1158,9 +1158,6 @@ local function modify(parent, region, data)
11581158
self:Resize()
11591159
end
11601160

1161-
function region:ApplyUpdates()
1162-
end
1163-
11641161
function region:Resize()
11651162
-- Resizes the dynamic group, for background and border purposes
11661163
if not self:IsSuspended() and false then

WeakAuras/Transmission.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ local function importPendingData()
582582
tinsert(parentData.controlledChildren, installedChild.id)
583583
WeakAuras.NewDisplayButton(installedChild)
584584
local childButton = WeakAuras.GetDisplayButton(installedChild.id)
585-
childButton:SetGroup(parentData.id, parentData.regionType:find("dynamicgroup"))
585+
childButton:SetGroup(parentData.id)
586586
childButton:SetGroupOrder(index, #parentData.controlledChildren)
587587
coroutine.yield()
588588
end

WeakAuras/WeakAuras.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,12 +2347,12 @@ function WeakAuras.AddMany(table, takeSnapshots)
23472347
local groups = {}
23482348
for id, data in pairs(idtable) do
23492349
load(id, {});
2350-
if data.regionType:find("group") then
2350+
if data.controlledChildren then
23512351
groups[data] = true
23522352
end
23532353
end
23542354
for data in pairs(groups) do
2355-
if data.regionType:find("dynamicgroup") then
2355+
if data.regionType:find("dynamicgroup", 1, true) then
23562356
regions[data.id].region:ReloadControlledChildren()
23572357
else
23582358
WeakAuras.Add(data)
@@ -2866,11 +2866,11 @@ function WeakAuras.SetRegion(data, cloneId)
28662866
regionType = regionType,
28672867
region = region
28682868
};
2869-
if not regionType:find("group") then
2869+
if data.controlledChildren then
2870+
region.toShow = true
2871+
else
28702872
region.toShow = false
28712873
region:Hide()
2872-
else
2873-
region.toShow = true
28742874
end
28752875
else
28762876
region = regions[id].region;
@@ -5001,7 +5001,7 @@ local anchorFrameDeferred = {}
50015001

50025002
function Private.AnchorFrame(data, region, parent)
50035003
if data.anchorFrameType == "CUSTOM"
5004-
and (data.regionType:find("group"))
5004+
and data.controlledChildren
50055005
and not WeakAuras.IsLoginFinished()
50065006
and not anchorFrameDeferred[data.id]
50075007
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 = {
@@ -599,7 +599,7 @@ local methods = {
599599
if childData.parent then
600600
childButton:Ungroup();
601601
end
602-
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
602+
childButton:SetGroup(data.id);
603603
childButton:SetGroupOrder(#data.controlledChildren, #data.controlledChildren);
604604
childData.parent = data.id;
605605
WeakAuras.Add(childData);
@@ -608,13 +608,13 @@ local methods = {
608608
else
609609
tinsert(data.controlledChildren, self.grouping.id);
610610
local childButton = WeakAuras.GetDisplayButton(self.grouping.id);
611-
childButton:SetGroup(data.id, data.regionType:find("dynamicgroup"));
611+
childButton:SetGroup(data.id);
612612
childButton:SetGroupOrder(#data.controlledChildren, #data.controlledChildren);
613613
self.grouping.parent = data.id;
614614
WeakAuras.Add(self.grouping);
615615
WeakAuras.ClearAndUpdateOptions(self.grouping.id);
616616
end
617-
if (data.regionType:find("dynamicgroup")) then
617+
if (data.regionType:find("dynamicgroup", 1, true)) then
618618
self.grouping.xOffset = 0;
619619
self.grouping.yOffset = 0;
620620
end
@@ -910,7 +910,7 @@ local methods = {
910910
if (not data.controlledChildren) then
911911
local convertMenu = {};
912912
for regionType, regionData in pairs(WeakAuras.regionOptions) do
913-
if(not regionType:find("group") and regionType ~= "timer" and regionType ~= data.regionType) then
913+
if(regionType ~= data.regionType) then
914914
tinsert(convertMenu, {
915915
text = regionData.displayName,
916916
notCheckable = true,
@@ -1107,7 +1107,7 @@ local methods = {
11071107
self.frame:SetScript("OnClick", self.callbacks.OnClickGroupingSelf);
11081108
self:SetDescription(L["Cancel"], L["Do not group this display"]);
11091109
else
1110-
if(self.data.regionType:find("group")) then
1110+
if(self.data.controlledChildren) then
11111111
self.frame:SetScript("OnClick", self.callbacks.OnClickGrouping);
11121112
self:SetDescription(self.data.id, L["Add to group %s"]:format(self.data.id));
11131113
else
@@ -1359,7 +1359,7 @@ local methods = {
13591359
return self.frame.dgroup;
13601360
end,
13611361
["IsGroup"] = function(self)
1362-
return self.data.regionType:find("group")
1362+
return self.data.controlledChildren
13631363
end,
13641364
["SetData"] = function(self, data)
13651365
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)