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
+131
View File
@@ -0,0 +1,131 @@
v2.1.1
*Fixed error with averages tab.
v2.1
*Added option to include soulbound items (disabled by default).
*Added "Averages" tab to options.
*Enabled sorting on scrolling tables within options.
*Fixed visual bug with log.
*Fixed visual bug with options layout.
v2.0.6
*No update. Trying to fix issue with curse.
v2.0.5
*Added tracing to assist in debugging lua errors.
v2.0.4
*Using new movable frame TSMAPI function for destroying frame.
v2.0.3
*The destroying frame will now remember its position when moved.
v2.0.2
*Updated TOC for patch 5.4.
v2.0.1
*Fixed error with closing destroying window in combat.
*Updated scrolling tables.
*Fixed issue with detecting disenchantable items for non-enUS locales.
v2.0
*First 2.0 Version!
\\
v1.3
*Updated for patch 5.2.
*The safe table is back.
*Many other minor bug fixes and improvements.
v1.2
*There is a new destroy window that is smaller and has a bigger button
*It is safe to use slow speed for DE items that are soulbound
*Destroying plays nice with loot addons such as Xloot
*Removed the lag caused by counting loot
*Removed safelist from DE
*Made the code simpler and faster
*other things that I dont remember...
v1.1
*fixed a bug.
v1.0
*release
v0.2.0.3
*fixed a bug in Prospecting/Milling
v0.2.0.2
*fixed a ui bug in DE
v0.2.0.1
*added the option to block sum loot later I will redo the algorithim that causes the lag.
v0.2
*4.3
v0.1.6.8
*DE now ignores all items that are not green, blue or purple
v0.1.6.7
*In slow mode the destroy button will now become disabled
*Fixed and issue with sum loot
v0.1.6.6
*fixed a typo
v0.1.6.5
*fixed another error with DE UI
v0.1.6.4
*added an error msg, for filter results.
*fixed an error with DE UI
v0.1.6.3
*remove a print statement.
v0.1.6.2
*For Milling and Prospecting you can now chose to filter results by mat or date
but be warned your old tables may not work
v0.1.6.1
*fixed a lua error
v0.1.6.0
*DE works!!
v0.1.5.3
*fixed pigment issue
v0.1.5.2
*postclick wasnt working so I did something a bit different
v0.1.5.1
*SumLoot added
*Merge stacks added
*needs TSM 0.2.5.1Beta to work
v0.1.5.0
*new ui
v0.1.4.1
*fixed a lua error
v0.1.4
*Fixed and issue with pigments showing up in the milling dd
v0.1.3
*Fixed a localization issue with the button.
*Updated the TOC for patch 4.2.
v0.1.2
*Herbs/Ore no longer swap spots infinitely
*Lua error fixed
v0.1.1
*Added the ability to mill/prospect older herbs/ore
*Populate Menus now uses a tooltip scan; so that the dropdowns are updated dynamically
v0.1
*First version!
+4
View File
@@ -0,0 +1,4 @@
This addon is licensed under the Attribution-NonCommercial-NoDerivs 3.0
Unported (CC BY-NC-ND 3.0) License. More info about this license can be
found here: http://creativecommons.org/licenses/by-nc-nd/3.0/
@@ -0,0 +1,49 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - deDE
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "deDE")
if not L then return end
L["Days of Log Data"] = "Tage Log Daten" -- Needs review
L["Destroyed Item"] = "Zerstörter Gegenstand" -- Needs review
L["Destroying Log"] = "Zerstören Log" -- Needs review
L["Destroying not list any items above this quality for disenchnting."] = "Zeige keine Gegenstände zum Zerstören durch Entzaubern über der gewählten Qualitätsstufe." -- Needs review
L["Destroy Next"] = "Nächstes Zerstören" -- Needs review
L["Disenchanting Options"] = "Entzauberoptionen" -- Needs review
L["Enable Automatic Stack Combination"] = "Erlaube automatische Kombination von Stapeln" -- Needs review
L["General Options"] = "Allgemeine Optionen" -- Needs review
L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = "Frame wird für den Rest dieser Session ausgeblendet. Gib '/tsm destroy' ein um den Frame wieder anzuzeigen." -- Needs review
L["_ Hr _ Min ago"] = "vor _Std _Min" -- Needs review
L["If checked, partial stacks of herbs/ore will automatically be combined."] = "Wenn markiert werden geteilte Stapel Kräuter/Erze automatisch kombiniert." -- Needs review
L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = "Wenn markiert wird das Zerstören Fenster automatisch geöffnet wenn sich zerstörbare Gegenstände in deinen Taschen befinden. Andernfalls kannst du das Fenster durch Eingabe von '/tsm destroy' öffnen." -- Needs review
L["Ignored Item"] = "Ignorierter Gegenstand" -- Needs review
L["Ignored Items"] = "Ignorierte Gegenstände" -- Needs review
L["Ignoring all %s permanently. You can undo this in the Destroying options."] = "Ignoriere alle %s dauerhaft. Du kannst dies in den Zerstören Optionen rückgängig machen." -- Needs review
L["Ignoring all %s this session (until your UI is reloaded)."] = "Ignoriere alle %s für diese Session (bis deine UI neu geladen wird)." -- Needs review
L["Item"] = "Gegenstand" -- Needs review
L["Maximum Disenchant Quality"] = "Maximale Entzauberqualität" -- Needs review
L["Nothing to destroy in your bags."] = "Nichsts Zerstörbares in deinen Taschen." -- Needs review
L["now"] = "jetzt" -- Needs review
L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = "Öffnet das Zerstören Fenster wenn du zerstörbare Gegenstände in deinen Taschen hast." -- Needs review
L["Options"] = "Optionen" -- Needs review
L["Removed %s from the permanent ignore list."] = "%s von der dauerhaften Ignorierliste entfernt." -- Needs review
L["Result"] = "Ergebnis" -- Needs review
L["Right click on this row to remove this item from the permanent ignore list."] = "Rechtsklicke auf diese Zeile um den Gegenstand von der dauerhaften Ignorierliste zu entfernen." -- Needs review
L["Select what format Destroying should use to display times in the Destroying log."] = "Wähle welches Format Destroying zur Zeitangabe im Zerstören Log verwenden soll." -- Needs review
L["Show Destroying Frame Automatically"] = "Zeige Zerstören Fenster Automatisch" -- Needs review
L["Spell"] = "Zauber" -- Needs review
L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = "%sRechtsklicke|r um Gegenstand in dieser Session zu ignorieren. Halte %sShift|r um dauerhaft zu ignorieren. Du kannst Gegenstände vom dauerhaften Ignorieren in den Optionen entferenen." -- Needs review
L["Stack Size"] = "Stapelgröße" -- Needs review
L["The destroying log will throw out any data that is older than this many days."] = "Das Zerstören Log verwirft alle Daten die älter als die angegebene Anzahl Tage sind." -- Needs review
L["Time"] = "Zeit" -- Needs review
@@ -0,0 +1,52 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - enUS
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "enUS", true)
if not L then return end
L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = true
L["Average Result (per Destroy)"] = true
L["Averages"] = true
L["Days of Log Data"] = true
L["Destroy Next"] = true
L["Destroyed Item"] = true
L["Destroying Log"] = true
L["Destroying not list any items above this quality for disenchnting."] = true
L["Disenchanting Options"] = true
L["Enable Automatic Stack Combination"] = true
L["General Options"] = true
L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = true
L["If checked, partial stacks of herbs/ore will automatically be combined."] = true
L["If checked, soulbound items can be destroyed by TSM_Destroying. USE THIS WITH EXTREME CAUTION!"] = true
L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = true
L["Ignored Item"] = true
L["Ignored Items"] = true
L["Ignoring all %s permanently. You can undo this in the Destroying options."] = true
L["Ignoring all %s this session (until your UI is reloaded)."] = true
L["Include Soulbound Items"] = true
L["Item"] = true
L["Maximum Disenchant Quality"] = true
L["Nothing to destroy in your bags."] = true
L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = true
L["Options"] = true
L["Removed %s from the permanent ignore list."] = true
L["Result"] = true
L["Right click on this row to remove this item from the permanent ignore list."] = true
L["Select what format Destroying should use to display times in the Destroying log."] = true
L["Show Destroying Frame Automatically"] = true
L["Spell"] = true
L["Stack Size"] = true
L["The destroying log will throw out any data that is older than this many days."] = true
L["Time"] = true
L["Times Destroyed"] = true
L["_ Hr _ Min ago"] = true
L["now"] = true
@@ -0,0 +1,49 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - esES
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "esES")
if not L then return end
L["Days of Log Data"] = "Días del Registro de datos" -- Needs review
L["Destroyed Item"] = "Objeto Destruido" -- Needs review
L["Destroying Log"] = "Registro del Destructor" -- Needs review
L["Destroying not list any items above this quality for disenchnting."] = "El Destructor no encuentra ningún objeto por encima de esta calidad para ser desencantado." -- Needs review
L["Destroy Next"] = "Destruir el Siguiente" -- Needs review
L["Disenchanting Options"] = "Opciones de Desencantamiento" -- Needs review
L["Enable Automatic Stack Combination"] = "Activación de Combinación de Montones Automática" -- Needs review
L["General Options"] = "Opciones Generales" -- Needs review
L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = "Ocultando macro para el resto de esta sesión. Escribe '/tsm destroy' y se abrirá el macro otra vez." -- Needs review
L["_ Hr _ Min ago"] = "hace _Hr_Min" -- Needs review
L["If checked, partial stacks of herbs/ore will automatically be combined."] = "Si se activa, los montones parciales de hierbas/menas serán automáticamente combinados." -- Needs review
L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = "Si se activa, la ventana del Destructor mostrará automáticamente cuando haya objetos para destruir en sus bolsas. De lo contrario, usted puede abrirla escribiendo '/tsm destroy'." -- Needs review
L["Ignored Item"] = "Objeto Ignorado" -- Needs review
L["Ignored Items"] = "Objetos Ignorados" -- Needs review
L["Ignoring all %s permanently. You can undo this in the Destroying options."] = "Ignorando todo %s permanentemente. Puede deshacer esto en las opciones del Destructor." -- Needs review
L["Ignoring all %s this session (until your UI is reloaded)."] = "Ignorando todo %s esta sesion (hasta que tu Interfaz sea recargada)." -- Needs review
L["Item"] = "Objeto" -- Needs review
L["Maximum Disenchant Quality"] = "Calidad de Desencantamiento Máxima" -- Needs review
L["Nothing to destroy in your bags."] = "Nada que destruir en tus bolsas." -- Needs review
L["now"] = "Ahora" -- Needs review
L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = "Abrir la ventana del Destructor si hay algo que ser destruido en tus bolsas." -- Needs review
L["Options"] = "Opciones" -- Needs review
L["Removed %s from the permanent ignore list."] = "Borrados %s desde la lista de ignorados permanentemente." -- Needs review
L["Result"] = "Resultado" -- Needs review
L["Right click on this row to remove this item from the permanent ignore list."] = "Clic derecho en esta fila para borrar este objeto desde la lista de ignorados permanentemente." -- Needs review
L["Select what format Destroying should use to display times in the Destroying log."] = "Selecciona que formato del Destructor debería usar para mostrar tiempos en el Registro del Destructor." -- Needs review
L["Show Destroying Frame Automatically"] = "Mostrar la ventana del Destructor Automáticamente" -- Needs review
L["Spell"] = "Hechizo" -- Needs review
L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = "%sClic Derecho|r para ignorar este objeto para esta sesión. Presiona %s mayúsculas|r para ignorar permanentemente. Puedes borrar objetos para ignorarlos permanentemente en las opciones del Destructor." -- Needs review
L["Stack Size"] = "Tamaño del montón" -- Needs review
L["The destroying log will throw out any data that is older than this many days."] = "El registro del Destructor desechará cualquier dato que sea más antiguo que una cantidad de días." -- Needs review
L["Time"] = "Tiempo" -- Needs review
@@ -0,0 +1,48 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - esMX
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "esMX")
if not L then return end
-- L["Days of Log Data"] = ""
-- L["Destroyed Item"] = ""
-- L["Destroying Log"] = ""
-- L["Destroying not list any items above this quality for disenchnting."] = ""
-- L["Destroy Next"] = ""
-- L["Disenchanting Options"] = ""
-- L["Enable Automatic Stack Combination"] = ""
-- L["General Options"] = ""
-- L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = ""
-- L["_ Hr _ Min ago"] = ""
-- L["If checked, partial stacks of herbs/ore will automatically be combined."] = ""
-- L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = ""
-- L["Ignored Item"] = ""
-- L["Ignored Items"] = ""
-- L["Ignoring all %s permanently. You can undo this in the Destroying options."] = ""
-- L["Ignoring all %s this session (until your UI is reloaded)."] = ""
-- L["Item"] = ""
-- L["Maximum Disenchant Quality"] = ""
-- L["Nothing to destroy in your bags."] = ""
-- L["now"] = ""
-- L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = ""
-- L["Options"] = ""
-- L["Removed %s from the permanent ignore list."] = ""
-- L["Result"] = ""
-- L["Right click on this row to remove this item from the permanent ignore list."] = ""
-- L["Select what format Destroying should use to display times in the Destroying log."] = ""
-- L["Show Destroying Frame Automatically"] = ""
-- L["Spell"] = ""
-- L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = ""
-- L["Stack Size"] = ""
-- L["The destroying log will throw out any data that is older than this many days."] = ""
-- L["Time"] = ""
@@ -0,0 +1,48 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - frFR
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "frFR")
if not L then return end
-- L["Days of Log Data"] = ""
-- L["Destroyed Item"] = ""
-- L["Destroying Log"] = ""
-- L["Destroying not list any items above this quality for disenchnting."] = ""
-- L["Destroy Next"] = ""
-- L["Disenchanting Options"] = ""
-- L["Enable Automatic Stack Combination"] = ""
-- L["General Options"] = ""
-- L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = ""
-- L["_ Hr _ Min ago"] = ""
-- L["If checked, partial stacks of herbs/ore will automatically be combined."] = ""
-- L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = ""
-- L["Ignored Item"] = ""
-- L["Ignored Items"] = ""
-- L["Ignoring all %s permanently. You can undo this in the Destroying options."] = ""
-- L["Ignoring all %s this session (until your UI is reloaded)."] = ""
-- L["Item"] = ""
-- L["Maximum Disenchant Quality"] = ""
-- L["Nothing to destroy in your bags."] = ""
-- L["now"] = ""
-- L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = ""
-- L["Options"] = ""
-- L["Removed %s from the permanent ignore list."] = ""
-- L["Result"] = ""
-- L["Right click on this row to remove this item from the permanent ignore list."] = ""
-- L["Select what format Destroying should use to display times in the Destroying log."] = ""
-- L["Show Destroying Frame Automatically"] = ""
-- L["Spell"] = ""
-- L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = ""
-- L["Stack Size"] = ""
-- L["The destroying log will throw out any data that is older than this many days."] = ""
-- L["Time"] = ""
@@ -0,0 +1,48 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - koKR
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "koKR")
if not L then return end
L["Days of Log Data"] = "기록 보관 일자" -- Needs review
L["Destroyed Item"] = "아이템" -- Needs review
L["Destroying Log"] = "추출 기록" -- Needs review
L["Destroying not list any items above this quality for disenchnting."] = "지정된 품질 이상의 아이템은 마력 추출 목록에 표시하지 않습니다." -- Needs review
L["Destroy Next"] = "다음 추출" -- Needs review
L["Disenchanting Options"] = "추출 옵션" -- Needs review
L["Enable Automatic Stack Combination"] = "묶음 자동 조합 사용" -- Needs review
L["General Options"] = "일반 옵션" -- Needs review
L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = "나머지 세션 동안 프레임을 감춥니다. 프레임을 다시 열려면 채팅창에 '/tsm destroy'를 입력하세요." -- Needs review
L["_ Hr _ Min ago"] = "_ 시 _ 분 전" -- Needs review
L["If checked, partial stacks of herbs/ore will automatically be combined."] = "선택하면, 약초/광석의 묶음이 자동 조합됩니다." -- Needs review
L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = "선택하면, 가방에 추출할 아이템이 있으면 추출창이 자동으로 나타납니다. 그외의 경우는 채팅창에 '/tsm destroy'를 입력하여 열수 있습니다." -- Needs review
L["Ignored Item"] = "제외 아이템" -- Needs review
L["Ignored Items"] = "제외 아이템" -- Needs review
L["Ignoring all %s permanently. You can undo this in the Destroying options."] = "모든 %s은(는) 영구적으로 제외됩니다. 추출 옵션에서 취소할 수 있습니다." -- Needs review
L["Ignoring all %s this session (until your UI is reloaded)."] = "모든 %s은(는) 이번 세션에서 제외됩니다. (UI가 재시작되기 전까지)" -- Needs review
L["Item"] = "아이템" -- Needs review
L["Maximum Disenchant Quality"] = "최대 추출 품질" -- Needs review
L["Nothing to destroy in your bags."] = "가방에 추출할 아이템이 없습니다." -- Needs review
L["now"] = "지금" -- Needs review
L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = "가방에 추출할 아이템이 있다면 추출 프레임을 엽니다." -- Needs review
L["Options"] = "옵션" -- Needs review
L["Removed %s from the permanent ignore list."] = "%s은(는) 제외 목록에서 제거되었습니다." -- Needs review
L["Result"] = "결과" -- Needs review
L["Right click on this row to remove this item from the permanent ignore list."] = "이 아이템을 목록에서 제거하려면 우클릭하세요." -- Needs review
L["Select what format Destroying should use to display times in the Destroying log."] = "추출 기록에 표시될 시간 형식을 선택하세요." -- Needs review
L["Show Destroying Frame Automatically"] = "추출 프레임을 자동으로 표시" -- Needs review
L["Spell"] = "주문" -- Needs review
L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = "\"%sRight-Click|r하면 이번 세션에서 이 아이템은 제외됩니다. %sshift|r를 누르면 영구적으로 제외됩니다. 영구적으로 제외된 아이템은 추출 옵션에 있는 목록에서 삭제할 수 있습니다." -- Needs review
L["Stack Size"] = "묶음 크기" -- Needs review
L["The destroying log will throw out any data that is older than this many days."] = "여기에 지정된 일자보다 오래된 데이터는 버립니다." -- Needs review
L["Time"] = "시간" -- Needs review
@@ -0,0 +1,49 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - ptBR
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "ptBR")
if not L then return end
-- L["Days of Log Data"] = ""
-- L["Destroyed Item"] = ""
-- L["Destroying Log"] = ""
-- L["Destroying not list any items above this quality for disenchnting."] = ""
-- L["Destroy Next"] = ""
-- L["Disenchanting Options"] = ""
-- L["Enable Automatic Stack Combination"] = ""
-- L["General Options"] = ""
-- L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = ""
-- L["_ Hr _ Min ago"] = ""
-- L["If checked, partial stacks of herbs/ore will automatically be combined."] = ""
-- L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = ""
-- L["Ignored Item"] = ""
-- L["Ignored Items"] = ""
-- L["Ignoring all %s permanently. You can undo this in the Destroying options."] = ""
-- L["Ignoring all %s this session (until your UI is reloaded)."] = ""
-- L["Item"] = ""
-- L["Maximum Disenchant Quality"] = ""
-- L["Nothing to destroy in your bags."] = ""
-- L["now"] = ""
-- L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = ""
-- L["Options"] = ""
-- L["Removed %s from the permanent ignore list."] = ""
-- L["Result"] = ""
-- L["Right click on this row to remove this item from the permanent ignore list."] = ""
-- L["Select what format Destroying should use to display times in the Destroying log."] = ""
-- L["Show Destroying Frame Automatically"] = ""
-- L["Spell"] = ""
-- L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = ""
-- L["Stack Size"] = ""
-- L["The destroying log will throw out any data that is older than this many days."] = ""
-- L["Time"] = ""
@@ -0,0 +1,48 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - ruRU
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "ruRU")
if not L then return end
-- L["Days of Log Data"] = ""
-- L["Destroyed Item"] = ""
-- L["Destroying Log"] = ""
-- L["Destroying not list any items above this quality for disenchnting."] = ""
-- L["Destroy Next"] = ""
L["Disenchanting Options"] = "Настройки распыления"
-- L["Enable Automatic Stack Combination"] = ""
L["General Options"] = "Основные настройки"
-- L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = ""
-- L["_ Hr _ Min ago"] = ""
-- L["If checked, partial stacks of herbs/ore will automatically be combined."] = ""
-- L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = ""
-- L["Ignored Item"] = ""
-- L["Ignored Items"] = ""
-- L["Ignoring all %s permanently. You can undo this in the Destroying options."] = ""
-- L["Ignoring all %s this session (until your UI is reloaded)."] = ""
-- L["Item"] = ""
-- L["Maximum Disenchant Quality"] = ""
-- L["Nothing to destroy in your bags."] = ""
-- L["now"] = ""
-- L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = ""
-- L["Options"] = ""
-- L["Removed %s from the permanent ignore list."] = ""
-- L["Result"] = ""
-- L["Right click on this row to remove this item from the permanent ignore list."] = ""
-- L["Select what format Destroying should use to display times in the Destroying log."] = ""
-- L["Show Destroying Frame Automatically"] = ""
-- L["Spell"] = ""
-- L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = ""
-- L["Stack Size"] = ""
-- L["The destroying log will throw out any data that is older than this many days."] = ""
-- L["Time"] = ""
@@ -0,0 +1,48 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - zhCN
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "zhCN")
if not L then return end
L["Days of Log Data"] = "保存日志数据的天数"
L["Destroyed Item"] = "分解的物品"
L["Destroying Log"] = "分解日志"
L["Destroying not list any items above this quality for disenchnting."] = "不分解绿色以上品质的装备"
L["Destroy Next"] = "分解下一个"
L["Disenchanting Options"] = "装备分解选项"
L["Enable Automatic Stack Combination"] = "启用自动堆叠"
L["General Options"] = "常规选项"
L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = "隐藏窗口 输入'/tsm destroy'再次开启。"
L["_ Hr _ Min ago"] = " _小时_分钟前"
L["If checked, partial stacks of herbs/ore will automatically be combined."] = "如果勾选,草药、矿石将自动合并堆叠。"
L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = "如果勾选,当您背包中有分解物品时,分解窗口将自动打开。否则,您需要手动输入'/tsm destroy'打开分解窗口。"
L["Ignored Item"] = "忽略物品"
L["Ignored Items"] = "忽略物品"
L["Ignoring all %s permanently. You can undo this in the Destroying options."] = "永久忽略所有 %s ,您可以在分解选项里撤销该指令。"
L["Ignoring all %s this session (until your UI is reloaded)."] = "暂时忽略所有 %s ,直到您重新加载界面。"
L["Item"] = "物品"
L["Maximum Disenchant Quality"] = "最高分解品质"
L["Nothing to destroy in your bags."] = "背包里没有物品可分解。"
L["now"] = "现在"
L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = "当您的背包中有被分解物品时打开分解窗口。"
L["Options"] = "选项"
L["Removed %s from the permanent ignore list."] = "从永久忽略列表中移除 %s 。"
L["Result"] = "结果"
L["Right click on this row to remove this item from the permanent ignore list."] = "右键点击此行,用以从永久忽略列表移除该物品。"
L["Select what format Destroying should use to display times in the Destroying log."] = "选择在分解日志中使用什么样的时间格式。"
L["Show Destroying Frame Automatically"] = "自动显示分解窗口"
L["Spell"] = "Spell"
L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = "%s右键点击|r 从此次分解中忽略这个物品。 按住 %sshift|r 永久忽略,您可以在分解选项中移除永久忽略的物品名单。"
L["Stack Size"] = "堆叠大小"
L["The destroying log will throw out any data that is older than this many days."] = "早于这个设定时间的分解日志数据将被删除。"
L["Time"] = "时间"
@@ -0,0 +1,48 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- A TradeSkillMaster Addon (http://tradeskillmaster.com) --
-- All Rights Reserved* - Detailed license information included with addon. --
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying Locale - zhTW
-- Please use the localization app on CurseForge to update this
-- http://wow.curseforge.com/addons/tradeskillmaster_destroying/localization/
local L = LibStub("AceLocale-3.0"):NewLocale("TradeSkillMaster_Destroying", "zhTW")
if not L then return end
-- L["Days of Log Data"] = ""
-- L["Destroyed Item"] = ""
-- L["Destroying Log"] = ""
-- L["Destroying not list any items above this quality for disenchnting."] = ""
-- L["Destroy Next"] = ""
-- L["Disenchanting Options"] = ""
-- L["Enable Automatic Stack Combination"] = ""
-- L["General Options"] = ""
-- L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."] = ""
-- L["_ Hr _ Min ago"] = ""
-- L["If checked, partial stacks of herbs/ore will automatically be combined."] = ""
-- L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."] = ""
-- L["Ignored Item"] = ""
-- L["Ignored Items"] = ""
-- L["Ignoring all %s permanently. You can undo this in the Destroying options."] = ""
-- L["Ignoring all %s this session (until your UI is reloaded)."] = ""
-- L["Item"] = ""
-- L["Maximum Disenchant Quality"] = ""
-- L["Nothing to destroy in your bags."] = ""
-- L["now"] = ""
-- L["Opens the Destroying frame if there's stuff in your bags to be destroyed."] = ""
-- L["Options"] = ""
-- L["Removed %s from the permanent ignore list."] = ""
-- L["Result"] = ""
-- L["Right click on this row to remove this item from the permanent ignore list."] = ""
-- L["Select what format Destroying should use to display times in the Destroying log."] = ""
-- L["Show Destroying Frame Automatically"] = ""
-- L["Spell"] = ""
-- L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."] = ""
-- L["Stack Size"] = ""
-- L["The destroying log will throw out any data that is older than this many days."] = ""
-- L["Time"] = ""
@@ -0,0 +1,412 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- 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 Options = TSM:NewModule("Options", "AceHook-3.0")
local AceGUI = LibStub("AceGUI-3.0") -- load the AceGUI libraries
-- loads the localization table --
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_Destroying")
local logST, averageST, ignoreST
function Options:Load(container)
local tabGroup = AceGUI:Create("TSMTabGroup")
tabGroup:SetLayout("Fill")
tabGroup:SetTabs({{text=L["Destroying Log"], value=1}, {text=L["Averages"], value=2}, {text=L["Ignored Items"], value=3}, {text=L["Options"], value=4}})
tabGroup:SetCallback("OnGroupSelected", function(self, _, value)
tabGroup:ReleaseChildren()
if logST then logST:Hide() end
if ignoreST then ignoreST:Hide() end
if averageST then averageST:Hide() end
if value == 1 then
-- load Destroying log
Options:LoadLog(self)
elseif value == 2 then
-- load Destroying log
Options:LoadAverages(self)
elseif value == 3 then
-- load ignored items list
Options:LoadIgnored(self)
elseif value == 4 then
-- load Destroying options
Options:LoadOptions(self)
end
tabGroup.children[1]:DoLayout()
end)
container:AddChild(tabGroup)
tabGroup:SelectTab(1)
Options:HookScript(tabGroup.frame, "OnHide", function()
Options:UnhookAll()
if logST then logST:Hide() end
if ignoreST then ignoreST:Hide() end
if averageST then averageST:Hide() end
end)
end
function Options:GetFormattedTime(rTime)
if TSM.db.global.timeFormat == "ago" then
if time() == rTime then
return format(L["now"])
end
return format("%s ago", SecondsToTime(time()-rTime) or "?")
elseif TSM.db.global.timeFormat == "usdate" then
return date("%m/%d/%y %H:%M", rTime)
elseif TSM.db.global.timeFormat == "eudate" then
return date("%d/%m/%y %H:%M", rTime)
elseif TSM.db.global.timeFormat == "aidate" then
return date("%y/%m/%d %H:%M", rTime)
end
end
function Options:UpdateLogST()
if not logST or not logST:IsVisible() then return end
-- clear old data
for spell, entries in pairs(TSM.db.global.history) do
for i=#entries, 1, -1 do
if (entries[i].time + TSM.db.global.logDays*24*60*60) < time() then
tremove(entries, i)
end
end
end
local stData = {}
for spell, entries in pairs(TSM.db.global.history) do
for _, entry in ipairs(entries) do
local result = {}
for itemString, quantity in pairs(entry.result) do
local link = select(2, TSMAPI:GetSafeItemInfo(itemString)) or itemString
tinsert(result, format("%sx%d", link, quantity))
end
sort(result, function(a,b) return a > b end)
local name, link = TSMAPI:GetSafeItemInfo(entry.item)
name = name or entry.item
link = link or entry.item
local resultStr = table.concat(result, ", ") or ""
local row = {
cols = {
{
value = spell,
sortArg = spell,
},
{
value = link,
sortArg = spell,
},
{
value = resultStr,
sortArg = resultStr,
},
{
value = Options:GetFormattedTime(entry.time),
sortArg = entry.time or 0,
},
},
}
tinsert(stData, row)
end
end
logST:SetData(stData)
end
function Options:LoadLog(container)
local page = {
{
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].frame
if not logST then
local stCols = {
{
name = L["Spell"],
width = 0.08,
},
{
name = L["Destroyed Item"],
width = 0.2,
},
{
name = L["Result"],
width = 0.56,
},
{
name = L["Time"],
width = 0.14,
}
}
logST = TSMAPI:CreateScrollingTable(stParent, stCols)
logST:EnableSorting(true, -4)
end
logST:Show()
logST:SetParent(stParent)
logST:SetAllPoints()
Options:UpdateLogST()
end
function Options:UpdateAverageST()
if not averageST or not averageST:IsVisible() then return end
local items = {}
for spell, entries in pairs(TSM.db.global.history) do
for _, entry in ipairs(entries) do
items[entry.item] = items[entry.item] or {spell=spell, num=0}
items[entry.item].num = items[entry.item].num + 1
for itemString, quantity in pairs(entry.result) do
items[entry.item][itemString] = items[entry.item][itemString] or {total=0}
items[entry.item][itemString].total = items[entry.item][itemString].total + quantity
end
end
end
local stData = {}
for destroyedItem, resultItems in pairs(items) do
local spell = resultItems.spell
resultItems.spell = nil
local totalNum = resultItems.num
resultItems.num = nil
local result = {}
for itemString, data in pairs(resultItems) do
local link = select(2, TSMAPI:GetSafeItemInfo(itemString)) or itemString
local average = floor((data.total/totalNum) * 100 + 0.5) / 100
tinsert(result, format("%sx%.2f", link, average))
end
sort(result, function(a,b) return a > b end)
local name, link = TSMAPI:GetSafeItemInfo(destroyedItem)
name = name or destroyedItem
link = link or destroyedItem
local resultStr = table.concat(result, ", ") or ""
local row = {
cols = {
{
value = spell,
sortArg = spell,
},
{
value = totalNum,
sortArg = totalNum,
},
{
value = link,
sorgArg = name,
},
{
value = resultStr,
sortArg = resultStr,
},
},
}
tinsert(stData, row)
end
averageST:SetData(stData)
end
function Options:LoadAverages(container)
local page = {
{
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].frame
if not averageST then
local stCols = {
{
name = L["Spell"],
width = 0.1,
},
{
name = L["Times Destroyed"],
width = 0.15,
},
{
name = L["Destroyed Item"],
width = 0.3,
},
{
name = L["Average Result (per Destroy)"],
width = 0.45,
}
}
averageST = TSMAPI:CreateScrollingTable(stParent, stCols)
averageST:EnableSorting(true, -2)
end
averageST:Show()
averageST:SetParent(stParent)
averageST:SetAllPoints()
Options:UpdateAverageST()
end
function Options:UpdateIgnoreST()
if not ignoreST or not ignoreST:IsVisible() then return end
local stData = {}
for itemString in pairs(TSM.db.global.ignore) do
local name, link = TSMAPI:GetSafeItemInfo(itemString)
name = name or itemString
link = link or itemString
local row = {
cols = {
{
value = link,
},
},
name = name,
link = link,
itemString = itemString,
}
tinsert(stData, row)
end
sort(stData, function(a, b) return a.name < b.name end)
ignoreST:SetData(stData)
end
function Options:LoadIgnored(container)
local page = {
{
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].frame
if not ignoreST then
local stCols = {
{
name = L["Ignored Item"],
width = 1,
}
}
local handlers = {
OnEnter = function(_, data, self)
if not data.itemString then return end
GameTooltip:SetOwner(self, "ANCHOR_NONE")
GameTooltip:SetPoint("BOTTOMLEFT", self, "TOPLEFT")
GameTooltip:AddLine(L["Right click on this row to remove this item from the permanent ignore list."], 1, 1, 1, true)
GameTooltip:Show()
end,
OnLeave = function()
GameTooltip:ClearLines()
GameTooltip:Hide()
end,
OnClick = function(_, data, _, button)
if not data.itemString then return end
if button == "RightButton" then
TSM.db.global.ignore[data.itemString] = nil
TSM:Printf(L["Removed %s from the permanent ignore list."], data.link)
Options:UpdateIgnoreST()
end
end
}
ignoreST = TSMAPI:CreateScrollingTable(stParent, stCols, handlers)
end
ignoreST:Show()
ignoreST:SetParent(stParent)
ignoreST:SetAllPoints()
Options:UpdateIgnoreST()
end
function Options:LoadOptions(container)
local page = {
{
type = "ScrollFrame",
layout = "Flow",
fullHeight = true,
children = {
{
type = "InlineGroup",
title = L["General Options"],
layout = "Flow",
children = {
{
type = "CheckBox",
label = L["Enable Automatic Stack Combination"],
relativeWidth = 0.5,
settingInfo = {TSM.db.global, "autoStack"},
tooltip = L["If checked, partial stacks of herbs/ore will automatically be combined."],
},
{
type = "CheckBox",
label = L["Show Destroying Frame Automatically"],
relativeWidth = 0.49,
settingInfo = {TSM.db.global, "autoShow"},
tooltip = L["If checked, the Destroying window will automatically be shown when there's items to destroy in your bags. Otherwise, you can open it up by typing '/tsm destroy'."],
},
{
type = "Dropdown",
label = "Time Format",
relativeWidth = 0.5,
list = {["ago"]=L["_ Hr _ Min ago"], ["usdate"]="MM/DD/YY HH:MM", ["aidate"]="YY/MM/DD HH:MM", ["eudate"]="DD/MM/YY HH:MM"},
settingInfo = {TSM.db.global, "timeFormat"},
tooltip = L["Select what format Destroying should use to display times in the Destroying log."],
},
{
type = "Slider",
label = L["Days of Log Data"],
relativeWidth = 0.49,
min = 0,
max = 30,
step = 1,
settingInfo = {TSM.db.global, "logDays"},
tooltip = L["The destroying log will throw out any data that is older than this many days."],
}
},
},
{
type = "InlineGroup",
title = L["Disenchanting Options"],
layout = "Flow",
children = {
{
type = "Dropdown",
label = L["Maximum Disenchant Quality"],
list = {[2]=ITEM_QUALITY2_DESC, [3]=ITEM_QUALITY3_DESC, [4]=ITEM_QUALITY4_DESC},
relativeWidth = 0.5,
settingInfo = {TSM.db.global, "deMaxQuality"},
tooltip = L["Destroying not list any items above this quality for disenchnting."],
},
{
type = "CheckBox",
label = L["Include Soulbound Items"],
relativeWidth = 0.49,
settingInfo = {TSM.db.global, "includeSoulbound"},
tooltip = L["If checked, soulbound items can be destroyed by TSM_Destroying. USE THIS WITH EXTREME CAUTION!"],
},
},
},
},
},
}
TSMAPI:BuildPage(container, page)
end
+283
View File
@@ -0,0 +1,283 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- 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 GUI = TSM:NewModule("GUI", "AceEvent-3.0")
-- loads the localization table --
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_Destroying")
local private = {data={}, ignore={}}
TSMAPI:RegisterForTracing(private, "TSM_Destroying.GUI_private")
function GUI:OnEnable()
private.frame = private:CreateDestroyingFrame()
TSMAPI:CreateEventBucket("BAG_UPDATE", function() private:UpdateST() end, 0.2)
GUI:RegisterEvent("LOOT_SLOT_CLEARED", private.LootChanged)
GUI:RegisterEvent("LOOT_OPENED", private.LootOpened)
GUI:RegisterEvent("LOOT_CLOSED", private.LootChanged)
GUI:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
GUI:RegisterEvent("UI_ERROR_MESSAGE", function(_, msg) if msg == ERR_INVALID_ITEM_TARGET or msg == SPELL_FAILED_ERROR then private.LootChanged() end end)
TSMAPI:CreateTimeDelay("destroyingSTUpdate", 1, function() private:UpdateST() end)
end
function GUI:ShowFrame()
private.hidden = nil
private:UpdateST(true)
end
function private:CreateDestroyingFrame()
local frameDefaults = {
x = 850,
y = 450,
width = 200,
height = 220,
scale = 1,
}
local frame = TSMAPI:CreateMovableFrame("TSMDestroyingFrame", frameDefaults)
frame:SetFrameStrata("HIGH")
TSMAPI.Design:SetFrameBackdropColor(frame)
local title = TSMAPI.GUI:CreateLabel(frame)
title:SetText("TSM_Destroying")
title:SetPoint("TOPLEFT")
title:SetPoint("TOPRIGHT")
title:SetHeight(20)
local line = TSMAPI.GUI:CreateVerticalLine(frame, 0)
line:ClearAllPoints()
line:SetPoint("TOPRIGHT", -25, -1)
line:SetWidth(2)
line:SetHeight(22)
local closeBtn = TSMAPI.GUI:CreateButton(frame, 18)
closeBtn:SetPoint("TOPRIGHT", -3, -3)
closeBtn:SetWidth(19)
closeBtn:SetHeight(19)
closeBtn:SetText("X")
closeBtn:SetScript("OnClick", function()
if InCombatLockdown() then return end
TSM:Print(L["Hiding frame for the remainder of this session. Typing '/tsm destroy' will open the frame again."])
private.hidden = true
frame:Hide()
end)
TSMAPI.GUI:CreateHorizontalLine(frame, -23)
local stContainer = CreateFrame("Frame", nil, frame)
stContainer:SetPoint("TOPLEFT", 0, -25)
stContainer:SetPoint("BOTTOMRIGHT", 0, 30)
TSMAPI.Design:SetFrameColor(stContainer)
local stCols = {
{
name = L["Item"],
width = 0.6,
},
{
name = L["Stack Size"],
width = 0.4,
align = "CENTER",
},
}
local handlers = {
OnClick = function(_, data, self, button)
if not data then return end
if button == "RightButton" then
if IsShiftKeyDown() then
TSM.db.global.ignore[data.itemString] = true
TSM:Printf(L["Ignoring all %s permanently. You can undo this in the Destroying options."], data.link)
TSM.Options:UpdateIgnoreST()
else
private.ignore[data.itemString] = true
TSM:Printf(L["Ignoring all %s this session (until your UI is reloaded)."], data.link)
end
private:UpdateST()
end
end,
OnEnter = function(_, data, self)
if not data then return end
local color = TSMAPI.Design:GetInlineColor("link")
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
TSMAPI:SafeTooltipLink(data.itemString)
-- GameTooltip:AddLine(data.link)
GameTooltip:AddLine("- - -")
GameTooltip:AddLine(format(L["%sRight-Click|r to ignore this item for this session. Hold %sshift|r to ignore permanently. You can remove items from permanent ignore in the Destroying options."], color, color), 1, 1, 1, 1, true)
GameTooltip:Show()
end,
OnLeave = function()
GameTooltip:ClearLines()
GameTooltip:Hide()
end
}
local st = TSMAPI:CreateScrollingTable(stContainer, stCols, handlers, 12)
st:SetData({})
st:DisableSelection(true)
frame.st = st
local destroyBtn = TSMAPI.GUI:CreateButton(frame, 14, "TSMDestroyButton", true)
destroyBtn:SetPoint("BOTTOMLEFT", 3, 3)
destroyBtn:SetPoint("BOTTOMRIGHT", -3, 3)
destroyBtn:SetHeight(20)
destroyBtn:SetText(L["Destroy Next"])
destroyBtn:SetAttribute("type1", "macro")
destroyBtn:SetAttribute("macrotext1", "")
destroyBtn:SetScript("PreClick", function()
if not destroyBtn:IsVisible() or #private.data == 0 then
destroyBtn:SetAttribute("macrotext1", "")
else
local data = private.data[1]
private.tempData = data
destroyBtn:SetAttribute("macrotext1", format("/cast %s;\n/use %d %d", data.spell, data.bag, data.slot))
destroyBtn:Disable()
TSMAPI:CancelFrame("destroyEnableDelay")
TSMAPI:CreateTimeDelay("destroyEnableDelay", 3, function() if not UnitCastingInfo("player") and not LootFrame:IsVisible() then destroyBtn:Enable() end end)
private.highStack = data.numDestroys > 1
private.currentSpell = data.spell
end
end)
frame.destroyBtn = destroyBtn
return frame
end
-- combine partial stacks
function private:Stack()
local partialStacks = {}
for bag, slot, itemString, quantity in TSMAPI:GetBagIterator(nil, TSM.db.global.includeSoulbound) do
local spell, perDestroy = TSM:IsDestroyable(bag, slot, itemString)
if spell and quantity % perDestroy ~= 0 and not private.ignore[itemString] and not TSM.db.global.ignore[itemString] then
partialStacks[itemString] = partialStacks[itemString] or {}
tinsert(partialStacks[itemString], {bag, slot})
end
end
for itemString, locations in pairs(partialStacks) do
for i=#locations, 2, -1 do
local quantity = select(2, GetContainerItemInfo(unpack(locations[i])))
local maxStack = select(8, GetItemInfo(itemString))
if quantity == 0 or quantity == maxStack then break end
for j=1, i-1 do
local targetQuantity = select(2, GetContainerItemInfo(unpack(locations[j])))
if targetQuantity ~= maxStack then
PickupContainerItem(unpack(locations[i]))
PickupContainerItem(unpack(locations[j]))
end
end
end
end
end
local isDelayed
function private:UpdateST(forceShow)
if private.hidden then return end
if (not private.frame or not private.frame:IsVisible()) and not forceShow and not isDelayed then
TSMAPI:CreateTimeDelay("destroyBagUpdateDelay2", 1, function() isDelayed = true private:UpdateST() isDelayed = nil end)
return
end
if InCombatLockdown() then return end
if TSM.db.global.autoStack then
private:Stack()
end
local stData = {}
for bag, slot, itemString, quantity in TSMAPI:GetBagIterator(nil, TSM.db.global.includeSoulbound) do
if not private.ignore[itemString] and not TSM.db.global.ignore[itemString] then
local spell, perDestroy = TSM:IsDestroyable(bag, slot, itemString)
local link = GetContainerItemLink(bag, slot)
if spell and quantity >= perDestroy then
local row = {
cols = {
{
value = link,
},
{
value = quantity
},
},
itemString = itemString,
link = link,
quantity = quantity,
bag = bag,
slot = slot,
spell = spell,
perDestroy = perDestroy,
numDestroys = floor(quantity/perDestroy),
}
tinsert(stData, row)
end
end
end
if #stData == 0 then
if forceShow then
TSM:Print(L["Nothing to destroy in your bags."])
end
private.frame.destroyBtn:Disable()
private.frame:Hide()
elseif (TSM.db.global.autoShow or forceShow) and not private.frame:IsVisible() then
TSMAPI:CancelFrame("destroyEnableDelay")
private.frame.destroyBtn:Enable()
private.frame:Show()
end
private.data = CopyTable(stData)
private.frame.st:SetData(stData)
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()
end
end
function private:LootOpened()
if not private.currentSpell then return end
local temp = {result={}, time=time()}
for bag, slot, itemString, quantity, locked in TSMAPI:GetBagIterator(nil, TSM.db.global.includeSoulbound) do
if locked and TSM:IsDestroyable(bag, slot, itemString) then
temp.item = itemString
break
end
end
if temp.item and GetNumLootItems() > 0 then
for i=1, GetNumLootItems() do
local itemString = TSMAPI:GetItemString(GetLootSlotLink(i))
local quantity = select(3, GetLootSlotInfo(i)) or 0
if itemString and quantity > 0 then
temp.result[itemString] = quantity
end
end
TSM.db.global.history[private.currentSpell] = TSM.db.global.history[private.currentSpell] or {}
tinsert(TSM.db.global.history[private.currentSpell], temp)
TSM.Options:UpdateLogST()
end
private.currentSpell = nil
end
function private:LootChanged()
if not private.tempData then return end
if not LootFrame:IsVisible() then
if private.frame and private.frame:IsVisible() then
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()
end
end
elseif private.highStack and GetNumLootItems() <= 1 then
if private.frame and private.frame:IsVisible() then
TSMAPI:CancelFrame("destroyEnableDelay")
private.frame.destroyBtn:Enable()
end
end
end
@@ -0,0 +1,93 @@
-- ------------------------------------------------------------------------------ --
-- TradeSkillMaster_Destroying --
-- http://www.curse.com/addons/wow/tradeskillmaster_destroying --
-- --
-- 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_Destroying", "AceConsole-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_Destroying") -- loads the localization table
--Professions--
TSM.spells = {
milling = 51005,
prospect = 31252,
disenchant = 13262,
}
local savedDBDefaults = {
global = {
history = {},
ignore = {},
autoStack = true,
autoShow = true,
timeFormat = "ago",
deMaxQuality = 3,
logDays = 3,
includeSoulbound = false,
},
}
-- Called once the player has loaded WOW.
function TSM:OnInitialize()
-- create shortcuts to all the modules
for moduleName, module in pairs(TSM.modules) do
TSM[moduleName] = module
end
-- load the savedDB into TSM.db
TSM.db = LibStub:GetLibrary("AceDB-3.0"):New("TradeSkillMaster_DestroyingDB", savedDBDefaults, true)
-- register this module with TSM
TSM:RegisterModule()
end
-- registers this module with TSM by first setting all fields and then calling TSMAPI:NewModule().
function TSM:RegisterModule()
TSM.icons = {
{side="module", desc="Destroying", slashCommand = "destroying", callback="Options:Load", icon="Interface\\Icons\\INV_Gizmo_RocketBoot_Destroyed_02"},
}
TSM.slashCommands = {
{key="destroy", label=L["Opens the Destroying frame if there's stuff in your bags to be destroyed."], callback="GUI:ShowFrame"},
}
TSMAPI:NewModule(TSM)
end
-- determines if an item is millable or prospectable
local scanTooltip
local destroyCache = {}
function TSM:IsDestroyable(bag, slot, itemString)
if destroyCache[itemString] then
return unpack(destroyCache[itemString])
end
local _, link, quality, _, _, iType = TSMAPI:GetSafeItemInfo(itemString)
local WEAPON, ARMOR = GetAuctionItemClasses()
if itemString and not TSMAPI.DisenchantingData.notDisenchantable[itemString] and (iType == ARMOR or iType == WEAPON) and (quality >= 2 and quality <= TSM.db.global.deMaxQuality) then
destroyCache[itemString] = {IsSpellKnown(TSM.spells.disenchant) and GetSpellInfo(TSM.spells.disenchant), 1}
return unpack(destroyCache[itemString])
end
if not scanTooltip then
scanTooltip = CreateFrame("GameTooltip", "TSMDestroyScanTooltip", UIParent, "GameTooltipTemplate")
scanTooltip:SetOwner(UIParent, "ANCHOR_NONE")
end
scanTooltip:ClearLines()
scanTooltip:SetBagItem(bag, slot)
for i=1, scanTooltip:NumLines() do
local text = _G["TSMDestroyScanTooltipTextLeft"..i] and _G["TSMDestroyScanTooltipTextLeft"..i]:GetText()
if text == ITEM_MILLABLE then
destroyCache[itemString] = {IsSpellKnown(TSM.spells.milling) and GetSpellInfo(TSM.spells.milling), 5}
break
elseif text == ITEM_PROSPECTABLE then
destroyCache[itemString] = {IsSpellKnown(TSM.spells.prospect) and GetSpellInfo(TSM.spells.prospect), 5}
break
end
end
return unpack(destroyCache[itemString] or {})
end
@@ -0,0 +1,26 @@
## Interface: 30300
## Title: |cff00ff00TradeSkillMaster_Destroying|r
## Notes: Makes bulk and one-off milling, prospecting, and disenchanting easier.
## Author: Sapu94, Bart39
## Version: v2.1.1
## SavedVariables: TradeSkillMaster_DestroyingDB
## Dependency: TradeSkillMaster
## X-Curse-Packaged-Version: v2.1.1
## X-Curse-Project-Name: TradeSkillMaster_Destroying
## X-Curse-Project-ID: tradeskillmaster_destroying
## X-Curse-Repository-ID: wow/tradeskillmaster_destroying/mainline
Locale\enUS.lua
Locale\deDE.lua
Locale\esES.lua
Locale\esMX.lua
Locale\frFR.lua
Locale\koKR.lua
Locale\ruRU.lua
Locale\zhCN.lua
Locale\zhTW.lua
Locale\ptBR.lua
TradeSkillMaster_Destroying.lua
Modules\GUI.lua
Modules\Options.lua