Browse Source

Merge pull request #2 from Ascension-Addons/main

Upstream merge
pull/15/head
Anthony Narkevicius 2 years ago committed by GitHub
parent
commit
81161edff3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      TradeSkillMaster/Core/Options.lua
  2. 38
      TradeSkillMaster/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua
  3. 55
      TradeSkillMaster/TradeSkillMaster.lua
  4. 1
      TradeSkillMaster_Auctioning/locale/deDE.lua
  5. 2
      TradeSkillMaster_Auctioning/locale/enUS.lua
  6. 1
      TradeSkillMaster_Auctioning/locale/esES.lua
  7. 1
      TradeSkillMaster_Auctioning/locale/esMX.lua
  8. 1
      TradeSkillMaster_Auctioning/locale/frFR.lua
  9. 1
      TradeSkillMaster_Auctioning/locale/koKR.lua
  10. 1
      TradeSkillMaster_Auctioning/locale/ptBR.lua
  11. 1
      TradeSkillMaster_Auctioning/locale/ruRU.lua
  12. 1
      TradeSkillMaster_Auctioning/locale/zhCN.lua
  13. 1
      TradeSkillMaster_Auctioning/locale/zhTW.lua
  14. 32
      TradeSkillMaster_Auctioning/modules/CancelScan.lua
  15. 1
      TradeSkillMaster_Auctioning/modules/GUI.lua
  16. 6
      TradeSkillMaster_Auctioning/modules/manage.lua
  17. 131
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

11
TradeSkillMaster/Core/Options.lua

@ -939,6 +939,17 @@ function private:LoadProfilesPage(container)
end end
end end
local bulkquerybuffer = {}
for itemString, _ in pairs(TSM.db.profile.items) do
-- check if item is cached
local _,_,itemID = itemString:find("item:(%d+)")
if itemID then
local item = Item:CreateFromID(itemID)
if not item:IsCached() then bulkquerybuffer[#bulkquerybuffer+1] = item.itemID end
end
end
TSMAPI:BulkQuery(bulkquerybuffer)
return profiles return profiles
end end

38
TradeSkillMaster/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua

@ -9,7 +9,7 @@ Dependencies: LibStub, CallbackHandler-1.0
License: LGPL v2.1 License: LGPL v2.1
]] ]]
local MAJOR, MINOR = "LibSharedMedia-3.0", 3030001 -- 3.3.5 / increase manually on changes local MAJOR, MINOR = "LibSharedMedia-3.0", 3030002 -- 3.3.5 / increase manually on changes
local lib = LibStub:NewLibrary(MAJOR, MINOR) local lib = LibStub:NewLibrary(MAJOR, MINOR)
if not lib then return end if not lib then return end
@ -99,9 +99,9 @@ if locale == "koKR" then
elseif locale == "zhCN" then elseif locale == "zhCN" then
LOCALE_MASK = lib.LOCALE_BIT_zhCN LOCALE_MASK = lib.LOCALE_BIT_zhCN
-- --
SML_MT_font["伤害数字"] = [[Fonts\ZYKai_C.ttf]] SML_MT_font["伤害数字"] = [[Fonts\ARKai_C.ttf]]
SML_MT_font["默认"] = [[Fonts\ZYKai_T.ttf]] SML_MT_font["默认"] = [[Fonts\ARKai_T.ttf]]
SML_MT_font["聊天"] = [[Fonts\ZYHei.ttf]] SML_MT_font["聊天"] = [[Fonts\ARHei.ttf]]
-- --
lib.DefaultMedia["font"] = "默认" -- someone from zhCN please adjust if needed lib.DefaultMedia["font"] = "默认" -- someone from zhCN please adjust if needed
-- --
@ -118,22 +118,35 @@ elseif locale == "zhTW" then
elseif locale == "ruRU" then elseif locale == "ruRU" then
LOCALE_MASK = lib.LOCALE_BIT_ruRU LOCALE_MASK = lib.LOCALE_BIT_ruRU
-- --
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] SML_MT_font["2002"] = [[Fonts\2002.TTF]]
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]]
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS.TTF]] SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]]
SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]]
SML_MT_font["Skurri"] = [[Fonts\SKURRI.TTF]] SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]]
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]]
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT___CYR.TTF]]
SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]]
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]]
SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]]
SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]]
-- --
lib.DefaultMedia.font = "Arial Narrow" lib.DefaultMedia.font = "Friz Quadrata TT"
-- --
else else
LOCALE_MASK = lib.LOCALE_BIT_western LOCALE_MASK = lib.LOCALE_BIT_western
locale_is_western = true locale_is_western = true
-- --
SML_MT_font["2002"] = [[Fonts\2002.TTF]]
SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]]
SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]]
SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]]
SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]]
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]]
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]]
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS.TTF]] SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]]
SML_MT_font["Skurri"] = [[Fonts\SKURRI.TTF]] SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]]
SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]]
SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]]
-- --
lib.DefaultMedia.font = "Friz Quadrata TT" lib.DefaultMedia.font = "Friz Quadrata TT"
-- --
@ -143,6 +156,7 @@ end
if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end
lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]] lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]]
lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]
lib.MediaTable.statusbar["Solid"] = [[Interface\Buttons\WHITE8X8]]
lib.DefaultMedia.statusbar = "Blizzard" lib.DefaultMedia.statusbar = "Blizzard"
-- SOUND -- SOUND

55
TradeSkillMaster/TradeSkillMaster.lua

