Skip to content

Commit

Permalink
update toc for 10.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ollidiemaus committed Jan 16, 2024
1 parent 64bd1ff commit 6cfb842
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 44 deletions.
4 changes: 2 additions & 2 deletions AutoPotion.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
90 changes: 48 additions & 42 deletions FrameXML/InterfaceOptionsFrame.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 -------------
Expand Down

0 comments on commit 6cfb842

Please sign in to comment.