Skip to content

Commit

Permalink
9.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Urtgard committed Oct 16, 2020
1 parent cadc3da commit 0ca044c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addons:
- pandoc

script: curl -sO https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh
after_script: bash release.sh -g 8.3.0
after_script: bash release.sh -g 9.0.1

branches:
only:
Expand Down
21 changes: 14 additions & 7 deletions Options.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local WQA = WQAchievements
local L = WQA.L

-- Blizzard
local GetCurrencyInfo = C_CurrencyInfo.GetCurrencyInfo
local GetTitleForQuestID = C_QuestLog.GetTitleForQuestID

local optionsTimer
local start

Expand All @@ -17,6 +21,9 @@ local IDToExpansionID = {
}

local CurrencyIDList = {
[6] = {
824, -- Garrison Resources
},
[7] = {
1220, -- Order Resources
1226, -- Nethershard
Expand Down Expand Up @@ -912,9 +919,9 @@ function WQA:UpdateOptions()
for k,v in pairs(CurrencyIDList[i]) do
if not (type(v) == "table" and v.faction ~= self.faction) then
if type(v) == "table" then v = v.id end
args.currency.args[GetCurrencyInfo(v)] = {
args.currency.args[GetCurrencyInfo(v).name] = {
type = "toggle",
name = GetCurrencyInfo(v),
name = GetCurrencyInfo(v).name,
set = function(info, val)
WQA.db.profile.options.reward.currency[v] = val
end,
Expand Down Expand Up @@ -967,9 +974,9 @@ function WQA:UpdateOptions()
for k,v in pairs(self.EmissaryQuestIDList[i]) do
if not (type(v) == "table" and v.faction ~= self.faction) then
if type(v) == "table" then v = v.id end
args.emissary.args[C_QuestLog.GetQuestInfo(v) or tostring(v)] = {
args.emissary.args[GetTitleForQuestID(v) or tostring(v)] = {
type = "toggle",
name = C_QuestLog.GetQuestInfo(v) or tostring(v),
name = GetTitleForQuestID(v) or tostring(v),
set = function(info, val)
WQA.db.profile.options.emissary[v] = val
end,
Expand Down Expand Up @@ -1107,9 +1114,9 @@ function WQA:UpdateOptions()
for k,v in pairs(CurrencyIDList[i]) do
if not (type(v) == "table" and v.faction ~= self.faction) then
if type(v) == "table" then v = v.id end
args.currency.args[GetCurrencyInfo(v)] = {
args.currency.args[GetCurrencyInfo(v).name] = {
type = "toggle",
name = GetCurrencyInfo(v),
name = GetCurrencyInfo(v).name,
set = function(info, val)
WQA.db.profile.options.missionTable.reward.currency[v] = val
end,
Expand Down Expand Up @@ -1262,7 +1269,7 @@ function WQA:UpdateCustomQuests()
for id,object in pairs(data) do
args[tostring(id)] = {
type = "toggle",
name = GetQuestLink(id) or C_QuestLog.GetQuestInfo(id) or tostring(id),
name = GetQuestLink(id) or GetTitleForQuestID(id) or tostring(id),
width = "double",
set = function(info, val)
WQA.db.profile.custom.worldQuest[id] = val
Expand Down
26 changes: 14 additions & 12 deletions WQAchievements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ WQA.links = {}

-- Blizzard
local IsActive = C_TaskQuest.IsActive
local GetQuestTagInfo = C_QuestLog.GetQuestTagInfo
local GetQuestBountyInfoForMapID = C_QuestLog.GetBountiesForMapID
local GetTitleForQuestID = C_QuestLog.GetTitleForQuestID
local GetCurrencyLink = C_CurrencyInfo.GetCurrencyLink

-- Locales
local locale = GetLocale()
Expand Down Expand Up @@ -225,7 +229,7 @@ end
local function GetTaskLink(task)
if task.type == "WORLD_QUEST" then
-- if WQA.questPinList[task.id] or WQA.questFlagList[task.id] then
return GetQuestLink(task.id) or C_QuestLog.GetQuestInfo(task.id)
return GetQuestLink(task.id) or GetTitleForQuestID(task.id)
-- else
-- return GetQuestLink(task.id)
-- end
Expand Down Expand Up @@ -2009,10 +2013,8 @@ function WQA:UpdateQTip(tasks)
f(widget)
end
else
if IsWorldQuestHardWatched(id) or (IsWorldQuestWatched(id) and GetSuperTrackedQuestID() == id) then
BonusObjectiveTracker_UntrackWorldQuest(id)
else
BonusObjectiveTracker_TrackWorldQuest(id, true)
if not C_QuestLog.AddWorldQuestWatch(id, 1) then
C_QuestLog.RemoveWorldQuestWatch(id)
end
end
end
Expand Down Expand Up @@ -2267,7 +2269,7 @@ local function SortByExpansion(a,b)
end

local function GetQuestName(questID)
return C_TaskQuest.GetQuestInfoByQuestID(questID) or C_QuestLog.GetQuestInfo(questID) or select(3,string.find(GetQuestLink(questID) or "[unknown]", "%[(.+)%]"))
return C_TaskQuest.GetQuestInfoByQuestID(questID) or GetTitleForQuestID(questID) or select(3,string.find(GetQuestLink(questID) or "[unknown]", "%[(.+)%]"))
end

local function GetMissionName(missionID)
Expand Down Expand Up @@ -2362,8 +2364,8 @@ function WQA:EmissaryIsActive(questID)
end

local i = 1
while GetQuestLogTitle(i) do
local _,_,_,_,_,_,_, questLogQuestID = GetQuestLogTitle(i)
while C_QuestLog.GetInfo(i) do
local questLogQuestID = C_QuestLog.GetInfo(i).questID
if questLogQuestID == questID then
return true
end
Expand Down Expand Up @@ -2468,9 +2470,9 @@ function WQA:formatTime(t)
end

local LE_GARRISON_TYPE = {
[6] = LE_GARRISON_TYPE_6_0,
[7] = LE_GARRISON_TYPE_7_0,
[8] = LE_GARRISON_TYPE_8_0,
[6] = Enum.GarrisonType.Type_6_0,
[7] = Enum.GarrisonType.Type_7_0,
[8] = Enum.GarrisonType.Type_8_0,
}

function WQA:CheckMissions()
Expand All @@ -2483,7 +2485,7 @@ function WQA:CheckMissions()
local missions = C_Garrison.GetAvailableMissions(GetPrimaryGarrisonFollowerType(type))
-- Add Shipyard Missions
if i == 6 and C_Garrison.HasShipyard() then
for missionID,mission in ipairs(C_Garrison.GetAvailableMissions(LE_FOLLOWER_TYPE_SHIPYARD_6_2)) do
for missionID,mission in ipairs(C_Garrison.GetAvailableMissions(Enum.GarrisonFollowerType.FollowerType_6_2)) do
mission.followerType = LE_FOLLOWER_TYPE_SHIPYARD_6_2
missions[#missions + 1] = mission
end
Expand Down
2 changes: 1 addition & 1 deletion WQAchievements.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 80300
## Interface: 90001
## Title: WQAchievements
## Author: Urtgard
## Version: @project-version@
Expand Down

0 comments on commit 0ca044c

Please sign in to comment.