Skip to content

Commit a6f707c

Browse files
committed
Better realm removal from names
1 parent a777012 commit a6f707c

2 files changed

Lines changed: 35 additions & 7 deletions

File tree

classes/class_damage.lua

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,9 +3224,12 @@ if detailsFramework.IsAddonApocalypseWow() then
32243224
end)
32253225
end
32263226

3227-
local dealWithPlayerName = function(instance, line)
3228-
if InCombatLockdown() and line.lineText1.__playerNameUpdated then
3229-
return
3227+
local dealWithPlayerName = function(instance, line, forceUpdate)
3228+
if InCombatLockdown() and line.lineText1.__playerNameUpdated and not forceUpdate then
3229+
local baseFrame = instance.baseframe
3230+
if not baseFrame.isStretching and not baseFrame.isResizing then
3231+
return
3232+
end
32303233
end
32313234

32323235
dummyText:SetFont(instance.row_info.font_face_file, instance.row_info.font_size, "")
@@ -3261,6 +3264,15 @@ end
32613264

32623265
Details222.Apocalypse.UpdatePlayerNameLength = dealWithPlayerName
32633266

3267+
function Details222.Apocalypse.UpdateInstancePlayerNameLength(instance)
3268+
local allLines = instance:GetAllLines()
3269+
for _, line in ipairs(allLines) do
3270+
---@cast line detailsline
3271+
local forceUpdate = true
3272+
dealWithPlayerName(instance, line, forceUpdate)
3273+
end
3274+
end
3275+
32643276
--~update ~bar ~apocalypse ~apoc ãpoc
32653277
---@param instanceLine detailsline
32663278
---@param source damagemeter_combat_source
@@ -3312,11 +3324,27 @@ function Details:UpdateBarApocalypseWow(instanceLine, source, instance, topValue
33123324
end
33133325
end)
33143326
else
3315-
actorName = UnitName(actorName)
3327+
--actorName = UnitName(actorName)
33163328
end
33173329

33183330
if not issecretvalue(actorName) then
3319-
actorName = actorName or source.name
3331+
if actorName then
3332+
actorName = detailsFramework:RemoveRealmName(actorName)
3333+
else
3334+
actorName = source.name
3335+
if not issecretvalue(actorName) then
3336+
actorName = detailsFramework:RemoveRealmName(actorName)
3337+
end
3338+
end
3339+
else
3340+
if specIcon then
3341+
actorName = UnitName(actorName)
3342+
if actorName == nil then
3343+
actorName = source.name
3344+
end
3345+
else
3346+
actorName = source.name
3347+
end
33203348
end
33213349

33223350
dealWithPlayerName(instance, instanceLine)
@@ -3325,7 +3353,6 @@ function Details:UpdateBarApocalypseWow(instanceLine, source, instance, topValue
33253353
if issecretvalue(actorName) then
33263354
instanceLine.lineText1:SetText(format("%d. %s", rank, actorName)) --left text
33273355
else
3328-
actorName = detailsFramework:RemoveRealmName(actorName)
33293356
instanceLine.lineText1:SetText(format("%d. %s", rank, actorName)) --left text
33303357
end
33313358
else

frames/window_main.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5341,7 +5341,8 @@ function Details:InstanceRefreshRows(instance)
53415341
end
53425342

53435343
if detailsFramework.IsAddonApocalypseWow() then
5344-
Details222.Apocalypse.UpdatePlayerNameLength(self, row)
5344+
local forceUpdate = true
5345+
Details222.Apocalypse.UpdatePlayerNameLength(self, row, forceUpdate)
53455346
end
53465347
end
53475348

0 commit comments

Comments
 (0)