Skip to content

Commit

Permalink
Refactoring and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
greven committed Oct 26, 2020
1 parent 3b98cbc commit 3a78262
Show file tree
Hide file tree
Showing 15 changed files with 371 additions and 348 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Version 9.2.0:

- Refactoring
- Update Rogue filters
- Refactor AuraBar Filters and settings
- Add fonts and media to defaults
- Update player visibility function
- Update Target Quest Icon

### Version 9.1.1:

- Update frame visibility options
Expand Down
61 changes: 33 additions & 28 deletions api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,47 +56,52 @@ function api:RaidColor(unit)
return color and {color.r, color.g, color.b} or {.5, .5, .5}
end

-- Create Border
function api:CreateBorder(self, frame, e_size, f_level, texture)
local border = {edgeFile = texture, edgeSize = e_size}
frame:SetPoint("TOPLEFT", self, "TOPLEFT", -2, 2)
frame:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 2, -2)
frame:SetBackdrop(border)
frame:SetFrameLevel(f_level)
frame:Hide()
end

-- Set the Backdrop
function api:SetBackdrop(frame, inset_l, inset_r, inset_t, inset_b)
-- Set the frame backdrop
function api:SetBackdrop(self, insetLeft, insetRight, insetTop, insetBottom, color)
local frame = self

if self:GetObjectType() == "Texture" then
frame = self:GetParent()
end

local lvl = frame:GetFrameLevel()

if not frame.Backdrop then
local backdrop = CreateFrame("Frame", nil, frame, "BackdropTemplate")
backdrop = CreateFrame("Frame", nil, frame, "BackdropTemplate")
backdrop:SetAllPoints()
backdrop:SetFrameLevel(frame:GetFrameLevel())
backdrop:SetAllPoints(frame)
backdrop:SetFrameLevel(lvl == 0 and 0 or lvl - 1)

backdrop:SetBackdrop {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
tile = false,
tileSize = 0,
insets = {
left = -inset_l,
right = -inset_r,
top = -inset_t,
bottom = -inset_b
left = -insetLeft,
right = -insetRight,
top = -insetTop,
bottom = -insetBottom
}
}

backdrop:SetBackdropColor(
cfg.colors.backdrop.r,
cfg.colors.backdrop.g,
cfg.colors.backdrop.b,
cfg.colors.backdrop.a
)

backdrop:SetBackdropColor(unpack(color or cfg.colors.backdrop))
frame.Backdrop = backdrop
end
end

-- Create a backdrop border
function api:CreateBorder(self, borderFrame, edgeSize, frameLevel, texture)
if borderFrame:GetObjectType() == "Texture" then
borderFrame = self:GetParent()
end

local backdrop = {edgeFile = texture or "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = edgeSize}
borderFrame:SetPoint("TOPLEFT", self, "TOPLEFT", -2, 2)
borderFrame:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 2, -2)
borderFrame:SetBackdrop(backdrop)
borderFrame:SetFrameLevel(frameLevel or borderFrame:GetFrameLevel() - 1)
borderFrame:SetBackdropBorderColor(0, 0, 0)
borderFrame:Hide()
end

-- Fontstring Function
function api:CreateFontstring(frame, font, size, outline, layer, sublayer, inheritsFrom)
local fs = frame:CreateFontString(nil, layer or "OVERLAY", sublayer or 0, inheritsFrom or nil)
Expand Down Expand Up @@ -128,7 +133,7 @@ function api:CreateDropShadow(frame, point, edge, color)
}
)
shadow:SetBackdropColor(0, 0, 0, 0)
shadow:SetBackdropBorderColor(unpack(color))
shadow:SetBackdropBorderColor(unpack(color or cfg.frames.shadow.color))
end

-- Frame Fader
Expand Down
22 changes: 11 additions & 11 deletions config/debuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ ns.debuffs = debuffs

debuffs.list = {
player = {
[GetSpellInfo(45181) or "Cheated Death"] = true,
[GetSpellInfo(57723) or "Exhaustion"] = true,
[GetSpellInfo(264689) or "Fatigued"] = true,
[GetSpellInfo(95809) or "Insanity"] = true,
[GetSpellInfo(57724) or "Sated"] = true,
[GetSpellInfo(80354) or "Temporal Displacement"] = true
[45181 or "Cheated Death"] = true,
[57723 or "Exhaustion"] = true,
[264689 or "Fatigued"] = true,
[95809 or "Insanity"] = true,
[57724 or "Sated"] = true,
[80354 or "Temporal Displacement"] = true
},
party = {
[GetSpellInfo(57723) or "Exhaustion"] = true,
[GetSpellInfo(264689) or "Fatigued"] = true,
[GetSpellInfo(95809) or "Insanity"] = true,
[GetSpellInfo(57724) or "Sated"] = true,
[GetSpellInfo(80354) or "Temporal Displacement"] = true
[57723 or "Exhaustion"] = true,
[264689 or "Fatigued"] = true,
[95809 or "Insanity"] = true,
[57724 or "Sated"] = true,
[80354 or "Temporal Displacement"] = true
}
}
155 changes: 113 additions & 42 deletions config/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cfg.healingSpecs = {
-- -----------------------------------

cfg.colors = {
backdrop = {r = 0, g = 0, b = 0, a = 1}, -- Backdrop Color (Some frames might not be affected)
backdrop = {0, 0, 0, 0.9}, -- Backdrop Color (Some frames might not be affected)
health = {0.2, 0.2, 0.2, 1}, -- Fallback color
inverted = {0.1, 0.1, 0.1, 1} -- Inverted Color
}
Expand Down Expand Up @@ -102,14 +102,53 @@ cfg.frames = {
},
shadow = {
show = true, -- Use frame drop shadows
opacity = 0.7
color = {0, 0, 0, 0.7}
},
range = {
insideAlpha = 1,
outsideAlpha = 0.25
}
}

