- fixed a bug where the combat icon would get stuck if you went into combat when resting but had the resting icon display disabled

- made the combat icon replace the resting icon if you go into combat while resting and then switch back to the resting icon (if appropriate) when dropping combat
This commit is contained in:
Parnic
2010-09-18 07:26:50 +00:00
parent 05afcebc3d
commit d677a04f1a

View File

@ -933,11 +933,15 @@ function PlayerHealth.prototype:Resting()
-- moved icon logic above :Update so that it will trigger the alpha settings properly -- moved icon logic above :Update so that it will trigger the alpha settings properly
if (self.resting) then if (self.resting) then
if self.moduleSettings.showStatusIcon and self.moduleSettings.showStatusResting and not self.frame.statusIcon then if self.moduleSettings.showStatusIcon and self.moduleSettings.showStatusResting then
self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20, if not self.frame.statusIcon then
self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20,
self.moduleSettings.statusIconScale, 0.0625, 0.4475, 0.0625, 0.4375) self.moduleSettings.statusIconScale, 0.0625, 0.4475, 0.0625, 0.4375)
self:SetTexLoc(self.frame.statusIcon, self.moduleSettings.statusIconOffset['x'], self.moduleSettings.statusIconOffset['y']) self:SetTexLoc(self.frame.statusIcon, self.moduleSettings.statusIconOffset['x'], self.moduleSettings.statusIconOffset['y'])
self:SetIconAlpha() self:SetIconAlpha()
else
self.frame.statusIcon:SetTexCoord(0.0625, 0.4475, 0.0625, 0.4375)
end
elseif (not self.moduleSettings.showStatusIcon or not self.moduleSettings.showStatusResting) and self.frame.statusIcon and not self.combat then elseif (not self.moduleSettings.showStatusIcon or not self.moduleSettings.showStatusResting) and self.frame.statusIcon and not self.combat then
self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon) self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon)
end end
@ -975,17 +979,23 @@ function PlayerHealth.prototype:CheckCombat()
end end
if self.combat or configMode then if self.combat or configMode then
if (configMode or (self.moduleSettings.showStatusIcon and self.moduleSettings.showStatusCombat)) and not self.frame.statusIcon then if (configMode or (self.moduleSettings.showStatusIcon and self.moduleSettings.showStatusCombat)) then
self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20, if not self.frame.statusIcon then
self.frame.statusIcon = self:CreateTexCoord(self.frame.statusIcon, "Interface\\CharacterFrame\\UI-StateIcon", 20, 20,
self.moduleSettings.statusIconScale, 0.5625, 0.9375, 0.0625, 0.4375) self.moduleSettings.statusIconScale, 0.5625, 0.9375, 0.0625, 0.4375)
self:SetTexLoc(self.frame.statusIcon, self.moduleSettings.statusIconOffset['x'], self.moduleSettings.statusIconOffset['y']) self:SetTexLoc(self.frame.statusIcon, self.moduleSettings.statusIconOffset['x'], self.moduleSettings.statusIconOffset['y'])
self:SetIconAlpha() self:SetIconAlpha()
else
self.frame.statusIcon:SetTexCoord(0.5625, 0.9375, 0.0625, 0.4375)
end
elseif not configMode and not self.resting and (not self.moduleSettings.showStatusIcon or not self.moduleSettings.showStatusCombat) and self.frame.statusIcon then elseif not configMode and not self.resting and (not self.moduleSettings.showStatusIcon or not self.moduleSettings.showStatusCombat) and self.frame.statusIcon then
self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon) self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon)
end end
else else
if not self.resting and self.frame.statusIcon then if (not self.resting or not self.moduleSettings.showStatusResting) and self.frame.statusIcon then
self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon) self.frame.statusIcon = self:DestroyTexFrame(self.frame.statusIcon)
elseif self.resting then
self:Resting()
end end
end end
end end