Power Color by Reaction for NPCs #1181


  • Enhancement
Open
  • zonkk created this issue Sep 6, 2018

    Would it be possible to either get an option to color the power bar by reaction type for NPCs (the way you can with health bars) or have the class colored power bar option fallback to reaction type for NPCs?

     

    Currently, I've edited the power module (modules\power.lua) to make class colored power bar fallback to reaction type for NPCs by adding the following code after line #56:

     

    if( not color ) then
    	if ( not UnitIsPlayer(frame.unit) ) then
    		local reaction = UnitReaction(frame.unit, "player")               
    		--probably a better way to handle nil value but I'm a novice
    		if ( reaction ~= nil ) then
    			if( reaction > 4 ) then
    				color = ShadowUF.db.profile.healthColors.friendly
    			elseif( reaction == 4 ) then
    				color = ShadowUF.db.profile.healthColors.neutral
    			elseif( reaction < 4 ) then
    				color = ShadowUF.db.profile.healthColors.hostile
    			end
    		end
    	end
    end
  • zonkk added a tag Enhancement Sep 6, 2018
  • zonkk edited title and description Sep 6, 2018

To post a comment, please login or register a new account.