Add ClassicAPI loot history bridges

This commit is contained in:
2026-09-03 18:40:41 +02:00
parent 056514bc30
commit 24767ddd9a
+29
View File
@@ -103,6 +103,16 @@ API.merchantiteminfo = type(_G.C_MerchantFrame) == "table"
API.buybackitemid = type(_G.C_MerchantFrame) == "table"
and type(_G.C_MerchantFrame.GetBuybackItemID) == "function"
API.loothistory = API.classicapi_version >= 11202
and type(_G.C_LootHistory) == "table"
and type(_G.C_LootHistory.GetNumItems) == "function"
and type(_G.C_LootHistory.GetItem) == "function"
and type(_G.C_LootHistory.GetPlayerInfo) == "function"
API.loothistoryevents = API.loothistory and API.eventutils
and _G.C_EventUtils.IsEventValid("LOOT_HISTORY_ROLL_CHANGED")
and _G.C_EventUtils.IsEventValid("LOOT_HISTORY_ROLL_COMPLETE")
and _G.C_EventUtils.IsEventValid("LOOT_HISTORY_FULL_UPDATE")
API.overridebindings = type(_G.SetOverrideBindingClick) == "function"
and type(_G.ClearOverrideBindings) == "function"
@@ -517,6 +527,25 @@ API.GetBuybackItemID = function(index)
end
end
API.GetLootHistoryNumItems = function()
if API.loothistory then
return _G.C_LootHistory.GetNumItems()
end
return 0
end
API.GetLootHistoryItem = function(index)
if API.loothistory and index then
return _G.C_LootHistory.GetItem(index)
end
end
API.GetLootHistoryPlayerInfo = function(itemIndex, playerIndex)
if API.loothistory and itemIndex and playerIndex then
return _G.C_LootHistory.GetPlayerInfo(itemIndex, playerIndex)
end
end
API.GetMerchantItemID = function(index)
if type(_G.GetMerchantItemID) == "function" then
return _G.GetMerchantItemID(index)