Skip to content

Commit

Permalink
add option for ignoring parent scale & not showing pet casts for name…
Browse files Browse the repository at this point in the history
…plates
  • Loading branch information
wardz committed Sep 14, 2024
1 parent 7699e33 commit 0e4b280
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 9 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ read_globals = {
"UnitCastingInfo",
"UnitChannelInfo",
"UnitIsFriend",
"UnitIsOtherPlayersPet",
"strsplit",
"C_AddOns",
"C_Spell",
Expand Down
1 change: 1 addition & 0 deletions ClassicCastbars/ClassicCastbars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function ClassicCastbars:GetCastbarFrameIfEnabled(unitID)
if not self.db.nameplate.showForFriendly and isFriendly then return end
if not self.db.nameplate.showForEnemy and not isFriendly then return end
if UnitIsUnit("player", unitID) then return end -- personal resource display nameplate
if not self.db.nameplate.showForPets and UnitIsOtherPlayersPet(unitID) then return end
end

return self:GetCastbarFrame(unitID)
Expand Down
1 change: 1 addition & 0 deletions ClassicCastbars/core/Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function ClassicCastbars:SetCastbarStyle(castbar, db, unitID)
castbar.Text:SetWidth(db.width - 10) -- ensures text gets truncated
castbar.currWidth = db.width -- avoids having to use a function call later on in OnUpdate
castbar:SetIgnoreParentAlpha(db.ignoreParentAlpha)
castbar:SetIgnoreParentScale(db.ignoreParentScale)

castbar.Border:SetDrawLayer("ARTWORK", 1)
castbar.BorderShield:SetDrawLayer("ARTWORK", 2)
Expand Down
9 changes: 8 additions & 1 deletion ClassicCastbars/core/SavedVariables.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
local _, namespace = ...

namespace.defaultConfig = {
version = "45",
version = "46",
locale = GetLocale(),
usePerCharacterSettings = false,

nameplate = {
enabled = true,
showForFriendly = true,
showForEnemy = true,
showForPets = true,
width = 106,
height = 11,
iconSize = 13,
Expand Down Expand Up @@ -43,6 +44,7 @@ namespace.defaultConfig = {
borderPaddingHeight = 1.3,
borderPaddingWidth = 1.17,
edgeSizeLSM = 18,
ignoreParentScale = false,
},

target = {
Expand Down Expand Up @@ -81,6 +83,7 @@ namespace.defaultConfig = {
borderPaddingHeight = 1.3,
borderPaddingWidth = 1.17,
edgeSizeLSM = 18,
ignoreParentScale = false,
},

focus = {
Expand Down Expand Up @@ -119,6 +122,7 @@ namespace.defaultConfig = {
borderPaddingHeight = 1.3,
borderPaddingWidth = 1.17,
edgeSizeLSM = 18,
ignoreParentScale = false,
},

party = {
Expand Down Expand Up @@ -157,6 +161,7 @@ namespace.defaultConfig = {
borderPaddingHeight = 1.3,
borderPaddingWidth = 1.17,
edgeSizeLSM = 18,
ignoreParentScale = false,
},

arena = {
Expand Down Expand Up @@ -195,6 +200,7 @@ namespace.defaultConfig = {
borderPaddingHeight = 1.3,
borderPaddingWidth = 1.17,
edgeSizeLSM = 18,
ignoreParentScale = false,
},

player = {
Expand Down Expand Up @@ -234,5 +240,6 @@ namespace.defaultConfig = {
borderPaddingHeight = 1.3,
borderPaddingWidth = 1.17,
edgeSizeLSM = 18,
ignoreParentScale = false,
},
}
33 changes: 25 additions & 8 deletions ClassicCastbars_Options/ClassicCastbars_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,33 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
disabled = ModuleIsDisabled,
hidden = unitID ~= "nameplate",
},
autoPosition = {
showForPets = {
order = 4,
width = "full",
name = L.SHOW_FOR_PETS,
type = "toggle",
disabled = ModuleIsDisabled,
hidden = unitID ~= "nameplate",
},
autoPosition = {
order = 5,
width = "full",
name = L.AUTO_POS_BAR,
desc = unitID ~= "player" and L.AUTO_POS_BAR_TOOLTIP or "",
type = "toggle",
hidden = unitID == "nameplate" or unitID == "party" or unitID == "arena",
disabled = ModuleIsDisabled,
},
showTimer = {
order = 5,
order = 6,
width = "full",
name = L.SHOW_TIMER,
desc = L.SHOW_TIMER_TOOLTIP,
type = "toggle",
disabled = ModuleIsDisabled,
},
showTotalTimer = {
order = 5,
order = 7,
width = "full",
name = L.SHOW_TOTAL_TIMER,
desc = L.SHOW_TOTAL_TIMER_TOOLTIP,
Expand All @@ -155,14 +163,14 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
disabled = ModuleIsDisabled,
},
showSpark = {
order = 6,
order = 8,
width = "full",
name = L.SHOW_SPARK,
type = "toggle",
disabled = ModuleIsDisabled,
},
showBorderShield = {
order = 7,
order = 9,
width = "full",
name = L.BORDERSHIELD,
desc = L.BORDERSHIELD_TOOLTIP,
Expand All @@ -171,17 +179,26 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
hidden = unitID == "player",
},
ignoreParentAlpha = {
order = 8,
order = 10,
width = "full",
name = L.IGNORE_PARENT_ALPHA,
desc = L.IGNORE_PARENT_ALPHA_TOOLTIP,
type = "toggle",
disabled = ModuleIsDisabled,
hidden = unitID == "player",
},
ignoreParentScale = {
order = 11,
width = "full",
name = L.IGNORE_PARENT_SCALE,
desc = L.IGNORE_PARENT_SCALE_TOOLTIP,
type = "toggle",
disabled = ModuleIsDisabled,
hidden = unitID == "player",
},
posX = {
-- Position slider X for nameplate castbars only
order = 10,
order = 12,
name = L.POS_X,
desc = L.POSXY_TOOLTIP,
width = 2,
Expand All @@ -201,7 +218,7 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
},
posY = {
-- Position slider Y for nameplate castbars only
order = 11,
order = 13,
name = L.POS_Y,
desc = L.POSXY_TOOLTIP,
width = 2,
Expand Down
3 changes: 3 additions & 0 deletions ClassicCastbars_Options/Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ L["ICON_SIZE"] = "Icon Size"
L["ICON_SIZE_TOOLTIP"] = "Sets the size for the castbar spell icon."
L["IGNORE_PARENT_ALPHA"] = "Ignore Parent Frame Alpha"
L["IGNORE_PARENT_ALPHA_TOOLTIP"] = "Ignore transparency/alpha value inherited from castbars parent's frame."
L["IGNORE_PARENT_SCALE"] = "Ignore Parent Frame Scale"
L["IGNORE_PARENT_SCALE_TOOLTIP"] = "Ignore scale multiplier inherited from castbars parent's frame."
L["NO_NAMEPLATE_VISIBLE"] = "You have no target or target nameplate is not visible on screen."
L["PER_CHARACTER"] = "|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:0:0:0:-1|tCharacter Specific Settings"
L["PER_CHARACTER_TOOLTIP"] = "Click this to toggle between general settings and settings specific to this character."
Expand All @@ -57,6 +59,7 @@ L["POS_Y"] = "Position Y (Up/Down)"
L["RESET_ALL"] = "Reset All Settings"
L["SHOW_FOR_ENEMY"] = "Show Enemy Casts"
L["SHOW_FOR_FRIENDLY"] = "Show Friendly Casts"
L["SHOW_FOR_PETS"] = "Show Player Pet Casts"
L["SHOW_SPARK"] = "Show Castbar Spark Effect"
L["SHOW_TIMER"] = "Show Timer Text"
L["SHOW_TIMER_TOOLTIP"] = "Display a timer countdown for the current cast."
Expand Down

0 comments on commit 0e4b280

Please sign in to comment.