Skip to content

Commit 1fb3c16

Browse files
committed
new ignorePartyTargetFrame & ignorePartyTargetFrame options
default enable, and set for SUF party's targets
1 parent 82ec9b3 commit 1fb3c16

File tree

2 files changed

+157
-138
lines changed

2 files changed

+157
-138
lines changed

LibGetFrame-1.0.lua

+10
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ local defaultTargettargetFrames = {
6767
"oUF_ToT",
6868
"TargetTargetFrame",
6969
}
70+
local defaultPartyTargetFrames = {
71+
"SUFChildpartytarget",
72+
}
7073

7174
local GetFramesCache = {}
7275
local FrameToUnitFresh = {}
@@ -176,9 +179,11 @@ local defaultOptions = {
176179
ignorePlayerFrame = true,
177180
ignoreTargetFrame = true,
178181
ignoreTargettargetFrame = true,
182+
ignorePartyTargetFrame = true,
179183
playerFrames = defaultPlayerFrames,
180184
targetFrames = defaultTargetFrames,
181185
targettargetFrames = defaultTargettargetFrames,
186+
partyTargetFrames = defaultPartyTargetFrames,
182187
ignoreFrames = {
183188
"PitBull4_Frames_Target's target's target",
184189
"ElvUF_PartyGroup%dUnitButton%dTarget",
@@ -221,6 +226,11 @@ function lib.GetUnitFrame(target, opt)
221226
tinsert(ignoredFrames, v)
222227
end
223228
end
229+
if opt.ignorePartyTargetFrame then
230+
for _,v in pairs(opt.partyTarget) do
231+
tinsert(ignoredFrames, v)
232+
end
233+
end
224234

225235
local frames = GetUnitFrames(target, ignoredFrames)
226236
if not frames then return end

README.md

+147-138
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,147 @@
1-
# LibGetFrame
2-
3-
Return unit frame for a given unit
4-
5-
## Usage
6-
7-
```Lua
8-
local LGF = LibStub("LibGetFrame-1.0")
9-
local frame = LGF.GetUnitFrame(unit , options)
10-
```
11-
12-
## Options
13-
14-
- framePriorities : array, default :
15-
16-
```Lua
17-
{
18-
-- raid frames
19-
[1] = "^Vd1", -- vuhdo
20-
[2] = "^Vd2", -- vuhdo
21-
[3] = "^Vd3", -- vuhdo
22-
[4] = "^Vd4", -- vuhdo
23-
[5] = "^Vd5", -- vuhdo
24-
[6] = "^Vd", -- vuhdo
25-
[7] = "^HealBot", -- healbot
26-
[8] = "^GridLayout", -- grid
27-
[9] = "^Grid2Layout", -- grid2
28-
[10] = "^ElvUF_RaidGroup", -- elv
29-
[11] = "^oUF_bdGrid", -- bdgrid
30-
[12] = "^oUF.*raid", -- generic oUF
31-
[13] = "^LimeGroup", -- lime
32-
[14] = "^SUFHeaderraid", -- suf
33-
[15] = "^CompactRaid", -- blizz
34-
-- party frames
35-
[16] = "^SUFHeaderparty", --suf
36-
[17] = "^ElvUF_PartyGroup", -- elv
37-
[18] = "^oUF.*party", -- generic oUF
38-
[19] = "^PitBull4_Groups_Party", -- pitbull4
39-
[20] = "^CompactParty", -- blizz
40-
-- player frame
41-
[21] = "^SUFUnitplayer",
42-
[22] = "^PitBull4_Frames_Player",
43-
[23] = "^ElvUF_Player",
44-
[24] = "^oUF.*player",
45-
[25] = "^PlayerFrame",
46-
}
47-
```
48-
49-
- ignorePlayerFrame : boolean (default true)
50-
- ignoreTargetFrame : boolean (default true)
51-
- ignoreTargettargetFrame : boolean (default true)
52-
- playerFrames : array, default :
53-
54-
```Lua
55-
{
56-
"SUFUnitplayer",
57-
"PitBull4_Frames_Player",
58-
"ElvUF_Player",
59-
"oUF_TukuiPlayer",
60-
"PlayerFrame",
61-
}
62-
```
63-
64-
- targetFrames : array, default :
65-
66-
```Lua
67-
{
68-
"SUFUnittarget",
69-
"PitBull4_Frames_Target",
70-
"ElvUF_Target",
71-
"TargetFrame",
72-
"oUF_TukuiTarget",
73-
}
74-
```
75-
76-
- targettargetFrames : array, default :
77-
78-
```Lua
79-
{
80-
"SUFUnittargetarget",
81-
"PitBull4_Frames_TargetTarget",
82-
"ElvUF_TargetTarget",
83-
"TargetTargetFrame",
84-
"oUF_TukuiTargetTarget",
85-
}
86-
```
87-
88-
- ignoreFrames : array, default :
89-
90-
```Lua
91-
{ }
92-
```
93-
94-
- returnAll : boolean (default false)
95-
96-
## Examples
97-
98-
### Glow player frame
99-
100-
```Lua
101-
local LGF = LibStub("LibGetFrame-1.0")
102-
local LCG = LibStub("LibCustomGlow-1.0")
103-
local frame = LGF.GetUnitFrame("player")
104-
105-
if frame then
106-
LCG.ButtonGlow_Start(frame)
107-
-- LCG.ButtonGlow_Stop(frame)
108-
end
109-
```
110-
111-
### Glow every frames for your target
112-
113-
```Lua
114-
local LGF = LibStub("LibGetFrame-1.0")
115-
local LCG = LibStub("LibCustomGlow-1.0")
116-
117-
local frames = LGF.GetUnitFrame("target", {
118-
ignorePlayerFrame = false,
119-
ignoreTargetFrame = false,
120-
ignoreTargettargetFrame = false,
121-
returnAll = true,
122-
})
123-
124-
for _, frame in pairs(frames) do
125-
LCG.ButtonGlow_Start(frame)
126-
--LCG.ButtonGlow_Stop(frame)
127-
end
128-
```
129-
130-
### Ignore Vuhdo panel 2 and 3
131-
132-
```Lua
133-
local frame = LGF.GetUnitFrame("player", {
134-
ignoreFrames = { "Vd2.*", "Vd3.*" }
135-
})
136-
```
137-
138-
[GitHub Project](https://github.com/mrbuds/LibGetFrame)
1+
# LibGetFrame
2+
3+
Return unit frame for a given unit
4+
5+
## Usage
6+
7+
```Lua
8+
local LGF = LibStub("LibGetFrame-1.0")
9+
local frame = LGF.GetUnitFrame(unit , options)
10+
```
11+
12+
## Options
13+
14+
- framePriorities : array, default :
15+
16+
```Lua
17+
{
18+
-- raid frames
19+
[1] = "^Vd1", -- vuhdo
20+
[2] = "^Vd2", -- vuhdo
21+
[3] = "^Vd3", -- vuhdo
22+
[4] = "^Vd4", -- vuhdo
23+
[5] = "^Vd5", -- vuhdo
24+
[6] = "^Vd", -- vuhdo
25+
[7] = "^HealBot", -- healbot
26+
[8] = "^GridLayout", -- grid
27+
[9] = "^Grid2Layout", -- grid2
28+
[10] = "^ElvUF_RaidGroup", -- elv
29+
[11] = "^oUF_bdGrid", -- bdgrid
30+
[12] = "^oUF.*raid", -- generic oUF
31+
[13] = "^LimeGroup", -- lime
32+
[14] = "^SUFHeaderraid", -- suf
33+
[15] = "^CompactRaid", -- blizz
34+
-- party frames
35+
[16] = "^SUFHeaderparty", --suf
36+
[17] = "^ElvUF_PartyGroup", -- elv
37+
[18] = "^oUF.*party", -- generic oUF
38+
[19] = "^PitBull4_Groups_Party", -- pitbull4
39+
[20] = "^CompactParty", -- blizz
40+
-- player frame
41+
[21] = "^SUFUnitplayer",
42+
[22] = "^PitBull4_Frames_Player",
43+
[23] = "^ElvUF_Player",
44+
[24] = "^oUF.*player",
45+
[25] = "^PlayerFrame",
46+
}
47+
```
48+
49+
- ignorePlayerFrame : boolean (default true)
50+
- ignoreTargetFrame : boolean (default true)
51+
- ignoreTargettargetFrame : boolean (default true)
52+
- ignorePartyTargetFrame : boolean (default true)
53+
- playerFrames : array, default :
54+
55+
```Lua
56+
{
57+
"SUFUnitplayer",
58+
"PitBull4_Frames_Player",
59+
"ElvUF_Player",
60+
"oUF_TukuiPlayer",
61+
"PlayerFrame",
62+
}
63+
```
64+
65+
- targetFrames : array, default :
66+
67+
```Lua
68+
{
69+
"SUFUnittarget",
70+
"PitBull4_Frames_Target",
71+
"ElvUF_Target",
72+
"TargetFrame",
73+
"oUF_TukuiTarget",
74+
}
75+
```
76+
77+
- targettargetFrames : array, default :
78+
79+
```Lua
80+
{
81+
"SUFUnittargetarget",
82+
"PitBull4_Frames_TargetTarget",
83+
"ElvUF_TargetTarget",
84+
"TargetTargetFrame",
85+
"oUF_TukuiTargetTarget",
86+
}
87+
```
88+
89+
- ignorePartyTargetFrame : array, default :
90+
91+
```Lua
92+
{
93+
"SUFChildpartytarget",
94+
}
95+
```
96+
97+
- ignoreFrames : array, default :
98+
99+
```Lua
100+
{ }
101+
```
102+
103+
- returnAll : boolean (default false)
104+
105+
## Examples
106+
107+
### Glow player frame
108+
109+
```Lua
110+
local LGF = LibStub("LibGetFrame-1.0")
111+
local LCG = LibStub("LibCustomGlow-1.0")
112+
local frame = LGF.GetUnitFrame("player")
113+
114+
if frame then
115+
LCG.ButtonGlow_Start(frame)
116+
-- LCG.ButtonGlow_Stop(frame)
117+
end
118+
```
119+
120+
### Glow every frames for your target
121+
122+
```Lua
123+
local LGF = LibStub("LibGetFrame-1.0")
124+
local LCG = LibStub("LibCustomGlow-1.0")
125+
126+
local frames = LGF.GetUnitFrame("target", {
127+
ignorePlayerFrame = false,
128+
ignoreTargetFrame = false,
129+
ignoreTargettargetFrame = false,
130+
returnAll = true,
131+
})
132+
133+
for _, frame in pairs(frames) do
134+
LCG.ButtonGlow_Start(frame)
135+
--LCG.ButtonGlow_Stop(frame)
136+
end
137+
```
138+
139+
### Ignore Vuhdo panel 2 and 3
140+
141+
```Lua
142+
local frame = LGF.GetUnitFrame("player", {
143+
ignoreFrames = { "Vd2.*", "Vd3.*" }
144+
})
145+
```
146+
147+
[GitHub Project](https://github.com/mrbuds/LibGetFrame)

0 commit comments

Comments
 (0)