-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed a bug with pawn integrations setting upgrade status on invalid items. * Overhaul of the debug log frame -- no longer lags and can infinite scroll. * Added a forced refresh all when sorting bags. * Fixed a bug in new item detection that would cause weird issues with new items. * Forcefully check for new items that don't belong as new items.
- Loading branch information
Showing
11 changed files
with
244 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
---@diagnostic disable: duplicate-set-field,duplicate-doc-field | ||
local ScrollBarWidth = 16; | ||
|
||
ScrollingFlatPanelMixin = {}; | ||
|
||
function ScrollingFlatPanelMixin:OnLoad() | ||
self:SetTitle(self.panelTitle); | ||
|
||
self.onCloseCallback = function(_) | ||
self:OnCloseCallback(); | ||
return false; | ||
end | ||
|
||
self.HideAnim:SetScript("OnFinished", function() | ||
self:OnHideAnimFinished(); | ||
end); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:OnCloseCallback() | ||
self:PlayCloseAnimation(); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:Open(skipShow) | ||
self.isOpen = true; | ||
|
||
-- Managing the visibility of this panel may occur manually | ||
-- in some special cases, such as EditMode. | ||
if not skipShow then | ||
self:Show(); | ||
end | ||
|
||
self:Resize(); | ||
self:PlayOpenAnimation(); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:Resize() | ||
local anchors = 26; | ||
local extra = 20; | ||
---@type number | ||
local height = self:CalculateElementsHeight() + anchors + extra; | ||
self:SetHeight(math.min(height, self.panelMaxHeight)); | ||
|
||
---@type boolean | ||
local showScrollBar = self.ScrollBox:HasScrollableExtent(); | ||
self:SetWidth(self.panelWidth + (showScrollBar and ScrollBarWidth or 0)); | ||
|
||
self.ScrollBar:SetShown(showScrollBar); | ||
|
||
---@type CallbackRegistryMixin|unknown | ||
local view = self.ScrollBox:GetView(); | ||
---@type table<string, number> | ||
local padding = view:GetPadding(); | ||
self.ScrollBox:SetWidth(self.panelWidth - padding.left); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:GetMaxPossibleWidth() | ||
return self.panelWidth + ScrollBarWidth; | ||
end | ||
|
||
function ScrollingFlatPanelMixin:OnHideAnimFinished() | ||
HideUIPanel(self); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:StopAllAnimations() | ||
self.ShowAnim:Stop(); | ||
self.HideAnim:Stop(); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:PlayOpenAnimation() | ||
self.HideAnim:Stop(); | ||
|
||
local reverse = true; | ||
self.ShowAnim:Play(reverse); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:PlayCloseAnimation() | ||
self.ShowAnim:Stop(); | ||
|
||
local reverse = false; | ||
self.HideAnim:Play(reverse); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:Close() | ||
self.isOpen = false; | ||
|
||
self:PlayCloseAnimation(); | ||
end | ||
|
||
function ScrollingFlatPanelMixin:GetPanelMaxHeight() | ||
assert(self.panelMaxHeight ~= nil, "panelMaxHeight was not assigned.") | ||
return self.panelMaxHeight; | ||
end | ||
|
||
function ScrollingFlatPanelMixin:CalculateElementsHeight() | ||
error("Requires implementation of ScrollingFlatPanelMixin:CalculateElementsHeight."); | ||
end |
Oops, something went wrong.