diff --git a/AutoPotion.toc b/AutoPotion.toc index 5a0f8d8..cf78370 100755 --- a/AutoPotion.toc +++ b/AutoPotion.toc @@ -1,7 +1,7 @@ -## Interface: 100200 +## Interface: 100205 ## Interface-Classic: 11500 ## Interface-WOTLKC: 30403 -## Version: 3.3.4 +## Version: 3.3.5 ## Title: Auto Potion ## Author: ollidiemaus ## Notes: Updates the Macro AutoPotion to use either Healthstone or the highest Potion found in Bags diff --git a/FrameXML/InterfaceOptionsFrame.lua b/FrameXML/InterfaceOptionsFrame.lua index 35f852d..1636df8 100644 --- a/FrameXML/InterfaceOptionsFrame.lua +++ b/FrameXML/InterfaceOptionsFrame.lua @@ -1,4 +1,5 @@ local addonName, ham = ... +local isRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) local isClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) local isWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC) ---@class Frame @@ -193,51 +194,56 @@ function panel:InitializeOptions() end) cdResetButton:SetChecked(HAMDB.cdReset) - ------------- 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") - witheringPotionButton:SetPoint("TOPLEFT", itemsTitle, 0, -PADDING) - ---@diagnostic disable-next-line: undefined-field - witheringPotionButton.Text:SetText("Use Potion of Withering Vitality") - witheringPotionButton:HookScript("OnClick", function(_, btn, down) - HAMDB.witheringPotion = witheringPotionButton:GetChecked() - self:updatePrio() - end) - witheringPotionButton:HookScript("OnEnter", function(_, btn, down) - ---@diagnostic disable-next-line: param-type-mismatch - GameTooltip:SetOwner(witheringPotionButton, "ANCHOR_TOPRIGHT") - GameTooltip:SetItemByID(ham.witheringR3.getId()) - GameTooltip:Show() - end) - witheringPotionButton:HookScript("OnLeave", function(_, btn, down) - GameTooltip:Hide() - end) - witheringPotionButton:SetChecked(HAMDB.witheringPotion) + lastStaticElement = cdResetButton + ------------- ITEMS ------------- + if isRetail then + 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") + witheringPotionButton:SetPoint("TOPLEFT", itemsTitle, 0, -PADDING) + ---@diagnostic disable-next-line: undefined-field + witheringPotionButton.Text:SetText("Use Potion of Withering Vitality") + witheringPotionButton:HookScript("OnClick", function(_, btn, down) + HAMDB.witheringPotion = witheringPotionButton:GetChecked() + self:updatePrio() + end) + witheringPotionButton:HookScript("OnEnter", function(_, btn, down) + ---@diagnostic disable-next-line: param-type-mismatch + GameTooltip:SetOwner(witheringPotionButton, "ANCHOR_TOPRIGHT") + GameTooltip:SetItemByID(ham.witheringR3.getId()) + GameTooltip:Show() + end) + witheringPotionButton:HookScript("OnLeave", function(_, btn, down) + GameTooltip:Hide() + end) + witheringPotionButton:SetChecked(HAMDB.witheringPotion) - 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 + 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 + end ------------- CURRENT PRIORITY -------------