comparison ObjectiveFrame.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
comparison
equal deleted inserted replaced
8:7923243ae972 9:2698173edd40
159 159
160 local Scroller_OnMouseWheel = function(self, delta) 160 local Scroller_OnMouseWheel = function(self, delta)
161 local r = Scroll:GetHeight() - Scroller:GetHeight() 161 local r = Scroll:GetHeight() - Scroller:GetHeight()
162 local s = B.Conf.ObjectiveScroll - delta * floor(r/5+.5) 162 local s = B.Conf.ObjectiveScroll - delta * floor(r/5+.5)
163 local from = self:GetVerticalScroll() 163 local from = self:GetVerticalScroll()
164 if r == 0 then return end
165 if s >= r then 164 if s >= r then
166 s = r 165 s = r
167 elseif s < 1 then 166 elseif s < 1 then
168 s = 0 167 s = 0
169 end 168 end
537 local w = 300 536 local w = 300
538 537
539 previousBlock = handler.Tracker 538 previousBlock = handler.Tracker
540 local numWatched = handler.GetNumWatched() 539 local numWatched = handler.GetNumWatched()
541 local numBlocks = handler.numBlocks 540 local numBlocks = handler.numBlocks
542 local actualBlocks = handler.actualBlocks 541 local actualBlocks = 0
543 for watchIndex = 1, 25 do 542 for watchIndex = 1, 25 do
544 blockIndex = blockIndex + 1 543 blockIndex = blockIndex + 1
545 if watchIndex <= numWatched then 544 if watchIndex <= numWatched then
546 local info = handler:GetInfo(watchIndex) 545 local info = handler:GetInfo(watchIndex)
547 if info then 546 if info then
610 609
611 610
612 -- Update frame dimensions 611 -- Update frame dimensions
613 if scrollHeight > wrapperMaxHeight then 612 if scrollHeight > wrapperMaxHeight then
614 print(' is larger than', wrapperMaxHeight) 613 print(' is larger than', wrapperMaxHeight)
615 --ScrollBar:Show()
616 --scrollWidth = wrapperMaxWidth - scrollBarWidth
617 wrapperHeight = wrapperMaxHeight 614 wrapperHeight = wrapperMaxHeight
618 -- Make ThumbTexture reflect the viewing scale (smaller for longer scroll, bigger for shorter) 615 else
619 --ScrollBar:GetThumbTexture():SetHeight((wrapperMaxHeight/scrollHeight) * (wrapperMaxHeight))
620 --ScrollBar:SetWidth(scrollBarWidth)
621 --ScrollBar:SetPoint('TOPRIGHT', Scroller, 'TOPRIGHT', 0, 0)
622 --ScrollBar:SetPoint('BOTTOMLEFT', Scroller, 'BOTTOMRIGHT', -scrollBarWidth, 0)
623 --ScrollBar:SetMinMaxValues(1, scrollHeight - wrapperMaxHeight)
624 else
625 --ScrollBar:Hide()
626 wrapperHeight = scrollHeight 616 wrapperHeight = scrollHeight
617 B.Conf.ObjectiveScroll = 0
627 end 618 end
628 scrollWidth = floor(scrollWidth+.5) 619 scrollWidth = floor(scrollWidth+.5)
629 scrollHeight = floor(scrollHeight+.5) 620 scrollHeight = floor(scrollHeight+.5)
630 wrapperWidth = floor(wrapperWidth+.5) 621 wrapperWidth = floor(wrapperWidth+.5)
631 wrapperHeight = floor(wrapperHeight+.5) 622 wrapperHeight = floor(wrapperHeight+.5)