@ -1,4 +1,4 @@
-- ------------------------------------------------------------------------------ -- -- ------------------------------------------------------------------------------ --
-- TradeSkillMaster -- -- TradeSkillMaster --
-- http://www.curse.com/addons/wow/tradeskill-master -- -- http://www.curse.com/addons/wow/tradeskill-master --
-- -- -- --
@ -134,7 +134,7 @@ local savedDBDefaults = {
-- Called once the player has loaded WOW. -- Called once the player has loaded WOW.
function TSM:OnInitialize() function TSM:OnInitialize()
TSMAPI:RegisterForTracing(TSMAPI, "TSMAPI") TSMAPI:RegisterForTracing(TSMAPI, "TSMAPI")
TSM.moduleObjects = nil TSM.moduleObjects = nil
TSM.moduleNames = nil TSM.moduleNames = nil
@ -149,7 +149,7 @@ function TSM:OnInitialize()
else else
TSM.operations = TSM.db.profile.operations TSM.operations = TSM.db.profile.operations
end end
-- Prepare the TradeSkillMasterAppDB database -- Prepare the TradeSkillMasterAppDB database
-- We're not using AceDB here on purpose due to bugs in AceDB, but are emulating the parts of it that we need. -- We're not using AceDB here on purpose due to bugs in AceDB, but are emulating the parts of it that we need.
@ -234,16 +234,23 @@ function TSM:OnInitialize()
-- create the main TSM frame -- create the main TSM frame
TSM:CreateMainFrame() TSM:CreateMainFrame()
local bulkquerybuffer = {}
-- fix any items with spaces in them -- fix any items with spaces in them
for itemString, groupPath in pairs(TSM.db.profile.items) do for itemString, groupPath in pairs(TSM.db.profile.items) do
-- check if item is cached
local _,_,itemID = itemString:find("item:(%d+)")
if itemID then
local item = Item:CreateFromID(itemID)
if not item:IsCached() then bulkquerybuffer[#bulkquerybuffer+1] = item.itemID end
end
if strfind(itemString, " ") then if strfind(itemString, " ") then
local newItemString = gsub(itemString, " ", "") local newItemString = gsub(itemString, " ", "")
TSM.db.profile.items[newItemString] = groupPath TSM.db.profile.items[newItemString] = groupPath
TSM.db.profile.items[itemString] = nil TSM.db.profile.items[itemString] = nil
end end
end end
TSMAPI:BulkQuery(bulkquerybuffer)
if TSM.db.profile.deValueSource then if TSM.db.profile.deValueSource then
TSM.db.profile.destroyValueSource = TSM.db.profile.deValueSource TSM.db.profile.destroyValueSource = TSM.db.profile.deValueSource
TSM.db.profile.deValueSource = nil TSM.db.profile.deValueSource = nil
@ -260,7 +267,7 @@ function TSM:RegisterModule()
} }
TSM.priceSources = {} TSM.priceSources = {}
-- Auctioneer -- Auctioneer
if select(4, GetAddOnInfo("Auc-Advanced")) == 1 and AucAdvanced then if select(4, GetAddOnInfo("Auc-Advanced")) == 1 and AucAdvanced then
if AucAdvanced.Modules.Util.Appraiser and AucAdvanced.Modules.Util.Appraiser.GetPrice then if AucAdvanced.Modules.Util.Appraiser and AucAdvanced.Modules.Util.Appraiser.GetPrice then
@ -273,7 +280,7 @@ function TSM:RegisterModule()
tinsert(TSM.priceSources, { key = "AucMarket", label = L["Auctioneer - Market Value"], callback = AucAdvanced.API.GetMarketValue }) tinsert(TSM.priceSources, { key = "AucMarket", label = L["Auctioneer - Market Value"], callback = AucAdvanced.API.GetMarketValue })
end end
end end
-- Auctionator -- Auctionator
if select(4, GetAddOnInfo("Auctionator")) == 1 and Atr_GetAuctionBuyout then if select(4, GetAddOnInfo("Auctionator")) == 1 and Atr_GetAuctionBuyout then
tinsert(TSM.priceSources, { key = "AtrValue", label = L["Auctionator - Auction Value"], callback = Atr_GetAuctionBuyout }) tinsert(TSM.priceSources, { key = "AtrValue", label = L["Auctionator - Auction Value"], callback = Atr_GetAuctionBuyout })
@ -423,7 +430,7 @@ function TSM:GetTooltip(itemString, quantity)
tinsert(text, { left = " " .. L["Disenchant Value:"], right = TSMAPI:FormatTextMoney(deValue, "|cffffffff", true) }) tinsert(text, { left = " " .. L["Disenchant Value:"], right = TSMAPI:FormatTextMoney(deValue, "|cffffffff", true) })
end end
end end
if TSM.db.profile.detailedDestroyTooltip then if TSM.db.profile.detailedDestroyTooltip then
local _, itemLink, quality, ilvl, _, iType = TSMAPI:GetSafeItemInfo(itemString) local _, itemLink, quality, ilvl, _, iType = TSMAPI:GetSafeItemInfo(itemString)
local itemString = TSMAPI:GetItemString(itemLink) local itemString = TSMAPI:GetItemString(itemLink)
@ -456,7 +463,7 @@ function TSM:GetTooltip(itemString, quantity)
end end
end end
end end
-- add mill value info -- add mill value info
if TSM.db.profile.millTooltip then if TSM.db.profile.millTooltip then
local millValue = TSM:GetMillValue(itemString) local millValue = TSM:GetMillValue(itemString)
@ -474,7 +481,7 @@ function TSM:GetTooltip(itemString, quantity)
tinsert(text, { left = " " .. L["Mill Value:"], right = TSMAPI:FormatTextMoney(millValue, "|cffffffff", true) }) tinsert(text, { left = " " .. L["Mill Value:"], right = TSMAPI:FormatTextMoney(millValue, "|cffffffff", true) })
end end
end end
if TSM.db.profile.detailedDestroyTooltip then if TSM.db.profile.detailedDestroyTooltip then
for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("mill")) do for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("mill")) do
local herbs = TSMAPI:GetItemConversions(targetItem) local herbs = TSMAPI:GetItemConversions(targetItem)
@ -497,7 +504,7 @@ function TSM:GetTooltip(itemString, quantity)
end end
end end
end end
-- add prospect value info -- add prospect value info
if TSM.db.profile.prospectTooltip then if TSM.db.profile.prospectTooltip then
local prospectValue = TSM:GetProspectValue(itemString) local prospectValue = TSM:GetProspectValue(itemString)
@ -515,7 +522,7 @@ function TSM:GetTooltip(itemString, quantity)
tinsert(text, { left = " " .. L["Prospect Value:"], right = TSMAPI:FormatTextMoney(prospectValue, "|cffffffff", true) }) tinsert(text, { left = " " .. L["Prospect Value:"], right = TSMAPI:FormatTextMoney(prospectValue, "|cffffffff", true) })
end end
end end
if TSM.db.profile.detailedDestroyTooltip then if TSM.db.profile.detailedDestroyTooltip then
for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("prospect")) do for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("prospect")) do
local gems = TSMAPI:GetItemConversions(targetItem) local gems = TSMAPI:GetItemConversions(targetItem)
@ -582,7 +589,7 @@ function TSM:GetTooltip(itemString, quantity)
end end
end end
end end
for name, method in pairs(TSM.db.global.customPriceSources) do for name, method in pairs(TSM.db.global.customPriceSources) do
if TSM.db.global.customPriceTooltips[name] then if TSM.db.global.customPriceTooltips[name] then
local price = TSM:GetCustomPrice(name, itemString) local price = TSM:GetCustomPrice(name, itemString)
@ -625,7 +632,7 @@ end
function TSM:GetMillValue(itemString) function TSM:GetMillValue(itemString)
local value = 0 local value = 0
for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("mill")) do for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("mill")) do
local herbs = TSMAPI:GetItemConversions(targetItem) local herbs = TSMAPI:GetItemConversions(targetItem)
if herbs[itemString] then if herbs[itemString] then
@ -633,13 +640,13 @@ function TSM:GetMillValue(itemString)
value = value + (matValue or 0) * herbs[itemString].rate value = value + (matValue or 0) * herbs[itemString].rate
end end
end end
return value return value
end end
function TSM:GetProspectValue(itemString) function TSM:GetProspectValue(itemString)
local value = 0 local value = 0
for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("prospect")) do for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("prospect")) do
local gems = TSMAPI:GetItemConversions(targetItem) local gems = TSMAPI:GetItemConversions(targetItem)
if gems[itemString] then if gems[itemString] then
@ -647,7 +654,7 @@ function TSM:GetProspectValue(itemString)
value = value + (matValue or 0) * gems[itemString].rate value = value + (matValue or 0) * gems[itemString].rate
end end
end end
return value return value
end end
@ -705,4 +712,16 @@ function TSM:GetAuctionPlayer(player, player_full)
else else
return player return player
end end
end end
-- Bulk load uncached IDs. Divides in to buckets of 50
function TSMAPI:BulkQuery(items)
if not items or #items == 0 then return end
self.QueryTicker = Timer.NewTicker(1, function()
Item:BulkContinueOnLoad(table.take(items, 50), function(id) end, function(id) return GetItemInfo(id) == nil end) -- 3rd parameter (validator) is optional
if #items == 0 then
self.QueryTicker:Cancel()
self.QueryTicker = nil
end
end)
end

