Skip to content

Commit

Permalink
3.2.5 update preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ollidiemaus committed Oct 10, 2023
1 parent dca2f9c commit e05636f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AutoPotion.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 100107
## Interface-Classic: 11404
## Interface-WOTLKC: 30402
## Version: 3.2.4
## Version: 3.2.5
## Title: Auto Potion
## Author: ollidiemaus
## Notes: Updates the Macro AutoPotion to use either Healthstone or the highest Potion found in Bags
Expand Down
22 changes: 22 additions & 0 deletions FrameXML/InterfaceOptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ local positionx = 0
local currentPrioTitle = nil
local lastStaticElement = nil

local onCombat = true

function panel:OnEvent(event, addOnName)
if addOnName == "AutoPotion" then
if event == "ADDON_LOADED" then
Expand All @@ -31,11 +33,31 @@ function panel:OnEvent(event, addOnName)
if event == "PLAYER_LOGIN" then
self:InitializeClassSpells(lastStaticElement)
self:updatePrio()
onCombat = false
end
if event == "PLAYER_REGEN_DISABLED" then
onCombat = true
return
end
if event == "PLAYER_REGEN_ENABLED" then
onCombat = false
end

if onCombat == false then
self:updatePrio()
end
end

panel:RegisterEvent("PLAYER_LOGIN")
panel:RegisterEvent("ADDON_LOADED")

panel:RegisterEvent("BAG_UPDATE")
if isClassic == false then
panel:RegisterEvent("TRAIT_CONFIG_UPDATED")
end
panel:RegisterEvent("PLAYER_REGEN_ENABLED")
panel:RegisterEvent("PLAYER_REGEN_DISABLED")

panel:SetScript("OnEvent", panel.OnEvent)

function panel:createPrioFrame(id, iconTexture, positionx, isSpell)
Expand Down

0 comments on commit e05636f

Please sign in to comment.