Skip to content

Commit

Permalink
Core: Backport POI and gossip API changes for vanilla, closes #141
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Aug 27, 2023
1 parent 71be0d6 commit d909c44
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
40 changes: 39 additions & 1 deletion Core_BCC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ do
end

do
local GetPOITextureCoords = C_Minimap.GetPOITextureCoords
-- Easy world map icon checker
--local start = function(self) self:StartMoving() end
--local stop = function(self) self:StopMovingOrSizing() end
Expand Down Expand Up @@ -641,7 +642,6 @@ do
[219] = "colorHorde",
}
local atlasColors = nil
local GetPOITextureCoords = GetPOITextureCoords
local capTime = 0
local curMapID = 0
local curMod = nil
Expand Down Expand Up @@ -786,6 +786,44 @@ do
end
end

do
local GetOptions = C_GossipInfo.GetOptions
local SelectOption = C_GossipInfo.SelectOption
function API:GetGossipNumOptions()
local gossipOptions = GetOptions()
return #gossipOptions
end
function API:GetGossipID(id)
local gossipOptions = GetOptions()
for i = 1, #gossipOptions do
local gossipTable = gossipOptions[i]
if gossipTable.gossipOptionID == id then
return true
end
end
end
function API:SelectGossipID(id)
SelectOption(id)
end
end

do
local GetAvailableQuests = C_GossipInfo.GetAvailableQuests
local SelectAvailableQuest = C_GossipInfo.SelectAvailableQuest
function API:GetGossipAvailableQuestID(id)
local gossipOptions = GetAvailableQuests()
for i = 1, #gossipOptions do
local gossipTable = gossipOptions[i]
if gossipTable.questID == id then
return true
end
end
end
function API:SelectGossipAvailableQuestID(id)
SelectAvailableQuest(id)
end
end

function mod:NewMod()
local t = {}
for k,v in next, API do
Expand Down
40 changes: 39 additions & 1 deletion Core_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ do
end

do
local GetPOITextureCoords = C_Minimap.GetPOITextureCoords
-- Easy world map icon checker
--local start = function(self) self:StartMoving() end
--local stop = function(self) self:StopMovingOrSizing() end
Expand Down Expand Up @@ -641,7 +642,6 @@ do
[219] = "colorHorde",
}
local atlasColors = nil
local GetPOITextureCoords = GetPOITextureCoords
local capTime = 0
local curMapID = 0
local curMod = nil
Expand Down Expand Up @@ -780,6 +780,44 @@ do
end
end

do
local GetOptions = C_GossipInfo.GetOptions
local SelectOption = C_GossipInfo.SelectOption
function API:GetGossipNumOptions()
local gossipOptions = GetOptions()
return #gossipOptions
end
function API:GetGossipID(id)
local gossipOptions = GetOptions()
for i = 1, #gossipOptions do
local gossipTable = gossipOptions[i]
if gossipTable.gossipOptionID == id then
return true
end
end
end
function API:SelectGossipID(id)
SelectOption(id)
end
end

do
local GetAvailableQuests = C_GossipInfo.GetAvailableQuests
local SelectAvailableQuest = C_GossipInfo.SelectAvailableQuest
function API:GetGossipAvailableQuestID(id)
local gossipOptions = GetAvailableQuests()
for i = 1, #gossipOptions do
local gossipTable = gossipOptions[i]
if gossipTable.questID == id then
return true
end
end
end
function API:SelectGossipAvailableQuestID(id)
SelectAvailableQuest(id)
end
end

function mod:NewMod()
local t = {}
for k,v in next, API do
Expand Down

0 comments on commit d909c44

Please sign in to comment.