From 984bae3abd41889746bd6849eccbfa5e067000e0 Mon Sep 17 00:00:00 2001 From: ollidiemaus Date: Fri, 24 May 2024 11:47:21 +0200 Subject: [PATCH] added support for Cata --- AutoPotion.toc | 7 ++-- Core/Potions.lua | 59 ++++++++++++++++++++++++++++-- FrameXML/InterfaceOptionsFrame.lua | 2 + code.lua | 2 + 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/AutoPotion.toc b/AutoPotion.toc index 8882223..226d048 100755 --- a/AutoPotion.toc +++ b/AutoPotion.toc @@ -1,7 +1,8 @@ -## Interface: 100206 -## Interface-Classic: 11501 +## Interface: 100207 +## Interface-Classic: 11502 ## Interface-WOTLKC: 30403 -## Version: 3.3.8 +## Interface-Cata: 40400 +## Version: 3.4.0 ## 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/Potions.lua b/Core/Potions.lua index 470595d..9871708 100644 --- a/Core/Potions.lua +++ b/Core/Potions.lua @@ -2,6 +2,7 @@ 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) +local isCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC) --ham.leywine = ham.Item.new(194684,"Azure Leywine") --ham.healthstone = ham.Item.new(117, "Healthstone") @@ -30,6 +31,7 @@ ham.ancient = ham.Item.new(127834, "Ancient Healing Potion") ham.aged = ham.Item.new(136569, "Aged Health Potion") ham.tonic = ham.Item.new(109223, "Healing Tonic") ham.master = ham.Item.new(76097, "Master Healing Potion") +ham.roguesDraught = ham.Item.new(63300, "Rogue's Draught") ham.mythical = ham.Item.new(57191, "Mythical Healing Potion") ham.crazy_alch = ham.Item.new(40077, "Crazy Alchemist's Potion") ham.runic_inject = ham.Item.new(41166, "Runic Healing Injector") @@ -75,6 +77,7 @@ ham.demonic2 = ham.Item.new(36891, "Demonic Healthstone") ham.fel0 = ham.Item.new(36892, "Fel Healthstone") ham.fel1 = ham.Item.new(36893, "Fel Healthstone") ham.fel2 = ham.Item.new(36894, "Fel Healthstone") +------Healthstones for Cata------ function RemoveFromList(list, itemToRemove) for i = #list, 1, -1 do @@ -88,9 +91,6 @@ function ham.getPots() if isRetail then local pots = { ham.thirdWind, - ham.witheringDreamsR3, - ham.witheringDreamsR2, - ham.witheringDreamsR1, ham.dreamR3, ham.dreamsR2, ham.dreamR1, @@ -132,7 +132,6 @@ 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) @@ -172,6 +171,29 @@ function ham.getPots() ham.minor } end + + if isCata then + return { + ham.roguesDraught, + ham.mythical, + ham.crazy_alch, + ham.runic_inject, + ham.runic, + ham.superreju, + ham.endless, + ham.injector, + ham.resurgent, + ham.super, + ham.argent, + ham.auchenai, + ham.major, + ham.superior, + ham.greater, + ham.healingPotion, + ham.lesser, + ham.minor + } + end end function ham.getHealthstonesClassic() @@ -223,4 +245,33 @@ function ham.getHealthstonesClassic() ham.minor0 } end + + if isCata then + return { + ham.fel2, + ham.fel1, + ham.fel0, + ham.demonic2, + ham.demonic1, + ham.demonic0, + ham.master2, + ham.master1, + ham.master0, + ham.major2, + ham.major1, + ham.major0, + ham.greater2, + ham.greater1, + ham.greater0, + ham.healtsthone2, + ham.healtsthone1, + ham.healtsthone0, + ham.lesser2, + ham.lesser1, + ham.lesser0, + ham.minor2, + ham.minor1, + ham.minor0 + } + end end diff --git a/FrameXML/InterfaceOptionsFrame.lua b/FrameXML/InterfaceOptionsFrame.lua index 1636df8..5f736ac 100644 --- a/FrameXML/InterfaceOptionsFrame.lua +++ b/FrameXML/InterfaceOptionsFrame.lua @@ -2,6 +2,8 @@ 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) +local isCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC) + ---@class Frame local panel = CreateFrame("Frame") local ICON_SIZE = 50 diff --git a/code.lua b/code.lua index c845d68..9ce67d4 100755 --- a/code.lua +++ b/code.lua @@ -2,6 +2,8 @@ local addonName, ham = ... local macroName = "AutoPotion" local isClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) local isWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC) +local isCata = (WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC) + ham.myPlayer = ham.Player.new()