Skip to content

Commit

Permalink
You can now toggle off automatically handing in quest items in AV and…
Browse files Browse the repository at this point in the history
… Ashran, closes #47
  • Loading branch information
funkydude committed Nov 2, 2022
1 parent 9d74ea8 commit be5f4b6
Show file tree
Hide file tree
Showing 20 changed files with 67 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,11 @@ function core:ADDON_LOADED(addon)
barOnShift = "SAY",
barOnControl = "INSTANCE_CHAT",
barOnAlt = "NONE",
autoTurnIn = true,
},
}
db = LibStub("AceDB-3.0"):New("CappingSettings", defaults, true)
CappingFrame.db = db
frame.db = db
do
local rl = function() ReloadUI() end
db.RegisterCallback(self, "OnProfileChanged", rl)
Expand Down
3 changes: 2 additions & 1 deletion Core_BCC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,11 @@ function core:ADDON_LOADED(addon)
barOnShift = "SAY",
barOnControl = "INSTANCE_CHAT",
barOnAlt = "NONE",
autoTurnIn = true,
},
}
db = LibStub("AceDB-3.0"):New("CappingSettings", defaults, true)
CappingFrame.db = db
frame.db = db
do
local rl = function() ReloadUI() end
db.RegisterCallback(self, "OnProfileChanged", rl)
Expand Down
3 changes: 2 additions & 1 deletion Core_Vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,11 @@ function core:ADDON_LOADED(addon)
barOnShift = "SAY",
barOnControl = "INSTANCE_CHAT",
barOnAlt = "NONE",
autoTurnIn = true,
},
}
db = LibStub("AceDB-3.0"):New("CappingSettings", defaults, true)
CappingFrame.db = db
frame.db = db
do
local rl = function() ReloadUI() end
db.RegisterCallback(self, "OnProfileChanged", rl)
Expand Down
3 changes: 2 additions & 1 deletion Core_Wrath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,11 @@ function core:ADDON_LOADED(addon)
barOnShift = "SAY",
barOnControl = "INSTANCE_CHAT",
barOnAlt = "NONE",
autoTurnIn = true,
},
}
db = LibStub("AceDB-3.0"):New("CappingSettings", defaults, true)
CappingFrame.db = db
frame.db = db
do
local rl = function() ReloadUI() end
db.RegisterCallback(self, "OnProfileChanged", rl)
Expand Down
8 changes: 6 additions & 2 deletions Modules/AlteracValley.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

local mod, L
local mod, L, cap
do
local _, core = ...
mod, L = core:NewMod()
mod, L, cap = core:NewMod()
end

do
local UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest = UnitGUID, strsplit, C_GossipInfo.GetNumActiveQuests, C_GossipInfo.SelectActiveQuest
local tonumber, GetGossipOptions, GetItemCount = tonumber, C_GossipInfo.GetOptions, GetItemCount
function mod:GOSSIP_SHOW()
if not cap.db.profile.autoTurnIn then return end

local target = UnitGUID("npc")
if target then
local _, _, _, _, _, id = strsplit("-", target)
Expand Down Expand Up @@ -94,6 +96,7 @@ do
end
local IsQuestCompletable, CompleteQuest = IsQuestCompletable, CompleteQuest
function mod:QUEST_PROGRESS()
if not cap.db.profile.autoTurnIn then return end
if IsQuestCompletable() then
CompleteQuest()
if not hasPrinted then
Expand All @@ -108,6 +111,7 @@ end
do
local GetQuestReward = GetQuestReward
function mod:QUEST_COMPLETE()
if not cap.db.profile.autoTurnIn then return end
GetQuestReward(0)
end
end
Expand Down
8 changes: 6 additions & 2 deletions Modules/AlteracValley_TBC.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@

local mod, L
local mod, L, cap
do
local _, core = ...
mod, L = core:NewMod()
mod, L, cap = core:NewMod()
end

