This commit is contained in:
Andrew6810
2022-11-05 21:19:42 -07:00
parent b79f4bd588
commit f3e579cb57
386 changed files with 93729 additions and 2 deletions
@@ -0,0 +1,52 @@
v2.0.8
*Fixed minor bug with connected realms.
v2.0.7
*Added connected realm support for character inventories.
*Fixed bug with deleting the current character causing errors (will now reset the current character's inventory data instead of attempt to delete it).
v2.0.6
*Rewrote some of the mail tracking code to make it much less laggy.
v2.0.5
*Remove some old mail tracking code.
*Fixed error from not viewing a character in a while.
v2.0.4
*Updated TOC for patch 5.4.
v2.0.3
*Some initial fixes for patch 5.4.
*Bug fix with returning mail containing gold (or COD).
v2.0.2
*Rewrote code for tacking mails to reduce lag and fix some bugs.
v2.0.1
*Bug fix in some of the 1.x cleanup code.
*Updated scrolling tables.
v2.0
*First 2.0 Version!
\\
v1.3
*Updated for 5.2.
*Fixed a bug with scrolling tables collapsing to half width in some situations.
*Fixed some issues with syncing multiple accounts.
*Many other minor bug fixes and improvements.
v1.2
*ItemTracker now tracks items in the mail.
*Updated for new design.
*Updated for patch 5.0.4.
*Many other minor bug fixes and improvements.
v1.1
*Added support for multiple accounts.
*Added inventory viewer tab to the ItemTracker part of the TSM window.
*Removed unnecessary processing code which was slowing things down.
*Fixed bug with tooltip lines being duplicated after changing tooltip setting.
v1.0
*First Release Version!
+21
View File
@@ -0,0 +1,21 @@
All rights are reserved unless explicitly stated below. The "license
holder" is the manager of this project, Sapu94 (sapu94@gmail.com).
Exceptions:
1) The use of this addon in accordance with all applicable terms set by
Blizzard Entertainment for addon use and game play is permitted.
2) Modifications for personal use or submission to license holder are
permitted. Modified versions of the works, derivative works, modified
sections of the works, and instructions for how to modify the works are
all prohibited unless the express consent of the license holder is
granted.
Comments:
1) Permission to use sections of the works in your own work is very
likely to be granted upon contacting the license holder.
2) The right to distribute the works is reserved by the license holder.
In no way or form may a person other than the license holder distribute
the works.
3) Please contact the license holder if you have any questions at all
regarding this license at the following email address: sapu94@gmail.com
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - deDE
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "deDE")
if not L then return end
-- L["AH"] = ""
-- L["Bags"] = ""
-- L["Bank"] = ""
-- L["Characters"] = ""
L["Delete Character:"] = "Lösche Charakter:"
L["Full"] = "Voll"
-- L["GBank"] = ""
-- L["Guilds"] = ""
-- L["Guilds (Guild Banks) to Ignore:"] = ""
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = "Wenn du ein deiner Charakter umbenennst / transferierst / löschst, nutze das Dropdownmenü um den Charakter aus ItemTracker zu löschen. Es gibt keine Bestätigung. Wenn du aus Versehen einen Charakter löschst der noch existiert, logge dich einfach auf den Charakter ein um in wieder zu ItemTracker hinzuzufügen. "
-- L["Inventory Viewer"] = ""
-- L["Item Name"] = ""
-- L["Item Search"] = ""
-- L["Mail"] = ""
-- L["Market Value Price Source"] = ""
L["No Tooltip Info"] = "Keine Tooltip Info"
L["Options"] = "Optionen"
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
L["Simple"] = "Einfach"
-- L["%s in guild bank"] = ""
-- L["%s item(s) total"] = ""
-- L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = ""
-- L["(%s player, %s alts, %s guild banks, %s AH)"] = ""
L["\"%s\" removed from ItemTracker."] = "\"%s\" aus ItemTracker entfernt."
-- L["%s (%s bags, %s bank, %s AH, %s mail)"] = ""
-- L["Total"] = ""
-- L["Total Value"] = ""
@@ -0,0 +1,44 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - enUS
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkill-Master/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "enUS", true)
if not L then return end
L["%s (%s bags, %s bank, %s AH, %s mail)"] = true
L["%s in guild bank"] = true
L["%s item(s) total"] = true
L["(%s player, %s alts, %s guild banks, %s AH)"] = true
L["AH"] = true
L["Bags"] = true
L["Bank"] = true
L["Characters"] = true
L["Delete Character:"] = true
L["Full"] = true
L["GBank"] = true
L["Guilds (Guild Banks) to Ignore:"] = true
L["Guilds"] = true
L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = true
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = true
L["Inventory Viewer"] = true
L["Item Name"] = true
L["Item Search"] = true
L["Mail"] = true
L["Market Value Price Source"] = true
L["No Tooltip Info"] = true
L["Options"] = true
L["Reset current player's inventory data."] = true
L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = true
L["Simple"] = true
L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = true
L["Total Value"] = true
L["Total"] = true
L["\"%s\" removed from ItemTracker."] = true
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - esES
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "esES")
if not L then return end
-- L["AH"] = ""
-- L["Bags"] = ""
-- L["Bank"] = ""
-- L["Characters"] = ""
-- L["Delete Character:"] = ""
-- L["Full"] = ""
-- L["GBank"] = ""
-- L["Guilds"] = ""
-- L["Guilds (Guild Banks) to Ignore:"] = ""
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
-- L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = ""
-- L["Inventory Viewer"] = ""
-- L["Item Name"] = ""
-- L["Item Search"] = ""
-- L["Mail"] = ""
-- L["Market Value Price Source"] = ""
-- L["No Tooltip Info"] = ""
-- L["Options"] = ""
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
-- L["Simple"] = ""
-- L["%s in guild bank"] = ""
-- L["%s item(s) total"] = ""
-- L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = ""
-- L["(%s player, %s alts, %s guild banks, %s AH)"] = ""
-- L["\"%s\" removed from ItemTracker."] = ""
-- L["%s (%s bags, %s bank, %s AH, %s mail)"] = ""
-- L["Total"] = ""
-- L["Total Value"] = ""
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - esMX
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "esMX")
if not L then return end
-- L["AH"] = ""
-- L["Bags"] = ""
-- L["Bank"] = ""
-- L["Characters"] = ""
-- L["Delete Character:"] = ""
-- L["Full"] = ""
-- L["GBank"] = ""
-- L["Guilds"] = ""
-- L["Guilds (Guild Banks) to Ignore:"] = ""
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
-- L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = ""
-- L["Inventory Viewer"] = ""
-- L["Item Name"] = ""
-- L["Item Search"] = ""
-- L["Mail"] = ""
-- L["Market Value Price Source"] = ""
-- L["No Tooltip Info"] = ""
-- L["Options"] = ""
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
-- L["Simple"] = ""
-- L["%s in guild bank"] = ""
-- L["%s item(s) total"] = ""
-- L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = ""
-- L["(%s player, %s alts, %s guild banks, %s AH)"] = ""
-- L["\"%s\" removed from ItemTracker."] = ""
-- L["%s (%s bags, %s bank, %s AH, %s mail)"] = ""
-- L["Total"] = ""
-- L["Total Value"] = ""
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - frFR
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "frFR")
if not L then return end
-- L["AH"] = ""
-- L["Bags"] = ""
-- L["Bank"] = ""
-- L["Characters"] = ""
-- L["Delete Character:"] = ""
-- L["Full"] = ""
-- L["GBank"] = ""
-- L["Guilds"] = ""
-- L["Guilds (Guild Banks) to Ignore:"] = ""
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
-- L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = ""
-- L["Inventory Viewer"] = ""
-- L["Item Name"] = ""
-- L["Item Search"] = ""
-- L["Mail"] = ""
-- L["Market Value Price Source"] = ""
-- L["No Tooltip Info"] = ""
-- L["Options"] = ""
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
-- L["Simple"] = ""
-- L["%s in guild bank"] = ""
-- L["%s item(s) total"] = ""
-- L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = ""
-- L["(%s player, %s alts, %s guild banks, %s AH)"] = ""
-- L["\"%s\" removed from ItemTracker."] = ""
-- L["%s (%s bags, %s bank, %s AH, %s mail)"] = ""
-- L["Total"] = ""
-- L["Total Value"] = ""
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - koKR
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "koKR")
if not L then return end
L["AH"] = "경매" -- Needs review
L["Bags"] = "가방"
L["Bank"] = "은행"
L["Characters"] = "캐릭터"
L["Delete Character:"] = "캐릭터 삭제:"
L["Full"] = "상세히"
L["GBank"] = "길드" -- Needs review
L["Guilds"] = "길드"
L["Guilds (Guild Banks) to Ignore:"] = "길드 (길드 은행) 무시:" -- Needs review
L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = "ItemTracker 표시 방식을 지정합니다. \\\"단순히\\\"는 가방/은행/길드 은행에 있는 개수를 합산해서 간단히 나타냅니다. \\\"상세히\\\"는 모든 캐릭터와 길드에 관한 자세한 정보를 표시합니다." -- Needs review
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = "드롭다운을 이용해서 캐릭터 이름의 변경/이전/삭제가 가능합니다. 만일 실수로 캐릭터를 삭제했다면, 그 캐릭터로 로그인한 후 다시 추가하실 수 있습니다."
L["Inventory Viewer"] = "인벤토리 뷰어"
L["Item Name"] = "아이템 이름"
L["Item Search"] = "아이템 찾기"
L["Mail"] = "우편" -- Needs review
L["Market Value Price Source"] = "시장 가격 출처" -- Needs review
L["No Tooltip Info"] = "표시 안 함" -- Needs review
L["Options"] = "옵션" -- Needs review
L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = "아이템 추적기가 무시할 길드를 선택하세요. 인벤토리는 여전히 추적하지만, 내용은 표시하지 않으며 Itemtracker에 의해 참조되지도 않습니다." -- Needs review
L["Simple"] = "단순히"
L["%s in guild bank"] = "길드 은행 %s개" -- Needs review
L["%s item(s) total"] = "전체 %s개" -- Needs review
L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = "인벤토리 뷰어의 \\\"전체 시장 가치\\\"에 사용할 시장가격의 출처를 지정하세요." -- Needs review
L["(%s player, %s alts, %s guild banks, %s AH)"] = "플레이어(%s), 부캐(%s), 길드 은행(%s), 경매장(%s)" -- Needs review
L["\"%s\" removed from ItemTracker."] = "\\\"%s\\\"은(는) ItemTracker에서 제거되었습니다." -- Needs review
L["%s (%s bags, %s bank, %s AH, %s mail)"] = "전체(%s), 가방(%s), 은행(%s), 경매장(%s), 우편(%s)" -- Needs review
L["Total"] = "전체"
L["Total Value"] = "총가치" -- Needs review
@@ -0,0 +1,44 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - ptBR
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "ptBR")
if not L then return end
-- L["AH"] = ""
-- L["Bags"] = ""
-- L["Bank"] = ""
-- L["Characters"] = ""
L["Delete Character:"] = "Apagar Personagem:" -- Needs review
L["Full"] = "Completo" -- Needs review
-- L["GBank"] = ""
-- L["Guilds"] = ""
-- L["Guilds (Guild Banks) to Ignore:"] = ""
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = "Se você renomear / transferir / remover um de seus personagens, utilize esta lista para remover aquele personagem do ItemTracker. Não há confirmação. Se você remover um personagem acidentalmente que ainda exista, simplesmente se conecte com aquele personagem e o readicione ao ItemTracker." -- Needs review
-- L["Inventory Viewer"] = ""
-- L["Item Name"] = ""
-- L["Item Search"] = ""
-- L["Mail"] = ""
-- L["Market Value Price Source"] = ""
L["No Tooltip Info"] = "Nenhuma Informação de Dica" -- Needs review
L["Options"] = "Opções" -- Needs review
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
L["Simple"] = "Simples" -- Needs review
-- L["%s in guild bank"] = ""
-- L["%s item(s) total"] = ""
-- L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = ""
-- L["(%s player, %s alts, %s guild banks, %s AH)"] = ""
L["\"%s\" removed from ItemTracker."] = "\"%s\" removido do ItemTracker." -- Needs review
-- L["%s (%s bags, %s bank, %s AH, %s mail)"] = ""
-- L["Total"] = ""
-- L["Total Value"] = ""
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - ruRU
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "ruRU")
if not L then return end
L["AH"] = "Аукцион" -- Needs review
L["Bags"] = "Сумки" -- Needs review
L["Bank"] = "Банк" -- Needs review
L["Characters"] = "Персонажи" -- Needs review
L["Delete Character:"] = "Удалить персонажа:"
L["Full"] = "Полный"
L["GBank"] = "Гильдбанк" -- Needs review
L["Guilds"] = "Гильдии" -- Needs review
L["Guilds (Guild Banks) to Ignore:"] = "Игнорировать гильдии (банки гильдий):" -- Needs review
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = "Без подтверждения! Если вы переименуете / перенесёте / удалите одного из ваших персонажей, используйте этот список для удаления данного персонажа из модуля ItemTracker. Если вы случайно удалили персонажа, то просто зайдите этим персонажем в игру для добавления его в модуль." -- Needs review
L["Inventory Viewer"] = "Просмотр инвентаря" -- Needs review
L["Item Name"] = "Название предмета" -- Needs review
L["Item Search"] = "Поиск предмета" -- Needs review
L["Mail"] = "Почта" -- Needs review
L["Market Value Price Source"] = "Источник рыночной цены" -- Needs review
L["No Tooltip Info"] = "Без подсказок"
L["Options"] = "Настройки"
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
L["Simple"] = "Простой"
L["%s in guild bank"] = "%s в банке гильдии" -- Needs review
L["%s item(s) total"] = "Всего %s предметов" -- Needs review
L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = "Указывает источник рыночной цены, используемой для расчета \"Общей рыночной стоимости\" в просмотре инвентаря" -- Needs review
L["(%s player, %s alts, %s guild banks, %s AH)"] = "(%s игрок, %s альты, %s банки гильдий, %s аукцион)" -- Needs review
L["\"%s\" removed from ItemTracker."] = "\"%s\" удалено из ItemTracker."
L["%s (%s bags, %s bank, %s AH, %s mail)"] = "%s (%s сумки, %s банк, %s аукцион, %s почта)" -- Needs review
L["Total"] = "Всего" -- Needs review
L["Total Value"] = "Общая стоимость" -- Needs review
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - zhCN
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "zhCN")
if not L then return end
L["AH"] = "拍卖行"
L["Bags"] = "背包"
L["Bank"] = "银行"
L["Characters"] = "角色"
L["Delete Character:"] = "删除角色:"
L["Full"] = "完整"
L["GBank"] = "公会银行"
L["Guilds"] = "公会"
L["Guilds (Guild Banks) to Ignore:"] = "公会银行忽略:"
L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = "此处,你可以选择在鼠标提示中显示 ItemTracker 的什么信息。“简单”只显示背包/银行和公会银行的总数。“完整”将显示每个角色和公会的详细信息。"
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = "如果您改名/转移/删除了某个角色,使用此下拉菜单从ItemTracker中移除该角色。此操作无确认提示。如果你意外删除了某个仍然存在的角色,只需登录该角色即可重新添加到ItemTracker。"
L["Inventory Viewer"] = "库存一览"
L["Item Name"] = "物品名称"
L["Item Search"] = "物品查询"
L["Mail"] = "邮件"
L["Market Value Price Source"] = "市场价来源"
L["No Tooltip Info"] = "无鼠标提示信息"
L["Options"] = "选项"
L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = "在ItemTracker中忽略公会银行中的库存。其库存还是会被追踪,只是不被ItemTracker使用和显示出来。"
L["Simple"] = "简单"
L["%s in guild bank"] = "%s 在公会银行"
L["%s item(s) total"] = "%s 物品总数"
L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = "在库存一览使用指定市场价值来源来计算总价值。"
L["(%s player, %s alts, %s guild banks, %s AH)"] = "(%s角色, %s小号, %s公会银行, %s拍卖行)"
L["\"%s\" removed from ItemTracker."] = "\"%s\" 已从 ItemTracker 移除。 "
L["%s (%s bags, %s bank, %s AH, %s mail)"] = "%s (%s背包, %s银行, %s拍卖行, %s邮箱)"
L["Total"] = "总共"
L["Total Value"] = "总价值"
@@ -0,0 +1,43 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker Locale - zhTW
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/TradeSkillMaster_ItemTracker/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_ItemTracker", "zhTW")
if not L then return end
L["AH"] = "拍賣"
L["Bags"] = "背包"
L["Bank"] = "銀行"
L["Characters"] = "角色"
L["Delete Character:"] = "刪除角色:"
L["Full"] = "完整"
-- L["GBank"] = ""
L["Guilds"] = "公會"
-- L["Guilds (Guild Banks) to Ignore:"] = ""
-- L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."] = ""
L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."] = "如果你重新命名/轉換/刪除你其中一隻角色,從ItemTracker使用下拉是選單來移除那名角色。沒有確認。如果你不小心刪除還在的角色,只要重新登入再去重新新增到ItemTracker。"
L["Inventory Viewer"] = "物品檢視"
L["Item Name"] = "物品名稱"
L["Item Search"] = "物品搜尋"
-- L["Mail"] = ""
-- L["Market Value Price Source"] = ""
L["No Tooltip Info"] = "無提示訊息"
L["Options"] = "設定"
-- L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."] = ""
L["Simple"] = "簡單"
-- L["%s in guild bank"] = ""
-- L["%s item(s) total"] = ""
-- L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."] = ""
-- L["(%s player, %s alts, %s guild banks, %s AH)"] = ""
L["\"%s\" removed from ItemTracker."] = "\"%s\"從ItemTracker移除。"
-- L["%s (%s bags, %s bank, %s AH, %s mail)"] = ""
L["Total"] = "總共"
-- L["Total Value"] = ""
@@ -0,0 +1,368 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- load the parent file (TSM) into a local variable and register this file as a module
local TSM = select(2, ...)
local Config = TSM:NewModule("Config", "AceEvent-3.0", "AceHook-3.0")
local AceGUI = LibStub("AceGUI-3.0") -- load the AceGUI libraries
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_ItemTracker")
local viewerST
local filters = { characters = {}, guilds = {}, name = "", group = nil }
function Config:Load(container)
local tabGroup = AceGUI:Create("TSMTabGroup")
tabGroup:SetLayout("Fill")
tabGroup:SetTabs({ { text = L["Inventory Viewer"], value = 1 }, { text = L["Options"], value = 2 } })
tabGroup:SetCallback("OnGroupSelected", function(self, _, value)
tabGroup:ReleaseChildren()
if viewerST then viewerST:Hide() end
if value == 1 then
Config:LoadInventoryViewer(self)
elseif value == 2 then
Config:LoadOptions(self)
end
tabGroup.children[1]:DoLayout()
end)
container:AddChild(tabGroup)
tabGroup:SelectTab(1)
Config:HookScript(tabGroup.frame, "OnHide", function()
Config:UnhookAll()
if viewerST then viewerST:Hide() end
end)
end
local function GetSTData()
local items, rowData = {}, {}
local function AddItem(itemString, key, quantity)
items[itemString] = items[itemString] or { total = 0, bags = 0, bank = 0, guild = 0, auctions = 0, mail = 0 }
items[itemString].total = items[itemString].total + quantity
items[itemString][key] = items[itemString][key] + quantity
end
for name, selected in pairs(filters.characters) do
if selected then
for itemString, quantity in pairs(TSM:GetPlayerBags(name) or {}) do
AddItem(itemString, "bags", quantity)
end
for itemString, quantity in pairs(TSM:GetPlayerBank(name) or {}) do
AddItem(itemString, "bank", quantity)
end
for itemString, quantity in pairs(TSM:GetPlayerMail(name) or {}) do
AddItem(itemString, "mail", quantity)
end
for itemString, quantity in pairs(TSM:GetPlayerAuctions(name) or {}) do
if itemString ~= "time" then
AddItem(itemString, "auctions", quantity)
end
end
end
end
for name, selected in pairs(filters.guilds) do
if selected then
for itemString, quantity in pairs(TSM:GetGuildBank(name) or {}) do
AddItem(itemString, "guild", quantity)
end
end
end
for itemString, data in pairs(items) do
local name, itemLink = TSMAPI:GetSafeItemInfo(itemString)
local marketValue = TSMAPI:GetItemValue(itemString, TSM.db.profile.marketValue) or 0
local groupPath = TSMAPI:GetGroupPath(itemString)
if (not name or filters.name == "" or strfind(strlower(name), filters.name)) and (not filters.group or groupPath and strfind(groupPath, "^" .. TSMAPI:StrEscape(filters.group))) then
tinsert(rowData, {
cols = {
{
value = itemLink or name or itemString,
sortArg = name or "",
},
{
value = data.bags,
sortArg = data.bags,
},
{
value = data.bank,
sortArg = data.bank,
},
{
value = data.mail,
sortArg = data.mail,
},
{
value = data.guild,
sortArg = data.guild,
},
{
value = data.auctions,
sortArg = data.auctions,
},
{
value = data.total,
sortArg = data.total,
},
{
value = TSMAPI:FormatTextMoney(data.total * marketValue) or "---",
sortArg = data.total * marketValue,
},
},
itemString = itemString,
})
end
end
sort(rowData, function(a, b) return a.cols[#a.cols].value > b.cols[#a.cols].value end)
return rowData
end
function Config:LoadInventoryViewer(container)
-- top AceGUI widgets
local playerList, guildList = {}, {}
for name in pairs(TSM.characters) do
playerList[name] = name
filters.characters[name] = true
end
for name in pairs(TSM.guilds) do
if not TSM.db.factionrealm.ignoreGuilds[name] then
guildList[name] = name
filters.guilds[name] = true
end
end
filters.group = nil
local page = {
{
type = "SimpleGroup",
layout = "Flow",
fullHeight = true,
children = {
{
type = "EditBox",
label = L["Item Search"],
relativeWidth = 0.24,
onTextChanged = true,
callback = function(_, _, value)
filters.name = value:trim()
viewerST:SetData(GetSTData())
end,
},
{
type = "GroupBox",
label = "Group",
relativeWidth = 0.25,
callback = function(_, _, value)
filters.group = value
viewerST:SetData(GetSTData())
end,
},
{
type = "Dropdown",
label = L["Characters"],
relativeWidth = 0.25,
list = playerList,
value = filters.characters,
multiselect = true,
callback = function(_, _, key, value)
filters.characters[key] = value
viewerST:SetData(GetSTData())
end,
},
{
type = "Dropdown",
label = L["Guilds"],
relativeWidth = 0.25,
list = guildList,
value = filters.guilds,
multiselect = true,
callback = function(_, _, key, value)
filters.guilds[key] = value
viewerST:SetData(GetSTData())
end,
},
{
type = "ScrollFrame", -- simple group didn't work here for some reason
fullHeight = true,
layout = "Flow",
children = {},
},
},
},
}
TSMAPI:BuildPage(container, page)
-- scrolling table
local stParent = container.children[1].children[#container.children[1].children].frame
if not viewerST then
local stCols = {
{
name = L["Item Name"],
width = 0.35,
},
{
name = L["Bags"],
width = 0.08,
},
{
name = L["Bank"],
width = 0.08,
},
{
name = L["Mail"],
width = 0.08,
},
{
name = L["GBank"],
width = 0.08,
},
{
name = L["AH"],
width = 0.08,
},
{
name = L["Total"],
width = 0.08,
},
{
name = L["Total Value"],
width = 0.17,
}
}
local handlers = {
OnEnter = function(_, data, self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
TSMAPI:SafeTooltipLink(data.itemString)
GameTooltip:Show()
end,
OnLeave = function()
GameTooltip:ClearLines()
GameTooltip:Hide()
end
}
viewerST = TSMAPI:CreateScrollingTable(stParent, stCols, handlers)
viewerST:EnableSorting(true)
end
viewerST:Show()
viewerST:SetParent(stParent)
viewerST:SetAllPoints()
viewerST:SetData(GetSTData())
end
function Config:LoadOptions(container)
local players, guildList = {}, {}
for _, v in ipairs(TSM:GetPlayers()) do
players[v] = v
end
for name in pairs(TSM.guilds) do
guildList[name] = name
end
local page = {
{
-- scroll frame to contain everything
type = "ScrollFrame",
layout = "flow",
children = {
{
type = "InlineGroup",
title = L["Options"],
layout = "flow",
children = {
{
type = "Dropdown",
label = L["Delete Character:"],
list = players,
relativeWidth = 0.49,
callback = function(self, _, value)
if value == UnitName("player") then
-- don't delete the current player, just reset to defaults
TSM.characters[value] = TSM.characterDefaults
TSM:Print(L["Reset current player's inventory data."])
self:SetValue()
return
end
local charGuild = TSM.characters[value].guild
if charGuild then
local hasMembersLeft = false
for player, data in pairs(TSM.characters) do
if player ~= value and data.guild == charGuild then
hasMembersLeft = true
end
end
if not hasMembersLeft then
TSM.guilds[charGuild] = nil
end
end
TSM.characters[value] = nil
TSM:Printf(L["\"%s\" removed from ItemTracker."], value)
players[value] = nil
self:SetList(players)
self:SetValue()
end,
tooltip = L["If you rename / transfer / delete one of your characters, use this dropdown to remove that character from ItemTracker. There is no confirmation. If you accidentally delete a character that still exists, simply log onto that character to re-add it to ItemTracker."],
},
{
type = "Dropdown",
label = L["Guilds (Guild Banks) to Ignore:"],
value = TSM.db.factionrealm.ignoreGuilds,
list = guildList,
relativeWidth = 0.49,
multiselect = true,
callback = function(_, _, key, value)
TSM.db.factionrealm.ignoreGuilds[key] = value
end,
tooltip = L["Select guilds to ingore in ItemTracker. Inventory will still be tracked but not displayed or taken into consideration by Itemtracker."],
},
{
type = "Dropdown",
label = L["Market Value Price Source"],
relativeWidth = 1,
list = TSMAPI:GetPriceSources(),
value = TSM.db.profile.marketValue,
callback = function(_, _, value) TSM.db.profile.marketValue = value end,
tooltip = L["Specifies the market value price source used for \"Total Market Value\" in the Inventory Viewer."],
},
},
},
},
},
}
TSMAPI:BuildPage(container, page)
end
function Config:LoadTooltipOptions(container)
local page = {
{
type = "SimpleGroup",
layout = "Flow",
fullHeight = true,
children = {
{
type = "Dropdown",
label = "Tooltip:",
value = TSM.db.global.tooltip,
list = { hide = L["No Tooltip Info"], simple = L["Simple"], full = L["Full"] },
relativeWidth = 0.49,
callback = function(_, _, value)
TSM.db.global.tooltip = value
end,
tooltip = L["Here, you can choose what ItemTracker info, if any, to show in tooltips. \"Simple\" will only show totals for bags/banks and for guild banks. \"Full\" will show detailed information for every character and guild."],
},
},
},
}
TSMAPI:BuildPage(container, page)
end
@@ -0,0 +1,444 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- load the parent file (TSM) into a local variable and register this file as a module
local TSM = select(2, ...)
local Data = TSM:NewModule("Data", "AceEvent-3.0", "AceHook-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_ItemTracker")
TSM.CURRENT_PLAYER, TSM.CURRENT_GUILD = UnitName("player"), GetGuildInfo("player")
local BUCKET_TIME = 0.2 -- wait at least this amount of time between throttled events firing
local throttleFrames = {}
local isScanning = false
function Data:Initialize()
Data:RegisterEvent("GUILDBANKFRAME_OPENED", "EventHandler")
Data:RegisterEvent("GUILDBANKBAGSLOTS_CHANGED", "EventHandler")
Data:RegisterEvent("AUCTION_OWNED_LIST_UPDATE", "EventHandler")
TSMAPI:RegisterForBagChange(function(...) Data:GetBagData(...) end)
TSMAPI:RegisterForBankChange(function(...) Data:GetBankData(...) end)
TSM.CURRENT_PLAYER, TSM.CURRENT_GUILD = UnitName("player"), GetGuildInfo("player")
Data:StoreCurrentGuildInfo()
end
local guildThrottle = CreateFrame("frame")
guildThrottle:Hide()
guildThrottle.attemptsLeft = 20
guildThrottle:SetScript("OnUpdate", function(self, elapsed)
self.timeLeft = self.timeLeft - elapsed
if self.timeLeft <= 0 then
self.attemptsLeft = self.attemptsLeft - 1
Data:StoreCurrentGuildInfo(self.attemptsLeft == 0)
end
end)
function Data:StoreCurrentGuildInfo(noDelay)
TSM.CURRENT_GUILD = GetGuildInfo("player")
if TSM.CURRENT_GUILD then
TSM.guilds[TSM.CURRENT_GUILD] = TSM.guilds[TSM.CURRENT_GUILD] or { items = {} }
TSM.guilds[TSM.CURRENT_GUILD].items = TSM.guilds[TSM.CURRENT_GUILD].items or {}
guildThrottle:Hide()
elseif not noDelay then
guildThrottle.timeLeft = 0.5
guildThrottle:Show()
else
guildThrottle:Hide()
end
TSM.characters[TSM.CURRENT_PLAYER].guild = TSM.CURRENT_GUILD
TSM.characters[TSM.CURRENT_PLAYER].lastUpdate.guild = time()
TSM.Sync:BroadcastUpdateRequest()
end
function Data:ThrottleEvent(event)
if not throttleFrames[event] then
local frame = CreateFrame("Frame")
frame.baseTime = BUCKET_TIME
frame.event = event
frame:Hide()
frame:SetScript("OnShow", function(self) Data:UnregisterEvent(self.event) self.timeLeft = self.baseTime end)
frame:SetScript("OnUpdate", function(self, elapsed)
self.timeLeft = self.timeLeft - elapsed
if self.timeLeft <= 0 then
Data:EventHandler(self.event, "FIRE")
self:Hide()
Data:RegisterEvent(self.event, "EventHandler")
end
end)
throttleFrames[event] = frame
end
-- resets the delay time on the frame
throttleFrames[event]:Hide()
throttleFrames[event]:Show()
end
function Data:EventHandler(event, fire)
if isScanning then return end
if fire ~= "FIRE" then
Data:ThrottleEvent(event)
else
if event == "GUILDBANKFRAME_OPENED" then
-- Query all tabs of the gbank to ensure all tabs will be scanned.
local initialTab = GetCurrentGuildBankTab()
for tab = 1, GetNumGuildBankTabs() do
if select(5, GetGuildBankTabInfo(tab)) > 0 or IsGuildLeader(UnitName("player")) then
QueryGuildBankTab(tab)
end
end
QueryGuildBankTab(initialTab)
elseif event == "GUILDBANKBAGSLOTS_CHANGED" then
Data:GetGuildBankData()
elseif event == "AUCTION_OWNED_LIST_UPDATE" then
Data:ScanPlayerAuctions()
end
end
end
-- scan the player's bags
function Data:GetBagData(state)
wipe(TSM.characters[TSM.CURRENT_PLAYER].bags)
for itemString, quantity in pairs(state) do
local baseItemString = TSMAPI:GetBaseItemString(itemString)
TSM.characters[TSM.CURRENT_PLAYER].bags[itemString] = quantity
if itemString ~= baseItemString then
TSM.characters[TSM.CURRENT_PLAYER].bags[baseItemString] = (TSM.characters[TSM.CURRENT_PLAYER].bags[baseItemString] or 0) + quantity
end
end
TSM.characters[TSM.CURRENT_PLAYER].lastUpdate.bags = time()
TSM.Sync:BroadcastUpdateRequest()
end
-- scan the player's bank
function Data:GetBankData(state)
wipe(TSM.characters[TSM.CURRENT_PLAYER].bank)
for itemString, quantity in pairs(state) do
local baseItemString = TSMAPI:GetBaseItemString(itemString)
TSM.characters[TSM.CURRENT_PLAYER].bank[itemString] = quantity
if itemString ~= baseItemString then
TSM.characters[TSM.CURRENT_PLAYER].bank[baseItemString] = (TSM.characters[TSM.CURRENT_PLAYER].bank[baseItemString] or 0) + quantity
end
end
TSM.characters[TSM.CURRENT_PLAYER].lastUpdate.bank = time()
TSM.Sync:BroadcastUpdateRequest()
end
-- scan the guild bank
function Data:GetGuildBankData()
if not TSM.CURRENT_GUILD then
Data:StoreCurrentGuildInfo(true)
if not TSM.CURRENT_GUILD then return end
end
wipe(TSM.guilds[TSM.CURRENT_GUILD].items)
for tab = 1, GetNumGuildBankTabs() do
if select(5, GetGuildBankTabInfo(tab)) > 0 or IsGuildLeader(UnitName("player")) then
for slot = 1, MAX_GUILDBANK_SLOTS_PER_TAB or 98 do
local itemString = TSMAPI:GetItemString(GetGuildBankItemLink(tab, slot))
local baseItemString = TSMAPI:GetBaseItemString(GetGuildBankItemLink(tab, slot))
if itemString then
local quantity = select(2, GetGuildBankItemInfo(tab, slot))
TSM.guilds[TSM.CURRENT_GUILD].items[itemString] = (TSM.guilds[TSM.CURRENT_GUILD].items[itemString] or 0) + quantity
if itemString ~= baseItemString then
TSM.guilds[TSM.CURRENT_GUILD].items[baseItemString] = (TSM.guilds[TSM.CURRENT_GUILD].items[baseItemString] or 0) + quantity
end
end
end
end
end
if GuildBankFrame and GuildBankFrame:IsVisible() then
TSM.guilds[TSM.CURRENT_GUILD].lastUpdate = time()
end
TSM.Sync:BroadcastUpdateRequest()
end
function Data:ScanPlayerAuctions()
wipe(TSM.characters[TSM.CURRENT_PLAYER].auctions)
TSM.characters[TSM.CURRENT_PLAYER].auctions.time = time()
for i = 1, GetNumAuctionItems("owner") do
local link = GetAuctionItemLink("owner", i)
local itemString = TSMAPI:GetItemString(link)
local baseItemString = TSMAPI:GetBaseItemString(link)
--local name, _, quantity, _, _, _, _, _, _, buyout, _, _, _, wasSold, _, wasSold_54 = GetAuctionItemInfo("owner", i)
local name, _, quantity, _, _, _, _, _, buyout, _, _, _, wasSold = GetAuctionItemInfo("owner", i)
if wasSold == 0 and itemString then
TSM.characters[TSM.CURRENT_PLAYER].auctions[itemString] = (TSM.characters[TSM.CURRENT_PLAYER].auctions[itemString] or 0) + quantity
if itemString ~= baseItemString then
TSM.characters[TSM.CURRENT_PLAYER].auctions[baseItemString] = (TSM.characters[TSM.CURRENT_PLAYER].auctions[baseItemString] or 0) + quantity
end
end
end
TSM.characters[TSM.CURRENT_PLAYER].lastUpdate.auctions = time()
TSM.Sync:BroadcastUpdateRequest()
end
-- ***************************************************************************
-- MAIL TRACKING FUNCTIONS
-- ***************************************************************************
local playersToUpdate = {}
local function UpdateMailQuantitiesThread(self)
-- this runs in the background forever, updating mail quantities as necessary
while true do
if #playersToUpdate > 0 then
local player = tremove(playersToUpdate)
if TSM.characters[player] then
local playerMail = TSM.characters[player].mail
wipe(playerMail)
for _, data in ipairs(TSM.characters[player].mailInbox) do
for _, itemData in ipairs(data.items) do
local itemString = TSMAPI:GetItemString(itemData.link)
local baseItemString = TSMAPI:GetBaseItemString(itemData.link)
playerMail[itemString] = (playerMail[itemString] or 0) + itemData.count
if itemString ~= baseItemString then
playerMail[baseItemString] = (playerMail[baseItemString] or 0) + itemData.count
end
end
self:Yield()
end
TSM.characters[player].lastUpdate.mail = time()
TSM.Sync:BroadcastUpdateRequest()
end
else
self:Sleep(1)
end
end
end
do
local function InsertInboxMail(player, index, data)
local playerMail = TSM.characters[player].mail
for _, itemData in ipairs(data.items) do
local itemString = TSMAPI:GetItemString(itemData.link)
local baseItemString = TSMAPI:GetBaseItemString(itemData.link)
playerMail[itemString] = (playerMail[itemString] or 0) + itemData.count
if itemString ~= baseItemString then
playerMail[baseItemString] = (playerMail[baseItemString] or 0) + itemData.count
end
end
tinsert(TSM.characters[player].mailInbox, index, data)
end
local function RemoveInboxMail(player, index)
local playerMail = TSM.characters[player].mail
for _, itemData in ipairs(TSM.characters[player].mailInbox[index].items) do
local itemString = TSMAPI:GetItemString(itemData.link)
local baseItemString = TSMAPI:GetBaseItemString(itemData.link)
if playerMail[itemString] then
playerMail[itemString] = max(playerMail[itemString] - itemData.count, 0)
if playerMail[itemString] == 0 then
playerMail[itemString] = nil
end
end
if itemString ~= baseItemString and playerMail[baseItemString] then
playerMail[baseItemString] = max(playerMail[baseItemString] - itemData.count, 0)
if playerMail[baseItemString] == 0 then
playerMail[baseItemString] = nil
end
end
end
tremove(TSM.characters[player].mailInbox, index)
end
local function RemoveInboxMailItem(player, index, itemIndex)
local playerMail = TSM.characters[player].mail
local itemData = TSM.characters[player].mailInbox[index].items[itemIndex]
local itemString = TSMAPI:GetItemString(itemData.link)
local baseItemString = TSMAPI:GetBaseItemString(itemData.link)
if playerMail[itemString] then
playerMail[itemString] = max(playerMail[itemString] - itemData.count, 0)
if playerMail[itemString] == 0 then
playerMail[itemString] = nil
end
end
if itemString ~= baseItemString and playerMail[baseItemString] then
playerMail[baseItemString] = max(playerMail[baseItemString] - itemData.count, 0)
if playerMail[baseItemString] == 0 then
playerMail[baseItemString] = nil
end
end
tremove(TSM.characters[player].mailInbox[index].items, itemIndex)
end
local function AddIncomingMail(player, ...)
if not TSM.characters[player] then return end
TSM.characters[player].mailInbox = TSM.characters[player].mailInbox or {}
local items
if select('#', ...) == 1 then
items = ...
else
local link, count = ...
items = {{link=link, count=count}}
end
if not items then error() end
InsertInboxMail(player, 1, {items=items, index=nil})
end
local function RemoveMailItem(index, itemIndex)
local link = GetInboxItemLink(index, itemIndex)
if not link then return end
local count = select(3, GetInboxItem(index, itemIndex))
for i, data in ipairs(TSM.characters[TSM.CURRENT_PLAYER].mailInbox) do
if data.index == index then
for j, itemData in ipairs(data.items) do
if itemData.link == link and itemData.count == count then
RemoveInboxMailItem(TSM.CURRENT_PLAYER, i, j)
break
end
end
if #data.items == 0 then
RemoveInboxMail(TSM.CURRENT_PLAYER, i)
end
break
end
end
end
local tmpBuyouts = {}
local function OnAuctionBid(listType, index, bidPlaced)
local link = GetAuctionItemLink(listType, index)
--local name, _, count, _, _, _, _, _, _, buyout = GetAuctionItemInfo(listType, index)
local name, _, count, _, _, _, _, _, buyout = GetAuctionItemInfo(listType, index)
if bidPlaced == buyout then
tinsert(tmpBuyouts, { name = name, link = link, count = count })
end
end
local function OnChatMsg(_, msg)
if msg:match(gsub(ERR_AUCTION_WON_S, "%%s", "")) then
while #tmpBuyouts > 0 do
local info = tremove(tmpBuyouts, 1)
if msg == format(ERR_AUCTION_WON_S, info.name) then
AddIncomingMail(TSM.CURRENT_PLAYER, info.link, info.count)
tinsert(playersToUpdate, TSM.CURRENT_PLAYER)
break
end
end
end
end
local function OnAuctionCanceled(index)
local link = GetAuctionItemLink("owner", index)
local count = select(3, GetAuctionItemInfo("owner", index))
AddIncomingMail(TSM.CURRENT_PLAYER, link, count)
tinsert(playersToUpdate, TSM.CURRENT_PLAYER)
end
local function OnSendMail(target)
local altName
for name in pairs(TSM.characters) do
if strlower(name) == strlower(target) then
altName = name
break
end
end
if not altName then return end
local items = {}
for i = 1, ATTACHMENTS_MAX_SEND do
local link = GetSendMailItemLink(i)
if link then
local count = select(3, GetSendMailItem(i))
tinsert(items, {link=link, count=count})
end
end
AddIncomingMail(altName, items)
tinsert(playersToUpdate, altName)
end
local function OnTakeInboxItem(index, itemIndex)
for i = (itemIndex or 1), (itemIndex or ATTACHMENTS_MAX_RECEIVE) do
local link = GetInboxItemLink(index, i)
if link then
RemoveMailItem(index, i)
end
end
end
local function OnReturnMail(index)
local sender = select(3, GetInboxHeaderInfo(index))
local items = {}
for itemIndex = 1, ATTACHMENTS_MAX_RECEIVE do
local link = GetInboxItemLink(index, itemIndex)
if link then
local count = select(3, GetInboxItem(index, itemIndex))
tinsert(items, {link=link, count=count})
RemoveMailItem(index, itemIndex)
end
end
AddIncomingMail(sender, items)
tinsert(playersToUpdate, sender)
tinsert(playersToUpdate, TSM.CURRENT_PLAYER)
end
local function OnInboxUpdate()
local player = TSM.characters[TSM.CURRENT_PLAYER]
player.mailInbox = player.mailInbox or {}
local numItems, totalItems = GetInboxNumItems()
if numItems == totalItems then
wipe(player.mailInbox)
end
local index = 1
for i=1, numItems do
local items = {}
if select(8, GetInboxHeaderInfo(i)) then
for j=1, ATTACHMENTS_MAX_RECEIVE do
local link = GetInboxItemLink(i, j)
if link then
tinsert(items, {link=link, count=select(3, GetInboxItem(i, j))})
end
end
local matchIndex
for k=index, #player.mailInbox do
if #player.mailInbox[k].items == #items then
local temp = {}
for _, data in ipairs(player.mailInbox[k].items) do
temp[data.link] = (temp[data.link] or 0) + data.count
end
for _, data in ipairs(items) do
if not temp[data.link] then break end
temp[data.link] = temp[data.link] - data.count
if temp[data.link] == 0 then temp[data.link] = nil end
end
if not next(temp) then
matchIndex = k
break
end
end
end
if matchIndex then
if index == matchIndex then
player.mailInbox[matchIndex].index = i
index = index + 1
elseif matchIndex > index then
for k=1, matchIndex-index do
RemoveInboxMail(TSM.CURRENT_PLAYER, index)
end
end
else
InsertInboxMail(TSM.CURRENT_PLAYER, index, {items=items, index=i})
index = index + 1
end
end
end
tinsert(playersToUpdate, TSM.CURRENT_PLAYER)
end
Data:RegisterEvent("CHAT_MSG_SYSTEM", OnChatMsg)
TSMAPI:CreateEventBucket("MAIL_INBOX_UPDATE", OnInboxUpdate, 0)
Data:Hook("PlaceAuctionBid", OnAuctionBid, true)
Data:Hook("CancelAuction", OnAuctionCanceled, true)
Data:Hook("TakeInboxItem", OnTakeInboxItem, true)
Data:Hook("AutoLootMailItem", OnTakeInboxItem, true)
Data:Hook("SendMail", OnSendMail, true)
Data:Hook("ReturnInboxItem", OnReturnMail, true)
TSMAPI.Threading:Start(UpdateMailQuantitiesThread, 0.1)
end
@@ -0,0 +1,92 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- load the parent file (TSM) into a local variable and register this file as a module
local TSM = select(2, ...)
local Sync = TSM:NewModule("Sync")
function Sync:BroadcastUpdateRequest(timerUp)
if not timerUp then
TSMAPI:CreateTimeDelay("itemTrackerSyncDelay", 3, function() Sync:BroadcastUpdateRequest(true) end)
return
end
local packet = {characters={}, guilds={}}
for player, data in pairs(TSM.characters or {}) do
if data.account == TSMAPI.Sync:GetAccountKey() then
packet.characters[player] = CopyTable(data.lastUpdate)
end
end
for guild, data in pairs(TSM.guilds or {}) do
packet.guilds[guild] = data.lastUpdate
end
TSMAPI.Sync:BroadcastData("ItemTracker", "REQUEST", packet)
end
function Sync:SendUpdateResponse(target, request)
local response = {characters={}, guilds={}}
for player, lastUpdate in pairs(request.characters or {}) do
for key, updateTime in pairs(lastUpdate) do
if not TSM.characters[player] or (TSM.characters[player].lastUpdate[key] or 0) < updateTime then
response.characters[player] = response.characters[player] or {}
tinsert(response.characters[player], key)
end
end
end
for guild, lastUpdate in pairs(request.guilds or {}) do
if not TSM.guilds[guild] or (TSM.guilds[guild].lastUpdate or 0) < lastUpdate then
tinsert(response.guilds, guild)
end
end
if next(response.characters) or #response.guilds > 0 then
TSMAPI.Sync:SendData("ItemTracker", "RESPONSE", response, target)
end
end
function Sync:SendUpdateData(target, response)
local data = {characters={}, guilds={}}
for player, keys in pairs(response.characters or {}) do
data.characters[player] = {}
for _, key in ipairs(keys) do
data.characters[player][key] = TSM.characters[player][key]
data.characters[player].lastUpdate = data.characters[player].lastUpdate or {}
data.characters[player].lastUpdate[key] = TSM.characters[player].lastUpdate[key]
end
end
for _, guild in ipairs(response.guilds or {}) do
data.guilds[guild] = TSM.guilds[guild]
end
if next(data) then
TSMAPI.Sync:SendData("ItemTracker", "DATA", data, target)
end
end
function Sync:ProcessUpdateData(data)
for player, info in pairs(data.characters or {}) do
TSM.characters[player] = TSM.characters[player] or CopyTable(TSM.characterDefaults)
for key, updateTime in pairs(info.lastUpdate or {}) do
TSM.characters[player][key] = info[key]
TSM.characters[player].lastUpdate[key] = updateTime
end
end
for player, info in pairs(data.guilds or {}) do
TSM.guilds[player] = info
end
end
function Sync:Callback(key, data, source)
if key == "REQUEST" then
Sync:SendUpdateResponse(source, data)
elseif key == "RESPONSE" then
Sync:SendUpdateData(source, data)
elseif key == "DATA" then
Sync:ProcessUpdateData(data)
end
end
@@ -0,0 +1,345 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_ItemTracker --
-- http://www.curse.com/addons/wow/tradeskillmaster_itemtracker --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- register this file with Ace Libraries
local TSM = select(2, ...)
TSM = LibStub("AceAddon-3.0"):NewAddon(TSM, "TSM_ItemTracker", "AceEvent-3.0", "AceConsole-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_ItemTracker")
-- default values for the savedDB
local savedDBDefaults = {
-- any global
global = {
tooltip = "simple",
},
-- data that is stored per realm/faction combination
factionrealm = {
characters = {},
guilds = {},
ignoreGuilds = {},
},
-- data that is stored per user profile
profile = {
marketValue = "DBMarket",
},
}
local characterDefaults = {
-- anything added to the characters table will have these defaults
bags = {},
bank = {},
auctions = {},
guild = nil,
mail = {},
mailInbox = {},
lastUpdate = { bags = 0, bank = 0, auctions = 0, mail = 0, guild = 0 },
account = nil,
}
TSM.characterDefaults = characterDefaults
local guildDefaults = {
items = {},
lastUpdate = 0,
}
-- Called once the player has loaded into the game
-- Anything that needs to be done in order to initialize the addon should go here
function TSM:OnInitialize()
-- create shortcuts to all the modules
for moduleName, module in pairs(TSM.modules) do
TSM[moduleName] = module
end
-- load the saved variables table into TSM.db
TSM.db = LibStub:GetLibrary("AceDB-3.0"):New("TradeSkillMaster_ItemTrackerDB", savedDBDefaults, true)
TSM.characters = TSM.db.factionrealm.characters
TSM.guilds = TSM.db.factionrealm.guilds
-- handle connected realms for characters
local connectedRealms = TSMAPI.GetConnectedRealms and TSMAPI:GetConnectedRealms() or {}
for _, realm in ipairs(connectedRealms) do
local connectedRealmData = TSM.db.sv.factionrealm[TSM.db.keys.faction.." - "..realm]
if connectedRealmData and connectedRealmData.characters then
for player, data in pairs(connectedRealmData.characters) do
TSM.characters[player.."-"..realm] = data
end
end
end
-- register this module with TSM
TSM:RegisterModule()
-- conversion stuff
for player, data in pairs(TSM.characters) do
if type(data.lastUpdate) ~= "table" then
data.lastUpdate = CopyTable(characterDefaults.lastUpdate)
end
data.mail = data.mail or {}
end
for guild, data in pairs(TSM.guilds) do
data.lastUpdate = data.lastUpdate or guildDefaults.lastUpdate
data.characters = nil
end
-- other init stuff
local playerName, guildName = UnitName("player"), GetGuildInfo("player")
if not TSM.characters[playerName] then
TSM.characters[playerName] = characterDefaults
end
--TSM.characters[playerName].account = TSMAPI.Sync:GetAccountKey()
if guildName and not TSM.guilds[guildName] then
TSM.guilds[guildName] = guildDefaults
end
-- get rid of old itemIDs
local function ClearItemIDs(tbl)
if not tbl then return end
for item in pairs(tbl) do
if tonumber(item) then
tbl[item] = nil
end
end
end
for _, playerData in pairs(TSM.characters) do
ClearItemIDs(playerData.bags)
ClearItemIDs(playerData.bank)
ClearItemIDs(playerData.auctions)
ClearItemIDs(playerData.mail)
end
for _, guildData in pairs(TSM.guilds) do
ClearItemIDs(guildData.items)
end
TSM.Data:Initialize()
TSM:UpdatePlayerLookup()
local function RemoveOldAuctions()
for player, data in pairs(TSM.characters) do
local lastAuctionUpdate = data.auctions and data.auctions.time
if lastAuctionUpdate and (time() - lastAuctionUpdate) > 48 * 60 * 60 then
wipe(TSM.characters[player].auctions)
end
end
end
TSMAPI:CreateTimeDelay("itemTrackerDeleteOldAuctions", 0, RemoveOldAuctions, 60)
end
-- registers this module with TSM by first setting all fields and then calling TSMAPI:NewModule().
function TSM:RegisterModule()
TSM.icons = {
{ side = "module", desc = "ItemTracker", slashCommand = "itemtracker", callback = "Config:Load", icon = "Interface\\Icons\\INV_Misc_Gem_Variety_01" },
}
TSM.moduleAPIs = {
{ key = "playerlist", callback = "GetPlayers" },
{ key = "guildlist", callback = "GetGuilds" },
{ key = "playerbags", callback = "GetPlayerBags" },
{ key = "playerbank", callback = "GetPlayerBank" },
{ key = "playermail", callback = "GetPlayerMail" },
{ key = "guildbank", callback = "GetGuildBank" },
{ key = "playerauctions", callback = "GetPlayerAuctions" },
{ key = "auctionstotal", callback = "GetAuctionsTotal" },
{ key = "playertotal", callback = "GetPlayerTotal" },
{ key = "guildtotal", callback = "GetGuildTotal" },
{ key = "playerguildtotal", callback = "GetPlayerGuildTotal" },
{ key = "playerguild", callback = "GetPlayerGuild" },
}
--TSM.sync = { callback = "Sync:Callback" }
TSM.tooltipOptions = { callback = "Config:LoadTooltipOptions" }
TSMAPI:NewModule(TSM)
end
function TSM:GetTooltip(itemString)
if TSM.db.global.tooltip == "hide" then return end
local itemString = TSMAPI:GetBaseItemString(itemString, true)
local text = {}
local grandTotal = 0
if TSM.db.global.tooltip == "simple" then
local player, alts = TSM:GetPlayerTotal(itemString)
local guild = TSM:GetGuildTotal(itemString)
local auctions = TSM:GetAuctionsTotal(itemString)
grandTotal = grandTotal + player + alts + guild + auctions
if grandTotal > 0 then
tinsert(text, { left = " " .. "ItemTracker:", right = format(L["(%s player, %s alts, %s guild banks, %s AH)"], "|cffffffff" .. player .. "|r", "|cffffffff" .. alts .. "|r", "|cffffffff" .. guild .. "|r", "|cffffffff" .. auctions .. "|r") })
end
elseif TSM.db.global.tooltip == "full" then
for name, data in pairs(TSM.characters) do
local bags = data.bags[itemString] or 0
local bank = data.bank[itemString] or 0
local auctions = data.auctions[itemString] or 0
local mail = data.mail[itemString] or 0
local total = bags + bank + auctions + mail
grandTotal = grandTotal + total
local bagText = "|cffffffff" .. bags .. "|r"
local bankText = "|cffffffff" .. bank .. "|r"
local auctionText = "|cffffffff" .. auctions .. "|r"
local mailText = "|cffffffff" .. mail .. "|r"
local totalText = "|cffffffff" .. total .. "|r"
if total > 0 then
tinsert(text, { left = format(" %s:", name), right = format(L["%s (%s bags, %s bank, %s AH, %s mail)"], "|cffffffff" .. totalText, "|cffffffff" .. bagText, "|cffffffff" .. bankText, "|cffffffff" .. auctionText, "|cffffffff" .. mailText) })
end
end
for name, data in pairs(TSM.guilds) do
if not TSM.db.factionrealm.ignoreGuilds[name] then
local gbank = data.items[itemString] or 0
grandTotal = grandTotal + gbank
local gbankText = "|cffffffff" .. (gbank) .. "|r"
if gbank > 0 then
tinsert(text, { left = format(" %s:", name), right = format(L["%s in guild bank"], gbankText) })
end
end
end
end
if #text > 0 then
tinsert(text, 1, { left = "|cffffff00" .. "TSM ItemTracker:", right = format(L["%s item(s) total"], "|cffffffff" .. grandTotal .. "|r") })
end
return text
end
function TSM:OnTSMDBShutdown()
TSM.db.factionrealm.characters = {}
local faction = TSM.db.keys.faction
for name, playerData in pairs(TSM.characters) do
local player, realm = ("-"):split(name)
if realm and realm ~= "" then
local factionrealm = faction.." - "..realm
for key, data in pairs(TSM.db.sv.factionrealm) do
if key == factionrealm then
data[player] = playerData
break
end
end
else
TSM.db.factionrealm.characters[player] = playerData
end
end
-- not yet handling guilds for connected realms
TSM.db.factionrealm.guilds = TSM.guilds
end
function TSM:UpdatePlayerLookup()
TSM.playerLookup = {}
for name in pairs(TSM.characters) do
TSM.playerLookup[strlower(name)] = name
end
end
function TSM:GetPlayers()
local temp = {}
for name in pairs(TSM.characters) do
tinsert(temp, name)
end
return temp
end
function TSM:GetGuilds()
local temp = {}
for name in pairs(TSM.guilds) do
tinsert(temp, name)
end
return temp
end
function TSM:GetPlayerBags(player)
player = player or TSM.CURRENT_PLAYER
player = TSM.playerLookup[player] or player
if not player or not TSM.characters[player] then return end
return TSM.characters[player].bags
end
function TSM:GetPlayerBank(player)
player = player or TSM.CURRENT_PLAYER
player = TSM.playerLookup[player] or player
if not player or not TSM.characters[player] then return end
return TSM.characters[player].bank
end
function TSM:GetPlayerMail(player)
player = player or TSM.CURRENT_PLAYER
player = TSM.playerLookup[player] or player
if not player or not TSM.characters[player] then return end
return TSM.characters[player].mail
end
function TSM:GetGuildBank(guild)
guild = guild or TSM.CURRENT_GUILD
if not guild or not TSM.guilds[guild] or TSM.db.factionrealm.ignoreGuilds[guild] then return end
return TSM.guilds[guild].items
end
function TSM:GetPlayerAuctions(player)
player = player or TSM.CURRENT_PLAYER
player = TSM.playerLookup[player] or player
if not TSM.characters[player] then return end
return TSM.characters[player].auctions
end
function TSM:GetPlayerTotal(itemString)
local playerTotal, altTotal = 0, 0
for name, data in pairs(TSM.characters) do
if name == TSM.CURRENT_PLAYER then
playerTotal = playerTotal + (data.bags[itemString] or 0)
playerTotal = playerTotal + (data.bank[itemString] or 0)
playerTotal = playerTotal + (data.mail[itemString] or 0)
else
altTotal = altTotal + (data.bags[itemString] or 0)
altTotal = altTotal + (data.bank[itemString] or 0)
altTotal = altTotal + (data.mail[itemString] or 0)
end
end
return playerTotal, altTotal
end
function TSM:GetGuildTotal(itemString)
local guildTotal = 0
for guild, data in pairs(TSM.guilds) do
if not TSM.db.factionrealm.ignoreGuilds[guild] then
guildTotal = guildTotal + (data.items[itemString] or 0)
end
end
return guildTotal
end
function TSM:GetAuctionsTotal(itemString)
local auctionsTotal = 0
for _, data in pairs(TSM.characters) do
auctionsTotal = auctionsTotal + (data.auctions[itemString] or 0)
end
return auctionsTotal
end
function TSM:GetPlayerGuildTotal(itemString, player)
player = player or TSM.CURRENT_PLAYER
player = TSM.playerLookup[player] or player
if not player or not TSM.characters[player] then return end
local guild = TSM.characters[player].guild
if not guild or not TSM.guilds[guild] or TSM.db.factionrealm.ignoreGuilds[guild] then return end
return TSM.guilds[guild].items[itemString]
end
function TSM:GetPlayerGuild(player)
player = TSM.playerLookup[player] or player
if not player or not TSM.characters[player] then return end
return TSM.characters[player].guild
end
@@ -0,0 +1,23 @@
## Interface: 30300
## Title: |cff00ff00TradeSkillMaster_ItemTracker|r
## Notes: Tracks inventory across multiple characters including bags, banks, guild banks, auctions, and mail.
## Author: Sapu94, Bart39
## Version: v2.0.8
## SavedVariables: TradeSkillMaster_ItemTrackerDB
## Dependency: TradeSkillMaster
Locale\enUS.lua
Locale\frFR.lua
Locale\deDE.lua
Locale\koKR.lua
Locale\esMX.lua
Locale\ruRU.lua
Locale\zhCN.lua
Locale\esES.lua
Locale\zhTW.lua
Locale\ptBR.lua
TradeSkillMaster_ItemTracker.lua
Modules\sync.lua
Modules\data.lua
Modules\config.lua