Skip to content

Commit

Permalink
Add visibility options
Browse files Browse the repository at this point in the history
  • Loading branch information
greven committed Oct 18, 2020
1 parent 72765a4 commit 3714176
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 15 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
### Version 9.1.0:

- Add frame visibility options
- Move default Pet position
- Add visibility conditions to pet frame

### Version 9.0.2:

- New version of oUF_MovableFrames
- Add scaling to frames

### Version 9.0.1:

- First pass for .
- First pass for Shadowlands.

### Version 8.0.12:

Expand Down
9 changes: 9 additions & 0 deletions config/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,14 @@ local cfg, oUF = ns.cfg, ns.oUF
-- x = cfg.frames.main.margin,
-- y = 0
-- }
-- cfg.units.focus.pos = {
-- a1 = "BOTTOMLEFT",
-- a2 = "TOPLEFT",
-- af = "oUF_LumenPlayer",
-- x = 0,
-- y = cfg.frames.secondary.margin
-- }
-- cfg.units.pet.width = cfg.frames.secondary.width
-- cfg.units.pet.pos = {a1 = "BOTTOMLEFT", a2 = "TOPLEFT", af = "oUF_LumenPlayer", x = 0, y = cfg.frames.secondary.margin},

-- ------------------------------------------------------------------------
15 changes: 11 additions & 4 deletions config/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ cfg.units = {
show = true,
width = cfg.frames.secondary.width,
height = cfg.frames.secondary.height,
pos = {a1 = "BOTTOMRIGHT", a2 = "TOPRIGHT", af = "oUF_LumenPlayer", x = 0, y = cfg.frames.secondary.margin},
pos = {a1 = "BOTTOMLEFT", a2 = "TOPLEFT", af = "oUF_LumenPlayer", x = 0, y = cfg.frames.secondary.margin},
health = {
classColored = true,
gradientColored = false,
Expand All @@ -208,9 +208,15 @@ cfg.units = {
},
pet = {
show = true,
width = cfg.frames.secondary.width,
width = 140,
height = cfg.frames.secondary.height,
pos = {a1 = "BOTTOMLEFT", a2 = "TOPLEFT", af = "oUF_LumenPlayer", x = 0, y = cfg.frames.secondary.margin},
pos = {
a1 = "LEFT",
a2 = "RIGHT",
af = "oUF_LumenPlayer",
x = cfg.frames.main.margin / 2 - 140 / 2,
y = 0
},
health = {
classColored = false,
gradientColored = true,
Expand All @@ -226,7 +232,8 @@ cfg.units = {
},
buffs = {
filter = true
}
},
visibility = "[petbattle][overridebar][vehicleui][possessbar][shapeshift][channeling] hide; [pet,mod][harm][combat] show; hide"
},
boss = {
show = true,
Expand Down
2 changes: 1 addition & 1 deletion units/focus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ local createStyle = function(self)
lum:globalStyle(self, "secondary")

-- Texts
core:createNameString(self, font, cfg.fontsize, "THINOUTLINE", 2, 0, "LEFT", self.cfg.width - 4)
core:createNameString(self, font, cfg.fontsize - 1, "THINOUTLINE", 2, 0, "LEFT", self.cfg.width - 4)
self:Tag(self.Name, "[lum:name]")
-- core:createHPString(self, font, cfg.fontsize - 4, "THINOUTLINE", -4, 0, "RIGHT")
-- self:Tag(self.Health.value, '[lum:hpperc]')
Expand Down
17 changes: 11 additions & 6 deletions units/pet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ local createStyle = function(self)
lum:globalStyle(self, "secondary")

-- Texts
core:createNameString(self, font, cfg.fontsize, "THINOUTLINE", 2, 0, "LEFT", self.cfg.width - 8)
core:createNameString(self, font, cfg.fontsize - 1, "THINOUTLINE", 2, 0, "LEFT", self.cfg.width - 8)
self:Tag(self.Name, "[lum:name]")
-- core:createHPString(self, font, cfg.fontsize - 4, "THINOUTLINE", -4, 0, "RIGHT")
-- self:Tag(self.Health.value, '[lum:hpperc]')
Expand All @@ -71,10 +71,10 @@ local createStyle = function(self)
self.Health.PostUpdate = PostUpdateHealth

-- Buffs
local buffs = auras:CreateAura(self, 4, 1, cfg.frames.secondary.height + 4, 2)
buffs:SetPoint("BOTTOMRIGHT", "oUF_LumenPlayer", "TOPLEFT", -6, 6)
buffs.initialAnchor = "BOTTOMRIGHT"
buffs["growth-x"] = "LEFT"
local buffs = auras:CreateAura(self, 5, 1, cfg.frames.secondary.height + 4, 2)
buffs:SetPoint("BOTTOMLEFT", "oUF_LumenPet", "TOPLEFT", -2, 6)
buffs.initialAnchor = "BOTTOMLEFT"
buffs["growth-x"] = "RIGHT"
buffs.PostUpdateIcon = PostUpdateIcon
if (self.cfg.buffs.filter) then
buffs.CustomFilter = PetBuffsFilter
Expand All @@ -91,5 +91,10 @@ end
if cfg.units[frame].show then
oUF:RegisterStyle(A .. frame:gsub("^%l", string.upper), createStyle)
oUF:SetActiveStyle(A .. frame:gsub("^%l", string.upper))
oUF:Spawn(frame, A .. frame:gsub("^%l", string.upper))
local f = oUF:Spawn(frame, A .. frame:gsub("^%l", string.upper))
-- Frame Visibility
if cfg.units[frame].visibility then
f:Disable()
RegisterStateDriver(f, "visibility", cfg.units[frame].visibility)
end
end
7 changes: 6 additions & 1 deletion units/target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,10 @@ end
if cfg.units[frame].show then
oUF:RegisterStyle(A .. frame:gsub("^%l", string.upper), createStyle)
oUF:SetActiveStyle(A .. frame:gsub("^%l", string.upper))
oUF:Spawn(frame, A .. frame:gsub("^%l", string.upper))
local f = oUF:Spawn(frame, A .. frame:gsub("^%l", string.upper))
-- Frame Visibility
if cfg.units[frame].visibility then
f:Disable()
RegisterStateDriver(f, "visibility", cfg.units[frame].visibility)
end
end
9 changes: 7 additions & 2 deletions units/targettarget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ local createStyle = function(self)
lum:globalStyle(self, "secondary")

-- Texts
core:createNameString(self, font, cfg.fontsize, "THINOUTLINE", 2, 0, "LEFT", self.cfg.width - 4)
core:createNameString(self, font, cfg.fontsize - 1, "THINOUTLINE", 2, 0, "LEFT", self.cfg.width - 4)
self:Tag(self.Name, "[lum:name]")
-- core:createHPString(self, font, cfg.fontsize - 4, "THINOUTLINE", -4, 0, "RIGHT")
-- self:Tag(self.Health.value, '[lum:hpperc]')
Expand All @@ -54,5 +54,10 @@ end
if cfg.units[frame].show then
oUF:RegisterStyle(A .. frame:gsub("^%l", string.upper), createStyle)
oUF:SetActiveStyle(A .. frame:gsub("^%l", string.upper))
oUF:Spawn(frame, A .. frame:gsub("^%l", string.upper))
local f = oUF:Spawn(frame, A .. frame:gsub("^%l", string.upper))
-- Frame Visibility
if cfg.units[frame].visibility then
f:Disable()
RegisterStateDriver(f, "visibility", cfg.units[frame].visibility)
end
end

0 comments on commit 3714176

Please sign in to comment.