Skip to content

Commit 5060f71

Browse files
committed
Fixing strange combo point behavior.
1 parent 438a8a0 commit 5060f71

1 file changed

Lines changed: 37 additions & 35 deletions

File tree

Core.lua

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -428,47 +428,49 @@ function SimplePointDisplay:UpdatePointDisplay(...)
428428
-- Cycle through all Types that need updating
429429
for ic,vc in pairs(UpdateList) do
430430
-- Cycle through all Point Displays in current Type
431-
for it,vt in ipairs(Types[ic].points) do
432-
local tid = Types[ic].points[it].id
431+
if Types[ic] then
432+
for it,vt in ipairs(Types[ic].points) do
433+
local tid = Types[ic].points[it].id
433434

434-
-- Do we hide the Display
435-
if ((Points[tid] == 0 and not db[ic].types[tid].general.showatzero)
436-
or (ic ~= PlayerClass and ic ~= "GENERAL") -- Not my class
437-
or ((PlayerClass ~= "ROGUE") and (ic == "GENERAL") and not UnitHasVehicleUI("player")) -- Impossible to have Combo Points
438-
or (db[ic].types[tid].general.hidein.vehicle and UnitHasVehicleUI("player")) -- Hide in vehicle
439-
or ((db[ic].types[tid].general.hidein.spec - 1) == PlayerSpec)) -- Hide in spec
440-
and not db[ic].types[tid].configmode.enabled then -- Not in config mode
441-
-- Hide Display
442-
Frames[ic][tid].bgpanel.frame:Hide()
443-
else
444-
-- Update the Display
445-
-- Update Bars if their Points have changed
446-
if PointsChanged[tid] then
447-
for i = 1, Types[ic].points[it].barcount do
448-
if Points[tid] == nil then Points[tid] = 0 end
449-
if Points[tid] >= i then
450-
-- Show bar and set textures to "Full"
451-
Frames[ic][tid].bars[i].frame:Show()
452-
SetPointBarTextures(true, ic, it, tid, i)
453-
else
454-
if db[ic].types[tid].general.hideempty then
455-
-- Hide "empty" bar
456-
Frames[ic][tid].bars[i].frame:Hide()
457-
else
458-
-- Show bar and set textures to "Empty"
435+
-- Do we hide the Display
436+
if ((Points[tid] == 0 and not db[ic].types[tid].general.showatzero)
437+
or (ic ~= PlayerClass and ic ~= "GENERAL") -- Not my class
438+
or ((PlayerClass ~= "ROGUE") and (ic == "GENERAL") and not UnitHasVehicleUI("player")) -- Impossible to have Combo Points
439+
or (db[ic].types[tid].general.hidein.vehicle and UnitHasVehicleUI("player")) -- Hide in vehicle
440+
or ((db[ic].types[tid].general.hidein.spec - 1) == PlayerSpec)) -- Hide in spec
441+
and not db[ic].types[tid].configmode.enabled then -- Not in config mode
442+
-- Hide Display
443+
Frames[ic][tid].bgpanel.frame:Hide()
444+
else
445+
-- Update the Display
446+
-- Update Bars if their Points have changed
447+
if PointsChanged[tid] then
448+
for i = 1, Types[ic].points[it].barcount do
449+
if Points[tid] == nil then Points[tid] = 0 end
450+
if Points[tid] >= i then
451+
-- Show bar and set textures to "Full"
459452
Frames[ic][tid].bars[i].frame:Show()
460-
SetPointBarTextures(false, ic, it, tid, i)
453+
SetPointBarTextures(true, ic, it, tid, i)
454+
else
455+
if db[ic].types[tid].general.hideempty then
456+
-- Hide "empty" bar
457+
Frames[ic][tid].bars[i].frame:Hide()
458+
else
459+
-- Show bar and set textures to "Empty"
460+
Frames[ic][tid].bars[i].frame:Show()
461+
SetPointBarTextures(false, ic, it, tid, i)
462+
end
463+
-- Hide the "Spark"
464+
Frames[ic][tid].bars[i].spark.frame:Hide()
461465
end
462-
-- Hide the "Spark"
463-
Frames[ic][tid].bars[i].spark.frame:Hide()
466+
464467
end
468+
-- Show the Display
469+
Frames[ic][tid].bgpanel.frame:Show()
465470

471+
-- Flag as having been changed
472+
PointsChanged[tid] = false
466473
end
467-
-- Show the Display
468-
Frames[ic][tid].bgpanel.frame:Show()
469-
470-
-- Flag as having been changed
471-
PointsChanged[tid] = false
472474
end
473475
end
474476
end

0 commit comments

Comments
 (0)