Skip to content

Commit

Permalink
Refactor: Moved the progress bar toggle to a separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
rdw-software committed Jul 19, 2023
1 parent dd6e6ec commit d063743
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Core/GUI/AnchoredTrackingBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@ function GUI:UpdateBar()
self.barGroup:Lock()
end
end

function GUI:ToggleProgressBar()
Rarity.db.profile.bar.visible = not Rarity.db.profile.bar.visible
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
end
5 changes: 1 addition & 4 deletions Core/GUI/DataBrokerDisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ function dataobj:OnClick(button)
(self.db.profile.tooltipActivation == CONSTANTS.TOOLTIP.ACTIVATION_METHOD_CLICK and isRightButton)
or (self.db.profile.tooltipActivation == CONSTANTS.TOOLTIP.ACTIVATION_METHOD_HOVER and isLeftButton)
then
-- Toggle progress bar visibility
R.db.profile.bar.visible = not R.db.profile.bar.visible
Rarity.GUI:UpdateBar()
Rarity.GUI:UpdateText()
Rarity.GUI:ToggleProgressBar()
elseif self.db.profile.tooltipActivation == CONSTANTS.TOOLTIP.ACTIVATION_METHOD_CLICK and isLeftButton then
if Rarity.Tooltips:IsTooltipAcquired("RarityTooltip") then
Rarity:HideTooltip()
Expand Down

0 comments on commit d063743

Please sign in to comment.