Skip to content

Commit 0e4b280

Browse files
committed
add option for ignoring parent scale & not showing pet casts for nameplates
1 parent 7699e33 commit 0e4b280

File tree

6 files changed

+39
-9
lines changed

6 files changed

+39
-9
lines changed

.luacheckrc

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ read_globals = {
8383
"UnitCastingInfo",
8484
"UnitChannelInfo",
8585
"UnitIsFriend",
86+
"UnitIsOtherPlayersPet",
8687
"strsplit",
8788
"C_AddOns",
8889
"C_Spell",

ClassicCastbars/ClassicCastbars.lua

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function ClassicCastbars:GetCastbarFrameIfEnabled(unitID)
6464
if not self.db.nameplate.showForFriendly and isFriendly then return end
6565
if not self.db.nameplate.showForEnemy and not isFriendly then return end
6666
if UnitIsUnit("player", unitID) then return end -- personal resource display nameplate
67+
if not self.db.nameplate.showForPets and UnitIsOtherPlayersPet(unitID) then return end
6768
end
6869

6970
return self:GetCastbarFrame(unitID)

ClassicCastbars/core/Frames.lua

+1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ function ClassicCastbars:SetCastbarStyle(castbar, db, unitID)
190190
castbar.Text:SetWidth(db.width - 10) -- ensures text gets truncated
191191
castbar.currWidth = db.width -- avoids having to use a function call later on in OnUpdate
192192
castbar:SetIgnoreParentAlpha(db.ignoreParentAlpha)
193+
castbar:SetIgnoreParentScale(db.ignoreParentScale)
193194

194195
castbar.Border:SetDrawLayer("ARTWORK", 1)
195196
castbar.BorderShield:SetDrawLayer("ARTWORK", 2)

ClassicCastbars/core/SavedVariables.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
local _, namespace = ...
22

33
namespace.defaultConfig = {
4-
version = "45",
4+
version = "46",
55
locale = GetLocale(),
66
usePerCharacterSettings = false,
77

88
nameplate = {
99
enabled = true,
1010
showForFriendly = true,
1111
showForEnemy = true,
12+
showForPets = true,
1213
width = 106,
1314
height = 11,
1415
iconSize = 13,
@@ -43,6 +44,7 @@ namespace.defaultConfig = {
4344
borderPaddingHeight = 1.3,
4445
borderPaddingWidth = 1.17,
4546
edgeSizeLSM = 18,
47+
ignoreParentScale = false,
4648
},
4749

4850
target = {
@@ -81,6 +83,7 @@ namespace.defaultConfig = {
8183
borderPaddingHeight = 1.3,
8284
borderPaddingWidth = 1.17,
8385
edgeSizeLSM = 18,
86+
ignoreParentScale = false,
8487
},
8588

8689
focus = {
@@ -119,6 +122,7 @@ namespace.defaultConfig = {
119122
borderPaddingHeight = 1.3,
120123
borderPaddingWidth = 1.17,
121124
edgeSizeLSM = 18,
125+
ignoreParentScale = false,
122126
},
123127

124128
party = {
@@ -157,6 +161,7 @@ namespace.defaultConfig = {
157161
borderPaddingHeight = 1.3,
158162
borderPaddingWidth = 1.17,
159163
edgeSizeLSM = 18,
164+
ignoreParentScale = false,
160165
},
161166

162167
arena = {
@@ -195,6 +200,7 @@ namespace.defaultConfig = {
195200
borderPaddingHeight = 1.3,
196201
borderPaddingWidth = 1.17,
197202
edgeSizeLSM = 18,
203+
ignoreParentScale = false,
198204
},
199205

200206
player = {
@@ -234,5 +240,6 @@ namespace.defaultConfig = {
234240
borderPaddingHeight = 1.3,
235241
borderPaddingWidth = 1.17,
236242
edgeSizeLSM = 18,
243+
ignoreParentScale = false,
237244
},
238245
}

ClassicCastbars_Options/ClassicCastbars_Options.lua

+25-8
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,33 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
128128
disabled = ModuleIsDisabled,
129129
hidden = unitID ~= "nameplate",
130130
},
131-
autoPosition = {
131+
showForPets = {
132132
order = 4,
133133
width = "full",
134+
name = L.SHOW_FOR_PETS,
135+
type = "toggle",
136+
disabled = ModuleIsDisabled,
137+
hidden = unitID ~= "nameplate",
138+
},
139+
autoPosition = {
140+
order = 5,
141+
width = "full",
134142
name = L.AUTO_POS_BAR,
135143
desc = unitID ~= "player" and L.AUTO_POS_BAR_TOOLTIP or "",
136144
type = "toggle",
137145
hidden = unitID == "nameplate" or unitID == "party" or unitID == "arena",
138146
disabled = ModuleIsDisabled,
139147
},
140148
showTimer = {
141-
order = 5,
149+
order = 6,
142150
width = "full",
143151
name = L.SHOW_TIMER,
144152
desc = L.SHOW_TIMER_TOOLTIP,
145153
type = "toggle",
146154
disabled = ModuleIsDisabled,
147155
},
148156
showTotalTimer = {
149-
order = 5,
157+
order = 7,
150158
width = "full",
151159
name = L.SHOW_TOTAL_TIMER,
152160
desc = L.SHOW_TOTAL_TIMER_TOOLTIP,
@@ -155,14 +163,14 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
155163
disabled = ModuleIsDisabled,
156164
},
157165
showSpark = {
158-
order = 6,
166+
order = 8,
159167
width = "full",
160168
name = L.SHOW_SPARK,
161169
type = "toggle",
162170
disabled = ModuleIsDisabled,
163171
},
164172
showBorderShield = {
165-
order = 7,
173+
order = 9,
166174
width = "full",
167175
name = L.BORDERSHIELD,
168176
desc = L.BORDERSHIELD_TOOLTIP,
@@ -171,17 +179,26 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
171179
hidden = unitID == "player",
172180
},
173181
ignoreParentAlpha = {
174-
order = 8,
182+
order = 10,
175183
width = "full",
176184
name = L.IGNORE_PARENT_ALPHA,
177185
desc = L.IGNORE_PARENT_ALPHA_TOOLTIP,
178186
type = "toggle",
179187
disabled = ModuleIsDisabled,
180188
hidden = unitID == "player",
181189
},
190+
ignoreParentScale = {
191+
order = 11,
192+
width = "full",
193+
name = L.IGNORE_PARENT_SCALE,
194+
desc = L.IGNORE_PARENT_SCALE_TOOLTIP,
195+
type = "toggle",
196+
disabled = ModuleIsDisabled,
197+
hidden = unitID == "player",
198+
},
182199
posX = {
183200
-- Position slider X for nameplate castbars only
184-
order = 10,
201+
order = 12,
185202
name = L.POS_X,
186203
desc = L.POSXY_TOOLTIP,
187204
width = 2,
@@ -201,7 +218,7 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
201218
},
202219
posY = {
203220
-- Position slider Y for nameplate castbars only
204-
order = 11,
221+
order = 13,
205222
name = L.POS_Y,
206223
desc = L.POSXY_TOOLTIP,
207224
width = 2,

ClassicCastbars_Options/Locales/enUS.lua

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ L["ICON_SIZE"] = "Icon Size"
4848
L["ICON_SIZE_TOOLTIP"] = "Sets the size for the castbar spell icon."
4949
L["IGNORE_PARENT_ALPHA"] = "Ignore Parent Frame Alpha"
5050
L["IGNORE_PARENT_ALPHA_TOOLTIP"] = "Ignore transparency/alpha value inherited from castbars parent's frame."
51+
L["IGNORE_PARENT_SCALE"] = "Ignore Parent Frame Scale"
52+
L["IGNORE_PARENT_SCALE_TOOLTIP"] = "Ignore scale multiplier inherited from castbars parent's frame."
5153
L["NO_NAMEPLATE_VISIBLE"] = "You have no target or target nameplate is not visible on screen."
5254
L["PER_CHARACTER"] = "|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:0:0:0:-1|tCharacter Specific Settings"
5355
L["PER_CHARACTER_TOOLTIP"] = "Click this to toggle between general settings and settings specific to this character."
@@ -57,6 +59,7 @@ L["POS_Y"] = "Position Y (Up/Down)"
5759
L["RESET_ALL"] = "Reset All Settings"
5860
L["SHOW_FOR_ENEMY"] = "Show Enemy Casts"
5961
L["SHOW_FOR_FRIENDLY"] = "Show Friendly Casts"
62+
L["SHOW_FOR_PETS"] = "Show Player Pet Casts"
6063
L["SHOW_SPARK"] = "Show Castbar Spark Effect"
6164
L["SHOW_TIMER"] = "Show Timer Text"
6265
L["SHOW_TIMER_TOOLTIP"] = "Display a timer countdown for the current cast."

0 commit comments

Comments
 (0)