Enchanting fixes, reverted Crafting module to previous version that s… (#1)
* Enchanting fixes, reverted Crafting module to previous version that supports Ascension specific crafts and Vellums. * Updated enchanting names from DB * Added the remaining Ascension specific recipes * Replace SpellNames2IDs.lua with UnitCastingSpellID * Bugfix: Ascension uses exact quality QueryAuctionItems, TSM was designed for quality or higher * Bugfix: Properly get list of Professions via index * Replaced factionrealm with realm Ascension does not have strict faction seperation * GetTradeSkillCooldown -> SpellHasBaseCooldown GetTradeSkillCooldown only tells you if a spell is on CD, not if it has a CD Data is from DB, which isn't populated fully yet. * Implement backported API GetSpellBaseCooldown * bugfix: hasCD is nil if no cd, not 0
This commit is contained in:
@@ -74,9 +74,9 @@ function private:LoadItemRecords(csvData, recordType, key)
|
||||
local saveTimeIndex = 1
|
||||
local saveTimes
|
||||
if recordType == "sales" then
|
||||
saveTimes = TSMAPI:SafeStrSplit(TSM.db.factionrealm.saveTimeSales, ",")
|
||||
saveTimes = TSMAPI:SafeStrSplit(TSM.db.realm.saveTimeSales, ",")
|
||||
elseif recordType == "buys" then
|
||||
saveTimes = TSMAPI:SafeStrSplit(TSM.db.factionrealm.saveTimeBuys, ",")
|
||||
saveTimes = TSMAPI:SafeStrSplit(TSM.db.realm.saveTimeBuys, ",")
|
||||
end
|
||||
for _, record in ipairs(select(2, LibParse:CSVDecode(csvData)) or {}) do
|
||||
local itemString = record.itemString
|
||||
@@ -119,20 +119,20 @@ function Data:Load()
|
||||
-- Decode item records
|
||||
TSM.items = {}
|
||||
TSM.cache = {}
|
||||
private:LoadItemRecords(TSM.db.factionrealm.csvSales, "sales")
|
||||
private:LoadItemRecords(TSM.db.factionrealm.csvBuys, "buys")
|
||||
private:LoadItemRecords(TSM.db.factionrealm.csvCancelled, "auctions", "Cancel")
|
||||
private:LoadItemRecords(TSM.db.factionrealm.csvExpired, "auctions", "Expire")
|
||||
private:LoadItemRecords(TSM.db.realm.csvSales, "sales")
|
||||
private:LoadItemRecords(TSM.db.realm.csvBuys, "buys")
|
||||
private:LoadItemRecords(TSM.db.realm.csvCancelled, "auctions", "Cancel")
|
||||
private:LoadItemRecords(TSM.db.realm.csvExpired, "auctions", "Expire")
|
||||
|
||||
-- Decode money records
|
||||
TSM.money = {}
|
||||
private:LoadMoneyRecords(TSM.db.factionrealm.csvIncome, "income")
|
||||
private:LoadMoneyRecords(TSM.db.factionrealm.csvExpense, "expense")
|
||||
private:LoadMoneyRecords(TSM.db.realm.csvIncome, "income")
|
||||
private:LoadMoneyRecords(TSM.db.realm.csvExpense, "expense")
|
||||
|
||||
-- Decode the gold log
|
||||
for player, data in pairs(TSM.db.factionrealm.goldLog) do
|
||||
for player, data in pairs(TSM.db.realm.goldLog) do
|
||||
if type(data) == "string" then
|
||||
TSM.db.factionrealm.goldLog[player] = select(2, LibParse:CSVDecode(data))
|
||||
TSM.db.realm.goldLog[player] = select(2, LibParse:CSVDecode(data))
|
||||
end
|
||||
end
|
||||
Data:SetupDataTracking()
|
||||
@@ -534,13 +534,13 @@ end
|
||||
|
||||
-- returns a formatted time in the format that the user has selected
|
||||
function private:GetFormattedTime(rTime)
|
||||
if TSM.db.factionrealm.timeFormat == "ago" then
|
||||
if TSM.db.realm.timeFormat == "ago" then
|
||||
return format(L["%s ago"], SecondsToTime(time() - rTime) or "?")
|
||||
elseif TSM.db.factionrealm.timeFormat == "usdate" then
|
||||
elseif TSM.db.realm.timeFormat == "usdate" then
|
||||
return date("%m/%d/%y %H:%M", rTime)
|
||||
elseif TSM.db.factionrealm.timeFormat == "eudate" then
|
||||
elseif TSM.db.realm.timeFormat == "eudate" then
|
||||
return date("%d/%m/%y %H:%M", rTime)
|
||||
elseif TSM.db.factionrealm.timeFormat == "aidate" then
|
||||
elseif TSM.db.realm.timeFormat == "aidate" then
|
||||
return date("%y/%m/%d %H:%M", rTime)
|
||||
end
|
||||
end
|
||||
@@ -559,7 +559,7 @@ function private:IsItemFiltered(itemString, filters)
|
||||
return true
|
||||
end
|
||||
|
||||
if not TSM.db.factionrealm.displayGreys and rarity == 0 then
|
||||
if not TSM.db.realm.displayGreys and rarity == 0 then
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -578,7 +578,7 @@ function private:IsRecordFiltered(record, filters)
|
||||
if filters.otherPlayer and record.otherPlayer ~= filters.otherPlayer then
|
||||
return true
|
||||
end
|
||||
if not TSM.db.factionrealm.displayTransfers and record.key == "Transfer" then
|
||||
if not TSM.db.realm.displayTransfers and record.key == "Transfer" then
|
||||
return true
|
||||
end
|
||||
if filters.time and floor(record.time/SECONDS_PER_DAY) < (floor(time()/SECONDS_PER_DAY) - filters.time) then
|
||||
@@ -684,7 +684,7 @@ function private:GetItemSummaryData(filters, includeProfit)
|
||||
|
||||
if isValidItem then
|
||||
itemData[itemString] = {buyNum=buyNum, sellNum=sellNum, profit=profit, profitText=profitText}
|
||||
if TSM.db.factionrealm.priceFormat == "total" then
|
||||
if TSM.db.realm.priceFormat == "total" then
|
||||
itemData[itemString].avgSell = sellNum > 0 and sellTotal or 0
|
||||
itemData[itemString].avgBuy = buyNum > 0 and buyTotal or 0
|
||||
else
|
||||
@@ -741,7 +741,7 @@ function Data.GetItemSummarySTData(filters)
|
||||
local stData = {}
|
||||
for itemString, data in pairs(itemData) do
|
||||
local name = TSM.items[itemString].name
|
||||
local marketValue = TSMAPI:GetItemValue(itemString, TSM.db.factionrealm.mvSource)
|
||||
local marketValue = TSMAPI:GetItemValue(itemString, TSM.db.realm.mvSource)
|
||||
local row = {
|
||||
cols = {
|
||||
{
|
||||
@@ -1169,7 +1169,7 @@ do
|
||||
end
|
||||
|
||||
local function onChatMsg(_, msg)
|
||||
if not TSM.db.factionrealm.trackTrades then return
|
||||
if not TSM.db.realm.trackTrades then return
|
||||
end
|
||||
if msg == ERR_TRADE_COMPLETE and tradeInfo then
|
||||
-- trade went through
|
||||
@@ -1223,7 +1223,7 @@ do
|
||||
Data:InsertItemBuyRecord(info.itemString, "Trade", info.count, info.price, tradeInfo.target.name)
|
||||
end
|
||||
end
|
||||
if TSM.db.factionrealm.autoTrackTrades then
|
||||
if TSM.db.realm.autoTrackTrades then
|
||||
InsertTradeRecord()
|
||||
else
|
||||
StaticPopupDialogs["TSMAccountingOnTrade"] = {
|
||||
@@ -1254,8 +1254,8 @@ function Data:LogGold()
|
||||
if not player then return end
|
||||
lastTrackMinute = currentMinute
|
||||
|
||||
TSM.db.factionrealm.goldLog[player] = TSM.db.factionrealm.goldLog[player] or {}
|
||||
local goldLog = TSM.db.factionrealm.goldLog[player]
|
||||
TSM.db.realm.goldLog[player] = TSM.db.realm.goldLog[player] or {}
|
||||
local goldLog = TSM.db.realm.goldLog[player]
|
||||
local currentGold = TSM:Round(GetMoney(), COPPER_PER_GOLD * 1000)
|
||||
if #goldLog > 0 and currentGold == goldLog[#goldLog].copper then
|
||||
goldLog[#goldLog].endMinute = currentMinute
|
||||
|
||||
@@ -224,7 +224,7 @@ function GUI:DrawRevenueTab(container)
|
||||
private:CreateScrollingTable(self, "income", TSM.Data.GetIncomeSTData, ITEM_MONEY_ST_COLS)
|
||||
elseif value == 3 then
|
||||
GUI:CreateFiltersWidgetsItem(self, "resale", {"Auction", "COD", "Trade", "Vendor"})
|
||||
local stCols = TSM.db.factionrealm.priceFormat == "avg" and ITEM_RESALE_ST_COLS_AVG or ITEM_RESALE_ST_COLS_TOTAL
|
||||
local stCols = TSM.db.realm.priceFormat == "avg" and ITEM_RESALE_ST_COLS_AVG or ITEM_RESALE_ST_COLS_TOTAL
|
||||
private:CreateScrollingTable(self, "resale", TSM.Data.GetResaleSTData, stCols, tabNum, value)
|
||||
end
|
||||
tabGroup.children[1]:DoLayout()
|
||||
@@ -287,7 +287,7 @@ end
|
||||
|
||||
function GUI:DrawItemSummary(container)
|
||||
GUI:CreateFiltersWidgetsItem(container, "itemSummary", {"Auction", "COD", "Trade", "Vendor"})
|
||||
local stCols = TSM.db.factionrealm.priceFormat == "avg" and ITEM_SUMMARY_ST_COLS_AVG or ITEM_SUMMARY_ST_COLS_TOTAL
|
||||
local stCols = TSM.db.realm.priceFormat == "avg" and ITEM_SUMMARY_ST_COLS_AVG or ITEM_SUMMARY_ST_COLS_TOTAL
|
||||
private:CreateScrollingTable(container, "itemSummary", TSM.Data.GetItemSummarySTData, stCols, 4)
|
||||
end
|
||||
|
||||
@@ -824,7 +824,7 @@ function private:GetGoldGraphSumData()
|
||||
local currentMinute = floor(time() / 60)
|
||||
local players = {}
|
||||
local starts = {}
|
||||
for _, playerData in pairs(TSM.db.factionrealm.goldLog) do
|
||||
for _, playerData in pairs(TSM.db.realm.goldLog) do
|
||||
if #playerData > 2 then
|
||||
local data = CopyTable(playerData)
|
||||
for i=1, #data do
|
||||
@@ -885,17 +885,17 @@ function private:GetGoldGraphSumData()
|
||||
end
|
||||
|
||||
function GUI:DrawGoldGraph(container)
|
||||
TSM.db.factionrealm.goldGraphCharacter = TSM.db.factionrealm.goldGraphCharacter or UnitName("player")
|
||||
local player = TSM.db.factionrealm.goldGraphCharacter
|
||||
TSM.db.realm.goldGraphCharacter = TSM.db.realm.goldGraphCharacter or UnitName("player")
|
||||
local player = TSM.db.realm.goldGraphCharacter
|
||||
local data, minX, maxX, minY, maxY
|
||||
if player == "<ALL>" then
|
||||
data, minX, maxX, minY, maxY = private:GetGoldGraphSumData()
|
||||
else
|
||||
data, minX, maxX, minY, maxY = private:GetGoldGraphPoints(TSM.db.factionrealm.goldLog[player])
|
||||
data, minX, maxX, minY, maxY = private:GetGoldGraphPoints(TSM.db.realm.goldLog[player])
|
||||
end
|
||||
|
||||
local dropdownList = {["<ALL>"]="Sum of All Characters"}
|
||||
for player in pairs(TSM.db.factionrealm.goldLog) do
|
||||
for player in pairs(TSM.db.realm.goldLog) do
|
||||
dropdownList[player] = player
|
||||
end
|
||||
|
||||
@@ -916,7 +916,7 @@ function GUI:DrawGoldGraph(container)
|
||||
{
|
||||
type = "Dropdown",
|
||||
label = "Character to Graph",
|
||||
settingInfo = {TSM.db.factionrealm, "goldGraphCharacter"},
|
||||
settingInfo = {TSM.db.realm, "goldGraphCharacter"},
|
||||
relativeWidth = 0.5,
|
||||
list = dropdownList,
|
||||
callback = function() container:ReloadTab() end,
|
||||
@@ -930,10 +930,10 @@ function GUI:DrawGoldGraph(container)
|
||||
end
|
||||
|
||||
local startDate, endDate
|
||||
if TSM.db.factionrealm.timeFormat == "eudate" then
|
||||
if TSM.db.realm.timeFormat == "eudate" then
|
||||
startDate = date("%d/%m/%y %H:%M", minX * 60)
|
||||
endDate = date("%d/%m/%y %H:%M", maxX * 60)
|
||||
elseif TSM.db.factionrealm.timeFormat == "aidate" then
|
||||
elseif TSM.db.realm.timeFormat == "aidate" then
|
||||
startDate = date("%y/%m/%d %H:%M", minX * 60)
|
||||
endDate = date("%y/%m/%d %H:%M", maxX * 60)
|
||||
else
|
||||
@@ -958,7 +958,7 @@ function GUI:DrawGoldGraph(container)
|
||||
{
|
||||
type = "Dropdown",
|
||||
label = L["Character to Graph"],
|
||||
settingInfo = {TSM.db.factionrealm, "goldGraphCharacter"},
|
||||
settingInfo = {TSM.db.realm, "goldGraphCharacter"},
|
||||
relativeWidth = 0.5,
|
||||
list = dropdownList,
|
||||
callback = function() container:ReloadTab() end,
|
||||
@@ -1024,7 +1024,7 @@ function GUI:DrawOptions(container)
|
||||
{
|
||||
type = "Dropdown",
|
||||
label = L["Time Format"],
|
||||
settingInfo = {TSM.db.factionrealm, "timeFormat"},
|
||||
settingInfo = {TSM.db.realm, "timeFormat"},
|
||||
relativeWidth = 0.5,
|
||||
list = { ["ago"] = L["_ Hr _ Min ago"], ["usdate"] = L["MM/DD/YY HH:MM"], ["aidate"] = L["YY/MM/DD HH:MM"], ["eudate"] = L["DD/MM/YY HH:MM"] },
|
||||
tooltip = L["Select what format Accounting should use to display times in applicable screens."],
|
||||
@@ -1032,7 +1032,7 @@ function GUI:DrawOptions(container)
|
||||
{
|
||||
type = "Dropdown",
|
||||
label = L["Market Value Source"],
|
||||
settingInfo = {TSM.db.factionrealm, "mvSource"},
|
||||
settingInfo = {TSM.db.realm, "mvSource"},
|
||||
relativeWidth = 0.49,
|
||||
list = mvSources,
|
||||
tooltip = L["Select where you want Accounting to get market value info from to show in applicable screens."],
|
||||
@@ -1040,7 +1040,7 @@ function GUI:DrawOptions(container)
|
||||
{
|
||||
type = "Dropdown",
|
||||
label = "Items/Resale Price Format",
|
||||
settingInfo = {TSM.db.factionrealm, "priceFormat"},
|
||||
settingInfo = {TSM.db.realm, "priceFormat"},
|
||||
relativeWidth = 0.49,
|
||||
list = { ["avg"] = L["Per Item"], ["total"] = L["Total Value"] },
|
||||
tooltip = L["Select how you would like prices to be shown in the \"Items\" and \"Resale\" tabs; either average price per item or total value."],
|
||||
@@ -1052,33 +1052,33 @@ function GUI:DrawOptions(container)
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Track sales/purchases via trade"],
|
||||
settingInfo = { TSM.db.factionrealm, "trackTrades" },
|
||||
settingInfo = { TSM.db.realm, "trackTrades" },
|
||||
callback = function() container:ReloadTab() end,
|
||||
tooltip = L["If checked, whenever you buy or sell any quantity of a single item via trade, Accounting will display a popup asking if you want it to record that transaction."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Don't prompt to record trades"],
|
||||
settingInfo = { TSM.db.factionrealm, "autoTrackTrades" },
|
||||
disabled = not TSM.db.factionrealm.trackTrades,
|
||||
settingInfo = { TSM.db.realm, "autoTrackTrades" },
|
||||
disabled = not TSM.db.realm.trackTrades,
|
||||
tooltip = L["If checked, you won't get a popup confirmation about whether or not to track trades."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Display Grey Items in Sales"],
|
||||
settingInfo = { TSM.db.factionrealm, "displayGreys" },
|
||||
settingInfo = { TSM.db.realm, "displayGreys" },
|
||||
tooltip = L["If checked, poor quality items will be shown in sales data. They will still be included in gold earned totals on the summary tab regardless of this setting"],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Display Money Transfers in Income/Expense/Summary"],
|
||||
settingInfo = { TSM.db.factionrealm, "displayTransfers" },
|
||||
settingInfo = { TSM.db.realm, "displayTransfers" },
|
||||
tooltip = L["If checked, Money Transfers will be included in income / expense and summary. Accounting will still track these if disabled but will not show them."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Use smart average for purchase price"],
|
||||
settingInfo = { TSM.db.factionrealm, "smartBuyPrice" },
|
||||
settingInfo = { TSM.db.realm, "smartBuyPrice" },
|
||||
tooltip = L["If checked, the average purchase price that shows in the tooltip will be the average price for the most recent X you have purchased, where X is the number you have in your bags / bank / gbank using data from the ItemTracker module. Otherwise, a simple average of all purchases will be used."],
|
||||
},
|
||||
},
|
||||
@@ -1131,34 +1131,34 @@ function GUI:LoadTooltipOptions(container)
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Show sale info in item tooltips"],
|
||||
settingInfo = { TSM.db.factionrealm.tooltip, "sale" },
|
||||
settingInfo = { TSM.db.realm.tooltip, "sale" },
|
||||
tooltip = L["If checked, the number you have sold and the average sale price will show up in an item's tooltip."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Show Expired Auctions as Failed Auctions since Last Sale in item tooltips"],
|
||||
settingInfo = { TSM.db.factionrealm, "expiredAuctions" },
|
||||
settingInfo = { TSM.db.realm, "expiredAuctions" },
|
||||
relativeWidth = 1,
|
||||
tooltip = L["If checked, the number of expired auctions since the last sale will show as up as failed auctions in an item's tooltip. if no sales then the total number of expired auctions will be shown."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Show Cancelled Auctions as Failed Auctions since Last Sale in item tooltips"],
|
||||
settingInfo = { TSM.db.factionrealm, "cancelledAuctions" },
|
||||
settingInfo = { TSM.db.realm, "cancelledAuctions" },
|
||||
relativeWidth = 1,
|
||||
tooltip = L["If checked, the number of cancelled auctions since the last sale will show as up as failed auctions in an item's tooltip. if no sales then the total number of cancelled auctions will be shown."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Show Sale Rate in item tooltips"],
|
||||
settingInfo = { TSM.db.factionrealm, "saleRate" },
|
||||
settingInfo = { TSM.db.realm, "saleRate" },
|
||||
relativeWidth = 1,
|
||||
tooltip = L["If checked, the sale rate will be shown in item tooltips. sale rate is calculated as total sold / (total sold + total expired + total cancelled)."],
|
||||
},
|
||||
{
|
||||
type = "CheckBox",
|
||||
label = L["Show purchase info in item tooltips"],
|
||||
settingInfo = { TSM.db.factionrealm.tooltip, "purchase" },
|
||||
settingInfo = { TSM.db.realm.tooltip, "purchase" },
|
||||
tooltip = L["If checked, the number you have purchased and the average purchase price will show up in an item's tooltip."],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -25,7 +25,7 @@ local savedDBDefaults = {
|
||||
itemStrings = {},
|
||||
infoID = 0,
|
||||
},
|
||||
factionrealm = {
|
||||
realm = {
|
||||
csvSales = "",
|
||||
csvBuys = "",
|
||||
csvIncome = "",
|
||||
@@ -64,25 +64,25 @@ function TSM:OnInitialize()
|
||||
TSM:RegisterModule()
|
||||
|
||||
-- clear out 1.x data
|
||||
if TSM.db.factionrealm.itemData then
|
||||
TSM.db.factionrealm.itemData = nil
|
||||
if TSM.db.realm.itemData then
|
||||
TSM.db.realm.itemData = nil
|
||||
end
|
||||
|
||||
if TSM.db.factionrealm.data then
|
||||
TSM.db.factionrealm.csvSales = TSM.db.factionrealm.data.sales
|
||||
TSM.db.factionrealm.csvBuys = TSM.db.factionrealm.data.buys
|
||||
TSM.db.factionrealm.data = nil
|
||||
if TSM.db.realm.data then
|
||||
TSM.db.realm.csvSales = TSM.db.realm.data.sales
|
||||
TSM.db.realm.csvBuys = TSM.db.realm.data.buys
|
||||
TSM.db.realm.data = nil
|
||||
end
|
||||
|
||||
for key, timestamp in pairs(TSM.db.factionrealm.trimmed) do
|
||||
for key, timestamp in pairs(TSM.db.realm.trimmed) do
|
||||
TSM:Printf(L["|cffff0000IMPORTANT:|r When TSM_Accounting last saved data for this realm, it was too big for WoW to handle, so old data was automatically trimmed in order to avoid corruption of the saved variables. The last %s of %s data has been preserved."], SecondsToTime(time()-timestamp), key)
|
||||
end
|
||||
TSM.db.factionrealm.trimmed = {}
|
||||
TSM.db.realm.trimmed = {}
|
||||
|
||||
TSM.Data:Load()
|
||||
|
||||
-- fix issues in gold log
|
||||
for player, playerData in pairs(TSM.db.factionrealm.goldLog) do
|
||||
for player, playerData in pairs(TSM.db.realm.goldLog) do
|
||||
for i=#playerData, 1, -1 do
|
||||
local data = playerData[i]
|
||||
data.startMinute = floor(data.startMinute)
|
||||
@@ -135,7 +135,7 @@ end
|
||||
|
||||
local tooltipCache = {buys={}, sales={}}
|
||||
function TSM:GetTooltip(itemString)
|
||||
if not (TSM.db.factionrealm.tooltip.sale or TSM.db.factionrealm.tooltip.purchase) then return end
|
||||
if not (TSM.db.realm.tooltip.sale or TSM.db.realm.tooltip.purchase) then return end
|
||||
if not TSM.items[itemString] then return end
|
||||
TSM.cache[itemString] = TSM.cache[itemString] or {}
|
||||
local text = {}
|
||||
@@ -145,7 +145,7 @@ function TSM:GetTooltip(itemString)
|
||||
local numSaleRecords = #TSM.items[itemString].sales
|
||||
local lastSold = numSaleRecords > 0 and TSM.items[itemString].sales[numSaleRecords].time or 0
|
||||
local moneyCoinsTooltip = TSMAPI:GetMoneyCoinsTooltip()
|
||||
if TSM.db.factionrealm.tooltip.sale and numSaleRecords > 0 then
|
||||
if TSM.db.realm.tooltip.sale and numSaleRecords > 0 then
|
||||
local totalSalePrice = avgSalePrice * totalSaleNum
|
||||
|
||||
if IsShiftKeyDown() then
|
||||
@@ -183,7 +183,7 @@ function TSM:GetTooltip(itemString)
|
||||
tinsert(text, { left = " " .. L["Sale Rate:"], right = "|cffffffff" .. saleRate })
|
||||
end
|
||||
|
||||
if TSM.db.factionrealm.tooltip.purchase and TSM.items[itemString] and #TSM.items[itemString].buys > 0 then
|
||||
if TSM.db.realm.tooltip.purchase and TSM.items[itemString] and #TSM.items[itemString].buys > 0 then
|
||||
local lastPurchased = TSM.items[itemString].buys[#TSM.items[itemString].buys].time
|
||||
local totalPrice, totalNum = 0, 0
|
||||
for _, record in ipairs(TSM.items[itemString].buys) do
|
||||
@@ -288,16 +288,16 @@ function TSM:OnTSMDBShutdown()
|
||||
while (#data > floor(MAX_CSV_RECORDS*0.9)) do
|
||||
tremove(data)
|
||||
end
|
||||
TSM.db.factionrealm.trimmed[key] = data[#data].time
|
||||
TSM.db.realm.trimmed[key] = data[#data].time
|
||||
end
|
||||
end
|
||||
|
||||
TSM.db.factionrealm.saveTimeSales = table.concat(saveTimeSales, ",")
|
||||
TSM.db.factionrealm.saveTimeBuys = table.concat(saveTimeBuys, ",")
|
||||
TSM.db.factionrealm.csvSales = LibParse:CSVEncode(TSM.SELL_KEYS, sales)
|
||||
TSM.db.factionrealm.csvBuys = LibParse:CSVEncode(TSM.BUY_KEYS, buys)
|
||||
TSM.db.factionrealm.csvCancelled = LibParse:CSVEncode(TSM.CANCELLED_KEYS, cancels)
|
||||
TSM.db.factionrealm.csvExpired = LibParse:CSVEncode(TSM.EXPIRED_KEYS, expires)
|
||||
TSM.db.realm.saveTimeSales = table.concat(saveTimeSales, ",")
|
||||
TSM.db.realm.saveTimeBuys = table.concat(saveTimeBuys, ",")
|
||||
TSM.db.realm.csvSales = LibParse:CSVEncode(TSM.SELL_KEYS, sales)
|
||||
TSM.db.realm.csvBuys = LibParse:CSVEncode(TSM.BUY_KEYS, buys)
|
||||
TSM.db.realm.csvCancelled = LibParse:CSVEncode(TSM.CANCELLED_KEYS, cancels)
|
||||
TSM.db.realm.csvExpired = LibParse:CSVEncode(TSM.EXPIRED_KEYS, expires)
|
||||
|
||||
-- process income
|
||||
local income = {}
|
||||
@@ -309,7 +309,7 @@ function TSM:OnTSMDBShutdown()
|
||||
tinsert(income, record)
|
||||
end
|
||||
end
|
||||
TSM.db.factionrealm.csvIncome = LibParse:CSVEncode(TSM.INCOME_KEYS, income)
|
||||
TSM.db.realm.csvIncome = LibParse:CSVEncode(TSM.INCOME_KEYS, income)
|
||||
|
||||
-- process expense
|
||||
local expense = {}
|
||||
@@ -327,13 +327,13 @@ function TSM:OnTSMDBShutdown()
|
||||
tinsert(expense, record)
|
||||
end
|
||||
end
|
||||
TSM.db.factionrealm.csvExpense = LibParse:CSVEncode(TSM.EXPENSE_KEYS, expense)
|
||||
TSM.db.realm.csvExpense = LibParse:CSVEncode(TSM.EXPENSE_KEYS, expense)
|
||||
|
||||
-- process gold log
|
||||
TSM.Data:LogGold()
|
||||
for player, data in pairs(TSM.db.factionrealm.goldLog) do
|
||||
for player, data in pairs(TSM.db.realm.goldLog) do
|
||||
if type(data) == "table" then
|
||||
TSM.db.factionrealm.goldLog[player] = LibParse:CSVEncode(TSM.GOLD_LOG_KEYS, data)
|
||||
TSM.db.realm.goldLog[player] = LibParse:CSVEncode(TSM.GOLD_LOG_KEYS, data)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -362,9 +362,9 @@ end
|
||||
local function GetAuctionStats(itemString, minTime)
|
||||
local cancel, expire, total = 0, 0, 0
|
||||
for _, record in ipairs(TSM.items[itemString].auctions) do
|
||||
if record.key == "Cancel" and TSM.db.factionrealm.cancelledAuctions and record.time > minTime then
|
||||
if record.key == "Cancel" and TSM.db.realm.cancelledAuctions and record.time > minTime then
|
||||
cancel = cancel + record.quantity
|
||||
elseif record.key == "Expire" and TSM.db.factionrealm.expiredAuctions and record.time > minTime then
|
||||
elseif record.key == "Expire" and TSM.db.realm.expiredAuctions and record.time > minTime then
|
||||
expire = expire + record.quantity
|
||||
end
|
||||
total = total + record.quantity
|
||||
@@ -441,7 +441,7 @@ local function GetAvgerageBuyPrice(itemString, noBaseItem)
|
||||
if not (TSM.items[itemString] and #TSM.items[itemString].buys > 0) then return end
|
||||
|
||||
local itemCount = 0
|
||||
if TSM.db.factionrealm.smartBuyPrice then
|
||||
if TSM.db.realm.smartBuyPrice then
|
||||
local player, alts = TSMAPI:ModuleAPI("ItemTracker", "playertotal", itemString)
|
||||
if not player then
|
||||
alts = nil
|
||||
|
||||
Reference in New Issue
Block a user