local hasPrinted = false
do
local UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest = UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest
local tonumber, SelectGossipOption, GetGossipOptions, GetItemCount, SelectGossipAvailableQuest = tonumber, SelectGossipOption, GetGossipOptions, GetItemCount, SelectGossipAvailableQuest
function mod:GOSSIP_SHOW()
if not cap.db.profile.autoTurnIn then return end

local target = UnitGUID("npc")
if target then
local _, _, _, _, _, id = strsplit("-", target)
Expand Down Expand Up @@ -59,6 +61,7 @@ end
do
local IsQuestCompletable, CompleteQuest = IsQuestCompletable, CompleteQuest
function mod:QUEST_PROGRESS()
if not cap.db.profile.autoTurnIn then return end
self:GOSSIP_SHOW()
if IsQuestCompletable() then
CompleteQuest()
Expand All @@ -73,6 +76,7 @@ end
do
local GetQuestReward = GetQuestReward
function mod:QUEST_COMPLETE()
if not cap.db.profile.autoTurnIn then return end
GetQuestReward(0)
end
end
Expand Down
8 changes: 6 additions & 2 deletions Modules/AlteracValley_Vanilla.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@

local mod, L
local mod, L, cap
do
local _, core = ...
mod, L = core:NewMod()
mod, L, cap = core:NewMod()
end

local hasPrinted = false
do
local UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest = UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest
local tonumber, SelectGossipOption, GetGossipOptions, GetItemCount, SelectGossipAvailableQuest = tonumber, SelectGossipOption, GetGossipOptions, GetItemCount, SelectGossipAvailableQuest
function mod:GOSSIP_SHOW()
if not cap.db.profile.autoTurnIn then return end

local target = UnitGUID("npc")
if target then
local _, _, _, _, _, id = strsplit("-", target)
Expand Down Expand Up @@ -59,6 +61,7 @@ end
do
local IsQuestCompletable, CompleteQuest = IsQuestCompletable, CompleteQuest
function mod:QUEST_PROGRESS()
if not cap.db.profile.autoTurnIn then return end
self:GOSSIP_SHOW()
if IsQuestCompletable() then
CompleteQuest()
Expand All @@ -73,6 +76,7 @@ end
do
local GetQuestReward = GetQuestReward
function mod:QUEST_COMPLETE()
if not cap.db.profile.autoTurnIn then return end
GetQuestReward(0)
end
end
Expand Down
8 changes: 6 additions & 2 deletions Modules/AlteracValley_Wrath.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@

local mod, L
local mod, L, cap
do
local _, core = ...
mod, L = core:NewMod()
mod, L, cap = core:NewMod()
end

local hasPrinted = false
do
local UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest = UnitGUID, strsplit, GetNumGossipActiveQuests, SelectGossipActiveQuest
local tonumber, SelectGossipOption, GetGossipOptions, GetItemCount, SelectGossipAvailableQuest = tonumber, SelectGossipOption, GetGossipOptions, GetItemCount, SelectGossipAvailableQuest
function mod:GOSSIP_SHOW()
if not cap.db.profile.autoTurnIn then return end

local target = UnitGUID("npc")
if target then
local _, _, _, _, _, id = strsplit("-", target)
Expand Down Expand Up @@ -59,6 +61,7 @@ end
do
local IsQuestCompletable, CompleteQuest = IsQuestCompletable, CompleteQuest
function mod:QUEST_PROGRESS()
if not cap.db.profile.autoTurnIn then return end
self:GOSSIP_SHOW()
if IsQuestCompletable() then
CompleteQuest()
Expand All @@ -73,6 +76,7 @@ end
do
local GetQuestReward = GetQuestReward
function mod:QUEST_COMPLETE()
if not cap.db.profile.autoTurnIn then return end
GetQuestReward(0)
end
end
Expand Down
5 changes: 3 additions & 2 deletions Modules/Ashran.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

local mod, L
local mod, L, cap
do
local _, core = ...
mod, L = core:NewMod()
mod, L, cap = core:NewMod()
end