-- -----------------------------------
-- > Elements
-- -----------------------------------

cfg.elements = {
castbar = {
backdrop = {
color = {0, 0, 0, 0.9}
},
timeToHold = 1.5,
fader = {
fadeInAlpha = 1,
fadeInDuration = 0.1,
fadeOutAlpha = 0,
fadeOutDuration = 0.3,
fadeOutDelay = 0.5
}
},
experiencebar = {
show = true,
height = 3,
width = Minimap:GetWidth() + 4,
pos = {a1 = "TOPLEFT", a2 = "BOTTOMLEFT", af = "Minimap", x = -2, y = -12}
},
artifactpowerbar = {
show = true,
height = 3,
width = Minimap:GetWidth() + 4,
pos = {a1 = "TOPLEFT", a2 = "BOTTOMLEFT", af = "Minimap", x = -2, y = -24}
},
altpowerbar = {
show = true
},
mirrorTimers = {
width = 220,
height = cfg.frames.main.height + 2
}
}

-- -----------------------------------
-- > UNITS
-- -----------------------------------
Expand Down Expand Up @@ -151,8 +190,13 @@ cfg.units = {
}
},
auras = {
buffs = {
show = false,
spellName = false
},
debuffs = {
show = true
show = true,
spellName = true
},
barTimers = {
show = true
Expand Down Expand Up @@ -195,7 +239,12 @@ cfg.units = {
},
auras = {
buffs = {
show = true
show = true,
spellName = false
},
debuffs = {
show = false,
spellName = false
},
barTimers = {
show = true
Expand Down Expand Up @@ -226,6 +275,16 @@ cfg.units = {
frequentUpdates = false,
smooth = true
},
auras = {
buffs = {
show = false,
spellName = false
},
debuffs = {
show = false,
spellName = false
}
},
fader = {
fadeInAlpha = 1,
fadeInDuration = 0.3,
Expand Down Expand Up @@ -257,6 +316,16 @@ cfg.units = {
width = 282,
height = cfg.frames.main.height
},
auras = {
buffs = {
show = false,
spellName = false
},
debuffs = {
show = false,
spellName = false
}
},
fader = {
fadeInAlpha = 1,
fadeInDuration = 0.3,
Expand Down Expand Up @@ -288,8 +357,15 @@ cfg.units = {
frequentUpdates = false,
smooth = true
},
buffs = {
filter = true
auras = {
buffs = {
show = false,
filter = true
},
debuffs = {
show = false,
spellName = false
}
},
visibility = "[petbattle][overridebar][vehicleui][possessbar][shapeshift][channeling] hide; [pet,mod][pet,harm][pet,combat] show; hide",
fader = {
Expand Down Expand Up @@ -323,6 +399,16 @@ cfg.units = {
color = {5 / 255, 107 / 255, 246 / 255},
width = 282,
height = cfg.frames.main.height
},
auras = {
buffs = {
show = false,
spellName = false
},
debuffs = {
show = false,
spellName = false
}
}
},
arena = {
Expand All @@ -342,6 +428,16 @@ cfg.units = {
classColored = false,
frequentUpdates = false,
smooth = true
},
auras = {
buffs = {
show = false,
spellName = false
},
debuffs = {
show = false,
spellName = false
}
}
},
party = {
Expand All @@ -363,6 +459,16 @@ cfg.units = {
frequentUpdates = false,
smooth = true
},
auras = {
buffs = {
show = false,
spellName = false
},
debuffs = {
show = true,
spellName = false
}
},
showPortraits = true,
forceRole = false
},
Expand All @@ -372,7 +478,7 @@ cfg.units = {
nameplate = {
show = true,
width = 120,
height = 8,
height = 6,
pos = {a1 = "CENTER", a2 = "CENTER", af = "UIParent", x = 0, y = 0},
power = {
height = 4,
Expand All @@ -394,38 +500,3 @@ cfg.units = {
showHighlight = false
}
}

cfg.elements = {
castbar = {
backdrop = {
color = {r = 0, g = 0, b = 0, a = 0.85}
},
timeToHold = 1.5,
fader = {
fadeInAlpha = 1,
fadeInDuration = 0.1,
fadeOutAlpha = 0,
fadeOutDuration = 0.3,
fadeOutDelay = 0.5
}
},
experiencebar = {
show = true,
height = 3,
width = Minimap:GetWidth() + 4,
pos = {a1 = "TOPLEFT", a2 = "BOTTOMLEFT", af = "Minimap", x = -2, y = -12}
},
artifactpowerbar = {
show = true,
height = 3,
width = Minimap:GetWidth() + 4,
pos = {a1 = "TOPLEFT", a2 = "BOTTOMLEFT", af = "Minimap", x = -2, y = -24}
},
altpowerbar = {
show = true
},
mirrorTimers = {
width = 220,
height = cfg.frames.main.height + 2
}
}
Loading

0 comments on commit 3a78262

Please sign in to comment.