Mercurial > wow > buffalo2
diff ObjectiveUI.lua @ 9:2698173edd40
ObjectiveUI & ObjectiveEvents
- securehook to API calls for compatibility with addons that work with the objective tracking interface
- let the API hooks invoke ObjectiveUI functions when possible
- ObjectiveUI framescript handlers should use the corresponding API call if possible, so that addon space can be fully aware of our actions
- Sanity check cached data when possible during 'Remove' hooks
ObjectiveInfo
- Add cheevID to criteria info
ObjectiveCore
- Index quest tracker blocks by their watch offset, and use that to verify whether the given block frame should be released into pool
ObjectiveFrame
- Differentiate between visible and non-visible unused buttons, and only release when their quest has been dropped
- Reset 'actualBlocks' count during full updates
- Reset scroll Position when the wrapper size shrinks
author | Nenue |
---|---|
date | Fri, 01 Apr 2016 14:54:01 -0400 |
parents | 7923243ae972 |
children | f03c75f63566 |
line wrap: on
line diff
--- a/ObjectiveUI.lua Fri Apr 01 14:40:14 2016 -0400 +++ b/ObjectiveUI.lua Fri Apr 01 14:54:01 2016 -0400 @@ -22,10 +22,10 @@ end Tracker.OnMouseUp = function(self, button) - if self.initialButton == 'LeftButton' then - if self.modChatLink and ChatEdit_GetActiveWindow() then + if button == 'LeftButton' then + if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then self:Link() - elseif self.modQuestWatch then + elseif IsModifiedClick("QUESTWATCHTOGGLE") then self:Remove() else self:Select() @@ -36,14 +36,10 @@ self.initialButton = nil self.modChatLink = nil self.modQuestWatch = nil - print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE")) print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r') end Tracker.OnMouseDown = function(self, button) - self.initialButton = button - self.modChatLink = IsModifiedClick("CHATLINK") - self.modQuestWatch = IsModifiedClick("QUESTWATCHTOGGLE") self:SetStyle('Active') print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE")) print(self.info.title) @@ -84,8 +80,8 @@ Cheevs.Remove = function(self) RemoveTrackedAchievement(self.info.cheevID) end -Cheevs.OnMouseUp = function(self) - Tracker.OnMouseUp(self) +Cheevs.OnMouseUp = function(self, button) + Tracker.OnMouseUp(self, button) self:SetStyle('CheevNormal') end Cheevs.Link = function(self) @@ -368,8 +364,9 @@ self.height = params.height self:SetHeight(20) self.bg:SetHeight(20) + self.fg:ClearAllPoints() + self.fg:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', 2, 2) self.fg:SetHeight(16) - self.fg:SetPoint('BOTTOMLEFT', self.bg, 'BOTTOMLEFT', 1, 1) self.quantityString:SetFontObject(params.quantityString.SetFontObject) self.quantityString:SetText(self.info.quantityString) end @@ -379,11 +376,11 @@ local quantity, requiredQuantity = self.info.quantity, self.info.requiredQuantity if self.info.finished then - self.fg:SetWidth(self.bg:GetWidth() - 2) + self.fg:SetWidth(self.bg:GetWidth() - 4) elseif quantity == 0 then self.fg:Hide() else self.fg:Show() - self.fg:SetWidth((self:GetWidth()-2) * (quantity / requiredQuantity)) + self.fg:SetWidth((self.bg:GetWidth()-4) * (quantity / requiredQuantity)) end end \ No newline at end of file