Skip to content

Commit

Permalink
add lfg and bg queue checks to busy status
Browse files Browse the repository at this point in the history
options panel is now standalone (can still be found in Blizzard option as well)
  • Loading branch information
Road-block committed Mar 21, 2022
1 parent 047bd24 commit 9dcdf82
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Adherent-BCC.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Author: Roadblock
## Title: Adherent
## Notes: Adherent lets you define rules for auto accepting follow, group join and group invite requests.
## Version: 1.1.1
## Version: 1.1.2
## X-Alpha:
## X-Website: https://github.com/Road-block/Adherent/releases/latest
## OptionalDeps: Ace3
Expand Down
2 changes: 1 addition & 1 deletion Adherent.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Author: Roadblock
## Title: Adherent
## Notes: Adherent lets you define rules for auto accepting follow, group join and group invite requests.
## Version: 1.1.1
## Version: 1.1.2
## X-Alpha:
## X-Website: https://github.com/Road-block/Adherent/releases/latest
## OptionalDeps: Ace3
Expand Down
8 changes: 4 additions & 4 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ if not L then return end
L["Hide from Minimap"] = true
L["Hide addon Minimap Button."] = true
L["Not when busy"] = true
L["%s will not interrupt Trade/Mail/Auction/Bank/Professions"] = true
L["%s will not interrupt Trade/Mail/Auction/Bank/Professions/Queues"] = true
L["Not in Combat"] = true
L["%s will not automate when you are in Combat"] = true
L["Not in Instances"] = true
L["%s will not automate when you are in an Instance"] = true
L["%s will not automate when you are in a PvE Instance"] = true
L["Can't comply due to \'%s\' option"] = true
L["Echo %s actions"] = true
L["Print %s actions to your chatframe"] = true
Expand Down Expand Up @@ -63,10 +63,10 @@ if not L then return end
L["Remove keywords from Custom Keywords"] = true
L["Keywords monitored by %s"] = true
L["Who can command %s?"] = true
L["%s will listen to.."] = true
L["%s will listen to"] = true
L["Only Custom"] = true
L["Only react to |cffffff00custom|r keywords (ignore |cffdcdcdcdefaults|r)"] = true
L["Auto accept Group Invites from.."] = true
L["Auto accept Group Invites from"] = true
L["Player Tooltip Hint"] = true
L["Indicate known %s in player tooltips with an icon after their Name|T%s:15|t"] = true
L["Inform Initiator"] = true
Expand Down
39 changes: 29 additions & 10 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function adherent:options()
},
where = {
type = "group",
name = format(L["%s will listen to.."],addonName),
name = format(L["%s will listen to"],addonName),
inline = true,
order = 2,
args = { },
Expand All @@ -207,7 +207,7 @@ function adherent:options()
args = {
who = {
type = "group",
name = L["Auto accept Group Invites from.."],
name = L["Auto accept Group Invites from"],
inline = true,
order = 1,
args = { },
Expand All @@ -229,7 +229,7 @@ function adherent:options()
},
where = {
type = "group",
name = format(L["%s will listen to.."],addonName),
name = format(L["%s will listen to"],addonName),
inline = true,
order = 2,
args = { },
Expand Down Expand Up @@ -294,7 +294,7 @@ function adherent:options()
self._options.args.general.args.settings.args["notinstance"] = {
type = "toggle",
name = L["Not in Instances"],
desc = format(L["%s will not automate when you are in an Instance"], addonName),
desc = format(L["%s will not automate when you are in a PvE Instance"], addonName),
order = 12,
get = function() return adherent.db.char.notinstance end,
set = function(info, val)
Expand All @@ -304,7 +304,7 @@ function adherent:options()
self._options.args.general.args.settings.args["notbusy"] = {
type = "toggle",
name = L["Not when busy"],
desc = format(L["%s will not interrupt Trade/Mail/Auction/Bank/Professions"], addonName),
desc = format(L["%s will not interrupt Trade/Mail/Auction/Bank/Professions/Queues"], addonName),
order = 13,
get = function() return adherent.db.char.notbusy end,
set = function(info, val)
Expand Down Expand Up @@ -1176,11 +1176,16 @@ function adherent:deferredInit(guildname)
end

function adherent:showOptions()
--[[InterfaceOptionsFrame_OpenToCategory(adherent.blizzoptions)
self:ScheduleTimer("ScrollToCategory",1,addonName,1)
self:ScheduleTimer(function()
InterfaceOptionsFrame_OpenToCategory(adherent.blizzoptions)
self:ScheduleTimer("ScrollToCategory",1,addonName,1)
self:ScheduleTimer(function()
InterfaceOptionsFrame_OpenToCategory(adherent.blizzoptions)
end,1)
end,1)]]
if ACD.OpenFrames[addonName] then
ACD:Close(addonName)
else
ACD:Open(addonName,"general")
end
end

function adherent:debugPrint(msg,onlyWhenDebug)
Expand Down Expand Up @@ -1531,13 +1536,27 @@ function adherent:group(unit)
end
end

local bg_queued = function()
for i=1, MAX_BATTLEFIELD_QUEUES do
local status = GetBattlefieldStatus(i)
if status and (status == "queued" or status == "confirm") then
return true
end
end
return false
end
function adherent:busy()
local _, _, _, _, _, tradeskillChannel = UnitChannelInfo("player")
local _, _, _, _, _, tradeskillCast = UnitCastingInfo("player")
local crafting = (_G.TradeSkillFrame and _G.TradeSkillFrame:IsVisible()) or (_G.CraftFrame and _G.CraftFrame:IsVisible())
local professions = crafting or tradeskillChannel or tradeskillCast
local interacting = UnitName("npc")
local lfgqueue = _G.C_LFGList and _G.C_LFGList.HasActiveEntryInfo()
local bgqueue = bg_queued()
local in_queue = lfgqueue or bgqueue
local wouldleave = _G.WillAcceptInviteRemoveQueues()
local dnd = UnitIsDND("player")
if interacting or crafting or tradeskillChannel or tradeskillCast or dnd then
if interacting or professions or in_queue or wouldleave or dnd then
return true
end
return false
Expand Down

0 comments on commit 9dcdf82

Please sign in to comment.