Mercurial > wow > worldplan
comparison FilterBar.lua @ 108:b67ba1078824
- Added some WorldMapFrame alterations to make the filter bar less obtrusive
| author | Nenue |
|---|---|
| date | Sat, 03 Jun 2017 17:20:14 -0400 |
| parents | b29b35cb8539 |
| children | a4dfdd4f1cf3 |
comparison
equal
deleted
inserted
replaced
| 107:b2be2de2b133 | 108:b67ba1078824 |
|---|---|
| 85 --{ filterKey = 'isElite', filterValue = true, label = 'Elite', texture = "", desaturated = false}, | 85 --{ filterKey = 'isElite', filterValue = true, label = 'Elite', texture = "", desaturated = false}, |
| 86 --{ filterKey = 'isElite', filterValue = false, label = 'Not-Elite', texture = "", desaturated = false}, | 86 --{ filterKey = 'isElite', filterValue = false, label = 'Not-Elite', texture = "", desaturated = false}, |
| 87 } | 87 } |
| 88 local defaults = {} | 88 local defaults = {} |
| 89 | 89 |
| 90 WorldPlanSummaryMixin = WorldPlanSummaryMixin or {} | 90 WorldPlanSummaryMixin = { |
| 91 fadeOpacity = 1, | |
| 92 } | |
| 91 local Module = WorldPlanSummaryMixin | 93 local Module = WorldPlanSummaryMixin |
| 92 Module.selectedBountyIndex = {} | 94 Module.selectedBountyIndex = {} |
| 93 Module.bounties = {} | 95 Module.bounties = {} |
| 94 Module.filterList = {} | 96 Module.filterList = {} |
| 95 Module.Buttons = {} | 97 Module.Buttons = {} |
| 142 print('|cFF00FF00pushing update') | 144 print('|cFF00FF00pushing update') |
| 143 self:Refresh() | 145 self:Refresh() |
| 144 end | 146 end |
| 145 | 147 |
| 146 barMouseOver = self:IsMouseOver() | 148 barMouseOver = self:IsMouseOver() |
| 147 if barMouseOver or filtersUsed then | 149 self:UpdateAlpha(sinceLast, barMouseOver) |
| 148 | |
| 149 self.toAlpha = 1 | |
| 150 self.Backdrop:Show() | |
| 151 else | |
| 152 self.toAlpha = 0.25 | |
| 153 self.Backdrop:Hide() | |
| 154 end | |
| 155 local cAlpha = self:GetAlpha() | |
| 156 if cAlpha ~= self.toAlpha then | |
| 157 if cAlpha > self.toAlpha then | |
| 158 cAlpha = cAlpha - sinceLast*4 | |
| 159 if cAlpha <= self.toAlpha then | |
| 160 cAlpha = self.toAlpha | |
| 161 end | |
| 162 else | |
| 163 cAlpha = cAlpha + sinceLast*4 | |
| 164 if cAlpha >= self.toAlpha then | |
| 165 cAlpha = self.toAlpha | |
| 166 end | |
| 167 end | |
| 168 end | |
| 169 self:SetAlpha(cAlpha) | |
| 170 end | 150 end |
| 171 | 151 |
| 172 function Module:OnMapInfo(isBrokenIsle, isZoomedOut, mapAreaID, isNewMap, isMapOpen) | 152 function Module:OnMapInfo(isBrokenIsle, isZoomedOut, mapAreaID, isNewMap, isMapOpen) |
| 173 print('|cFFFFFF00OnMapInfo()', isBrokenIsle, isZoomedOut, mapAreaID, isNewMap, isMapOpen) | 153 print('|cFFFFFF00OnMapInfo()', isBrokenIsle, isZoomedOut, mapAreaID, isNewMap, isMapOpen) |
| 174 if not isBrokenIsle then | 154 if not isBrokenIsle then |
| 416 layoutWidth = layoutWidth + headerWidth + HEADERS_SPACING | 396 layoutWidth = layoutWidth + headerWidth + HEADERS_SPACING |
| 417 end | 397 end |
| 418 | 398 |
| 419 self:SetSize(layoutWidth, BUTTONS_HEIGHT + (BUTTONS_SPACING * 2)) | 399 self:SetSize(layoutWidth, BUTTONS_HEIGHT + (BUTTONS_SPACING * 2)) |
| 420 self:ClearAllPoints() | 400 self:ClearAllPoints() |
| 421 self:SetPoint('BOTTOM') | 401 self:SetPoint('TOPLEFT', WorldMapFrameNavBar, 'BOTTOMLEFT', 0, -3) |
| 422 self.isStale = nil | 402 self.isStale = nil |
| 423 layoutDirty = nil | 403 layoutDirty = nil |
| 424 end | 404 end |
| 425 | 405 |
| 426 function Module:Cleanup() | 406 function Module:Cleanup() |
| 430 local rgbWhite = {r = 1, g= 1, b= 1, hex = '|cFFFFFFFF' } | 410 local rgbWhite = {r = 1, g= 1, b= 1, hex = '|cFFFFFFFF' } |
| 431 local found = {} | 411 local found = {} |
| 432 function Pin:OnEnter() | 412 function Pin:OnEnter() |
| 433 if #self.GlobalMatches >= 1 then | 413 if #self.GlobalMatches >= 1 then |
| 434 GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT') | 414 GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT') |
| 415 GameTooltip:AddLine(headerNames[self.info.filterKey]) | |
| 435 GameTooltip:AddLine(self.info.label) | 416 GameTooltip:AddLine(self.info.label) |
| 436 wipe(found) | 417 wipe(found) |
| 437 | 418 |
| 438 if self.numQuestsHere >= 1 then | 419 if self.numQuestsHere >= 1 then |
| 439 if self.numQuestsHere < self.numQuestsTotal then | 420 if self.numQuestsHere < self.numQuestsTotal then |
