Skip to content

Commit

Permalink
Merge pull request #563 from WowRarity/progress-bar-toggle
Browse files Browse the repository at this point in the history
Add a slash command to toggle the progress bar
  • Loading branch information
rdw-software authored Jul 19, 2023
2 parents dd6e6ec + eeb129c commit 15c911a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Core/EventHandlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,8 @@ function R:OnChatCommand(input)
self:Print("Current map: " .. mapID .. " ~ " .. mapName)
elseif strlower(input) == "purge" then -- TODO: This should be done automatically, no?
self.Database:PurgeObsoleteEntries()
elseif strlower(input) == "progress" then
self.GUI:ToggleProgressBar()
elseif strlower(input) == "test" then
self.Testing:RunIntegrationTests()
elseif strlower(input) == "profiling" then
Expand Down
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 15c911a

Please sign in to comment.