1
TradeSkillMaster_Auctioning/locale/deDE.lua

@ -104,6 +104,7 @@ L["General Reset Settings"] = "Allgemeine Reset Einstellungen" -- Needs review
L["General Settings"] = "Allgemeine Optionen" L["General Settings"] = "Allgemeine Optionen"
L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Gib der neuen Operation einen Namen. Ein beschreibender Name hilft dir die Operation später wieder zu finden." -- Needs review L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Gib der neuen Operation einen Namen. Ein beschreibender Name hilft dir die Operation später wieder zu finden." -- Needs review
L["Help"] = "Hilfe" L["Help"] = "Hilfe"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "Wielange Auktionen dauern sollen." L["How long auctions should be up for."] = "Wielange Auktionen dauern sollen."
L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "Wieviele Auktionen sollen zum niedrigsten Preis auf einmal erstellt werden. Wenn auf 0 gesetzt werden keine Auktionen für alle Gruppen die diese Operation verwenden erstellt." -- Needs review L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "Wieviele Auktionen sollen zum niedrigsten Preis auf einmal erstellt werden. Wenn auf 0 gesetzt werden keine Auktionen für alle Gruppen die diese Operation verwenden erstellt." -- Needs review
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Wieviele Items sollen pro Auktion versteigert werden? 20 bedeutet, dass sie als Stacks (Paket) von 20 Items ins Auktionshaus gesetzt werden." -- Needs review L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Wieviele Items sollen pro Auktion versteigert werden? 20 bedeutet, dass sie als Stacks (Paket) von 20 Items ins Auktionshaus gesetzt werden." -- Needs review

2
TradeSkillMaster_Auctioning/locale/enUS.lua

@ -108,6 +108,8 @@ L["General Settings"] = true
L["General"] = true L["General"] = true
L["Give the new operation a name. A descriptive name will help you find this operation later."] = true L["Give the new operation a name. A descriptive name will help you find this operation later."] = true
L["Help"] = true L["Help"] = true
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["Hold Alt to cancel 100 auctions at a time"] = true
L["How long auctions should be up for."] = true L["How long auctions should be up for."] = true
L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = true L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = true
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = true L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = true

1
TradeSkillMaster_Auctioning/locale/esES.lua

@ -99,6 +99,7 @@ Could potentially reset %d items for %s profit.]=] ] = "" ]==]
-- L["General Settings"] = "" -- L["General Settings"] = ""
-- L["Give the new operation a name. A descriptive name will help you find this operation later."] = "" -- L["Give the new operation a name. A descriptive name will help you find this operation later."] = ""
-- L["Help"] = "" -- L["Help"] = ""
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
-- L["How long auctions should be up for."] = "" -- L["How long auctions should be up for."] = ""
-- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "" -- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = ""
-- L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "" -- L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = ""

1
TradeSkillMaster_Auctioning/locale/esMX.lua

@ -99,6 +99,7 @@ L["General"] = "General" -- Needs review
L["General Settings"] = "Opciones Generales" -- Needs review L["General Settings"] = "Opciones Generales" -- Needs review
-- L["Give the new operation a name. A descriptive name will help you find this operation later."] = "" -- L["Give the new operation a name. A descriptive name will help you find this operation later."] = ""
L["Help"] = "Ayuda" -- Needs review L["Help"] = "Ayuda" -- Needs review
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "Cuanto tiempo deberian estar las subastas." -- Needs review L["How long auctions should be up for."] = "Cuanto tiempo deberian estar las subastas." -- Needs review
-- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "" -- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = ""
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Cuantos objetos deberian estar en una sola subasta, 20 significaria que seran subastados en pilas de 20." -- Needs review L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Cuantos objetos deberian estar en una sola subasta, 20 significaria que seran subastados en pilas de 20." -- Needs review

1
TradeSkillMaster_Auctioning/locale/frFR.lua

@ -99,6 +99,7 @@ L["General Options"] = "Options générales" -- Needs review
L["General Settings"] = "Paramètres généraux" L["General Settings"] = "Paramètres généraux"
-- L["Give the new operation a name. A descriptive name will help you find this operation later."] = "" -- L["Give the new operation a name. A descriptive name will help you find this operation later."] = ""
L["Help"] = "Aide" L["Help"] = "Aide"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "Combien de temps les enchères doivent elles durer. " L["How long auctions should be up for."] = "Combien de temps les enchères doivent elles durer. "
-- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "" -- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = ""
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Combien d'objets doivent être vendu en une seule enchère, 20 signifiera une seul pile de 20 objets." L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Combien d'objets doivent être vendu en une seule enchère, 20 signifiera une seul pile de 20 objets."

1
TradeSkillMaster_Auctioning/locale/koKR.lua

