• 0

    posted a message on UnderHood Official Thread
    I started playing my hunter again recently and noticed that changing my aspects did not change the buff icon in UnderHood. It seems thats true for any buff that does not have a duration (Paladin Auras tested too).

    The culprit seems to be this here:

    if button.id ~= id or button.unit ~= unit or
    button.isBuff ~= isBuff or button.isPlayer ~= isPlayer or
    button.count ~= count or button.duration ~= duration or
    button.startTime ~= startTimeRounded or
    not( button:IsVisible() ) or self.forceUpdate then


    In BuffFrame:UpdateButtons. An easy fix is to also compare the name of the buff as well as all of the other things:

    if button.id ~= id or button.unit ~= unit or
    button.isBuff ~= isBuff or button.isPlayer ~= isPlayer or
    button.count ~= count or button.duration ~= duration or
    button.startTime ~= startTimeRounded or
    button.name ~= name or
    not( button:IsVisible() ) or self.forceUpdate then
    Posted in: General AddOns
  • 0

    posted a message on UnderHood Official Thread
    Aha, I've got it. I'll tell you a big secret: If I remeber right, then to enlarge buffs you do not need to sort actual buffs or something. You only need to set button.isLarge somewhere around UpdateButtons() and layout engine will handle things. And I think it'll be better to double SPECIFIED buffs/debuffs instead of "all that unchecked".


    I tried both of those things actually as I figured that made more sense, but both of those actually don't work quite right. The layout engine enlarges all buffs that are sorted before the last enlarged buff (or so it seems). So, having PW:S and PW:F on means that neither are enlarged because Shield ends up being displayed after Fortitude and Fort is small.

    I agree that having checked buffs be large is a better approach, but the structure sets a buff's value to "true" if they are filtered, that is, unchecked. Doing it the other way around means all buffs that are not in the list (food buffs, other class buffs, etc.) are enlarged as well. That's one of the reasons I'd like to make an entirely different configuration section for this behavior but I haven't really had the time to figure out how quite yet.
    Posted in: General AddOns
  • 0

    posted a message on UnderHood Official Thread
    And what those changes supposed to do? Can't get an idea Sad


    If filtering buffs is disabled, then player buffs will be sorted such that all filtered buffs are first and enlarged. For example, if I have "Power Word: Fortitude" and "Power Word: Shield" active on me, fort will be normal size and shield will be "Big". Shield will also be sorted first. Its a hacked up implementation of custom buff enlarging.

    However, theres a bit of broken in there as my development situation when posting it was suboptimal, heres the fixed code:

    local auraSort__isFriend
    local auraSort__isBuff
    local auraSort__isPlayer
    local auraSort__filteredBuffs
    local auraSort__extraFilteredBuffs
    local auraSort__doubleBuffs
    local auraSort__doubleWhenSolo
    local auraSort__groupCount
    local function auraSort(alpha, bravo)
    	-- id, name, iconTexture, count, debuffType, duration, timeLeft, itemSlot, quality
    
    	if not alpha then
    		return false
    	elseif not bravo then
    		return true
    	end
    
    	-- show filtered buffs first
    	if auraSort__isPlayer and auraSort__doubleBuffs and (auraSort__groupCount > 0 or auraSort__doubleWhenSolo) then
    		local alpha_filtered = not auraSort__filteredBuffs[alpha[2]] or (auraSort__extraFilteredBuffs and not auraSort__extraFilteredBuffs[alpha[2]])
    		local bravo_filtered = not auraSort__filteredBuffs[bravo[2]] or (auraSort__extraFilteredBuffs and not auraSort__extraFilteredBuffs[bravo[2]])
    
    		if not alpha_filtered ~= not bravo_filtered then
    			if alpha_filtered then
    				return true
    			else
    				return false
    			end
    		end
    	end
    
    	-- show your own buffs/debuffs first


    Also in BuffFrame:CollectAuras:

    	auraSort__isFriend = isFriend
    	auraSort__isBuff = isBuff
    	auraSort__isPlayer = isPlayer
    	auraSort__doubleBuffs = self.doubleBuffs
    	auraSort__doubleWhenSolo = self.doubleWhenSolo
    	auraSort__filteredBuffs = self.module.db.profile.filter.friendBuffs
    	auraSort__extraFilteredBuffs = self.module.db.profile.filter.extraFriendBuffs
    	auraSort__groupCount = GetNumPartyMembers() + GetNumRaidMembers()
    	
    	table_sort( auras, auraSort )


    Essentially, any buff unchecked in the filter window will be drawn the way "self debuffs" appear.
    Posted in: General AddOns
  • 0

    posted a message on UnderHood Official Thread
    Here are my changes to BuffFrame.lua for custom self buff sorting and enlarging based on filtered buffs:

    Note: These aren't the entire methods as they're large, just the modifications.

    Modified AuraSort method:

    local auraSort__isFriend
    local auraSort__isBuff
    local auraSort__isPlayer
    local auraSort__filteredBuffs
    local auraSort__extraFilteredBuffs
    local auraSort__doublebuffs
    local auraSort__doubleWhenSolo
    local auraSort__groupCount
    local function auraSort(alpha, bravo)
    	-- id, name, iconTexture, count, debuffType, duration, timeLeft, itemSlot, quality
    
    	if not alpha then
    		return false
    	elseif not bravo then
    		return true
    	end
    
    	-- show filtered buffs first
    	if auraSort__isPlayer and auraSort__doublebuffs and (auraSort__groupCount > 0 or auraSort__doubleWhenSolo) then
    		local alpha_filtered = auraSort__filteredBuffs[alpha[2]] or (auraSort__extraFilteredBuffs and auraSort__extraFilteredBuffs[alpha[2]])
    		local bravo_filtered = auraSort__filteredBuffs[bravo[2]] or (auraSort__extraFilteredBuffs and auraSort__extraFilteredBuffs[bravo[2]])
    
    		if not alpha_filtered ~= not bravo_filtered then
    			if alpha_filtered then
    				return true
    			else
    				return false
    			end
    		end
    	end
    
    	-- show your own buffs/debuffs first
    	local alpha_timeLeft, bravo_timeLeft = alpha[7], bravo[7]


    Modified BuffFrame:UpdateButtons:

    					if count and count > 1 then
    						button.Count:SetText( count )
    						button.Count:Show()
    					else
    						button.Count:Hide()
    					end
    
    					button.isLarge = nil;
    
    					if isBuff and self.doubleBuffs then
    						if (groupCount > 0 or self.doubleWhenSolo) then
    							if isPlayer then
    								filteredSpells = self.module.db.profile.filter.friendBuffs
    								extraFilteredSpells = self.module.db.profile.filter.extraFriendBuffs
    
    								if ((not filteredSpells[name]) or (extraFilteredSpells and (not extraFilteredSpells[name]))) then
    									button.isLarge = true
    								end
    							else 
    								if duration then
    									button.isLarge = true
    								end
    							end
    						end
    					else
    						if self.doubleDebuffs then
    							if(duration and (groupCount > 0 or self.doubleWhenSolo)) then
    								button.isLarge = true
    							end
    						end
    					end
    
    					if startTime then
    						button.cooldown:Show()
    						button.cooldown:SetCooldown( startTime, duration )
    					else


    This is a big hack and I'm hoping to separate this away from filtered buffs and make this less of a dirty hack, but it works for now.
    Posted in: General AddOns
  • 0

    posted a message on UnderHood Official Thread
    Hey, I've actually got some solutions to some of those problems. I was thinking about posting them to SVN at some point just have been busy since I implemented them. Here's what my version of Underhood currently does:

    - Range Check working by installing LibRangeCheck-2.0 and modifying the "Range" text provider DogTag like this:

    ["Range:":Gray] [Range?[Outline Range]:Red:Bracket][~Range?"28+":Gray:Bracket] ["yds":Gray]


    - Custom buff enlargement using filtered buffs. That is, if buff filtering is disabled, then filtered buffs are enlarged and sorted first. I'd like to add some options to enable/disable that effect and perhaps add a second list of buffs rather than simply using filtered buffs.

    I'd like to help out with this in any way I can but I'm not quite sure how to get write access to SVN here, I suppose some forum browsing will have to be done.

    By the way, sorry about the bug in my energy tick fix. Fixed that error on my friend's box and not on mine, then copy and pasted from the wrong place. Oops.
    Posted in: General AddOns
  • 0

    posted a message on UnderHood Official Thread
    Last night I had a rogue friend of mine check out Underhood and we found that the energy ticks would get reset every time he would gain energy from some other means than the normal 2 second tick. I didn't think this was intentional and it was a pretty big deal for him so I made a quick fix:

    function Provider:UNIT_ENERGY( event, unit )
    	if unit ~= "player" or self.powerType ~= 3 then
    	  return
    	end
    	
    	local energy = UnitMana( "player" )
    	
    	if (self.currentEnergy + 20) = energy then
    	  self.energyLastTick = GetTime()
    	end
    
    	if energy > self.currentEnergy then
    	  
    		if UnitIsDeadOrGhost( "player" ) or (energy == UnitManaMax( "player" ) and (not UnitCanAttack( "player", "target" ) or UnitIsDeadOrGhost( "target" )) and not self.inCombat) then
    		  self:Hide()
    		else
    		  self:Show()
    		end
    	end
    	
    	self.currentEnergy = energy
    end


    Thats the modified UNIT_ENERGY handler for the ticker. I didn't want to try and get this on SVN just yet as it was a 4am fix that was tested for roughly 2 minutes.

    The old handler would set its energyLastTick timer every time the player gained energy from any means. This means that things like Thistle Tea and a rogue's array of abilities that generate energy reset the timer prematurely. The only time you gain a solid 20 energy is when you get it from a normal energy tick, so thats the only time we should reset the timer.

    It seems to work but there'l be more testing later. There are a couple of things that look like minor bugs I'd like to work out but this makes UnderHood usable for him and I imagine lots of other rogues.
    Posted in: General AddOns
  • To post a comment, please or register a new account.