diff --git a/Debug.lua b/Debug.lua index 81cf084..de2abfb 100644 --- a/Debug.lua +++ b/Debug.lua @@ -3,7 +3,7 @@ local Private, _, Namespace = {}, ... Namespace.Debug = {} --@debug@ Namespace.Debug.enabled = true -Namespace.Meta.version = '1.8.0-dev' +Namespace.Meta.version = '1.9.0-dev' --@end-debug@ local type, pairs, tostring, print, concat, select = type, pairs, tostring, print, table.concat, select diff --git a/Locales/deDE.lua b/Locales/deDE.lua index e12a8ff..68bcc67 100644 --- a/Locales/deDE.lua +++ b/Locales/deDE.lua @@ -77,6 +77,7 @@ L['Send Say (/s)'] = true L['Send Raid (/r)'] = true L['Automation'] = true L['Automatically Accept Role Selection'] = true +L['Auto Accept Role'] = true L['Accepts the pre-selected role when your group applies for a battleground'] = true L['Clear frame when exiting the battleground'] = true L['Removes the instructions from the last battleground'] = true diff --git a/Locales/enUS.lua b/Locales/enUS.lua index fae7802..79cdc17 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -76,6 +76,7 @@ L['Send Say (/s)'] = true L['Send Raid (/r)'] = true L['Automation'] = true L['Automatically Accept Role Selection'] = true +L['Auto Accept Role'] = true L['Accepts the pre-selected role when your group applies for a battleground'] = true L['Clear frame when exiting the battleground'] = true L['Removes the instructions from the last battleground'] = true diff --git a/Locales/ruRU.lua b/Locales/ruRU.lua index 564f126..48ccb17 100644 --- a/Locales/ruRU.lua +++ b/Locales/ruRU.lua @@ -77,6 +77,7 @@ L['Send Say (/s)'] = true L['Send Raid (/r)'] = true L['Automation'] = true L['Automatically Accept Role Selection'] = true +L['Auto Accept Role'] = true L['Accepts the pre-selected role when your group applies for a battleground'] = true L['Clear frame when exiting the battleground'] = true L['Removes the instructions from the last battleground'] = true diff --git a/QueueTools.lua b/QueueTools.lua index c044971..ea1252e 100644 --- a/QueueTools.lua +++ b/QueueTools.lua @@ -377,8 +377,7 @@ function Private.UpdateQueueFrameVisibility(newVisibility) end function Private.InitializeBattlegroundModeCheckbox() - local PVPUIFrame = _G.PVPUIFrame - local checkbox = CreateFrame('CheckButton', 'BgcBattlegroundModeCheckbox', PVPUIFrame, 'UICheckButtonTemplate') + local checkbox = CreateFrame('CheckButton', 'BgcBattlegroundModeCheckbox', _G.PVPUIFrame, 'UICheckButtonTemplate') checkbox:SetPoint('BOTTOMRIGHT', _G.PVEFrame, 'BOTTOMRIGHT', -2, 2) checkbox:SetSize(24, 24) checkbox:SetChecked(Namespace.Database.profile.QueueTools.showGroupQueueFrame) @@ -402,7 +401,7 @@ function Private.InitializeBattlegroundModeCheckbox() end) checkbox:Show() - PVPUIFrame.BattlegroundModeCheckbox = checkbox + _G.PVPUIFrame.BattlegroundModeCheckbox = checkbox local text = checkbox:CreateFontString(nil, 'ARTWORK', 'GameFontNormal') text:SetText(L['Group Info']) @@ -412,6 +411,31 @@ function Private.InitializeBattlegroundModeCheckbox() checkbox.Text = text end +function Private.InitializeAutoQueueCheckbox() + local checkbox = CreateFrame('CheckButton', 'BgcAutoQueueCheckbox', _G.HonorFrame.TankIcon, 'UICheckButtonTemplate') + checkbox:SetPoint('BOTTOMLEFT', _G.HonorFrame.TankIcon, 'TOPLEFT', -5, 8) + checkbox:SetSize(24, 24) + checkbox:SetChecked(Module:GetAutomationSetting('acceptRoleSelection')) + checkbox:SetScript('OnEnter', function (self) + local tooltip = _G.GameTooltip + tooltip:SetOwner(self, 'ANCHOR_RIGHT') + tooltip:SetText(L['Accepts the pre-selected role when your group applies for a battleground'], nil, nil, nil, nil, true) + tooltip:Show() + end) + checkbox:SetScript('OnLeave', function () _G.GameTooltip:Hide() end) + checkbox:SetScript('OnClick', function (self) Module:SetAutomationSetting('acceptRoleSelection', self:GetChecked()) end) + checkbox:Show() + + _G.HonorFrame.TankIcon.AutoQueueCheckbox = checkbox + + local text = checkbox:CreateFontString(nil, 'ARTWORK', 'GameFontNormal') + text:SetText(L['Auto Accept Role']) + text:SetPoint('LEFT', checkbox, 'RIGHT', 3, 0) + text:SetWordWrap(false) + + checkbox.Text = text +end + function Private.ProcessSyncData(payload, data) local time = GetTime() -- renamed after 1.4.0, remove "remaining" index in the future @@ -946,6 +970,7 @@ end function Module:ADDON_LOADED(_, addonName) if addonName == 'Blizzard_PVPUI' then + Private.InitializeAutoQueueCheckbox() Private.InitializeBattlegroundModeCheckbox() Private.InitializeGroupQueueFrame() _G.PVPUIFrame:HookScript('OnShow', function () @@ -968,6 +993,9 @@ function Module:SetAutomationSetting(setting, value) if setting == 'acceptRoleSelection' and value ~= Automation[setting] then -- notify through sync data when this setting changed Automation[setting] = value + if _G.BgcAutoQueueCheckbox then + _G.BgcAutoQueueCheckbox:SetChecked(value) + end return Private.ScheduleSendSyncData() end