@ -99,6 +99,7 @@ L["General Reset Settings"] = "일반 재설정 설정" -- Needs review
L["General Settings"] = "일반 설정" L["General Settings"] = "일반 설정"
L["Give the new operation a name. A descriptive name will help you find this operation later."] = "새 작업의 이름을 지정하세요. 설명이 포함된 이름은 나중에 이 작업을 찾는 데 도움이 됩니다." -- Needs review L["Give the new operation a name. A descriptive name will help you find this operation later."] = "새 작업의 이름을 지정하세요. 설명이 포함된 이름은 나중에 이 작업을 찾는 데 도움이 됩니다." -- Needs review
L["Help"] = "도움말" L["Help"] = "도움말"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "경매 지속시간" L["How long auctions should be up for."] = "경매 지속시간"
L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "한 번에 몇 개의 경매를 등록할지 지정합니다. 0으로 설정하면 이 작업이 적용되는 모든 그룹은 경매 등록을 하지 않습니다." -- Needs review L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "한 번에 몇 개의 경매를 등록할지 지정합니다. 0으로 설정하면 이 작업이 적용되는 모든 그룹은 경매 등록을 하지 않습니다." -- Needs review
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "각 경매당 등록할 아이템의 개수를 지정, 20은 20 묶음을 등록한다는 의미입니다." -- Needs review L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "각 경매당 등록할 아이템의 개수를 지정, 20은 20 묶음을 등록한다는 의미입니다." -- Needs review

1
TradeSkillMaster_Auctioning/locale/ptBR.lua

@ -104,6 +104,7 @@ L["General Options"] = "Opções Gerais" -- Needs review
L["General Settings"] = "Configurações Gerais" L["General Settings"] = "Configurações Gerais"
L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Dê um nome a nova operação. Um nome descritivo ajudará você a encontrar esta operação mais tarde." -- Needs review L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Dê um nome a nova operação. Um nome descritivo ajudará você a encontrar esta operação mais tarde." -- Needs review
L["Help"] = "Ajuda" L["Help"] = "Ajuda"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "Quanto tempo os leilões devem durar." L["How long auctions should be up for."] = "Quanto tempo os leilões devem durar."
-- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "" -- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = ""
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Quantos itens devem estar em um mesmo leilão, 20 significa que serão postados em pilhas de 20." L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Quantos itens devem estar em um mesmo leilão, 20 significa que serão postados em pilhas de 20."

1
TradeSkillMaster_Auctioning/locale/ruRU.lua

@ -104,6 +104,7 @@ L["General Reset Settings"] = "Основные опции сброса"
L["General Settings"] = "Основные настройки" L["General Settings"] = "Основные настройки"
L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Укажите новое имя для операции. Правильное название поможет вам найти эту операцию позже." L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Укажите новое имя для операции. Правильное название поможет вам найти эту операцию позже."
L["Help"] = "Помощь" L["Help"] = "Помощь"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "Сколько должен длиться аукцион." L["How long auctions should be up for."] = "Сколько должен длиться аукцион."
-- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "" -- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = ""
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Количество товаров в связке. 20 обозначает, что товары будут выставляться связками по 20 штук." L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Количество товаров в связке. 20 обозначает, что товары будут выставляться связками по 20 штук."

1
TradeSkillMaster_Auctioning/locale/zhCN.lua

@ -105,6 +105,7 @@ L["General Reset Settings"] = "常规转卖设置"
L["General Settings"] = "常规设定" L["General Settings"] = "常规设定"
L["Give the new operation a name. A descriptive name will help you find this operation later."] = "为新操作命名,一个描述性的名称将方便您找到它。" L["Give the new operation a name. A descriptive name will help you find this operation later."] = "为新操作命名,一个描述性的名称将方便您找到它。"
L["Help"] = "帮助" L["Help"] = "帮助"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "拍卖持续时间。" L["How long auctions should be up for."] = "拍卖持续时间。"
L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "发布商品的数量上限。设置为0时会使任何应用此操作的分组无法发布拍卖。" L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "发布商品的数量上限。设置为0时会使任何应用此操作的分组无法发布拍卖。"
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "一次拍卖发布多少个物品,20意味着物品将以20个为堆叠发布." L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "一次拍卖发布多少个物品,20意味着物品将以20个为堆叠发布."

1
TradeSkillMaster_Auctioning/locale/zhTW.lua

