diff --git a/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.lua b/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.lua index c036f47ff2..d7a3cd6e45 100644 --- a/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.lua +++ b/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.lua @@ -1,7 +1,7 @@ -- Author : generalwrex (Natop on Myzrael TBC) -- Create Date : 1/28/2022 9:30:08 AM -- --- Update Date : 2023-04-04 Riotdog-GehennasEU: v2.5 - exporting bag items for bulk sim, fixes use of legacy APIs in libs and corrects link order (LibStub must come first). +-- Update Date : 2023-04-16 Riotdog-GehennasEU: v2.5 - exporting bag items for bulk sim, fixes use of legacy APIs in libs and corrects link order (LibStub must come first). -- WowSimsExporter = LibStub("AceAddon-3.0"):NewAddon("WowSimsExporter", "AceConsole-3.0", "AceEvent-3.0") @@ -175,12 +175,25 @@ function WowSimsExporter:createItemFromItemLink(itemLink) return item end -function considerItemReplacement(itemLink) -- TODO(Riotdog-GehennasEU): Is this sufficient? This seems to be what simc uses: -- https://github.com/simulationcraft/simc-addon/blob/master/core.lua -- Except we don't need the artifact check for wotlk classic. - -- We should probably filter some more, because this also returns e.g. the Mining Pick and items of the wrong armor type etc.. :D - return IsEquippableItem(itemLink) +function considerItemReplacement(itemLink) + if not IsEquippableItem(itemLink) then + return false + end + + local _, _, itemRarity, itemLevel = GetItemInfo(itemLink) + + -- Ignore TBC items like Rocket Boots Xtreme (Lite). The ilvl limit is intentionally set low + -- to limit accidental filtering. + if itemLevel <= 112 then + return false + end + + -- https://wowwiki-archive.fandom.com/wiki/API_TYPE_Quality + -- 3 = Rare, 4 = Epic, 5 = Legendary + return itemRarity == 3 or itemRarity == 4 or itemRarity == 5 end function WowSimsExporter:GetGearEnchantGems(withBags) @@ -217,6 +230,7 @@ function WowSimsExporter:GetGearEnchantGems(withBags) end end end + DEFAULT_CHAT_FRAME:AddMessage(("[|cffFFFF00WowSimsExporter|r] Exported %d items from bags."):format(#bagGear)) return {["items"] = bagGear} end @@ -305,7 +319,6 @@ function WowSimsExporter:CreateCopyDialog(text) end function WowSimsExporter:CreateWindow(generate) - local char = self:CreateCharacterStructure("player") local frame = AceGUI:Create("Frame") @@ -351,7 +364,7 @@ function WowSimsExporter:CreateWindow(generate) end) local extraButton = AceGUI:Create("Button") - extraButton:SetText("Generate Bulk Bag Data") + extraButton:SetText("Batch: Export Bag Items") extraButton:SetWidth(300) extraButton:SetCallback("OnClick", function() l_Generate(true) diff --git a/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.toc b/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.toc index b30a2eed3b..932b97ab0e 100644 --- a/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.toc +++ b/tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.toc @@ -1,4 +1,4 @@ -## Title: WowSimsExporter v2.4 |c0000ffffWOTLK|r +## Title: WowSimsExporter v2.5 |c0000ffffWOTLK|r ## Version: 2.5 ## Author: generalwrex, namreeb ## Interface: 30400