- updated UnitGroupRolesAssigned check for the new return value

This commit is contained in:
Parnic
2010-09-07 00:22:15 +00:00
parent aed00f0434
commit 83936af830

View File

@ -841,7 +841,7 @@ function PlayerHealth.prototype:CreateBackground(redraw)
end end
self.frame.button.menu = function() self.frame.button.menu = function()
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor"); ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor")
end end
self:EnableClickTargeting(self.moduleSettings.allowMouseInteraction) self:EnableClickTargeting(self.moduleSettings.allowMouseInteraction)
@ -901,8 +901,8 @@ function PlayerHealth.prototype:EnableClickTargeting(bEnable)
-- self.frame.button:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", -- self.frame.button:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",
-- edgeFile = "Interface/Tooltips/UI-Tooltip-Border", -- edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
-- tile = false, -- tile = false,
-- insets = { left = 0, right = 0, top = 0, bottom = 0 }}); -- insets = { left = 0, right = 0, top = 0, bottom = 0 }})
-- self.frame.button:SetBackdropColor(0,0,0,1); -- self.frame.button:SetBackdropColor(0,0,0,1)
else else
self.frame.button:EnableMouse(false) self.frame.button:EnableMouse(false)
self.frame.button:RegisterForClicks() self.frame.button:RegisterForClicks()
@ -977,78 +977,85 @@ function PlayerHealth.prototype:CheckPartyRole()
local mode, submode local mode, submode
mode, submode= GetLFGMode() mode, submode= GetLFGMode()
IsLFGParty = (mode ~= nil and mode ~= "abandonedInDungeon" and mode ~= "queued"); IsLFGParty = (mode ~= nil and mode ~= "abandonedInDungeon" and mode ~= "queued")
if configMode or IsLFGParty then if configMode or IsLFGParty then
if (configMode or self.moduleSettings.showPartyRoleIcon) and not self.frame.PartyRoleIcon then if (configMode or self.moduleSettings.showPartyRoleIcon) and not self.frame.PartyRoleIcon then
local isTank, isHeal, isDPS; local isTank, isHeal, isDPS
local proposalExists, typeID, id, name local proposalExists, typeID, id, name
local texture, role, hasResponded, totalEncounters, completedEncounters, numMembers, isleader; local texture, role, hasResponded, totalEncounters, completedEncounters, numMembers, isleader
proposalExists, typeID, id, name, texture, role, hasResponded, totalEncounters, completedEncounters, numMembers, isleader = GetLFGProposal(); proposalExists, typeID, id, name, texture, role, hasResponded, totalEncounters, completedEncounters, numMembers, isleader = GetLFGProposal()
local p = self.unit; local p = self.unit
isTank, isHeal, isDPS = UnitGroupRolesAssigned(p); if IceHUD.WowVer < 40000 then
IceHUD:Debug("......."); isTank, isHeal, isDPS = UnitGroupRolesAssigned(p)
IceHUD:Debug(p.."="..tostring(UnitName(p))); else
IceHUD:Debug( tostring(proposalExists) .."**".. tostring(typeID) .."**".. tostring(id) .."**".. tostring(name) .."**".. tostring(texture) .."**".. tostring(role) .."**".. tostring(hasResponded) .."**".. tostring(totalEncounters) .."**".. tostring(completedEncounters) .."**".. tostring(numMembers) .."**".. tostring(isleader) ); local role = UnitGroupRolesAssigned(p)
isTank = (role == "TANK")
isHeal = (role == "HEALER")
isDPS = (role == "DAMAGER")
end
IceHUD:Debug(".......")
IceHUD:Debug(p.."="..tostring(UnitName(p)))
IceHUD:Debug( tostring(proposalExists) .."**".. tostring(typeID) .."**".. tostring(id) .."**".. tostring(name) .."**".. tostring(texture) .."**".. tostring(role) .."**".. tostring(hasResponded) .."**".. tostring(totalEncounters) .."**".. tostring(completedEncounters) .."**".. tostring(numMembers) .."**".. tostring(isleader) )
if proposalExists == true then if proposalExists == true then
IceHUD:Debug(tostring(typeID).." "..role); IceHUD:Debug(tostring(typeID).." "..role)
isTank = (role == "TANK"); isTank = (role == "TANK")
isHeal = (role == "HEALER"); isHeal = (role == "HEALER")
isDPS = (role == "DAMAGER"); isDPS = (role == "DAMAGER")
else else
IceHUD:Debug("NoProposal"); IceHUD:Debug("NoProposal")
end end
IceHUD:Debug("---"); IceHUD:Debug("---")
if proposalExists == nil then if proposalExists == nil then
hasResponded = false; hasResponded = false
proposalExists = false; proposalExists = false
end end
if hasResponded == false then if hasResponded == false then
if proposalExists == true then if proposalExists == true then
isTank = (role == "TANK"); isTank = (role == "TANK")
isHeal = (role == "HEALER"); isHeal = (role == "HEALER")
isDPS = (role == "DAMAGER"); isDPS = (role == "DAMAGER")
end end
else else
isTank = not hasResponded; isTank = not hasResponded
isHeal = not hasResponded; isHeal = not hasResponded
isDPS = not hasResponded; isDPS = not hasResponded
end end
IceHUD:Debug("Tank:"..tostring(isTank)); IceHUD:Debug("Tank:"..tostring(isTank))
IceHUD:Debug("Heal:"..tostring(isHeal)); IceHUD:Debug("Heal:"..tostring(isHeal))
IceHUD:Debug("DPS:"..tostring(isDPS)); IceHUD:Debug("DPS:"..tostring(isDPS))
if isTank then if isTank then
IceHUD:Debug("Loading Tank"); IceHUD:Debug("Loading Tank")
self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 0/64, 19/64, 22/64, 41/64) self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 0/64, 19/64, 22/64, 41/64)
elseif isHeal then elseif isHeal then
IceHUD:Debug("Loading Heal"); IceHUD:Debug("Loading Heal")
self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 20/64, 39/64, 1/64, 20/64) self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 20/64, 39/64, 1/64, 20/64)
elseif isDPS then elseif isDPS then
IceHUD:Debug("Loading DPS"); IceHUD:Debug("Loading DPS")
self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 20/64, 39/64, 22/64, 41/64) self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 20/64, 39/64, 22/64, 41/64)
elseif configMode then elseif configMode then
IceHUD:Debug("No Roles==Defaulting to Leader icon"); IceHUD:Debug("No Roles==Defaulting to Leader icon")
self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 0/64, 19/64, 1/64, 20/64) self.frame.PartyRoleIcon = self:CreateTexCoord(self.frame.PartyRoleIcon, "Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES", 20, 20, self.moduleSettings.PartyRoleIconScale, 0/64, 19/64, 1/64, 20/64)
else else
IceHUD:Debug("Clearing Frame"); IceHUD:Debug("Clearing Frame")
self.frame.PartyRoleIcon = self:DestroyTexFrame(self.frame.PartyRoleIcon) self.frame.PartyRoleIcon = self:DestroyTexFrame(self.frame.PartyRoleIcon)
end end
self:SetTexLoc(self.frame.PartyRoleIcon, self.moduleSettings.PartyRoleIconOffset['x'], self.moduleSettings.PartyRoleIconOffset['y']) self:SetTexLoc(self.frame.PartyRoleIcon, self.moduleSettings.PartyRoleIconOffset['x'], self.moduleSettings.PartyRoleIconOffset['y'])
self:SetIconAlpha() self:SetIconAlpha()
elseif not configMode and not self.moduleSettings.showPartyRoleIcon and self.frame.PartyRoleIcon then elseif not configMode and not self.moduleSettings.showPartyRoleIcon and self.frame.PartyRoleIcon then
IceHUD:Debug("Clearing Frame"); IceHUD:Debug("Clearing Frame")
self.frame.PartyRoleIcon = self:DestroyTexFrame(self.frame.PartyRoleIcon) self.frame.PartyRoleIcon = self:DestroyTexFrame(self.frame.PartyRoleIcon)
end end
else else
if self.frame.PartyRoleIcon then if self.frame.PartyRoleIcon then
IceHUD:Debug("Clearing Frame"); IceHUD:Debug("Clearing Frame")
self.frame.PartyRoleIcon = self:DestroyTexFrame(self.frame.PartyRoleIcon) self.frame.PartyRoleIcon = self:DestroyTexFrame(self.frame.PartyRoleIcon)
end end
end end
@ -1281,21 +1288,21 @@ end
function PlayerHealth.prototype:ShowBlizz() function PlayerHealth.prototype:ShowBlizz()
PlayerFrame:Show() PlayerFrame:Show()
PlayerFrame:RegisterEvent("UNIT_LEVEL"); PlayerFrame:RegisterEvent("UNIT_LEVEL")
PlayerFrame:RegisterEvent("UNIT_COMBAT"); PlayerFrame:RegisterEvent("UNIT_COMBAT")
PlayerFrame:RegisterEvent("UNIT_FACTION"); PlayerFrame:RegisterEvent("UNIT_FACTION")
PlayerFrame:RegisterEvent("UNIT_MAXMANA"); PlayerFrame:RegisterEvent("UNIT_MAXMANA")
PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD"); PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
PlayerFrame:RegisterEvent("PLAYER_ENTER_COMBAT"); PlayerFrame:RegisterEvent("PLAYER_ENTER_COMBAT")
PlayerFrame:RegisterEvent("PLAYER_LEAVE_COMBAT"); PlayerFrame:RegisterEvent("PLAYER_LEAVE_COMBAT")
PlayerFrame:RegisterEvent("PLAYER_REGEN_DISABLED"); PlayerFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
PlayerFrame:RegisterEvent("PLAYER_REGEN_ENABLED"); PlayerFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
PlayerFrame:RegisterEvent("PLAYER_UPDATE_RESTING"); PlayerFrame:RegisterEvent("PLAYER_UPDATE_RESTING")
PlayerFrame:RegisterEvent("PARTY_MEMBERS_CHANGED"); PlayerFrame:RegisterEvent("PARTY_MEMBERS_CHANGED")
PlayerFrame:RegisterEvent("PARTY_LEADER_CHANGED"); PlayerFrame:RegisterEvent("PARTY_LEADER_CHANGED")
PlayerFrame:RegisterEvent("PARTY_LOOT_METHOD_CHANGED"); PlayerFrame:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
PlayerFrame:RegisterEvent("RAID_ROSTER_UPDATE"); PlayerFrame:RegisterEvent("RAID_ROSTER_UPDATE")
PlayerFrame:RegisterEvent("PLAYTIME_CHANGED"); PlayerFrame:RegisterEvent("PLAYTIME_CHANGED")
end end
@ -1364,7 +1371,7 @@ UIParent:RegisterEvent("RAID_ROSTER_UPDATE")
-- end -- end
-- UIParent:RegisterEvent('RAID_ROSTER_UPDATE') -- UIParent:RegisterEvent('RAID_ROSTER_UPDATE')
-- --
-- ShowPartyFrame(); -- Just call Blizzard default method -- ShowPartyFrame() -- Just call Blizzard default method
--end --end
function PlayerHealth.prototype:UpdateBar(scale, color, alpha) function PlayerHealth.prototype:UpdateBar(scale, color, alpha)