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:
Xan-Asc
2023-04-07 03:55:47 -07:00
committed by GitHub
parent d6aaac97af
commit 42dbe9d526
41 changed files with 1122 additions and 4694 deletions
@@ -48,7 +48,7 @@ local function GetCommonQueryInfo(name, items)
if existingQuery then
existingQuery.minLevel = min(existingQuery.minLevel, itemQuery.minLevel)
existingQuery.maxLevel = max(existingQuery.maxLevel, itemQuery.maxLevel)
existingQuery.quality = min(existingQuery.quality, itemQuery.quality)
existingQuery.quality = (existingQuery.quality == itemQuery.quality) and existingQuery.quality or nil
if existingQuery.subClass ~= itemQuery.subClass then
existingQuery.subClass = nil
end
@@ -70,7 +70,7 @@ local function GetCommonQueryInfoClass(class, items)
local itemQuery = TSMAPI:GetAuctionQueryInfo(items[i])
resultQuery.minLevel = min(resultQuery.minLevel, itemQuery.minLevel)
resultQuery.maxLevel = max(resultQuery.maxLevel, itemQuery.maxLevel)
resultQuery.quality = min(resultQuery.quality, itemQuery.quality)
resultQuery.quality = (resultQuery.quality == itemQuery.quality) and resultQuery.quality or nil
if resultQuery.subClass ~= itemQuery.subClass then resultQuery.subClass = nil end
end
resultQuery.items = items
+3 -3
View File
@@ -213,7 +213,7 @@ function private:ScanAuctions()
local totalPages = ceil(total / NUM_AUCTION_ITEMS_PER_PAGE)
if private.scanType == "numPages" then
local cacheData = TSM.db.factionrealm.numPagesCache[private.query.cacheKey]
local cacheData = TSM.db.realm.numPagesCache[private.query.cacheKey]
cacheData.lastScan = time()
local confidence = (120 - cacheData.confidence) / (CACHE_DECAY_PER_DAY * 2)
local diff = abs(cacheData.avg - totalPages)
@@ -393,7 +393,7 @@ function TSMAPI.AuctionScan:GetNumPages(query, callbackHandler)
temp[i] = tostring(query[field])
end
local cacheKey = table.concat(temp, "~")
local cacheData = TSM.db.factionrealm.numPagesCache[cacheKey]
local cacheData = TSM.db.realm.numPagesCache[cacheKey]
if cacheData then
local cacheHit
if time() - cacheData.lastScan < CACHE_AUTO_HIT_TIME then
@@ -412,7 +412,7 @@ function TSMAPI.AuctionScan:GetNumPages(query, callbackHandler)
return 2
end
else
TSM.db.factionrealm.numPagesCache[cacheKey] = { avg = 0, confidence = 0, numScans = 0, lastScan = 0 }
TSM.db.realm.numPagesCache[cacheKey] = { avg = 0, confidence = 0, numScans = 0, lastScan = 0 }
end
-- setup the query
+10 -10
View File
@@ -363,14 +363,14 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName)
local operation = TSMObj.operations[operationName]
local playerList = {}
local factionrealmKey = TSM.db.keys.factionrealm
for playerName in pairs(TSM.db.factionrealm.characters) do
playerList[playerName.." - "..factionrealmKey] = playerName
local realmKey = TSM.db.keys.realm
for playerName in pairs(TSM.db.realm.characters) do
playerList[playerName.." - "..realmKey] = playerName
end
local factionrealmList = {}
for factionrealm in pairs(TSM.db.sv.factionrealm) do
factionrealmList[factionrealm] = factionrealm
local realmList = {}
for realm in pairs(TSM.db.sv.realm) do
realmList[realm] = realm
end
local groupList = {}
@@ -436,9 +436,9 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName)
{
type = "Dropdown",
label = L["Ignore Operation on Faction-Realms:"],
list = factionrealmList,
list = realmList,
relativeWidth = 0.5,
settingInfo = {operation, "ignoreFactionrealm"},
settingInfo = {operation, "ignorerealm"},
multiselect = true,
tooltip = L["This operation will be ignored when you're on any character which is checked in this dropdown."],
},
@@ -612,7 +612,7 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName)
end
data.module = nil
data.ignorePlayer = {}
data.ignoreFactionrealm = {}
data.ignorerealm = {}
data.relationships = {}
TSMObj.operations[operationName] = data
self:SetText("")
@@ -629,7 +629,7 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName)
local data = CopyTable(operation)
data.module = moduleName
data.ignorePlayer = nil
data.ignoreFactionrealm = nil
data.ignorerealm = nil
data.relationships = nil
ShowExportFrame(LibStub("AceSerializer-3.0"):Serialize(data))
end,
+5 -5
View File
@@ -220,7 +220,7 @@ function TSMAPI:NewModule(obj)
obj.operations = TSM.operations[moduleName]
for _, operation in pairs(obj.operations) do
operation.ignorePlayer = operation.ignorePlayer or {}
operation.ignoreFactionrealm = operation.ignoreFactionrealm or {}
operation.ignorerealm = operation.ignorerealm or {}
operation.relationships = operation.relationships or {}
end
TSM:CheckOperationRelationships(moduleName)
@@ -266,7 +266,7 @@ function TSM:UpdateModuleProfiles()
for module, operations in pairs(TSM.operations) do
for _, operation in pairs(operations) do
operation.ignorePlayer = operation.ignorePlayer or {}
operation.ignoreFactionrealm = operation.ignoreFactionrealm or {}
operation.ignorerealm = operation.ignorerealm or {}
operation.relationships = operation.relationships or {}
end
TSM:CheckOperationRelationships(module)
@@ -296,9 +296,9 @@ function TSM:IsOperationIgnored(module, operationName)
local obj = moduleObjects[module]
local operation = obj.operations[operationName]
if not operation then return end
local factionrealm = TSM.db.keys.factionrealm
local playerKey = UnitName("player").." - "..factionrealm
return operation.ignorePlayer[playerKey] or operation.ignoreFactionrealm[factionrealm]
local realm = TSM.db.keys.realm
local playerKey = UnitName("player").." - "..realm
return operation.ignorePlayer[playerKey] or operation.ignorerealm[realm]
end
function TSM:CheckOperationRelationships(moduleName)
+3 -3
View File
@@ -455,7 +455,7 @@ function private:LoadOptionsPage(parent)
relativeWidth = 0.49,
callback = function(_, _, value)
local name = characterList[value]
TSM.db.factionrealm.characters[name] = nil
TSM.db.realm.characters[name] = nil
TSM:Printf("%s removed.", name)
parent:ReloadTab()
end,
@@ -663,7 +663,7 @@ function private:LoadOptionsPage(parent)
}
-- extra multi-account syncing widgets
for account, players in pairs(TSM.db.factionrealm.syncAccounts) do
for account, players in pairs(TSM.db.realm.syncAccounts) do
local playerList = {}
for player in pairs(players) do
tinsert(playerList, player)
@@ -674,7 +674,7 @@ function private:LoadOptionsPage(parent)
text = DELETE,
relativeWidth = 0.2,
callback = function()
TSM.db.factionrealm.syncAccounts[account] = nil
TSM.db.realm.syncAccounts[account] = nil
parent:ReloadTab()
end,
},
+7 -7
View File
@@ -25,7 +25,7 @@ function Sync:OnEnable()
Sync:RegisterEvent("CHAT_MSG_SYSTEM")
local data = {characters={}, accountKey=TSMAPI.Sync:GetAccountKey()}
for name in pairs(TSM.db.factionrealm.characters) do
for name in pairs(TSM.db.realm.characters) do
data.characters[name] = TSMAPI.Sync:GetAccountKey()
end
TSMAPI:CreateTimeDelay("syncSetupDelay", 3, function() TSMAPI.Sync:BroadcastData("TradeSkillMaster", "SETUP", data) end)
@@ -63,7 +63,7 @@ function Sync:OnCommReceived(_, data, _, source)
data.__account = nil
-- make sure we are getting this from a known source
if not TSM.db.factionrealm.syncAccounts[account] and (module ~= "TradeSkillMaster" and not data.isSetup) then return end
if not TSM.db.realm.syncAccounts[account] and (module ~= "TradeSkillMaster" and not data.isSetup) then return end
private.callbacks[module](key, data, source)
end
@@ -83,7 +83,7 @@ end
function TSMAPI.Sync:GetAccountKey()
return TSM.db.factionrealm.accountKey
return TSM.db.realm.accountKey
end
function TSM:RegisterSyncCallback(module, callback)
@@ -147,7 +147,7 @@ end
function TSMAPI.Sync:BroadcastData(module, key, data)
for account, players in pairs(TSM.db.factionrealm.syncAccounts) do
for account, players in pairs(TSM.db.realm.syncAccounts) do
if account ~= TSMAPI.Sync:GetAccountKey() then
local sent
for player in pairs(players) do
@@ -173,7 +173,7 @@ end
function private:SendSetupData(target, isResponse, isSetup)
local data = {isResponse=isResponse, isSetup=isSetup, characters={}, accountKey=TSMAPI.Sync:GetAccountKey()}
for name in pairs(TSM.db.factionrealm.characters) do
for name in pairs(TSM.db.realm.characters) do
data.characters[name] = true
end
TSMAPI.Sync:SendData("TradeSkillMaster", "SETUP", data, target)
@@ -190,11 +190,11 @@ end
function TSM:SyncCallback(key, data, source)
if key == "SETUP" then
if (data.isSetup and strlower(source) ~= strlower(private.syncSetupTarget or "")) or (not data.isSetup and not TSM.db.factionrealm.syncAccounts[data.accountKey]) then
if (data.isSetup and strlower(source) ~= strlower(private.syncSetupTarget or "")) or (not data.isSetup and not TSM.db.realm.syncAccounts[data.accountKey]) then
return
end
TSMAPI:Verify(data.accountKey ~= TSMAPI.Sync:GetAccountKey(), "It appears that you've manually copied your saved variables between accounts which will cause TSM's automatic sync'ing to not work. You'll need to undo this, and/or delete the TradeSkillMaster, TSM_Crafting, and TSM_ItemTracker saved variables files on both accounts (with WoW closed) in order to fix this.")
TSM.db.factionrealm.syncAccounts[data.accountKey] = data.characters
TSM.db.realm.syncAccounts[data.accountKey] = data.characters
if data.isSetup then
TSMAPI:CloseFrame()
TSM:Printf(L["Setup account sync'ing with the account which '%s' is on."], source)
+3 -1
View File
@@ -55,7 +55,9 @@ local vendorItems = {
["item:39684:0:0:0:0:0:0"] = 9000,
["item:40533:0:0:0:0:0:0"] = 50000,
["item:44835:0:0:0:0:0:0"] = 10,
["item:44853:0:0:0:0:0:0"] = 25,
["item:52510:0:0:0:0:0:0"] = 30000,
["item:52511:0:0:0:0:0:0"] = 30000,
["item:8925:0:0:0:0:0:0"] = 500,
-- ["item:52188:0:0:0:0:0:0"] = 15000,
-- ["item:58274:0:0:0:0:0:0"] = 11000,
-- ["item:58278:0:0:0:0:0:0"] = 16000,
+8 -8
View File
@@ -169,9 +169,9 @@ function BankUI:getFrame(frameType)
bFrame:SetScript("OnMouseDown", bFrame.StartMoving)
bFrame:SetScript("OnMouseUp", function(...) bFrame.StopMovingOrSizing(...)
if bankType == "guild" then
TSM.db.factionrealm.bankUIGBankFramePosition = { bFrame:GetLeft(), bFrame:GetBottom() }
TSM.db.realm.bankUIGBankFramePosition = { bFrame:GetLeft(), bFrame:GetBottom() }
else
TSM.db.factionrealm.bankUIBankFramePosition = { bFrame:GetLeft(), bFrame:GetBottom() }
TSM.db.realm.bankUIBankFramePosition = { bFrame:GetLeft(), bFrame:GetBottom() }
end
end)
bFrame:SetMovable(true)
@@ -183,9 +183,9 @@ function BankUI:getFrame(frameType)
self:SetFrameLevel(0)
self:ClearAllPoints()
if bankType == "guild" then
self:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.factionrealm.bankUIGBankFramePosition))
self:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.realm.bankUIGBankFramePosition))
else
self:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.factionrealm.bankUIBankFramePosition))
self:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.realm.bankUIBankFramePosition))
end
end
@@ -270,9 +270,9 @@ end
function BankUI:resetPoints(container)
if bankType == "guild" then
container:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.factionrealm.bankUIGBankFramePosition))
container:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.realm.bankUIGBankFramePosition))
else
container:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.factionrealm.bankUIBankFramePosition))
container:SetPoint("BOTTOMLEFT", UIParent, unpack(TSM.db.realm.bankUIBankFramePosition))
end
end
@@ -337,8 +337,8 @@ function TSM:getBankTabs()
end
function TSM:ResetBankUIFramePosition()
TSM.db.factionrealm.bankUIGBankFramePosition = { 100, 300 }
TSM.db.factionrealm.bankUIBankFramePosition = { 100, 300 }
TSM.db.realm.bankUIGBankFramePosition = { 100, 300 }
TSM.db.realm.bankUIBankFramePosition = { 100, 300 }
if ui then
ui:Hide()
ui:Show()
+3 -3
View File
@@ -121,7 +121,7 @@ local savedDBDefaults = {
colorGroupName = true,
embeddedTooltip = true,
},
factionrealm = {
realm = {
accountKey = nil,
characters = {},
syncAccounts = {},
@@ -161,9 +161,9 @@ function TSM:OnInitialize()
TSM:RegisterModule()
-- create account key for multi-account syncing if necessary
TSM.db.factionrealm.accountKey = TSM.db.factionrealm.accountKey or (GetRealmName() .. random(time()))
TSM.db.realm.accountKey = TSM.db.realm.accountKey or (GetRealmName() .. random(time()))
-- add this character to the list of characters on this realm
TSM.db.factionrealm.characters[UnitName("player")] = true
TSM.db.realm.characters[UnitName("player")] = true
-- Initialize default design, and apply defaults for any missing DB values.
-- NOTE: We allow missing fonts (such as uninstalled SharedMedia fonts), and
+1 -1
View File
@@ -46,7 +46,7 @@ function TSMAPI:ShowStaticPopupDialog(name)
end
function TSMAPI:GetCharacters()
return CopyTable(TSM.db.factionrealm.characters)
return CopyTable(TSM.db.realm.characters)
end