Skip to content

Commit

Permalink
Added an option to auto accept abandon quests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Jul 29, 2024
1 parent bca7cbc commit d0e6ae8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions WorldQuestTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ function WorldQuestTracker:OnInit()
DF.Language.SetCurrentLanguage(addonId, WQTrackerLanguage.language)
end

hooksecurefunc(_G, "StaticPopup_Show", function(token)
if (token == "ABANDON_QUEST") then
if (WorldQuestTracker.db.profile.close_blizz_popups.ABANDON_QUEST) then
---@diagnostic disable-next-line: undefined-global
StaticPopup1Button1:Click()
end
end
end)

WorldQuestTracker.InitAt = GetTime()
WorldQuestTracker.LastMapID = WorldQuestTracker.GetCurrentMapAreaID()

Expand Down
4 changes: 4 additions & 0 deletions WorldQuestTracker_Initialize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ do
minimap_track_color = {1, 1, 1},
},

close_blizz_popups = {
ABANDON_QUEST = false,
},

sort_order = {
[WQT_QUESTTYPE_REPUTATION] = 7,
[WQT_QUESTTYPE_TRADE] = 5,
Expand Down
11 changes: 11 additions & 0 deletions WorldQuestTracker_OptionsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,17 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
name = "S_MAPBAR_OPTIONSMENU_SOUNDENABLED",
desc = "S_MAPBAR_OPTIONSMENU_SOUNDENABLED",
},
{
type = "toggle",
get = function()
return DB.profile.close_blizz_popups.ABANDON_QUEST
end,
set = function(self, fixedparam, value)
DB.profile.close_blizz_popups.ABANDON_QUEST = value
end,
name = "S_OPTTIONS_AUTOACCEPT_ABANDONQUEST",
desc = "S_OPTTIONS_AUTOACCEPT_ABANDONQUEST_DESC",
},

{type = "blank"},

Expand Down
3 changes: 3 additions & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ local languageTable = DetailsFramework.Language.RegisterLanguage(addonId, "enUS"
local L = languageTable


L["S_OPTTIONS_AUTOACCEPT_ABANDONQUEST"] = "Auto Accept Abandon Quests"
L["S_OPTTIONS_AUTOACCEPT_ABANDONQUEST_DESC"] = "Don't show the confirmation dialog when abandoning a quest."

L["S_TRACKEROPTIONS_BACKGROUNDALPHA"] = "Background Alpha"

L["S_OPTTIONS_TAB_DRAGONRACE_SETTINGS"] = "Dragon Race"
Expand Down

0 comments on commit d0e6ae8

Please sign in to comment.