Show a players role on its unitframe #640


  • Enhancment
  • Fixed
Closed
Assigned to ckknight
  • Samnthar created this issue Nov 17, 2009

    What is the enhancement in mind? How should it look and feel?

    I think it would be great to see an icon for the role a player has.

    First i got this idea when i saw how the LFG-Tool on the 3.3 PTR works,
    you select the roles you are able to fullfill, dps/tank/heal, and the lfg.tool will assemble the group.
    I noticed that there are symbols on the Standardframes which show the role you selected.
    "+" for heal, a shield for tanks, and a sword for dps.

    Also http://www.wowace.com/addons/gridstatusrole/ does something similiar by using Zeksies LGT

    Quote:

    "Adds role status to Grid. Indicates the roles of your group members (Caster, Healer, Melee, or Tank), and updates when group members change roles."

    Would be nice to see these Icons on PB4-frames as well.

  • Samnthar added the tags New Enhancment Nov 17, 2009
  • Samnthar added an attachment WoWScrnShot_111209_231739.jpg Nov 17, 2009

    WoWScrnShot_111209_231739.jpg

  • _ForgeUser243212 posted a comment Dec 8, 2009
    if select(6, GetAddOnInfo("PitBull4_" .. (debugstack():match("[o%.][d%.][u%.]les\\(.-)\\") or ""))) ~= "MISSING" then return end
    
    local PitBull4 = _G.PitBull4
    
    if not PitBull4 then
    	error("PitBull4_RoleIcon requires PitBull4")
    end
    
    local L = PitBull4.L
    
    local PitBull4_RoleIcon = PitBull4:NewModule("RoleIcon", "AceEvent-3.0")
    
    PitBull4_RoleIcon:SetModuleType("indicator")
    PitBull4_RoleIcon:SetName(L["Role icon"])
    PitBull4_RoleIcon:SetDescription(L["Show an icon on the unit frame based on which Role it is."])
    
    PitBull4_RoleIcon:SetDefaults({
    	attach_to = "root",
    	location = "edge_top_right",
    	position = 1,
    })
    
    function PitBull4_RoleIcon:OnEnable()
    	self:RegisterEvent("PLAYER_ROLES_ASSIGNED")
    end
    
    function PitBull4_RoleIcon:GetTexture(frame)
    	local isTank, isHealer, isDamage = UnitGroupRolesAssigned(frame.unit)
    	if not isTank and not isHealer and not isDamage then
    		return nil
    	end
    
    	return [[Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES]]
    end
    
    function PitBull4_RoleIcon:GetExampleTexture(frame)
    	return [[Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES]]
    end
    
    local tex_coords = {
    	-- tank
    	{0, 19/64, 22/64, 41/64},
    	-- healer
    	{20/64, 39/64, 1/64, 20/64},
    	-- damage
    	{20/64, 39/64, 22/64, 41/64},
    }
    
    function PitBull4_RoleIcon:GetTexCoord(frame)
    	local isTank, isHealer, isDamage = UnitGroupRolesAssigned(frame.unit)
    	if isTank then
    		tex_coord = tex_coords[1]
    	elseif isHealer then
    		tex_coord = tex_coords[2]
    	else 
    		tex_coord = tex_coords[3]
    	end
    
    	return tex_coord[1], tex_coord[2], tex_coord[3], tex_coord[4]
    end
    
    function PitBull4_RoleIcon:GetExampleTexCoord(frame)
    	local tex_coord
    	local isTank, isHealer, isDamage = UnitGroupRolesAssigned(frame.unit)
    	if isTank then
    		tex_coord = tex_coords[1]
    	elseif isHealer then
    		tex_coord = tex_coords[2]
    	elseif isDamage then
    		tex_coord = tex_coords[3]
    	else
    		tex_coord = tex_coords[math.random(1, 3)]
    	end
    
    	return tex_coord[1], tex_coord[2], tex_coord[3], tex_coord[4]
    end
    
    function PitBull4_RoleIcon:PLAYER_ROLES_ASSIGNED()
    	self:UpdateAll()
    end
    

    Edited Dec 9, 2009
  • shefkin removed a tag New Dec 11, 2009
  • shefkin added a tag Fixed Dec 11, 2009
  • shefkin closed issue Dec 11, 2009

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