PitBull Unit Frames 4.0

388 - Texture vertex coloring not implemented for indicators

What does the provided patch do?

Implements vertex coloring for indicator textures, as the documentation already suggests should be possible.

Please provide any additional information below.
-- The following modifications would be required in PitBull4\ModuleHandling\IndicatorModule.lua

local function call_texture_function(self, frame)
    if not self.GetTexture then
        -- no function, let's just return
        return nil
    end
--    local tex
++    local tex, red, green, blue, alpha
    if frame.guid then
--        tex = self:GetTexture(frame)
++        tex, red, green, blue, alpha = self:GetTexture(frame)
    end
    if not tex and frame.force_show and self.GetExampleTexture then
--        tex = self:GetExampleTexture(frame)
++        tex, red, green, blue, alpha = self:GetExampleTexture(frame)
    end
    if not tex then
        return nil
    end

--    return tex    
++    return tex, red, green, blue, alpha
end

--
--
--

function IndicatorModule:UpdateFrame(frame)
    --@alpha@
    expect(frame, 'typeof', 'frame')
    --@end-alpha@
    
--    local tex = call_texture_function(self, frame)
++    local tex, red, green, blue, alpha = call_texture_function(self, frame)
    if not tex then
        return self:ClearFrame(frame)
    end
    
    local id = self.id
    local control = frame[id]
    local made_control = not control
    if made_control then
        control = PitBull4.Controls.MakeIcon(frame)
        control:SetFrameLevel(frame:GetFrameLevel() + 3)
        frame[id] = control
        control:SetWidth(INDICATOR_SIZE)
        control:SetHeight(INDICATOR_SIZE)
    end
    
    control:SetTexture(tex)
    
++    control.texture:SetVertexColor(red or 1, green or 1, blue or 1, alpha or 1)
    
    control:SetTexCoord(call_tex_coord_function(self, frame, tex))
    
    return made_control
end

User When Change
Stanzilla Nov 04, 2013 at 22:19 UTC Changed assigned to from ckknight to Shefki
Nandini May 16, 2009 at 07:48 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Last updated
Nov 04, 2013
Reported
May 16, 2009
Status
New - Issue has not had initial review yet.
Type
Patch - Source code patch for review
Priority
Medium - Normal priority.
Votes
0
Component
Core

Reported by

Possible assignees