Mercurial > wow > buffalo2
changeset 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 |
files | ObjectiveFrame.lua ObjectiveUI.lua ObjectiveWidgets.xml |
diffstat | 3 files changed, 13 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/ObjectiveFrame.lua Fri Apr 01 14:40:14 2016 -0400 +++ b/ObjectiveFrame.lua Fri Apr 01 14:54:01 2016 -0400 @@ -161,7 +161,6 @@ local r = Scroll:GetHeight() - Scroller:GetHeight() local s = B.Conf.ObjectiveScroll - delta * floor(r/5+.5) local from = self:GetVerticalScroll() - if r == 0 then return end if s >= r then s = r elseif s < 1 then @@ -539,7 +538,7 @@ previousBlock = handler.Tracker local numWatched = handler.GetNumWatched() local numBlocks = handler.numBlocks - local actualBlocks = handler.actualBlocks + local actualBlocks = 0 for watchIndex = 1, 25 do blockIndex = blockIndex + 1 if watchIndex <= numWatched then @@ -612,18 +611,10 @@ -- Update frame dimensions if scrollHeight > wrapperMaxHeight then print(' is larger than', wrapperMaxHeight) - --ScrollBar:Show() - --scrollWidth = wrapperMaxWidth - scrollBarWidth wrapperHeight = wrapperMaxHeight - -- Make ThumbTexture reflect the viewing scale (smaller for longer scroll, bigger for shorter) - --ScrollBar:GetThumbTexture():SetHeight((wrapperMaxHeight/scrollHeight) * (wrapperMaxHeight)) - --ScrollBar:SetWidth(scrollBarWidth) - --ScrollBar:SetPoint('TOPRIGHT', Scroller, 'TOPRIGHT', 0, 0) - --ScrollBar:SetPoint('BOTTOMLEFT', Scroller, 'BOTTOMRIGHT', -scrollBarWidth, 0) - --ScrollBar:SetMinMaxValues(1, scrollHeight - wrapperMaxHeight) else - --ScrollBar:Hide() wrapperHeight = scrollHeight + B.Conf.ObjectiveScroll = 0 end scrollWidth = floor(scrollWidth+.5) scrollHeight = floor(scrollHeight+.5)
--- 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
--- a/ObjectiveWidgets.xml Fri Apr 01 14:40:14 2016 -0400 +++ b/ObjectiveWidgets.xml Fri Apr 01 14:54:01 2016 -0400 @@ -20,7 +20,7 @@ </Scripts> <Layers> <Layer level="BACKGROUND"> - <Texture SetAllPoints="true" name="$parentBackground" parentKey="bg"> + <Texture name="$parentBackground" parentKey="bg"> <Color r="0" g="0" b="0" a="0.70" /> <Anchors> <Anchor point="BOTTOMLEFT" /> @@ -30,7 +30,7 @@ </Layer> <Layer level="ARTWORK"> - <Texture SetAllPoints="true" name="$parentForeground" parentKey="fg"> + <Texture name="$parentForeground" parentKey="fg"> <Color r="1" g="1" b="1" a="1" /> </Texture> </Layer>