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. 23
      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. 13
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

11
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

38
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

23
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
@ -706,3 +713,15 @@ function TSM:GetAuctionPlayer(player, player_full)
return player
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["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

2
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

1
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."] = ""

1
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

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["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."

1
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

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["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."

1
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 штук."

1
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个为堆叠发布."

1
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的堆疊發佈。"

32
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

1
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)

6
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

13
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,7 +281,7 @@ 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 ~= 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
@ -2560,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"

Loading…
Cancel
Save