oUF

97.2k Downloads

Custom Power Color issue

Thatmemedk opened this issue ยท 4 comments

commented

When i use custom power colors, i got some sort of issue with stagger plugin.

ERROR:

Message: ...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:88: attempt to index upvalue 'color' (a nil value)
Time: 02/27/17 16:12:07
Count: 1
Stack: ...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:88: in function <...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:67>
(tail call): ?
(tail call): ?
(tail call): ?
Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:159: in function <Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:148>
(tail call): ?

Locals: self = oUF_AftermathhPlayer {
 0 = <userdata>
 UNIT_PORTRAIT_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\portraits.lua:75
 Combat = <unnamed> {
 }
 __tags = <table> {
 }
 PLAYER_ENTERING_WORLD = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:148
 Leader = <unnamed> {
 }
 UNIT_SPELLCAST_CHANNEL_START = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:256
 Resting = <unnamed> {
 }
 UNIT_HEALTH_FREQUENT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\health.lua:145
 UNIT_MAXHEALTH = <table> {
 }
 __elements = <table> {
 }
 UNIT_POWER_FREQUENT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_COMBAT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF_Plugins\oUF_CombatFeedback.lua:59
 SmoothBar = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF_Plugins\oUF_Smooth.lua:13
 RAID_TARGET_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\ricons.lua:58
 Power = <unnamed> {
 }
 UNIT_DISPLAYPOWER = <table> {
 }
 UNIT_SPELLCAST_NOT_INTERRUPTIBLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:204
 DruidMana = <unnamed> {
 }
 PARTY_LOOT_METHOD_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\masterlooter.lua:73
 UNIT_MAXPOWER = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_HEALTH = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 Health = <unnamed> {
 }
 UNIT_POWER_BAR_HIDE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_POWER_BAR_SHOW = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 PLAYER_REGEN_ENABLED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\combat.lua:52
 UNIT_EXITED_VEHICLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:38
 PLAYER_REGEN_DISABLED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\combat.lua:52
 UNIT_CONNECTION = <table> {
 }
 SpecialPowerBar = <unnamed> {
 }
 Portrait = <unnamed> {
 }
 UNIT_HEAL_PREDICTION = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_HEAL_ABSORB_AMOUNT_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_ABSORB_AMOUNT_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_SPELLCAST_START = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:104
 unit = "player"
 GROUP_ROSTER_UPDATE = <table> {
 }
 style = "AftermathhPlayer"
 UNIT_SPELLCAST_CHANNEL_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:309
 PARTY_LEADER_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\leader.lua:53
 UNIT_SPELLCAST_DELAYED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:218
 RaidIcon = <unnamed> {
 }
 UNIT_AURA = <table> {
 }
 UNIT_SPELLCAST_INTERRUPTIBLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:190
 UNIT_SPELLCAST_INTERRUPTED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:172
 UNIT_SPELLCAST_STOP = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:238
 UNIT_SPELLCAST_FAILED = <function> defined


Message: ...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:88: attempt to index upvalue 'color' (a nil value)
Time: 02/27/17 16:14:37
Count: 6
Stack: ...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:88: in function <...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:67>
(tail call): ?
Interface\AddOns\AftermathhUI\Libs\oUF\events.lua:48: in function <Interface\AddOns\AftermathhUI\Libs\oUF\events.lua:46>
(tail call): ?

Locals: self = oUF_AftermathhPlayer {
 0 = <userdata>
 UNIT_PORTRAIT_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\portraits.lua:75
 Combat = <unnamed> {
 }
 __tags = <table> {
 }
 PLAYER_ENTERING_WORLD = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:148
 Leader = <unnamed> {
 }
 UNIT_SPELLCAST_CHANNEL_START = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:256
 Resting = <unnamed> {
 }
 UNIT_HEALTH_FREQUENT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\health.lua:145
 UNIT_MAXHEALTH = <table> {
 }
 __elements = <table> {
 }
 UNIT_POWER_FREQUENT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_COMBAT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF_Plugins\oUF_CombatFeedback.lua:59
 SmoothBar = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF_Plugins\oUF_Smooth.lua:13
 RAID_TARGET_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\ricons.lua:58
 Power = <unnamed> {
 }
 UNIT_DISPLAYPOWER = <table> {
 }
 UNIT_SPELLCAST_NOT_INTERRUPTIBLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:204
 DruidMana = <unnamed> {
 }
 PARTY_LOOT_METHOD_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\masterlooter.lua:73
 UNIT_MAXPOWER = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_HEALTH = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 Health = <unnamed> {
 }
 UNIT_POWER_BAR_HIDE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_POWER_BAR_SHOW = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 PLAYER_REGEN_ENABLED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\combat.lua:52
 UNIT_EXITED_VEHICLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:38
 PLAYER_REGEN_DISABLED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\combat.lua:52
 UNIT_CONNECTION = <table> {
 }
 SpecialPowerBar = <unnamed> {
 }
 Portrait = <unnamed> {
 }
 UNIT_HEAL_PREDICTION = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_HEAL_ABSORB_AMOUNT_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_ABSORB_AMOUNT_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_SPELLCAST_START = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:104
 unit = "player"
 GROUP_ROSTER_UPDATE = <table> {
 }
 style = "AftermathhPlayer"
 UNIT_SPELLCAST_CHANNEL_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:309
 PARTY_LEADER_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\leader.lua:53
 UNIT_SPELLCAST_DELAYED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:218
 RaidIcon = <unnamed> {
 }
 UNIT_AURA = <table> {
 }
 UNIT_SPELLCAST_INTERRUPTIBLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:190
 UNIT_SPELLCAST_INTERRUPTED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:172
 UNIT_SPELLCAST_STOP = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:238
 UNIT_SPELLCAST_FAILED = <function> defined @Interface\AddOns\Aftermathh
Aftermathh
commented

How are you defining custom colors?

I also noticed the following reviewing the stagger element and we should probably fix that as well.

commented
local oUF = ns.oUF or oUF

oUF.colors.reaction = {
	[1] = { 0.87, 0.37, 0.37 }, -- Hated
	[2] = { 0.87, 0.37, 0.37 }, -- Hostile
	[3] = { 0.87, 0.37, 0.37 }, -- Unfriendly
	[4] = { 0.85, 0.77, 0.36 }, -- Neutral
	[5] = { 0.29, 0.67, 0.30 }, -- Friendly
	[6] = { 0.29, 0.67, 0.30 }, -- Honored
	[7] = { 0.29, 0.67, 0.30 }, -- Revered
	[8] = { 0.29, 0.67, 0.30 }, -- Exalted
}

oUF.colors.power = {
	["MANA"]              = {0.31, 0.45, 0.63},
	["INSANITY"]          = {0.40, 0.00, 0.80},
	["MAELSTROM"]         = {0.00, 0.50, 1.00},
	["LUNAR_POWER"]       = {0.93, 0.51, 0.93},
	["HOLY_POWER"]        = {0.95, 0.90, 0.60},
	["RAGE"]              = {0.69, 0.31, 0.31},
	["FOCUS"]             = {0.71, 0.43, 0.27},
	["ENERGY"]            = {0.65, 0.63, 0.35},
	["CHI"]               = {0.71, 1.00, 0.92},
	["RUNES"]             = {0.55, 0.57, 0.61},
	["SOUL_SHARDS"]       = {0.50, 0.32, 0.55},
	["FURY"]              = {0.78, 0.26, 0.99},
	["PAIN"]              = {1.00, 0.61, 0.00},
	["RUNIC_POWER"]       = {0.00, 0.82, 1.00},
	["AMMOSLOT"]          = {0.80, 0.60, 0.00},
	["FUEL"]              = {0.00, 0.55, 0.50},
	["POWER_TYPE_STEAM"]  = {0.55, 0.57, 0.61},
	["POWER_TYPE_PYRITE"] = {0.60, 0.09, 0.17},
	["ALTPOWER"]          = {0.00, 1.00, 1.00},
}

oUF.colors.class = {
	["DEATHKNIGHT"] = { 0.77, 0.12, 0.23 },
	["DRUID"]       = { 1.00, 0.49, 0.04 },
	["HUNTER"]      = { 0.67, 0.83, 0.45 },
	["MAGE"]        = { 0.25, 0.78, 0.92 },
	["PALADIN"]     = { 0.96, 0.55, 0.73 },
	["PRIEST"]      = { 0.65, 0.84, 1.00 },
	["ROGUE"]       = { 1.00, 0.96, 0.41 },
	["SHAMAN"]      = { 0.00, 0.44, 0.87 },
	["WARLOCK"]     = { 0.53, 0.53, 0.93 },
	["WARRIOR"]     = { 0.78, 0.61, 0.43 },
	["MONK"]        = { 0.00, 1.00, 0.59 },
	["DEMONHUNTER"] = { 0.64, 0.19, 0.79 },
}

And if i use this:

oUF.colors.power = {
	["STAGGER"]           = {0.00, 0.80, 0.00},

}

As well this error comes up.

Message: ...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:91: attempt to index local 'rgb' (a number value)
Time: 02/27/17 19:04:27
Count: 1
Stack: ...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:91: in function <...ce\AddOns\AftermathhUI\Libs\oUF\elements\stagger.lua:67>
(tail call): ?
(tail call): ?
(tail call): ?
Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:159: in function <Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:148>
(tail call): ?

Locals: self = oUF_AftermathhPlayer {
 0 = <userdata>
 UNIT_PORTRAIT_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\portraits.lua:75
 Combat = <unnamed> {
 }
 __tags = <table> {
 }
 PLAYER_ENTERING_WORLD = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:148
 Leader = <unnamed> {
 }
 UNIT_SPELLCAST_CHANNEL_START = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:256
 Resting = <unnamed> {
 }
 UNIT_HEALTH_FREQUENT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\health.lua:145
 UNIT_MAXHEALTH = <table> {
 }
 __elements = <table> {
 }
 UNIT_POWER_FREQUENT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_COMBAT = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF_Plugins\oUF_CombatFeedback.lua:59
 SmoothBar = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF_Plugins\oUF_Smooth.lua:13
 RAID_TARGET_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\ricons.lua:58
 Power = <unnamed> {
 }
 UNIT_DISPLAYPOWER = <table> {
 }
 UNIT_SPELLCAST_NOT_INTERRUPTIBLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:204
 DruidMana = <unnamed> {
 }
 PARTY_LOOT_METHOD_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\masterlooter.lua:73
 UNIT_MAXPOWER = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_HEALTH = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 Health = <unnamed> {
 }
 UNIT_POWER_BAR_HIDE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 UNIT_POWER_BAR_SHOW = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\power.lua:220
 PLAYER_REGEN_ENABLED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\combat.lua:52
 UNIT_EXITED_VEHICLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\ouf.lua:38
 PLAYER_REGEN_DISABLED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\combat.lua:52
 UNIT_CONNECTION = <table> {
 }
 SpecialPowerBar = <unnamed> {
 }
 Portrait = <unnamed> {
 }
 UNIT_HEAL_PREDICTION = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_HEAL_ABSORB_AMOUNT_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_ABSORB_AMOUNT_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\healprediction.lua:151
 UNIT_SPELLCAST_START = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:104
 unit = "player"
 GROUP_ROSTER_UPDATE = <table> {
 }
 style = "AftermathhPlayer"
 UNIT_SPELLCAST_CHANNEL_UPDATE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:309
 PARTY_LEADER_CHANGED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\leader.lua:53
 UNIT_SPELLCAST_DELAYED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:218
 RaidIcon = <unnamed> {
 }
 UNIT_AURA = <table> {
 }
 UNIT_SPELLCAST_INTERRUPTIBLE = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:190
 UNIT_SPELLCAST_INTERRUPTED = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:172
 UNIT_SPELLCAST_STOP = <function> defined @Interface\AddOns\AftermathhUI\Libs\oUF\elements\castbar.lua:238
 UNIT_SPELLCAST_FAILED = <function> defined 
commented

Stagger has subcolors, which is why it's defined in the stagger element and not in the power element.

Default values (as defined in FrameXML/UnitFrame.lua):

{
	{0.52, 1.0, 0.52},
	{1.0, 0.98, 0.72},
	{1.0, 0.42, 0.42},
}
commented

Thank you :)