From ebd664d7c27a9a874a1fad94e5b80af123c529ae Mon Sep 17 00:00:00 2001 From: Cinecom <42314202+Cinecom@users.noreply.github.com> Date: Sat, 29 Mar 2025 13:40:10 +0100 Subject: [PATCH] Update 2.0.4 --- ConsumesManager.toc | 2 +- Itemlist.lua | 8 ++++++-- Main.lua | 16 ++++++++++++---- README.md | 6 ++++++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ConsumesManager.toc b/ConsumesManager.toc index 3a17394..f8efdcd 100644 --- a/ConsumesManager.toc +++ b/ConsumesManager.toc @@ -2,7 +2,7 @@ ## Title: |cff00ff00Consumes Manager|r |cff808080[Horyoshi]|r ## Notes: Easily track and manage your consumables, food buffs, and more across your inventory, bank, and mail, while supporting multiple characters and accounts. ## Author: Horyoshi -## Version: 2.0.3 +## Version: 2.0.4 ## SavedVariables: ConsumesManager_Options, ConsumesManager_SelectedItems, ConsumesManager_Data libs\LibStub\LibStub.lua diff --git a/Itemlist.lua b/Itemlist.lua index 85f2792..4380ba5 100644 --- a/Itemlist.lua +++ b/Itemlist.lua @@ -32,7 +32,9 @@ consumablesCategories = { { id = 13458, name = "Greater Nature Protection Potion", mats = {"1x Elemental Earth", "1x Dreamfoil", "1x Crystal Vial"}, texture = "Interface\\Icons\\INV_Potion_22", description = "Absorbs 1950 to 3250 Nature damage for 1 hour." }, { id = 13459, name = "Greater Shadow Protection Potion", mats = {"1x Shadow Oil", "2x Arthas' Tears", "1x Crystal Vial"}, texture = "Interface\\Icons\\INV_Potion_23", description = "Absorbs 1950 to 3250 Shadow damage for 1 hour." }, { id = 13461, name = "Greater Arcane Protection Potion", mats = {"1x Dream Dust", "1x Dreamfoil", "1x Crystal Vial"}, texture = "Interface\\Icons\\INV_Potion_83", description = "Absorbs 1950 to 3250 Arcane damage for 1 hour." }, - { id = 13460, name = "Greater Holy Protection Potion", mats = {"1x Elemental Air", "1x Golden Sansam", "1x Crystal Vial"}, texture = "Interface\\Icons\\INV_Potion_09", description = "Absorbs 1950 to 3251 holy damage for 1 hour." } + { id = 13460, name = "Greater Holy Protection Potion", mats = {"1x Elemental Air", "1x Golden Sansam", "1x Crystal Vial"}, texture = "Interface\\Icons\\INV_Potion_09", description = "Absorbs 1950 to 3251 holy damage for 1 hour." }, + { id = 9036, name = "Magic Resistance Potion", mats = {"1x Khadgar's Whisker", "1x Purple Lotus", "1x Crystal Vial"}, texture = "Interface\\Icons\\INV_Potion_16", description = "Increases your resistance to all schools of magic by 50 for 3 minutes." }, + { id = 3384, name = "Minor Magic Resistance Potion", mats = {"3x Mage Royal", "1x Wild Steelbloom", "1x Empty Vial"}, texture = "Interface\\Icons\\INV_Potion_08", description = "Increases your resistance to all schools of magic by 25 for 3 minutes." } }, ["Weapon Enhancements"] = { { id = 12404, name = "Dense Sharpening Stone", mats = {"1x Dense Stone"}, texture = "Interface\\Icons\\INV_Stone_SharpeningStone_05", description = "Increases weapon damage by 8 for 30 minutes." }, @@ -76,7 +78,9 @@ consumablesCategories = { { id = 14530, name = "Heavy Runecloth Bandage", mats = {"2x Runecloth"}, texture = "Interface\\Icons\\inv_misc_bandage_12", description = "Heals 2000 damage over 8 sec." }, { id = 13180, name = "Stratholme Holy Water", mats = {"Looted from Crates in Stratholme"}, texture = "Interface\\Icons\\inv_potion_75", description = "Inflicts between 438 and 562 damage to Undead in a 10 yard radius." }, { id = 20520, name = "Dark Rune", mats = {"Looted from NPC's in Stratholme"}, texture = "Interface\\Icons\\spell_shadow_sealofkings", description = "Restores 900 to 1501 mana at the cost of 600 to 1001 life." }, - { id = 12662, name = "Demonic Rune", mats = {"Looted from various world NPC's"}, texture = "Interface\\Icons\\inv_misc_rune_04", description = "Restores 900 to 1501 mana at the cost of 600 to 1001 life." } + { id = 12662, name = "Demonic Rune", mats = {"Looted from various world NPC's"}, texture = "Interface\\Icons\\inv_misc_rune_04", description = "Restores 900 to 1501 mana at the cost of 600 to 1001 life." }, + { id = 9172, name = "Invisibility Potion", mats = {"1x Ghost Mushroom", "1x Sungrass", "1x Crystal Vial"}, texture = "Interface\\Icons\\inv_potion_25", description = "Gives the imbiber invisibility for 18 sec." }, + { id = 3823, name = "Lesser Invisibility Potion", mats = {"1x Fadeleaf", "1x Wild Steelbloom", "1x Leaded Vial"}, texture = "Interface\\Icons\\inv_potion_18", description = " Gives the imbiber lesser invisibility for 15 sec." } }, ["Food Buffs"] = { { id = 21023, name = "Dirge's Kickin' Chimaerok Chops", mats = {"1x Hot Spices", "1x Goblin Rocket Fuel", "1x Deeprock Salt", "1x Chimaerok Tenderloin"}, texture = "Interface\\Icons\\INV_Misc_Food_65", description = "Increases Strength by 25 for 1 hour." }, diff --git a/Main.lua b/Main.lua index 4ee8469..375cd01 100644 --- a/Main.lua +++ b/Main.lua @@ -3526,8 +3526,12 @@ function ConsumesManager_ScanPlayerBank() ConsumesManager_Data[realmName][faction] = ConsumesManager_Data[realmName][faction] or {} ConsumesManager_Data[realmName][faction][playerName] = ConsumesManager_Data[realmName][faction][playerName] or {} local data = ConsumesManager_Data[realmName][faction][playerName] - data["bank"] = {} - + + -- Initialize bank data if it doesn't exist yet + data["bank"] = data["bank"] or {} + + -- Create a temporary table to track what we find + local tempBankData = {} for bag = -1, 10 do if bag == -1 or (bag >= 5 and bag <= 10) then @@ -3543,7 +3547,7 @@ function ConsumesManager_ScanPlayerBank() local _, itemCount = GetContainerItemInfo(bag, slot) if itemCount and itemCount ~= 0 then if itemCount < 0 then itemCount = -itemCount end - data["bank"][itemID] = (data["bank"][itemID] or 0) + itemCount + tempBankData[itemID] = (tempBankData[itemID] or 0) + itemCount end end end @@ -3553,12 +3557,16 @@ function ConsumesManager_ScanPlayerBank() end end + -- Update only the items we found, preserve existing data for items we didn't scan + for itemID, count in pairs(tempBankData) do + data["bank"][itemID] = count + end + ConsumesManager_UpdateManagerContent() ConsumesManager_UpdateTabStates() delayFrameBank:SetScript("OnUpdate", nil) end end) - end function ConsumesManager_ScanPlayerMail() diff --git a/README.md b/README.md index 3999e11..492190f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ Unzip the file and place the 'ConsumesManager' folder in your /Interface/AddOns Click the mini-map icon to open/close the Tracker. For a detailled overview watch the tutorial video on top. ## Changelog +**2.0.4** +``` +- Fixed a bug where the count of the consumes in your bank would reset +- Added magic resistance and invisibility potions +``` + **2.0.3** ``` - Fixed a bug where multi-account characters where not selected by default