do
local GetCurrencyInfo = C_CurrencyInfo.GetCurrencyInfo
function mod:GOSSIP_SHOW()
if not cap.db.profile.autoTurnIn then return end
local alliance = self:GetGossipID(43063)
local horde = self:GetGossipID(52320)
if alliance or horde then
Expand Down
2 changes: 2 additions & 0 deletions Options/Locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ L.raidChat = "Gruppenchat"
L.clickableBars = "Klickbare Leisten"
L.loudQueue = "Laute Warteschlange"
L.loudQueueDesc = "Wenn die Warteschlange bereit ist, wird eine akustische Benachrichtigung, über den 'Haupt'-Tonkanal abgespielt."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ L.raidChat = "Group Chat"
L.clickableBars = "Clickable Bars"
L.loudQueue = "Loud Queue"
L.loudQueueDesc = "When the queue is ready the sound notification will be forced to play over the 'Master' sound channel."
L.autoTurnIn = "Auto Turn-In"
L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.barBackground = "Fondo de barra"
--L.clickableBars = "Clickable Bars"
--L.loudQueue = "Loud Queue"
--L.loudQueueDesc = "When the queue is ready the sound notification will be forced to play over the 'Master' sound channel."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.raidChat = "Channel du groupe"
L.clickableBars = "Barres cliquable"
L.loudQueue = "File d'attente bruyante"
L.loudQueueDesc = "Lorsque la file d'attente est prête, la notification sonore sera forcée de jouer sur le canal sonore «Principal»."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/itIT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.general = "General"
--L.clickableBars = "Clickable Bars"
--L.loudQueue = "Loud Queue"
--L.loudQueueDesc = "When the queue is ready the sound notification will be forced to play over the 'Master' sound channel."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.barBackground = "바 배경"
--L.clickableBars = "Clickable Bars"
--L.loudQueue = "Loud Queue"
--L.loudQueueDesc = "When the queue is ready the sound notification will be forced to play over the 'Master' sound channel."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.raidChat = "Bate-papo do Grupo"
L.clickableBars = "Barras Clicáveis"
L.loudQueue = "Alerta da Fila"
L.loudQueueDesc = "Quando a fila estiver pronta, a notificação de som será forçada a tocar no canal de som 'Mestre'."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.raidChat = "Группой чат"
L.clickableBars = "Полоски, реагирующие на клик"
L.loudQueue = "Звук очереди" -- loud, посмотреть на проде // spellcheck on live
L.loudQueueDesc = "Когда наступит очередь, звуковое оповещение будет принудительно направлено через основной звуковой канал" -- посмотреть на проде // spellcheck on live // "When the queue is ready the sound notification will be forced to play over the 'Master' sound channel."
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.raidChat ="Group/队伍团队 频道"
L.clickableBars ="可点击计时条"
L.loudQueue ="队列就绪音效"
L.loudQueueDesc ="当队列准备好时,主声道将强制播放音效通知。"
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
2 changes: 2 additions & 0 deletions Options/Locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ L.raidChat = "Group/隊伍頻道"
L.clickableBars = "可點擊計時條"
L.loudQueue = "隊列就緒提示音"
L.loudQueueDesc = "當隊列就緒時,使用主聲道播放提示音。"
--L.autoTurnIn = "Auto Turn-In"
--L.autoTurnInDesc = "Automatically turn in quest items in zones like Alterac Valley and Ashran."
12 changes: 12 additions & 0 deletions Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,18 @@ local options = function()
values = barClickOptions,
set = barClickSetOptions,
},
autoTurnInHeader = {
type = "header",
name = "",
order = 7,
},
autoTurnIn = {
type = "toggle",
name = L.autoTurnIn,
desc = L.autoTurnInDesc,
order = 8,
width = "full",
},
},
},
profiles = adbo:GetOptionsTable(cap.db),
Expand Down

0 comments on commit be5f4b6

Please sign in to comment.