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
|
||||
|
||||
Reference in New Issue
Block a user