Skip to content

Commit

Permalink
Add castbars to pet, partypet and raidpet
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviana committed Sep 25, 2022
1 parent 7dbc1b8 commit 4cd58d8
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 5 deletions.
3 changes: 0 additions & 3 deletions modules/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,13 @@ function LUF:CreateConfig()
["player"] = true,
},
["castBar"] = {
["pet"] = true,
["pettarget"] = true,
["pettargettarget"] = true,
["targettarget"] = true,
["targettargettarget"] = true,
["partytarget"] = true,
["focustarget"] = true,
["focustargettarget"] = true,
["partypet"] = true,
["raidpet"] = true,
["maintanktarget"] = true,
["maintanktargettarget"] = true,
["mainassisttarget"] = true,
Expand Down
48 changes: 48 additions & 0 deletions modules/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ function LUF:LoadDefaults()
healthBar = { enabled = true, background = true, backgroundAlpha = 0.2, colorType = "happiness", reactionType="npc", height = 6, order = 10, posSlot = "CENTER"},
powerBar = { enabled = true, background = true, backgroundAlpha = 0.2, height = 4.5, order = 20, colorType = "type", posSlot = "CENTER" },
portrait = {enabled = true, type = "3D", alignment = "LEFT", width = 0.22, height = 4, order = 15, posSlot = "CENTER"},
castBar = { enabled = false, background = true, backgroundAlpha = 0.2, height = 3, icon = "HIDE", autoHide = true, order = 60, posSlot = "CENTER"},
xpBar = { enabled = true, height = 2, order = 80, background = true, backgroundAlpha = 0.2, alpha = 1, autoHide = true, posSlot = "CENTER" },
emptyBar = { enabled = false, height = 3, order = 50, reactionType="npc", class = true, alpha = 0.2, posSlot = "CENTER"},
range = { enabled = false },
Expand Down Expand Up @@ -399,6 +400,21 @@ function LUF:LoadDefaults()
size = 100,
},
},
["castBar"] = {
size = 10,
["left"] = {
tagline = "[castname]",
size = 100,
},
["center"] = {
tagline = "",
size = 100,
},
["right"] = {
tagline = "[casttime]",
size = 100,
},
},
["emptyBar"] = {
size = 10,
["left"] = {
Expand Down Expand Up @@ -2016,6 +2032,7 @@ function LUF:LoadDefaults()
portrait = {enabled = false, type = "3D", alignment = "LEFT", width = 0.22, height = 4, order = 15, posSlot = "CENTER"},
powerBar = { enabled = false, background = true, backgroundAlpha = 0.2, height = 4.5, order = 20, colorType = "type", posSlot = "CENTER" },
emptyBar = { enabled = false, height = 3, order = 50, reactionType="npc", class = true, alpha = 0.2, posSlot = "CENTER"},
castBar = { enabled = false, background = true, backgroundAlpha = 0.2, height = 3, icon = "HIDE", autoHide = true, order = 60, posSlot = "CENTER"},
range = { enabled = false },
highlight = { enabled = true, debuff = 2 },
borders = { enabled = true, debuff = 2, size = 1 },
Expand Down Expand Up @@ -2101,6 +2118,21 @@ function LUF:LoadDefaults()
size = 100,
},
},
["castBar"] = {
size = 10,
["left"] = {
tagline = "[castname]",
size = 100,
},
["center"] = {
tagline = "",
size = 100,
},
["right"] = {
tagline = "[casttime]",
size = 100,
},
},
["emptyBar"] = {
size = 10,
["left"] = {
Expand Down Expand Up @@ -2364,6 +2396,7 @@ function LUF:LoadDefaults()
portrait = {enabled = false, type = "3D", alignment = "LEFT", width = 0.22, height = 4, order = 15, posSlot = "CENTER"},
powerBar = { enabled = true, background = true, backgroundAlpha = 0.2, height = 1, order = 20, colorType = "type", vertical = true, posSlot = "right", posSlot = "RIGHT" },
emptyBar = { enabled = false, height = 3, order = 50, reactionType="npc", class = true, alpha = 0.2, posSlot = "CENTER"},
castBar = { enabled = false, background = true, backgroundAlpha = 0.2, height = 3, icon = "HIDE", autoHide = true, order = 60, posSlot = "CENTER"},
range = { enabled = false },
highlight = { enabled = true, debuff = 2 },
borders = { enabled = true, debuff = 2, size = 1 },
Expand Down Expand Up @@ -2449,6 +2482,21 @@ function LUF:LoadDefaults()
size = 100,
},
},
["castBar"] = {
size = 10,
["left"] = {
tagline = "[castname]",
size = 100,
},
["center"] = {
tagline = "",
size = 100,
},
["right"] = {
tagline = "[casttime]",
size = 100,
},
},
["emptyBar"] = {
size = 10,
["left"] = {
Expand Down
63 changes: 61 additions & 2 deletions modules/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,27 @@ local UnitSpecific = {
end,

pet = function(frame)
-- Castbar
local Castbar = CreateFrame("StatusBar", nil, frame)

local Background = Castbar:CreateTexture(nil, "BACKGROUND")
Background:SetAllPoints(Castbar)

local Icon = Castbar:CreateTexture(nil, "OVERLAY")
Icon:SetSize(10, 10)
Icon:SetPoint("TOPLEFT", Castbar, "TOPLEFT")

local SafeZone = Castbar:CreateTexture(nil, "OVERLAY")

Castbar.bg = Background
Castbar.Icon = Icon
Castbar.SafeZone = SafeZone
Castbar:SetScript("OnShow", LUF.PlaceModules)
Castbar:SetScript("OnHide", LUF.PlaceModules)
frame.Castbar = Castbar
frame.modules.castBar = Castbar
frame.modules.castBar.name = "Castbar"

-- XP Bar
local xpBarFrame = CreateFrame("Frame", nil, frame)
xpBarFrame:SetScript("OnSizeChanged", function() end)
Expand Down Expand Up @@ -388,7 +409,26 @@ local UnitSpecific = {
end,

partypet = function(frame)
-- Nothing here yet
-- Castbar
local Castbar = CreateFrame("StatusBar", nil, frame)

local Background = Castbar:CreateTexture(nil, "BACKGROUND")
Background:SetAllPoints(Castbar)

local Icon = Castbar:CreateTexture(nil, "OVERLAY")
Icon:SetSize(10, 10)
Icon:SetPoint("TOPLEFT", Castbar, "TOPLEFT")

local SafeZone = Castbar:CreateTexture(nil, "OVERLAY")

Castbar.bg = Background
Castbar.Icon = Icon
Castbar.SafeZone = SafeZone
Castbar:SetScript("OnShow", LUF.PlaceModules)
Castbar:SetScript("OnHide", LUF.PlaceModules)
frame.Castbar = Castbar
frame.modules.castBar = Castbar
frame.modules.castBar.name = "Castbar"
end,

raid = function(frame)
Expand All @@ -415,7 +455,26 @@ local UnitSpecific = {
end,

raidpet = function(frame)
-- Nothing here yet
-- Castbar
local Castbar = CreateFrame("StatusBar", nil, frame)

local Background = Castbar:CreateTexture(nil, "BACKGROUND")
Background:SetAllPoints(Castbar)

local Icon = Castbar:CreateTexture(nil, "OVERLAY")
Icon:SetSize(10, 10)
Icon:SetPoint("TOPLEFT", Castbar, "TOPLEFT")

local SafeZone = Castbar:CreateTexture(nil, "OVERLAY")

Castbar.bg = Background
Castbar.Icon = Icon
Castbar.SafeZone = SafeZone
Castbar:SetScript("OnShow", LUF.PlaceModules)
Castbar:SetScript("OnHide", LUF.PlaceModules)
frame.Castbar = Castbar
frame.modules.castBar = Castbar
frame.modules.castBar.name = "Castbar"
end,

maintank = function(frame)
Expand Down

0 comments on commit 4cd58d8

Please sign in to comment.