@ -104,6 +104,7 @@ L["General"] = "一般"
L["General Settings"] = "一般設定" L["General Settings"] = "一般設定"
-- L["Give the new operation a name. A descriptive name will help you find this operation later."] = "" -- L["Give the new operation a name. A descriptive name will help you find this operation later."] = ""
L["Help"] = "幫助" L["Help"] = "幫助"
-- L["Hold Alt to cancel 100 auctions at a time"] = ""
L["How long auctions should be up for."] = "拍賣要發佈多久。" L["How long auctions should be up for."] = "拍賣要發佈多久。"
-- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = "" -- L["How many auctions at the lowest price tier can be up at any one time. Setting this to 0 disables posting for any groups this operation is applied to."] = ""
L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "多少物品在單一拍賣,20是指20的堆疊發佈。" L["How many items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "多少物品在單一拍賣,20是指20的堆疊發佈。"

32
TradeSkillMaster_Auctioning/modules/CancelScan.lua

@ -410,8 +410,17 @@ local function DelayFrame()
end end
-- updates the current item to the first one in the list -- updates the current item to the first one in the list
function Cancel:UpdateItem() function Cancel:UpdateItem(...)
if #(cancelQueue) == 0 then local count = ...
if count then
totalCanceled = totalCanceled + count
else
totalCanceled = totalCanceled + 1
end
TSM.Manage:UpdateStatus("manage", totalCanceled, totalToCancel)
if #(cancelQueue) == 0 or totalCanceled >= totalToCancel then
GUI.buttons:Disable() GUI.buttons:Disable()
if isScanning then if isScanning then
TSMAPI:CreateFunctionRepeat("cancelDelayFrame", DelayFrame) TSMAPI:CreateFunctionRepeat("cancelDelayFrame", DelayFrame)
@ -423,14 +432,29 @@ function Cancel:UpdateItem()
sort(cancelQueue, function(a, b) return (a.index or 0)>(b.index or 0) end) sort(cancelQueue, function(a, b) return (a.index or 0)>(b.index or 0) end)
totalCanceled = totalCanceled + 1
TSM.Manage:UpdateStatus("manage", totalCanceled, totalToCancel)
wipe(currentItem) wipe(currentItem)
currentItem = cancelQueue[1] currentItem = cancelQueue[1]
TSM.Manage:SetCurrentItem(currentItem) TSM.Manage:SetCurrentItem(currentItem)
GUI.buttons:Enable() GUI.buttons:Enable()
end end
-- cancel auctions up to 100 at a time
function Cancel:BulkCancel()
local count = 0
-- list may be unsorted before we start
sort(cancelQueue, function(a, b) return (a.index or 0)>(b.index or 0) end)
for j=1,#(cancelQueue) do
CancelAuction(cancelQueue[1].index)
tinsert(itemsCancelled, CopyTable(cancelQueue[1]))
tremove(cancelQueue, 1)
count = count + 1
if j >= 100 then break end -- 100 items, stop processing cancels
end
Cancel:UpdateItem(count)
end
-- cancel the current item (gets called when the button is pressed -- cancel the current item (gets called when the button is pressed
function Cancel:DoAction() function Cancel:DoAction()
local index, backupIndex local index, backupIndex

1
TradeSkillMaster_Auctioning/modules/GUI.lua

@ -73,6 +73,7 @@ function private:CreateButtons(parent)
button:SetPoint("TOPLEFT") button:SetPoint("TOPLEFT")
button:SetWidth(80) button:SetWidth(80)
button:SetHeight(height) button:SetHeight(height)
button.tooltip = L["Hold Alt to cancel 100 auctions at a time"]
button:SetText(L["Cancel"]) button:SetText(L["Cancel"])
button.which = "action" button.which = "action"
button:SetScript("OnClick", OnClick) button:SetScript("OnClick", OnClick)

6
TradeSkillMaster_Auctioning/modules/manage.lua

@ -65,7 +65,11 @@ end
function Manage:OnGUIEvent(event) function Manage:OnGUIEvent(event)
if event == "action" then if event == "action" then
Util:DoAction() if mode == "Cancel" and IsAltKeyDown() then
Util:BulkCancel()
else
Util:DoAction()
end
elseif event == "skip" then elseif event == "skip" then
Util:SkipItem() Util:SkipItem()
elseif event == "stop" then elseif event == "stop" then

131
TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

@ -16,6 +16,14 @@ local private = {}
private.gather = {} private.gather = {}
private.shown = {} private.shown = {}
-- list of profession skills that do not have crafting. used by UpdateTradeSkills
local invalidTrade = {
["Herbalism"] = true,
["Skinning"] = true,
["Fishing"] = true,
["Riding"] = true
}
-- Helper function to find spellID associated to spellname -- Helper function to find spellID associated to spellname
local function GetTradeSkillSpellID(spellName) local function GetTradeSkillSpellID(spellName)
-- GetTradeSkillRecipeLink ONLY works when a trade skill window is open, but this should always happen -- GetTradeSkillRecipeLink ONLY works when a trade skill window is open, but this should always happen
@ -109,7 +117,7 @@ function GUI:ShowProfessionWindow()
AscensionTradeSkillFrame:UnregisterEvent("TRADE_SKILL_SHOW") AscensionTradeSkillFrame:UnregisterEvent("TRADE_SKILL_SHOW")
AscensionTradeSkillFrame:OpenOldUI() AscensionTradeSkillFrame:OpenOldUI()
GUI:ShowSwitchButton() GUI:ShowSwitchButton()
if TSM.db.global.showingDefaultFrame then return end if TSM.db.global.showingDefaultFrame then return end
GUI:UpdateTradeSkills(GetTradeSkillLine()) GUI:UpdateTradeSkills(GetTradeSkillLine())
@ -174,7 +182,7 @@ end
function GUI:EventHandler(event, ...) function GUI:EventHandler(event, ...)
if not GUI.frame or not GUI.frame:IsVisible() then return end if not GUI.frame or not GUI.frame:IsVisible() then return end
local unittest = ... local unittest = ...
if unittest == "player" or unittest==nil then --Changing tradeskill frames and stuff has "nil" unit, when other players cast this also triggers with nil if unittest == "player" or unittest==nil then --Changing tradeskill frames and stuff has "nil" unit, when other players cast this also triggers with nil
if event == "TRADE_SKILL_CLOSE" then if event == "TRADE_SKILL_CLOSE" then
GUI.frame:Hide() GUI.frame:Hide()
@ -219,7 +227,7 @@ function GUI:EventHandler(event, ...)
-- if spellID == nil then -- if spellID == nil then
-- TSM:Printf("Could not find spellID for %s", spellName) -- TSM:Printf("Could not find spellID for %s", spellName)
-- end -- end
-- decrements the number of this craft that are queued to be crafted -- decrements the number of this craft that are queued to be crafted
craft.queued = craft.queued - 1 craft.queued = craft.queued - 1
if GUI.isCrafting and GUI.isCrafting.quantity > 0 then if GUI.isCrafting and GUI.isCrafting.quantity > 0 then
@ -227,7 +235,7 @@ function GUI:EventHandler(event, ...)
if GUI.isCrafting.quantity == 0 then if GUI.isCrafting.quantity == 0 then
--GUI:UpdateQueue() --GUI:UpdateQueue()
end end
end end
-- no longer casting a spell so discard spellID -- no longer casting a spell so discard spellID
TSM.currentspell = nil TSM.currentspell = nil
-- TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue) -- TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue)
@ -238,7 +246,7 @@ function GUI:EventHandler(event, ...)
-- if spellID == nil then -- if spellID == nil then
-- TSM:Printf("Could not find spellID for %s", spellName) -- TSM:Printf("Could not find spellID for %s", spellName)
-- end -- end
if GUI.isCrafting and TSM.currentspell == GUI.isCrafting.spellID then if GUI.isCrafting and TSM.currentspell == GUI.isCrafting.spellID then
GUI.isCrafting.quantity = 0 GUI.isCrafting.quantity = 0
TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue) TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue)
@ -265,15 +273,15 @@ function GUI:UpdateTradeSkills(...)
-- for each trade skill found, add it to the db -- for each trade skill found, add it to the db
for i = 1, GetNumSkillLines() do for i = 1, GetNumSkillLines() do
local skillName, _, _, skillRank, _, _, skillMaxRank = GetSkillLineInfo(i) local skillName, _, _, skillRank, _, _, skillMaxRank = GetSkillLineInfo(i)
if skillName == "Professions" then if skillName == "Professions" then
inProfessions = true inProfessions = true
elseif skillName == "Secondary Skills" then elseif skillName == "Secondary Skills" then
inProfessions = false inProfessions = false
inSecondary = true inSecondary = true
elseif skillName == "Weapon Skills" then elseif skillName == "Weapon Skills" then
inSecondary = false inSecondary = false
elseif inProfessions == true or inSecondary == true then elseif inProfessions == true or inSecondary == true then
if skillName ~= nil and (not filterTrade or filterTrade == skillName)then if skillName ~= nil and (not filterTrade or filterTrade == skillName) and not invalidTrade[skillName] then
-- if skillName == "Mining" then skillName = "Smelting" end -- bandaid for mining as related spell is different than craft -- if skillName == "Mining" then skillName = "Smelting" end -- bandaid for mining as related spell is different than craft
TSM.db.realm.tradeSkills[playerName][skillName] = old[skillName] or {} TSM.db.realm.tradeSkills[playerName][skillName] = old[skillName] or {}
TSM.db.realm.tradeSkills[playerName][skillName].level = skillRank TSM.db.realm.tradeSkills[playerName][skillName].level = skillRank
@ -290,8 +298,8 @@ function GUI:UpdateTradeSkills(...)
TSM.Sync:BroadcastTradeSkillData() TSM.Sync:BroadcastTradeSkillData()
end end
end end
end end
end end
end end
@ -379,7 +387,7 @@ function GUI:ClearFilters()
SetTradeSkillSubClassFilter(0,1,1) SetTradeSkillSubClassFilter(0,1,1)
GUI.frame.content.professionsTab.HaveMatsCheckBox:SetValue(false) GUI.frame.content.professionsTab.HaveMatsCheckBox:SetValue(false)
TradeSkillFrameAvailableFilterCheckButton:SetChecked(false) TradeSkillFrameAvailableFilterCheckButton:SetChecked(false)
TradeSkillOnlyShowMakeable(false) TradeSkillOnlyShowMakeable(false)
TradeSkillFrame_Update() TradeSkillFrame_Update()
-- TradeSkillSetFilter(-1, -1) -- TradeSkillSetFilter(-1, -1)
SetTradeSkillItemNameFilter("") SetTradeSkillItemNameFilter("")
@ -529,14 +537,14 @@ function GUI:CreateQueueFrame(parent)
else else
color = "|cff00ff00" color = "|cff00ff00"
end end
end end
GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetOwner(self, "ANCHOR_NONE")
-- GameTooltip:SetPoint("LEFT", self, "RIGHT") -- GameTooltip:SetPoint("LEFT", self, "RIGHT")
GameTooltip:SetPoint("LEFT", self, "LEFT") GameTooltip:SetPoint("LEFT", self, "LEFT")
GameTooltip:AddLine(TSM.db.realm.crafts[data.spellID].name .. " (x" .. data.numQueued .. ")") GameTooltip:AddLine(TSM.db.realm.crafts[data.spellID].name .. " (x" .. data.numQueued .. ")")
local cost = TSM.Cost:GetCraftPrices(data.spellID) local cost = TSM.Cost:GetCraftPrices(data.spellID)
if data.profit then if data.profit then
local profitPercent = data.profit / cost * 100 local profitPercent = data.profit / cost * 100
local profitPercText = format("%s%.0f%%|r", color, profitPercent) local profitPercText = format("%s%.0f%%|r", color, profitPercent)
@ -567,10 +575,10 @@ function GUI:CreateQueueFrame(parent)
else else
GameTooltip:AddLine("Total Loss: " .. (TSMAPI:FormatTextMoney(totalProfit, color) or "---") .. " (" .. (profitPercTextM or "---") .. ")") GameTooltip:AddLine("Total Loss: " .. (TSMAPI:FormatTextMoney(totalProfit, color) or "---") .. " (" .. (profitPercTextM or "---") .. ")")
end end
end end
end end
end end
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
if moneyCoinsTooltip then if moneyCoinsTooltip then
GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoneyIcon(cost, "|cffffff00") or "---")) GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoneyIcon(cost, "|cffffff00") or "---"))
@ -585,27 +593,27 @@ function GUI:CreateQueueFrame(parent)
GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoney(totalcost, "|cffffff00") or "---")) GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoney(totalcost, "|cffffff00") or "---"))
end end
end end
for itemID, matQuantity in pairs(TSM.db.realm.crafts[data.spellID].mats) do for itemID, matQuantity in pairs(TSM.db.realm.crafts[data.spellID].mats) do
local name = TSMAPI:GetSafeItemInfo(itemID) or (TSM.db.realm.mats[itemID] and TSM.db.realm.mats[itemID].name) or "?" local name = TSMAPI:GetSafeItemInfo(itemID) or (TSM.db.realm.mats[itemID] and TSM.db.realm.mats[itemID].name) or "?"
local itemIDx = itemID local itemIDx = itemID
-- Get Cheapest vellum, lower vellum types can be replaced by III -- Get Cheapest vellum, lower vellum types can be replaced by III
local velName local velName
if strfind(name, "Vellum") then if strfind(name, "Vellum") then
velName = name velName = name
end end
if (velName ~= nil) then if (velName ~= nil) then
if strfind(velName, "Weapon") then if strfind(velName, "Weapon") then
itemIDx = "item:52511:0:0:0:0:0:0" itemIDx = "item:52511:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx) name = TSMAPI:GetSafeItemInfo(itemIDx)
else else
itemIDx = "item:52510:0:0:0:0:0:0" itemIDx = "item:52510:0:0:0:0:0:0"
name = TSMAPI:GetSafeItemInfo(itemIDx) name = TSMAPI:GetSafeItemInfo(itemIDx)
end end
end end
local inventory = TSM.Inventory:GetPlayerBagNum(itemIDx) local inventory = TSM.Inventory:GetPlayerBagNum(itemIDx)
local need = matQuantity * data.numQueued local need = matQuantity * data.numQueued
local color local color
@ -681,7 +689,7 @@ function GUI:CreateQueueFrame(parent)
local function MatOnLeave(_, data) local function MatOnLeave(_, data)
GameTooltip:Hide() GameTooltip:Hide()
end end
local function MatOnClick(_, data) local function MatOnClick(_, data)
if IsModifiedClick() then if IsModifiedClick() then
local link = select(2, TSMAPI:GetSafeItemInfo(data.itemString)) local link = select(2, TSMAPI:GetSafeItemInfo(data.itemString))
@ -934,7 +942,7 @@ function GUI:CreateProfessionsTab(parent)
frame.HaveMatsCheckBox = HaveMatsCheckBox frame.HaveMatsCheckBox = HaveMatsCheckBox
HaveMatsCheckBox:SetCallback("OnValueChanged", function(_, _, value) HaveMatsCheckBox:SetCallback("OnValueChanged", function(_, _, value)
TradeSkillFrameAvailableFilterCheckButton:SetChecked(value) TradeSkillFrameAvailableFilterCheckButton:SetChecked(value)
TradeSkillOnlyShowMakeable(value) TradeSkillOnlyShowMakeable(value)
end) end)
local RestockBtn = TSMAPI.GUI:CreateButton(frame, 14) local RestockBtn = TSMAPI.GUI:CreateButton(frame, 14)
@ -1025,7 +1033,7 @@ function GUI:CreateProfessionsTab(parent)
-- btn:SetText(L["Filters >>"]) -- btn:SetText(L["Filters >>"])
-- btn:SetScript("OnClick", function(self) ToggleDropDownMenu(1, nil, TradeSkillFilterDropDown, "TSMCraftingFilterButton", btn:GetWidth(), 0) end) -- btn:SetScript("OnClick", function(self) ToggleDropDownMenu(1, nil, TradeSkillFilterDropDown, "TSMCraftingFilterButton", btn:GetWidth(), 0) end)
-- frame.filterBtn = btn -- frame.filterBtn = btn
local btn = TSMAPI.GUI:CreateButton(frame, 14, "TSMCraftingFilterButton") local btn = TSMAPI.GUI:CreateButton(frame, 14, "TSMCraftingFilterButton")
btn:SetPoint("TOPLEFT", frame.clearFilterBtn, "TOPRIGHT", 5, 0) btn:SetPoint("TOPLEFT", frame.clearFilterBtn, "TOPRIGHT", 5, 0)
btn:SetWidth(80) btn:SetWidth(80)
@ -1447,7 +1455,7 @@ function GUI:CreateGroupsTab(parent)
TSMAPI.Design:SetFrameColor(stContainer) TSMAPI.Design:SetFrameColor(stContainer)
local groupTree = TSMAPI:CreateGroupTree(stContainer, "Crafting", "Crafting_Profession") local groupTree = TSMAPI:CreateGroupTree(stContainer, "Crafting", "Crafting_Profession")
RestockGroups = groupTree RestockGroups = groupTree
local function OnCreateBtnClick() local function OnCreateBtnClick()
if TSM.db.realm.tradeSkills[UnitName("player")][GetTradeSkillLine()] then if TSM.db.realm.tradeSkills[UnitName("player")][GetTradeSkillLine()] then
TSM.db.realm.tradeSkills[UnitName("player")][GetTradeSkillLine()].prompted = nil TSM.db.realm.tradeSkills[UnitName("player")][GetTradeSkillLine()].prompted = nil
@ -1482,7 +1490,7 @@ end
function GUI:UpdateProfessionsTabST() function GUI:UpdateProfessionsTabST()
if not GUI.frame or not GUI.frame:IsVisible() then return end if not GUI.frame or not GUI.frame:IsVisible() then return end
local stData = {} local stData = {}
TSM:UpdateCraftReverseLookup() TSM:UpdateCraftReverseLookup()
@ -1563,10 +1571,10 @@ function GUI:UpdateProfessionsTabST()
end end
local priceText = priceTextCache[spellID] local priceText = priceTextCache[spellID]
local cost, buyout, profit = TSM.Cost:GetCraftPrices(spellID) local cost, buyout, profit = TSM.Cost:GetCraftPrices(spellID)
if spellID and not priceText then if spellID and not priceText then
--local cost, buyout, profit = TSM.Cost:GetCraftPrices(spellID) --local cost, buyout, profit = TSM.Cost:GetCraftPrices(spellID)
if TSM.db.global.priceColumn == 1 then -- Crafting Cost if TSM.db.global.priceColumn == 1 then -- Crafting Cost
if cost and cost > 0 then if cost and cost > 0 then
priceText = TSMAPI:FormatTextMoney(cost, TSMAPI.Design:GetInlineColor("link")) priceText = TSMAPI:FormatTextMoney(cost, TSMAPI.Design:GetInlineColor("link"))
@ -1576,7 +1584,7 @@ function GUI:UpdateProfessionsTabST()
priceText = TSMAPI:FormatTextMoney(buyout, TSMAPI.Design:GetInlineColor("link")) priceText = TSMAPI:FormatTextMoney(buyout, TSMAPI.Design:GetInlineColor("link"))
end end
elseif TSM.db.global.priceColumn == 3 then -- Profit elseif TSM.db.global.priceColumn == 3 then -- Profit
if profit then if profit then
-- if profit < 0 then -- if profit < 0 then
-- priceText = "|cffff0000-|r" .. TSMAPI:FormatTextMoney(-profit, "|cffff0000") .. format(" (%s%.0f%%|r)", "|cffff0000", profitPercent) -- priceText = "|cffff0000-|r" .. TSMAPI:FormatTextMoney(-profit, "|cffff0000") .. format(" (%s%.0f%%|r)", "|cffff0000", profitPercent)
-- else -- else
@ -1588,25 +1596,25 @@ function GUI:UpdateProfessionsTabST()
priceText = TSMAPI:FormatTextMoney(profit, "|cff00ff00") priceText = TSMAPI:FormatTextMoney(profit, "|cff00ff00")
end end
end end
end end
if priceText then if priceText then
priceTextCache[spellID] = priceText priceTextCache[spellID] = priceText
else else
priceText = "---" priceText = "---"
end end
end end
local profitPercent = "---" local profitPercent = "---"
if profit then if profit then
profitPercent = profit / cost * 100 profitPercent = profit / cost * 100
if profit < 0 then if profit < 0 then
profitPercent = format("%s%.0f%%|r", "|cffff0000", profitPercent) profitPercent = format("%s%.0f%%|r", "|cffff0000", profitPercent)
else else
profitPercent = format("%s%.0f%%|r", "|cff00ff00", profitPercent) profitPercent = format("%s%.0f%%|r", "|cff00ff00", profitPercent)
end end
end end
local row = { local row = {
cols = { cols = {
{ {
@ -1637,7 +1645,7 @@ end
function GUI:UpdateSelectedTradeSkill(forceUpdate) function GUI:UpdateSelectedTradeSkill(forceUpdate)
if not GUI.frame or not GUI.frame.content or not GUI.frame.content.professionsTab:IsVisible() then return end if not GUI.frame or not GUI.frame.content or not GUI.frame.content.professionsTab:IsVisible() then return end
local frame = GUI.frame.content.professionsTab local frame = GUI.frame.content.professionsTab
TradeSkillFrame.selectedSkill = TradeSkillFrame.selectedSkill or 1 TradeSkillFrame.selectedSkill = TradeSkillFrame.selectedSkill or 1
if forceUpdate or frame.st:GetSelection() - 1 ~= TradeSkillFrame.selectedSkill then if forceUpdate or frame.st:GetSelection() - 1 ~= TradeSkillFrame.selectedSkill then
@ -1665,7 +1673,7 @@ function GUI:UpdateQueue()
local currentProfession = GetTradeSkillLine() local currentProfession = GetTradeSkillLine()
local stData = {} local stData = {}
local bagTotals = TSM.Inventory:GetTotals(itemID) local bagTotals = TSM.Inventory:GetTotals(itemID)
for profession, crafts in pairs(queuedCrafts) do for profession, crafts in pairs(queuedCrafts) do
local professionColor, playerColor local professionColor, playerColor
local players = {} local players = {}
@ -1722,9 +1730,9 @@ function GUI:UpdateQueue()
if TSM.VellumInfo[spellID] then if TSM.VellumInfo[spellID] then
velName = GetItemInfo(TSM.VellumInfo[spellID]) velName = GetItemInfo(TSM.VellumInfo[spellID])
end end
for itemID, quantity in pairs(TSM.db.realm.crafts[spellID].mats) do for itemID, quantity in pairs(TSM.db.realm.crafts[spellID].mats) do
local MatName = GetItemInfo(itemID) local MatName = GetItemInfo(itemID)
if MatName ~= nil and velName ~= nil and strfind(MatName, "Vellum") then if MatName ~= nil and velName ~= nil and strfind(MatName, "Vellum") then
local NewItemString = CheapestVellum(itemID) local NewItemString = CheapestVellum(itemID)
@ -1733,7 +1741,7 @@ function GUI:UpdateQueue()
velName = GetItemInfo(itemID) velName = GetItemInfo(itemID)
end end
end end
local numHave = bagTotals[itemID] or 0 local numHave = bagTotals[itemID] or 0
canCraft = min(canCraft, floor(numHave / quantity)) canCraft = min(canCraft, floor(numHave / quantity))
end end
@ -1820,16 +1828,16 @@ function GUI:UpdateQueue()
local totalMats = {} local totalMats = {}
for _, data in pairs(queuedMats) do for _, data in pairs(queuedMats) do
for itemString, quantity in pairs(data) do for itemString, quantity in pairs(data) do
local MatName = GetItemInfo(itemString) local MatName = GetItemInfo(itemString)
if MatName ~= nil and strfind(MatName, "Vellum") then if MatName ~= nil and strfind(MatName, "Vellum") then
local NewItemString = CheapestVellum(itemString) local NewItemString = CheapestVellum(itemString)
if itemString ~= NewItemString then if itemString ~= NewItemString then
itemString = NewItemString itemString = NewItemString
end end
end end
totalMats[itemString] = (totalMats[itemString] or 0) + quantity totalMats[itemString] = (totalMats[itemString] or 0) + quantity
end end
end end
for itemString, quantity in pairs(totalMats) do for itemString, quantity in pairs(totalMats) do
@ -1879,8 +1887,8 @@ function GUI:UpdateQueue()
sort(stData, function(a, b) return a.order < b.order end) sort(stData, function(a, b) return a.order < b.order end)
GUI.frame.queue.matST:SetData(stData) GUI.frame.queue.matST:SetData(stData)
-- TSMAPI:CreateTimeDelay("gatheringUpdateThrottle", 0.3, GUI.UpdateGathering) -- TSMAPI:CreateTimeDelay("gatheringUpdateThrottle", 0.3, GUI.UpdateGathering)
TSMAPI:CreateTimeDelay("UpdateCraftButtonThrottle", 0.2, GUI.UpdateCraftButton) TSMAPI:CreateTimeDelay("UpdateCraftButtonThrottle", 0.2, GUI.UpdateCraftButton)
end end
@ -1909,7 +1917,7 @@ function GUI:ShowGroupsTab()
GUI.frame.navFrame.groupsBtn:LockHighlight() GUI.frame.navFrame.groupsBtn:LockHighlight()
GUI.frame.content.professionsTab:Hide() GUI.frame.content.professionsTab:Hide()
GUI.frame.content.groupsTab:Show() GUI.frame.content.groupsTab:Show()
if QuickRestock then if QuickRestock then
QuickRestock = false QuickRestock = false
TSM.Queue:CreateRestockQueue(RestockGroups:GetSelectedGroupInfo()) TSM.Queue:CreateRestockQueue(RestockGroups:GetSelectedGroupInfo())
@ -2204,7 +2212,7 @@ function GUI:CreateGatheringFrame()
GUI:UpdateGathering() GUI:UpdateGathering()
end end
end end
local function AvilableOnEnter(_, data, col) local function AvilableOnEnter(_, data, col)
if not data.isTitle then if not data.isTitle then
local link = select(2, TSMAPI:GetSafeItemInfo(data.cols[1].itemString)) local link = select(2, TSMAPI:GetSafeItemInfo(data.cols[1].itemString))
@ -2248,7 +2256,7 @@ function GUI:CreateGatheringFrame()
end end
end end
end end
frame.availableST = TSMAPI:CreateScrollingTable(stContainer3, stCols3, { OnEnter = MatOnEnter, OnLeave = MatOnLeave, OnClick = OnAvailRowClicked }, 12) frame.availableST = TSMAPI:CreateScrollingTable(stContainer3, stCols3, { OnEnter = MatOnEnter, OnLeave = MatOnLeave, OnClick = OnAvailRowClicked }, 12)
frame.availableST:SetData({}) frame.availableST:SetData({})
@ -2560,6 +2568,9 @@ function GUI:UpdateGathering()
end end
availableMats[itemString] = availQty availableMats[itemString] = availQty
local name = select(1, TSMAPI:GetSafeItemInfo(itemString)) local name = select(1, TSMAPI:GetSafeItemInfo(itemString))
if not name then
name = GetItemInfo(itemString)
end
local color local color
if need == availQty then if need == availQty then
color = "|cff00ff00" color = "|cff00ff00"
@ -2664,18 +2675,18 @@ function CheapestVellum(itemPassed)
-- Return one of the two vellum available -- Return one of the two vellum available
local MatName = GetItemInfo(itemPassed) local MatName = GetItemInfo(itemPassed)
-- MatName is sometimes nil ??? -- MatName is sometimes nil ???
if MatName ~= nil then if MatName ~= nil then
local velName local velName
if strfind(MatName, "Vellum") then if strfind(MatName, "Vellum") then
velName = MatName velName = MatName
end end
if (velName ~= nil) then if (velName ~= nil) then
if strfind(velName, "Weapon") then if strfind(velName, "Weapon") then
itemPassed = "item:52511:0:0:0:0:0:0" itemPassed = "item:52511:0:0:0:0:0:0"
else else
itemPassed = "item:52510:0:0:0:0:0:0" itemPassed = "item:52510:0:0:0:0:0:0"
end end
end end
end end
return itemPassed return itemPassed
end end

Loading…
Cancel
Save