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
+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)