Allow the Icon Indicator to handle Texture Coordinates #67


  • Fixed
  • Patch
Closed
Assigned to _ForgeUser117147
  • _ForgeUser1990418 created this issue Jan 8, 2010

    Hi,

    I'd like to propose a small change to the icon indicator to allow for texture co-ordinates and alpha settings.

    Texture co-ordinates are necessary so that it is possible to render the same icons as the blizzard UI. What blizzard sometimes do is package a whole bunch of icons into one .blp file, the icon then needs to use texture co-ordinates to specificy which part of the .blp to render.

    I've also added a setting for icon alpha. Sometimes transparent icons are useful if you'd like to show something that isn't all that important, e.g. a buff you can't cure, or the master looter status.

    Finally I've written a separate module for the 5 man LFD role indicators. I include it here mostly as an example of why these Icon Indicator changes are useful, however you're welcome to include it into the main module if you wish. I don't know what your philosophy on these things is: The argument for including it is that it's in the blizzard UI and so if you want to replace the blizzard party frames with Grid2 you'd need this. The argument against is that it it's not 'critical' information that you'd rely upon in combat and so it's not necessary as part of the core.

    Here's the patch:

    Index: modules/IndicatorIcon.lua
    ===================================================================
    --- modules/IndicatorIcon.lua	(revision 303)
    +++ modules/IndicatorIcon.lua	(working copy)
    @@ -49,14 +49,23 @@
     	if (status) then
     		Icon.Icon:SetTexture(status:GetIcon(unit))
     		Icon:Show()
    +		if (status.GetTexCoord) then
    +			Icon.Icon:SetTexCoord( status:GetTexCoord(unit) )
    +		else
    +			Icon.Icon:SetTexCoord(0.05, 0.95, 0.05, 0.95)
    +		end
     		if (status.GetColor) then
    +			local r, g, b, a = status:GetColor(unit)
     			if (status.GetBorder and status:GetBorder(unit) > 0) then
    -				Icon:SetBackdropBorderColor(status:GetColor(unit))
    +				Icon:SetBackdropBorderColor(r, g, b, a)
     			else
     				Icon:SetBackdropBorderColor(0, 0, 0, 0)
     			end
    +			Icon.Icon:SetAlpha(a or 1)
     		else
     			Icon:SetBackdropBorderColor(1, 0, 0)
    +			Icon.Icon:SetAlpha(1)
     		end
     		if status.GetCount then
     			local count = status:GetCount(unit)
    
  • _ForgeUser1990418 added the tags New Patch Jan 8, 2010
  • _ForgeUser1990418 added an attachment TextureCoordinates.patch Jan 8, 2010

    TextureCoordinates.patch

  • _ForgeUser1990418 added an attachment LFD-Large.jpg Jan 8, 2010

    LFD-Large.jpg

  • _ForgeUser1990418 added an attachment LFD-Small.jpg Jan 8, 2010

    LFD-Small.jpg

  • _ForgeUser1990418 added an attachment Grid2StatusDungeonRole.zip Jan 8, 2010

    Grid2StatusDungeonRole.zip

  • _ForgeUser117147 posted a comment Jan 11, 2010

    Patch committed in rev304.

  • _ForgeUser117147 removed a tag New Jan 11, 2010
  • _ForgeUser117147 added a tag Fixed Jan 11, 2010
  • _ForgeUser117147 closed issue Jan 11, 2010

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