Skip to content

Commit

Permalink
ra opt on bf
Browse files Browse the repository at this point in the history
  • Loading branch information
tg123 committed May 11, 2020
1 parent 0f5cec5 commit fdc8f85
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function GUI:Init()
do
local bf = CreateFrame("Frame", nil, f)
bf:SetWidth(290)
bf:SetHeight(280)
bf:SetHeight(310)
bf:SetBackdrop({
bgFile = "Interface\\FrameGeneral\\UI-Background-Marble",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
Expand Down Expand Up @@ -625,6 +625,22 @@ function GUI:Init()
ensureone()
end

do
local b = CreateFrame("CheckButton", nil, bf, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", bf, 15, -230)

b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 1)
b.text:SetText("/RA")

b:SetScript("OnClick", function()
Database:SetConfig("bfusera", b:GetChecked())
end)
b:SetChecked(Database:GetConfigOrDefault("bfusera", true))

bf.usera = b
end

do
local ctx = nil

Expand Down Expand Up @@ -655,7 +671,7 @@ function GUI:Init()
end

local SendRaidMessage = function(text)
if UnitIsGroupLeader('player') or UnitIsGroupAssistant('player') then
if bf.usera:GetChecked() and (UnitIsGroupLeader('player') or UnitIsGroupAssistant('player')) then
SendChatMessage(text, "RAID_WARNING")
else
SendChatMessage(text, "RAID")
Expand Down

0 comments on commit fdc8f85

Please sign in to comment.