Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addon: rename bulk->batch, filter more items, bump version number in title as well #2946

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -305,7 +319,6 @@ function WowSimsExporter:CreateCopyDialog(text)
end

function WowSimsExporter:CreateWindow(generate)

local char = self:CreateCharacterStructure("player")

local frame = AceGUI:Create("Frame")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tools/wowsimsexporter/WowSimsExporter/WowSimsExporter.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Title: WowSimsExporter v2.4 |c0000ffffWOTLK|r
## Title: WowSimsExporter v2.5 |c0000ffffWOTLK|r
## Version: 2.5
## Author: generalwrex, namreeb
## Interface: 30400
Expand Down