From 94f2f00b15a210b2b4597bf61b895f2d51e277d3 Mon Sep 17 00:00:00 2001 From: ollidiemaus Date: Fri, 10 Nov 2023 22:52:41 +0100 Subject: [PATCH] 3.3.1 added Potion of Withering Dreams --- AutoPotion.toc | 2 +- Core/DB.lua | 1 + Core/Potions.lua | 10 ++++++++++ FrameXML/InterfaceOptionsFrame.lua | 23 +++++++++++++++++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/AutoPotion.toc b/AutoPotion.toc index 1b1064f..d9c9072 100755 --- a/AutoPotion.toc +++ b/AutoPotion.toc @@ -1,7 +1,7 @@ ## Interface: 100200 ## Interface-Classic: 11404 ## Interface-WOTLKC: 30402 -## Version: 3.3.0 +## Version: 3.3.1 ## Title: Auto Potion ## Author: ollidiemaus ## Notes: Updates the Macro AutoPotion to use either Healthstone or the highest Potion found in Bags diff --git a/Core/DB.lua b/Core/DB.lua index fea136b..241282a 100644 --- a/Core/DB.lua +++ b/Core/DB.lua @@ -2,6 +2,7 @@ local addonName, ham = ... ham.defaults = { cdReset = false, witheringPotion = false, + witheringDreamsPotion = false, activatedSpells = { ham.crimsonVialSpell, ham.renewal, ham.exhilaration, ham.fortitudeOfTheBear, ham.bitterImmunity, ham.desperatePrayer, ham.healingElixir } diff --git a/Core/Potions.lua b/Core/Potions.lua index 27c3a8a..c4c3c10 100644 --- a/Core/Potions.lua +++ b/Core/Potions.lua @@ -6,6 +6,9 @@ local isWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC) --ham.leywine = ham.Item.new(194684,"Azure Leywine") --ham.healthstone = ham.Item.new(117, "Healthstone") ham.healthstone = ham.Item.new(5512, "Healthstone") +ham.witheringDreamsR3 = ham.Item.new(207041, "Potion of Withering Dreams") +ham.witheringDreamsR2 = ham.Item.new(207040, "Potion of Withering Dreams") +ham.witheringDreamsR1 = ham.Item.new(207039, "Potion of Withering Dreams") ham.dreamR3 = ham.Item.new(207023, "Dreamwalker's Healing Potion") ham.dreamsR2 = ham.Item.new(207022, "Dreamwalker's Healing Potion") ham.dreamR1 = ham.Item.new(207021, "Dreamwalker's Healing Potion") @@ -110,6 +113,13 @@ function ham.getPots() table.insert(pots, 1, ham.witheringR3) end + ---ADD HERE new WITHERING + if HAMDB.witheringDreamsPotion then + table.insert(pots, 1, ham.witheringDreamsR1) + table.insert(pots, 1, ham.witheringDreamsR2) + table.insert(pots, 1, ham.witheringDreamsR3) + end + return pots end if isClassic then diff --git a/FrameXML/InterfaceOptionsFrame.lua b/FrameXML/InterfaceOptionsFrame.lua index 2fdaff8..6070953 100644 --- a/FrameXML/InterfaceOptionsFrame.lua +++ b/FrameXML/InterfaceOptionsFrame.lua @@ -196,7 +196,6 @@ function panel:InitializeOptions() ------------- ITEMS ------------- local itemsTitle = self.panel:CreateFontString("ARTWORK", nil, "GameFontNormalHuge") itemsTitle:SetPoint("TOPLEFT", cdResetButton, 0, -PADDING_CATERGORY) - itemsTitle:SetText("Items") local witheringPotionButton = CreateFrame("CheckButton", nil, self.panel, "InterfaceOptionsCheckButtonTemplate") @@ -218,7 +217,27 @@ function panel:InitializeOptions() end) witheringPotionButton:SetChecked(HAMDB.witheringPotion) - lastStaticElement = witheringPotionButton + + local witheringDreamsPotionButton = CreateFrame("CheckButton", nil, self.panel, "InterfaceOptionsCheckButtonTemplate") + witheringDreamsPotionButton:SetPoint("TOPLEFT", itemsTitle, 300, -PADDING) + ---@diagnostic disable-next-line: undefined-field + witheringDreamsPotionButton.Text:SetText("Use Potion of Withering Dreams") + witheringDreamsPotionButton:HookScript("OnClick", function(_, btn, down) + HAMDB.witheringDreamsPotion = witheringDreamsPotionButton:GetChecked() + self:updatePrio() + end) + witheringDreamsPotionButton:HookScript("OnEnter", function(_, btn, down) + ---@diagnostic disable-next-line: param-type-mismatch + GameTooltip:SetOwner(witheringDreamsPotionButton, "ANCHOR_TOPRIGHT") + GameTooltip:SetItemByID(ham.witheringDreamsR3.getId()) + GameTooltip:Show() + end) + witheringDreamsPotionButton:HookScript("OnLeave", function(_, btn, down) + GameTooltip:Hide() + end) + witheringDreamsPotionButton:SetChecked(HAMDB.witheringDreamsPotion) + + lastStaticElement = witheringPotionButton ---MAYBE witheringDreamsPotionButton ------------- CURRENT PRIORITY -------------