Skip to content

Commit

Permalink
Make healthstones optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneMcC committed Aug 30, 2024
1 parent a3c8597 commit 6fc4ccf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Core/DB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ham.defaults = {
raidStone = false,
witheringPotion = false,
witheringDreamsPotion = false,
useHealthstones = true,
activatedSpells = { ham.crimsonVialSpell, ham.renewal, ham.exhilaration, ham.fortitudeOfTheBear, ham.bitterImmunity,
ham.desperatePrayer, ham.healingElixir, ham.giftOfTheNaaruDK, ham.giftOfTheNaaruHunter, ham.giftOfTheNaaruMage,
ham.giftOfTheNaaruMageWarlock, ham.giftOfTheNaaruMonk, ham.giftOfTheNaaruPaladin, ham.giftOfTheNaaruPriest, ham
Expand Down
14 changes: 14 additions & 0 deletions FrameXML/InterfaceOptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,19 @@ function ham.settingsFrame:InitializeOptions()
lastStaticElement = witheringPotionButton ---MAYBE witheringDreamsPotionButton
end

local useHealthstonesButton = CreateFrame("CheckButton", nil, self.panel, "InterfaceOptionsCheckButtonTemplate")
useHealthstonesButton:SetPoint("TOPLEFT", lastStaticElement, 0, -PADDING)
---@diagnostic disable-next-line: undefined-field
useHealthstonesButton.Text:SetText("Include Healthstones")
useHealthstonesButton:HookScript("OnClick", function(_, btn, down)
HAMDB.useHealthstones = useHealthstonesButton:GetChecked()
ham.updateHeals()
ham.updateMacro()
self:updatePrio()
end)
useHealthstonesButton:SetChecked(HAMDB.useHealthstones)
lastStaticElement = useHealthstonesButton


------------- CURRENT PRIORITY -------------
currentPrioTitle = self.panel:CreateFontString("ARTWORK", nil, "GameFontNormalHuge")
Expand Down Expand Up @@ -302,6 +315,7 @@ function ham.settingsFrame:InitializeOptions()
witheringPotionButton:SetChecked(HAMDB.witheringPotion)
witheringDreamsPotionButton:SetChecked(HAMDB.witheringDreamsPotion)
end
useHealthstonesButton:SetChecked(HAMDB.useHealthstones)
ham.updateHeals()
ham.updateMacro()
self:updatePrio()
Expand Down
3 changes: 3 additions & 0 deletions code.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ local function addPlayerHealingItemIfAvailable()
end

local function addHealthstoneIfAvailable()
if not HAMDB.useHealthstones then
return
end
if isClassic == true or isWrath == true then
for i, value in ipairs(ham.getHealthstonesClassic()) do
if value.getCount() > 0 then
Expand Down

0 comments on commit 6fc4ccf

Please sign in to comment.