From 1da9c62e6b60897dc8ff04d9e7b1f573dfd67877 Mon Sep 17 00:00:00 2001 From: Xan-Asc <119889093+Xan-Asc@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:23:50 -0800 Subject: [PATCH 1/5] Bulk cancel (#11) * Added Bulk Cancel for 100 items * Bugfix: filter out tradeskills that don't craft * Remove excess prints --- TradeSkillMaster_Auctioning/locale/deDE.lua | 1 + TradeSkillMaster_Auctioning/locale/enUS.lua | 2 ++ TradeSkillMaster_Auctioning/locale/esES.lua | 1 + TradeSkillMaster_Auctioning/locale/esMX.lua | 1 + TradeSkillMaster_Auctioning/locale/frFR.lua | 1 + TradeSkillMaster_Auctioning/locale/koKR.lua | 1 + TradeSkillMaster_Auctioning/locale/ptBR.lua | 1 + TradeSkillMaster_Auctioning/locale/ruRU.lua | 1 + TradeSkillMaster_Auctioning/locale/zhCN.lua | 1 + TradeSkillMaster_Auctioning/locale/zhTW.lua | 1 + .../modules/CancelScan.lua | 32 ++++++++++++++++--- TradeSkillMaster_Auctioning/modules/GUI.lua | 1 + .../modules/manage.lua | 6 +++- .../Modules/CraftingGUI.lua | 12 +++++-- 14 files changed, 55 insertions(+), 7 deletions(-) diff --git a/TradeSkillMaster_Auctioning/locale/deDE.lua b/TradeSkillMaster_Auctioning/locale/deDE.lua index 14c8838..ea6c6ce 100644 --- a/TradeSkillMaster_Auctioning/locale/deDE.lua +++ b/TradeSkillMaster_Auctioning/locale/deDE.lua @@ -104,6 +104,7 @@ L["General Reset Settings"] = "Allgemeine Reset Einstellungen" -- Needs review 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["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 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 diff --git a/TradeSkillMaster_Auctioning/locale/enUS.lua b/TradeSkillMaster_Auctioning/locale/enUS.lua index cb4fa71..4712985 100644 --- a/TradeSkillMaster_Auctioning/locale/enUS.lua +++ b/TradeSkillMaster_Auctioning/locale/enUS.lua @@ -108,6 +108,8 @@ L["General Settings"] = true L["General"] = true L["Give the new operation a name. A descriptive name will help you find this operation later."] = 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 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 diff --git a/TradeSkillMaster_Auctioning/locale/esES.lua b/TradeSkillMaster_Auctioning/locale/esES.lua index 08a9605..c0e213b 100644 --- a/TradeSkillMaster_Auctioning/locale/esES.lua +++ b/TradeSkillMaster_Auctioning/locale/esES.lua @@ -99,6 +99,7 @@ Could potentially reset %d items for %s profit.]=] ] = "" ]==] -- L["General Settings"] = "" -- L["Give the new operation a name. A descriptive name will help you find this operation later."] = "" -- L["Help"] = "" +-- L["Hold Alt to cancel 100 auctions at a time"] = "" -- 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 items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "" diff --git a/TradeSkillMaster_Auctioning/locale/esMX.lua b/TradeSkillMaster_Auctioning/locale/esMX.lua index 53f6313..9ed0a1b 100644 --- a/TradeSkillMaster_Auctioning/locale/esMX.lua +++ b/TradeSkillMaster_Auctioning/locale/esMX.lua @@ -99,6 +99,7 @@ L["General"] = "General" -- 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["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 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 diff --git a/TradeSkillMaster_Auctioning/locale/frFR.lua b/TradeSkillMaster_Auctioning/locale/frFR.lua index 7f1c512..01e6c10 100644 --- a/TradeSkillMaster_Auctioning/locale/frFR.lua +++ b/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["Give the new operation a name. A descriptive name will help you find this operation later."] = "" 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 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." diff --git a/TradeSkillMaster_Auctioning/locale/koKR.lua b/TradeSkillMaster_Auctioning/locale/koKR.lua index 2c7009c..9988b66 100644 --- a/TradeSkillMaster_Auctioning/locale/koKR.lua +++ b/TradeSkillMaster_Auctioning/locale/koKR.lua @@ -99,6 +99,7 @@ L["General Reset Settings"] = "일반 재설정 설정" -- Needs review L["General Settings"] = "일반 설정" L["Give the new operation a name. A descriptive name will help you find this operation later."] = "새 작업의 이름을 지정하세요. 설명이 포함된 이름은 나중에 이 작업을 찾는 데 도움이 됩니다." -- Needs review L["Help"] = "도움말" +-- L["Hold Alt to cancel 100 auctions at a time"] = "" 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 items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "각 경매당 등록할 아이템의 개수를 지정, 20은 20 묶음을 등록한다는 의미입니다." -- Needs review diff --git a/TradeSkillMaster_Auctioning/locale/ptBR.lua b/TradeSkillMaster_Auctioning/locale/ptBR.lua index 38259c6..38a69a3 100644 --- a/TradeSkillMaster_Auctioning/locale/ptBR.lua +++ b/TradeSkillMaster_Auctioning/locale/ptBR.lua @@ -104,6 +104,7 @@ L["General Options"] = "Opções Gerais" -- Needs review 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["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 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." diff --git a/TradeSkillMaster_Auctioning/locale/ruRU.lua b/TradeSkillMaster_Auctioning/locale/ruRU.lua index 0191b46..d39db99 100644 --- a/TradeSkillMaster_Auctioning/locale/ruRU.lua +++ b/TradeSkillMaster_Auctioning/locale/ruRU.lua @@ -104,6 +104,7 @@ L["General Reset Settings"] = "Основные опции сброса" L["General Settings"] = "Основные настройки" L["Give the new operation a name. A descriptive name will help you find this operation later."] = "Укажите новое имя для операции. Правильное название поможет вам найти эту операцию позже." L["Help"] = "Помощь" +-- L["Hold Alt to cancel 100 auctions at a time"] = "" 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 items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "Количество товаров в связке. 20 обозначает, что товары будут выставляться связками по 20 штук." diff --git a/TradeSkillMaster_Auctioning/locale/zhCN.lua b/TradeSkillMaster_Auctioning/locale/zhCN.lua index 7fb326d..dce48cd 100644 --- a/TradeSkillMaster_Auctioning/locale/zhCN.lua +++ b/TradeSkillMaster_Auctioning/locale/zhCN.lua @@ -105,6 +105,7 @@ L["General Reset Settings"] = "常规转卖设置" L["General Settings"] = "常规设定" L["Give the new operation a name. A descriptive name will help you find this operation later."] = "为新操作命名,一个描述性的名称将方便您找到它。" L["Help"] = "帮助" +-- L["Hold Alt to cancel 100 auctions at a time"] = "" 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 items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "一次拍卖发布多少个物品,20意味着物品将以20个为堆叠发布." diff --git a/TradeSkillMaster_Auctioning/locale/zhTW.lua b/TradeSkillMaster_Auctioning/locale/zhTW.lua index 1e74b2d..e55bad6 100644 --- a/TradeSkillMaster_Auctioning/locale/zhTW.lua +++ b/TradeSkillMaster_Auctioning/locale/zhTW.lua @@ -104,6 +104,7 @@ L["General"] = "一般" L["General Settings"] = "一般設定" -- L["Give the new operation a name. A descriptive name will help you find this operation later."] = "" L["Help"] = "幫助" +-- L["Hold Alt to cancel 100 auctions at a time"] = "" 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 items should be in a single auction, 20 will mean they are posted in stacks of 20."] = "多少物品在單一拍賣,20是指20的堆疊發佈。" diff --git a/TradeSkillMaster_Auctioning/modules/CancelScan.lua b/TradeSkillMaster_Auctioning/modules/CancelScan.lua index 19dd765..1e9ec5f 100644 --- a/TradeSkillMaster_Auctioning/modules/CancelScan.lua +++ b/TradeSkillMaster_Auctioning/modules/CancelScan.lua @@ -410,8 +410,17 @@ local function DelayFrame() end -- updates the current item to the first one in the list -function Cancel:UpdateItem() - if #(cancelQueue) == 0 then +function Cancel:UpdateItem(...) + 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() if isScanning then 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) - totalCanceled = totalCanceled + 1 - TSM.Manage:UpdateStatus("manage", totalCanceled, totalToCancel) wipe(currentItem) currentItem = cancelQueue[1] TSM.Manage:SetCurrentItem(currentItem) GUI.buttons:Enable() 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 function Cancel:DoAction() local index, backupIndex diff --git a/TradeSkillMaster_Auctioning/modules/GUI.lua b/TradeSkillMaster_Auctioning/modules/GUI.lua index 104d163..6c4a9be 100644 --- a/TradeSkillMaster_Auctioning/modules/GUI.lua +++ b/TradeSkillMaster_Auctioning/modules/GUI.lua @@ -73,6 +73,7 @@ function private:CreateButtons(parent) button:SetPoint("TOPLEFT") button:SetWidth(80) button:SetHeight(height) + button.tooltip = L["Hold Alt to cancel 100 auctions at a time"] button:SetText(L["Cancel"]) button.which = "action" button:SetScript("OnClick", OnClick) diff --git a/TradeSkillMaster_Auctioning/modules/manage.lua b/TradeSkillMaster_Auctioning/modules/manage.lua index 7541db3..f7e1606 100644 --- a/TradeSkillMaster_Auctioning/modules/manage.lua +++ b/TradeSkillMaster_Auctioning/modules/manage.lua @@ -65,7 +65,11 @@ end function Manage:OnGUIEvent(event) if event == "action" then - Util:DoAction() + if mode == "Cancel" and IsAltKeyDown() then + Util:BulkCancel() + else + Util:DoAction() + end elseif event == "skip" then Util:SkipItem() elseif event == "stop" then diff --git a/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua b/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua index 2b5c2fd..b4f7d68 100644 --- a/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua +++ b/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua @@ -16,6 +16,14 @@ local private = {} private.gather = {} 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 local function GetTradeSkillSpellID(spellName) -- GetTradeSkillRecipeLink ONLY works when a trade skill window is open, but this should always happen @@ -273,8 +281,8 @@ function GUI:UpdateTradeSkills(...) elseif skillName == "Weapon Skills" then inSecondary = false elseif inProfessions == true or inSecondary == true then - if skillName ~= nil and (not filterTrade or filterTrade == skillName)then --- if skillName == "Mining" then skillName = "Smelting" end -- bandaid for mining as related spell is different than craft + 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 TSM.db.realm.tradeSkills[playerName][skillName] = old[skillName] or {} TSM.db.realm.tradeSkills[playerName][skillName].level = skillRank TSM.db.realm.tradeSkills[playerName][skillName].maxLevel = skillMaxRank From ba48ff95ba35076e98d0d496c7214f10ce028c1c Mon Sep 17 00:00:00 2001 From: Anthony Narkevicius Date: Sat, 25 Nov 2023 16:24:10 -0800 Subject: [PATCH 2/5] fix error with destroy window in combat (#10) * Fix GetAll scan functionality * fix error with destroy window in combat --- TradeSkillMaster_Destroying/Modules/gui.lua | 39 +++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/TradeSkillMaster_Destroying/Modules/gui.lua b/TradeSkillMaster_Destroying/Modules/gui.lua index d09dd3a..ae5a078 100644 --- a/TradeSkillMaster_Destroying/Modules/gui.lua +++ b/TradeSkillMaster_Destroying/Modules/gui.lua @@ -236,7 +236,18 @@ end function GUI:UNIT_SPELLCAST_INTERRUPTED(_, unit) if unit == "player" and private.frame and private.frame:IsVisible() then TSMAPI:CancelFrame("destroyEnableDelay") - private.frame.destroyBtn:Enable() + if InCombatLockdown() then + TSMAPI:CreateTimeDelay("destroyEnableDelay", 1, + function() + if not UnitCastingInfo("player") + and not LootFrame:IsVisible() + and not InCombatLockdown() then + private.frame.destroyBtn:Enable() + end + end) + else + private.frame.destroyBtn:Enable() + end end end @@ -271,13 +282,35 @@ function private:LootChanged() local quantity = select(2, GetContainerItemInfo(private.tempData.bag, private.tempData.slot)) if quantity == private.tempData.quantity or quantity == private.tempData.perDestroy then TSMAPI:CancelFrame("destroyEnableDelay") - private.frame.destroyBtn:Enable() + if InCombatLockdown() then + TSMAPI:CreateTimeDelay("destroyEnableDelay", 1, + function() + if not UnitCastingInfo("player") + and not LootFrame:IsVisible() + and not InCombatLockdown() then + private.frame.destroyBtn:Enable() + end + end) + else + private.frame.destroyBtn:Enable() + end end end elseif private.highStack and GetNumLootItems() <= 1 then if private.frame and private.frame:IsVisible() then TSMAPI:CancelFrame("destroyEnableDelay") - private.frame.destroyBtn:Enable() + if InCombatLockdown() then + TSMAPI:CreateTimeDelay("destroyEnableDelay", 1, + function() + if not UnitCastingInfo("player") + and not LootFrame:IsVisible() + and not InCombatLockdown() then + private.frame.destroyBtn:Enable() + end + end) + else + private.frame.destroyBtn:Enable() + end end end end \ No newline at end of file From b69cfb38774c55fa5ccae39cbe745b929cc93e45 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Mon, 15 Jan 2024 09:03:04 -0700 Subject: [PATCH 3/5] LibSharedMedia: Ascension Fonts Upgrade --- .../LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/TradeSkillMaster/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua b/TradeSkillMaster/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua index 1b24822..15f0529 100644 --- a/TradeSkillMaster/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua +++ b/TradeSkillMaster/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua @@ -9,7 +9,7 @@ Dependencies: LibStub, CallbackHandler-1.0 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) if not lib then return end @@ -99,9 +99,9 @@ if locale == "koKR" then elseif locale == "zhCN" then LOCALE_MASK = lib.LOCALE_BIT_zhCN -- - SML_MT_font["伤害数字"] = [[Fonts\ZYKai_C.ttf]] - SML_MT_font["默认"] = [[Fonts\ZYKai_T.ttf]] - SML_MT_font["聊天"] = [[Fonts\ZYHei.ttf]] + SML_MT_font["伤害数字"] = [[Fonts\ARKai_C.ttf]] + SML_MT_font["默认"] = [[Fonts\ARKai_T.ttf]] + SML_MT_font["聊天"] = [[Fonts\ARHei.ttf]] -- lib.DefaultMedia["font"] = "默认" -- someone from zhCN please adjust if needed -- @@ -118,22 +118,35 @@ elseif locale == "zhTW" then elseif locale == "ruRU" then LOCALE_MASK = lib.LOCALE_BIT_ruRU -- - SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] - SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] - SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS.TTF]] - SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] - SML_MT_font["Skurri"] = [[Fonts\SKURRI.TTF]] + 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["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 LOCALE_MASK = lib.LOCALE_BIT_western 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["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] - SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS.TTF]] - SML_MT_font["Skurri"] = [[Fonts\SKURRI.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 = "Friz Quadrata TT" -- @@ -143,6 +156,7 @@ end if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]] lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] +lib.MediaTable.statusbar["Solid"] = [[Interface\Buttons\WHITE8X8]] lib.DefaultMedia.statusbar = "Blizzard" -- SOUND From a23e8cdb4f762fffa0f8dd5a5a26b6b310af6dac Mon Sep 17 00:00:00 2001 From: Xan-Asc <119889093+Xan-Asc@users.noreply.github.com> Date: Sun, 18 Feb 2024 08:19:45 -0800 Subject: [PATCH 4/5] Will query the server for any uncached recipe items during login (#12) --- TradeSkillMaster/Core/Options.lua | 11 ++ TradeSkillMaster/TradeSkillMaster.lua | 22 ++- .../Modules/CraftingGUI.lua | 125 +++++++++--------- 3 files changed, 95 insertions(+), 63 deletions(-) diff --git a/TradeSkillMaster/Core/Options.lua b/TradeSkillMaster/Core/Options.lua index d0f2155..ead1ce9 100644 --- a/TradeSkillMaster/Core/Options.lua +++ b/TradeSkillMaster/Core/Options.lua @@ -939,6 +939,17 @@ function private:LoadProfilesPage(container) 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 end diff --git a/TradeSkillMaster/TradeSkillMaster.lua b/TradeSkillMaster/TradeSkillMaster.lua index 4450f53..c99f97c 100644 --- a/TradeSkillMaster/TradeSkillMaster.lua +++ b/TradeSkillMaster/TradeSkillMaster.lua @@ -1,4 +1,4 @@ --- ------------------------------------------------------------------------------ -- +-- ------------------------------------------------------------------------------ -- -- TradeSkillMaster -- -- http://www.curse.com/addons/wow/tradeskill-master -- -- -- @@ -234,15 +234,22 @@ function TSM:OnInitialize() -- create the main TSM frame TSM:CreateMainFrame() - + local bulkquerybuffer = {} -- fix any items with spaces in them 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 local newItemString = gsub(itemString, " ", "") TSM.db.profile.items[newItemString] = groupPath TSM.db.profile.items[itemString] = nil end end + TSMAPI:BulkQuery(bulkquerybuffer) if TSM.db.profile.deValueSource then TSM.db.profile.destroyValueSource = TSM.db.profile.deValueSource @@ -705,4 +712,15 @@ function TSM:GetAuctionPlayer(player, player_full) else return player end +end + +-- Bulk load uncached IDs. Divides in to buckets of 50 +function TSMAPI:BulkQuery(items) + 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 \ No newline at end of file diff --git a/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua b/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua index b4f7d68..367697e 100644 --- a/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua +++ b/TradeSkillMaster_Crafting/Modules/CraftingGUI.lua @@ -23,7 +23,7 @@ local invalidTrade = { ["Fishing"] = true, ["Riding"] = true } - + -- Helper function to find spellID associated to spellname local function GetTradeSkillSpellID(spellName) -- GetTradeSkillRecipeLink ONLY works when a trade skill window is open, but this should always happen @@ -117,7 +117,7 @@ function GUI:ShowProfessionWindow() AscensionTradeSkillFrame:UnregisterEvent("TRADE_SKILL_SHOW") AscensionTradeSkillFrame:OpenOldUI() - + GUI:ShowSwitchButton() if TSM.db.global.showingDefaultFrame then return end GUI:UpdateTradeSkills(GetTradeSkillLine()) @@ -182,7 +182,7 @@ end function GUI:EventHandler(event, ...) 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 event == "TRADE_SKILL_CLOSE" then GUI.frame:Hide() @@ -227,7 +227,7 @@ function GUI:EventHandler(event, ...) -- if spellID == nil then -- TSM:Printf("Could not find spellID for %s", spellName) -- end - + -- decrements the number of this craft that are queued to be crafted craft.queued = craft.queued - 1 if GUI.isCrafting and GUI.isCrafting.quantity > 0 then @@ -235,7 +235,7 @@ function GUI:EventHandler(event, ...) if GUI.isCrafting.quantity == 0 then --GUI:UpdateQueue() end - end + end -- no longer casting a spell so discard spellID TSM.currentspell = nil -- TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue) @@ -246,7 +246,7 @@ function GUI:EventHandler(event, ...) -- if spellID == nil then -- TSM:Printf("Could not find spellID for %s", spellName) -- end - + if GUI.isCrafting and TSM.currentspell == GUI.isCrafting.spellID then GUI.isCrafting.quantity = 0 TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.2, GUI.UpdateQueue) @@ -273,16 +273,16 @@ function GUI:UpdateTradeSkills(...) -- for each trade skill found, add it to the db for i = 1, GetNumSkillLines() do local skillName, _, _, skillRank, _, _, skillMaxRank = GetSkillLineInfo(i) - if skillName == "Professions" then + if skillName == "Professions" then inProfessions = true - elseif skillName == "Secondary Skills" then + elseif skillName == "Secondary Skills" then inProfessions = false - inSecondary = true - elseif skillName == "Weapon Skills" then + inSecondary = true + elseif skillName == "Weapon Skills" then 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) 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].level = skillRank TSM.db.realm.tradeSkills[playerName][skillName].maxLevel = skillMaxRank @@ -298,8 +298,8 @@ function GUI:UpdateTradeSkills(...) TSM.Sync:BroadcastTradeSkillData() end end - end - end + end + end end @@ -387,7 +387,7 @@ function GUI:ClearFilters() SetTradeSkillSubClassFilter(0,1,1) GUI.frame.content.professionsTab.HaveMatsCheckBox:SetValue(false) TradeSkillFrameAvailableFilterCheckButton:SetChecked(false) - TradeSkillOnlyShowMakeable(false) + TradeSkillOnlyShowMakeable(false) TradeSkillFrame_Update() -- TradeSkillSetFilter(-1, -1) SetTradeSkillItemNameFilter("") @@ -537,14 +537,14 @@ function GUI:CreateQueueFrame(parent) else color = "|cff00ff00" end - + end GameTooltip:SetOwner(self, "ANCHOR_NONE") -- GameTooltip:SetPoint("LEFT", self, "RIGHT") GameTooltip:SetPoint("LEFT", self, "LEFT") 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 local profitPercent = data.profit / cost * 100 local profitPercText = format("%s%.0f%%|r", color, profitPercent) @@ -575,10 +575,10 @@ function GUI:CreateQueueFrame(parent) else GameTooltip:AddLine("Total Loss: " .. (TSMAPI:FormatTextMoney(totalProfit, color) or "---") .. " (" .. (profitPercTextM or "---") .. ")") end - end - end + end + end end - + GameTooltip:AddLine(" ") if moneyCoinsTooltip then GameTooltip:AddLine("Crafting Cost: " .. (TSMAPI:FormatTextMoneyIcon(cost, "|cffffff00") or "---")) @@ -593,27 +593,27 @@ function GUI:CreateQueueFrame(parent) GameTooltip:AddLine("Total Cost: " .. (TSMAPI:FormatTextMoney(totalcost, "|cffffff00") or "---")) end end - + 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 itemIDx = itemID - + -- Get Cheapest vellum, lower vellum types can be replaced by III local velName if strfind(name, "Vellum") then velName = name end - if (velName ~= nil) then - if strfind(velName, "Weapon") then + if (velName ~= nil) then + if strfind(velName, "Weapon") then itemIDx = "item:52511:0:0:0:0:0:0" name = TSMAPI:GetSafeItemInfo(itemIDx) else itemIDx = "item:52510:0:0:0:0:0:0" - name = TSMAPI:GetSafeItemInfo(itemIDx) + name = TSMAPI:GetSafeItemInfo(itemIDx) end end - + local inventory = TSM.Inventory:GetPlayerBagNum(itemIDx) local need = matQuantity * data.numQueued local color @@ -689,7 +689,7 @@ function GUI:CreateQueueFrame(parent) local function MatOnLeave(_, data) GameTooltip:Hide() end - + local function MatOnClick(_, data) if IsModifiedClick() then local link = select(2, TSMAPI:GetSafeItemInfo(data.itemString)) @@ -942,7 +942,7 @@ function GUI:CreateProfessionsTab(parent) frame.HaveMatsCheckBox = HaveMatsCheckBox HaveMatsCheckBox:SetCallback("OnValueChanged", function(_, _, value) TradeSkillFrameAvailableFilterCheckButton:SetChecked(value) - TradeSkillOnlyShowMakeable(value) + TradeSkillOnlyShowMakeable(value) end) local RestockBtn = TSMAPI.GUI:CreateButton(frame, 14) @@ -1033,7 +1033,7 @@ function GUI:CreateProfessionsTab(parent) -- btn:SetText(L["Filters >>"]) -- btn:SetScript("OnClick", function(self) ToggleDropDownMenu(1, nil, TradeSkillFilterDropDown, "TSMCraftingFilterButton", btn:GetWidth(), 0) end) -- frame.filterBtn = btn - + local btn = TSMAPI.GUI:CreateButton(frame, 14, "TSMCraftingFilterButton") btn:SetPoint("TOPLEFT", frame.clearFilterBtn, "TOPRIGHT", 5, 0) btn:SetWidth(80) @@ -1455,7 +1455,7 @@ function GUI:CreateGroupsTab(parent) TSMAPI.Design:SetFrameColor(stContainer) local groupTree = TSMAPI:CreateGroupTree(stContainer, "Crafting", "Crafting_Profession") RestockGroups = groupTree - + local function OnCreateBtnClick() if TSM.db.realm.tradeSkills[UnitName("player")][GetTradeSkillLine()] then TSM.db.realm.tradeSkills[UnitName("player")][GetTradeSkillLine()].prompted = nil @@ -1490,7 +1490,7 @@ end function GUI:UpdateProfessionsTabST() if not GUI.frame or not GUI.frame:IsVisible() then return end - + local stData = {} TSM:UpdateCraftReverseLookup() @@ -1571,10 +1571,10 @@ function GUI:UpdateProfessionsTabST() end 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 --local cost, buyout, profit = TSM.Cost:GetCraftPrices(spellID) - + if TSM.db.global.priceColumn == 1 then -- Crafting Cost if cost and cost > 0 then priceText = TSMAPI:FormatTextMoney(cost, TSMAPI.Design:GetInlineColor("link")) @@ -1584,7 +1584,7 @@ function GUI:UpdateProfessionsTabST() priceText = TSMAPI:FormatTextMoney(buyout, TSMAPI.Design:GetInlineColor("link")) end elseif TSM.db.global.priceColumn == 3 then -- Profit - if profit then + if profit then -- if profit < 0 then -- priceText = "|cffff0000-|r" .. TSMAPI:FormatTextMoney(-profit, "|cffff0000") .. format(" (%s%.0f%%|r)", "|cffff0000", profitPercent) -- else @@ -1596,25 +1596,25 @@ function GUI:UpdateProfessionsTabST() priceText = TSMAPI:FormatTextMoney(profit, "|cff00ff00") end end - end - + end + if priceText then priceTextCache[spellID] = priceText else priceText = "---" end end - - local profitPercent = "---" + + local profitPercent = "---" if profit then - profitPercent = profit / cost * 100 + profitPercent = profit / cost * 100 if profit < 0 then profitPercent = format("%s%.0f%%|r", "|cffff0000", profitPercent) else profitPercent = format("%s%.0f%%|r", "|cff00ff00", profitPercent) - end + end end - + local row = { cols = { { @@ -1645,7 +1645,7 @@ end function GUI:UpdateSelectedTradeSkill(forceUpdate) 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 TradeSkillFrame.selectedSkill = TradeSkillFrame.selectedSkill or 1 if forceUpdate or frame.st:GetSelection() - 1 ~= TradeSkillFrame.selectedSkill then @@ -1673,7 +1673,7 @@ function GUI:UpdateQueue() local currentProfession = GetTradeSkillLine() local stData = {} local bagTotals = TSM.Inventory:GetTotals(itemID) - + for profession, crafts in pairs(queuedCrafts) do local professionColor, playerColor local players = {} @@ -1730,9 +1730,9 @@ function GUI:UpdateQueue() if TSM.VellumInfo[spellID] then velName = GetItemInfo(TSM.VellumInfo[spellID]) end - + for itemID, quantity in pairs(TSM.db.realm.crafts[spellID].mats) do - + local MatName = GetItemInfo(itemID) if MatName ~= nil and velName ~= nil and strfind(MatName, "Vellum") then local NewItemString = CheapestVellum(itemID) @@ -1741,7 +1741,7 @@ function GUI:UpdateQueue() velName = GetItemInfo(itemID) end end - + local numHave = bagTotals[itemID] or 0 canCraft = min(canCraft, floor(numHave / quantity)) end @@ -1828,16 +1828,16 @@ function GUI:UpdateQueue() local totalMats = {} for _, data in pairs(queuedMats) do for itemString, quantity in pairs(data) do - + local MatName = GetItemInfo(itemString) - if MatName ~= nil and strfind(MatName, "Vellum") then + if MatName ~= nil and strfind(MatName, "Vellum") then local NewItemString = CheapestVellum(itemString) if itemString ~= NewItemString then itemString = NewItemString end end totalMats[itemString] = (totalMats[itemString] or 0) + quantity - + end end for itemString, quantity in pairs(totalMats) do @@ -1887,8 +1887,8 @@ function GUI:UpdateQueue() sort(stData, function(a, b) return a.order < b.order end) 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) end @@ -1917,7 +1917,7 @@ function GUI:ShowGroupsTab() GUI.frame.navFrame.groupsBtn:LockHighlight() GUI.frame.content.professionsTab:Hide() GUI.frame.content.groupsTab:Show() - + if QuickRestock then QuickRestock = false TSM.Queue:CreateRestockQueue(RestockGroups:GetSelectedGroupInfo()) @@ -2212,7 +2212,7 @@ function GUI:CreateGatheringFrame() GUI:UpdateGathering() end end - + local function AvilableOnEnter(_, data, col) if not data.isTitle then local link = select(2, TSMAPI:GetSafeItemInfo(data.cols[1].itemString)) @@ -2256,7 +2256,7 @@ function GUI:CreateGatheringFrame() end end end - + frame.availableST = TSMAPI:CreateScrollingTable(stContainer3, stCols3, { OnEnter = MatOnEnter, OnLeave = MatOnLeave, OnClick = OnAvailRowClicked }, 12) frame.availableST:SetData({}) @@ -2568,6 +2568,9 @@ function GUI:UpdateGathering() end availableMats[itemString] = availQty local name = select(1, TSMAPI:GetSafeItemInfo(itemString)) + if not name then + name = GetItemInfo(itemString) + end local color if need == availQty then color = "|cff00ff00" @@ -2672,18 +2675,18 @@ function CheapestVellum(itemPassed) -- Return one of the two vellum available local MatName = GetItemInfo(itemPassed) -- MatName is sometimes nil ??? - if MatName ~= nil then + if MatName ~= nil then local velName if strfind(MatName, "Vellum") then velName = MatName end - if (velName ~= nil) then - if strfind(velName, "Weapon") then + if (velName ~= nil) then + if strfind(velName, "Weapon") then itemPassed = "item:52511:0:0:0:0:0:0" else itemPassed = "item:52510:0:0:0:0:0:0" end end end - return itemPassed -end \ No newline at end of file + return itemPassed +end From 2fe75e447244885fcbe30bf91a641d784e365c49 Mon Sep 17 00:00:00 2001 From: Xan-Asc <119889093+Xan-Asc@users.noreply.github.com> Date: Sat, 6 Apr 2024 10:32:06 -0700 Subject: [PATCH 5/5] Bugfix: BulkQuery->QueryTicker spammed errors if items list was empty (#13) --- TradeSkillMaster/TradeSkillMaster.lua | 33 ++++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/TradeSkillMaster/TradeSkillMaster.lua b/TradeSkillMaster/TradeSkillMaster.lua index c99f97c..bc6ae51 100644 --- a/TradeSkillMaster/TradeSkillMaster.lua +++ b/TradeSkillMaster/TradeSkillMaster.lua @@ -134,7 +134,7 @@ local savedDBDefaults = { -- Called once the player has loaded WOW. function TSM:OnInitialize() TSMAPI:RegisterForTracing(TSMAPI, "TSMAPI") - + TSM.moduleObjects = nil TSM.moduleNames = nil @@ -149,7 +149,7 @@ function TSM:OnInitialize() else TSM.operations = TSM.db.profile.operations end - + -- 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. @@ -250,7 +250,7 @@ function TSM:OnInitialize() end end TSMAPI:BulkQuery(bulkquerybuffer) - + if TSM.db.profile.deValueSource then TSM.db.profile.destroyValueSource = TSM.db.profile.deValueSource TSM.db.profile.deValueSource = nil @@ -267,7 +267,7 @@ function TSM:RegisterModule() } TSM.priceSources = {} - + -- Auctioneer if select(4, GetAddOnInfo("Auc-Advanced")) == 1 and AucAdvanced then if AucAdvanced.Modules.Util.Appraiser and AucAdvanced.Modules.Util.Appraiser.GetPrice then @@ -280,7 +280,7 @@ function TSM:RegisterModule() tinsert(TSM.priceSources, { key = "AucMarket", label = L["Auctioneer - Market Value"], callback = AucAdvanced.API.GetMarketValue }) end end - + -- Auctionator if select(4, GetAddOnInfo("Auctionator")) == 1 and Atr_GetAuctionBuyout then tinsert(TSM.priceSources, { key = "AtrValue", label = L["Auctionator - Auction Value"], callback = Atr_GetAuctionBuyout }) @@ -430,7 +430,7 @@ function TSM:GetTooltip(itemString, quantity) tinsert(text, { left = " " .. L["Disenchant Value:"], right = TSMAPI:FormatTextMoney(deValue, "|cffffffff", true) }) end end - + if TSM.db.profile.detailedDestroyTooltip then local _, itemLink, quality, ilvl, _, iType = TSMAPI:GetSafeItemInfo(itemString) local itemString = TSMAPI:GetItemString(itemLink) @@ -463,7 +463,7 @@ function TSM:GetTooltip(itemString, quantity) end end end - + -- add mill value info if TSM.db.profile.millTooltip then local millValue = TSM:GetMillValue(itemString) @@ -481,7 +481,7 @@ function TSM:GetTooltip(itemString, quantity) tinsert(text, { left = " " .. L["Mill Value:"], right = TSMAPI:FormatTextMoney(millValue, "|cffffffff", true) }) end end - + if TSM.db.profile.detailedDestroyTooltip then for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("mill")) do local herbs = TSMAPI:GetItemConversions(targetItem) @@ -504,7 +504,7 @@ function TSM:GetTooltip(itemString, quantity) end end end - + -- add prospect value info if TSM.db.profile.prospectTooltip then local prospectValue = TSM:GetProspectValue(itemString) @@ -522,7 +522,7 @@ function TSM:GetTooltip(itemString, quantity) tinsert(text, { left = " " .. L["Prospect Value:"], right = TSMAPI:FormatTextMoney(prospectValue, "|cffffffff", true) }) end end - + if TSM.db.profile.detailedDestroyTooltip then for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("prospect")) do local gems = TSMAPI:GetItemConversions(targetItem) @@ -589,7 +589,7 @@ function TSM:GetTooltip(itemString, quantity) end end end - + for name, method in pairs(TSM.db.global.customPriceSources) do if TSM.db.global.customPriceTooltips[name] then local price = TSM:GetCustomPrice(name, itemString) @@ -632,7 +632,7 @@ end function TSM:GetMillValue(itemString) local value = 0 - + for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("mill")) do local herbs = TSMAPI:GetItemConversions(targetItem) if herbs[itemString] then @@ -640,13 +640,13 @@ function TSM:GetMillValue(itemString) value = value + (matValue or 0) * herbs[itemString].rate end end - + return value end function TSM:GetProspectValue(itemString) local value = 0 - + for _, targetItem in ipairs(TSMAPI:GetConversionTargetItems("prospect")) do local gems = TSMAPI:GetItemConversions(targetItem) if gems[itemString] then @@ -654,7 +654,7 @@ function TSM:GetProspectValue(itemString) value = value + (matValue or 0) * gems[itemString].rate end end - + return value end @@ -716,6 +716,7 @@ 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 @@ -723,4 +724,4 @@ function TSMAPI:BulkQuery(items) self.QueryTicker = nil end end) -end \ No newline at end of file +end