diff --git a/ElvUI_SLE/ElvUI_SLE.lua b/ElvUI_SLE/ElvUI_SLE.lua index 844f641..2aab872 100644 --- a/ElvUI_SLE/ElvUI_SLE.lua +++ b/ElvUI_SLE/ElvUI_SLE.lua @@ -11,7 +11,6 @@ function SLE:Initialize() print(L['SLE_LOGIN_MSG']) end E:GetModule('Chat'):SetTimer() --If called before Edit loaded from chat.lua will cause errors - E:GetModule('Chat'):SetChannelsCheck() --If called before Edit loaded from chat.lua will cause errors end --Updating things that must be updated only after everything loads diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua index bb525ef..551ae03 100644 --- a/ElvUI_SLE/config/profile.lua +++ b/ElvUI_SLE/config/profile.lua @@ -139,11 +139,8 @@ P['sle'] = { --Chat ['chat'] = { ['fade'] = false, - ['namehighlight'] = false, - ['sound'] = true, + ['sound'] = false, ['warningsound'] = "ElvUI Warning", - ['name1'] = "", - ['name2'] = "", }, --Unit Frames text formatting diff --git a/ElvUI_SLE/config/sle_global.lua b/ElvUI_SLE/config/sle_global.lua index c9d006d..d8768f3 100644 --- a/ElvUI_SLE/config/sle_global.lua +++ b/ElvUI_SLE/config/sle_global.lua @@ -1,20 +1,7 @@ local E, L, V, P, G = unpack(ElvUI); --Inport: Engine, Locales, ProfileDB, GlobalDB -V['namelist'] = {}; -V['channellist'] = {}; V['channelcheck'] = { - ['say'] = false, - ['yell'] = false, - ['party'] = true, - ['raid'] = true, - ['battleground'] = false, - ['guild'] = true, - ['officer'] = false, - ['general'] = false, - ['trade'] = false, - ['defense'] = false, - ['lfg'] = false, ['time'] = 3, } diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua index 0644b52..49e647b 100644 --- a/ElvUI_SLE/locales/english.lua +++ b/ElvUI_SLE/locales/english.lua @@ -183,34 +183,12 @@ L["Enable/Disable the text fading in the chat window."] = true L["Chat Editbox History"] = true L["Amount of messages to save. Set to 0 to disable."] = true L["Name Highlight"] = true -L["TOON_DESC"] = [=[The options for highlighting and sound warning if someone mentions your name in chat. -Names are stored character-based, so you can have different names lists on different characters. -Your current character's name will be on the list automaticaly.]=] +L["TOON_DESC"] = [=[Sound options for the ElvUI's keyword coloring feature.]=] L["Enable Sound"] = true -L["Play sound when your name is mentioned in chat."] = true -L["Sound that will play when your name is mentioned in chat."] = true +L["Play sound when keyword is mentioned in chat."] = true +L["Sound that will be played."] = true L["Timer"] = true L["Sound will be played only once in this number of seconds."] = true -L["Add Name"] = true -L["Add a name different from your current character's to be looked for"] = true -L["Invalid name entered!"] = true -L["Name already exists!"] = true -L["Names list"] = true -L["You can delete selected name from the list here by clicking the button below"] = true -L["Remove Name"] = true -L["Delete this name from the list"] = true -L["Channels"] = true -L["Enable/Disable checking of this channel."] = true -L["Defense"] = true -L["LFG"] = true -L["Add Channel"] = true -L["Invalid channel entered!"] = true -L["Channel already exists!"] = true -L["Add a custom channel name."] = true -L["Channels List"] = true -L["You can delete selected channel from the list here by clicking the button below"] = true -L["Remove Channel"] = true -L["Delete this channel from the list"] = true --------------- @@ -272,7 +250,6 @@ Swordyy - idea of ui buttons Azilroka@US-Daggerspine - core of ExtVendor and Altoholic skins Pat - skinning options dropdowns and checkboxes missed by Elv Boradan - the idea of classbar movement -Hydra - basic core of toon name highlight feature ]=] L["Other Support:"] = true L["ELVUI_SLE_MISC"] = [=[BuG - brining fun to the chat while i was writing this diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua index fbb2364..b8fed21 100644 --- a/ElvUI_SLE/locales/russian.lua +++ b/ElvUI_SLE/locales/russian.lua @@ -164,38 +164,18 @@ L['Show/Hide Skada backdrop.'] = "Показать/скрыть фон окон -------- --Chat-- -------- -L["Chat options"] = "Настройки чата" +L["Chat Options"] = "Настройки чата" L["Chat Fade"] = "Затухание чата" -L["Enable/disable the text fading in the chat window."] = "Включит/выключить постепенное исчезновение строк чата со временем." +L["Enable/Disable the text fading in the chat window."] = "Включит/выключить постепенное исчезновение строк чата со временем." L["Chat Editbox History"] = "История чата" L["Amount of messages to save. Set to 0 to disable."] = "Количество сообщений, введенных вами, которое будет сохранено между сеансами" L["Name Highlight"] = "Выделение имени" -L["TOON_DESC"] = [=[Опции подсветки и звукового предупреждения, если кто-то называет ваше имя в чате. -У каждого персонажа индивидуальное хранилище имен, так что вы можете иметь разные наборы на каждом из них. -Имя вашего текущего персонажа будет отслеживаться автоматически.]=] -L["Enable sound"] = "Включить звук" -L["Play sound when your name is mentioned in chat."] = "Проигрывать звук, когда ваше имя появляется в чате" -L["Sound that will play when your name is mentioned in chat."] = "Звук, который будет проигрываться, когда ваше имя появляется в чате" +L["TOON_DESC"] = [=[Опции звукового сопровождения окрашивания ключевых слов в ElvUI.]=] +L["Enable Sound"] = "Включить звук" +L["Play sound when keyword is mentioned in chat."] = "Проигрывать звук, когда в чате обнаруживается ключевое слово." +L["Sound that will be played."] = "Звук, который будет проигрываться." L['Timer'] = "Таймер" L['Sound will be played only once in this number of seconds.'] = "Звук будет проигрываться только единожды за установленный промежуток времени" -L["Add a name different from your current character's to be looked for"] = "Добавьте в список имя отличное от имени вашего текуущего персонажа для отслеживания в чате." -L['Invalid name entered!'] = "Неверное имя!" -L['Name already exists!'] = "Такое имя уже существует!" -L['Names list'] = "Список имен" -L["You can delete selected name from the list here by clicking the button below"] = "Здесь вы можете удалить выбранное имя из списка, нажав на кнопку ниже." -L["Delete this name from the list"] = "Удалить это имя из списка" -L["Channels"] = "Каналы" -L["Enable/disable checking of this channel."] = "Включить/выключить проверку этого канала" -L["Defense"] = "Оборона" -L['LFG'] = "Поиск спутников" -L['Add channel'] = "Добавить канал" -L['Invalid channel entered!'] = "Неверное имя канала!" -L['Channel already exists!'] = "Такой канал уже существует!" -L["Add a custom channel name."] = "Добавить имя пользовательского канала." -L['Channels list'] = "Список каналов" -L["You can delete selected channel from the list here by clicking the button below"] = "Здесь вы можете удалить выбранный канал из списка, нажав на кнопку ниже." -L["Remove Channel"] = "Удалить канал" -L["Delete this channel from the list"] = "Удалить этот канал из списка" --------------- --Backgrounds-- @@ -255,7 +235,6 @@ Swordyy - идея меню интерфейса Azilroka@US-Daggerspine - ядро скинов для ExtVendor и Altoholic Pat - скины меню и опций, пропущенных Элвом Boradan - идея перемещения полос класса -Hydra - базовый код функции подсветки имени ]] L['Other Support:'] = "Прочая поддержка:" L['ELVUI_SLE_MISC'] = [[BuG - веселье в чате, пока я писал это все diff --git a/ElvUI_SLE/modules/chat/chat.lua b/ElvUI_SLE/modules/chat/chat.lua index f99f7b1..fb157d3 100644 --- a/ElvUI_SLE/modules/chat/chat.lua +++ b/ElvUI_SLE/modules/chat/chat.lua @@ -39,63 +39,9 @@ function CH:ChatEdit_AddHistory(editBox, line) end end -------------------------------------------------------- --- Highlight your own name when someone mentions you --- Credit: Hydra --- Todo: Add some options for it later -------------------------------------------------------- -local string = string -local gsub = string.gsub -local strsub = string.sub -local strfind = string.find -local format = string.format -local strlower = string.lower -local Wrapper = "|cff71D5FF[%s]|r" -local MyName = gsub(UnitName("player"), "%u", strlower, 1) -local NameList ---Name list -function CH:NamesListUpdate() - local name - local names - NameList = {MyName} - names = {} - if E.private.namelist == nil then return end - for name in pairs(E.private.namelist) do - names[name] = name - table.insert(NameList, name) - end -end -CH:NamesListUpdate() - ---Channel list -local ChannelList -function CH:ChannelListUpdate() - local channel - local channels - ChannelList = {} - channels = {} - if E.private.channellist == nil then return end - for channel in pairs(E.private.channellist) do - channels[channel] = channel - table.insert(ChannelList, channel) - end -end -CH:ChannelListUpdate() - --- Finding our name in a URL breaks the hyperlink, so check & exclude them -local FindURL = function(msg) - local NewString, Found = gsub(msg, "(%a+)://(%S+)%s?", "%1://%2") - if Found > 0 then return NewString end - - NewString, Found = gsub(msg, "www%.([_A-Za-z0-9-]+)%.(%S+)%s?", "www.%1.%2") - if Found > 0 then return NewString end - - NewString, Found = gsub(msg, "([_A-Za-z0-9-%.]+)@([_A-Za-z0-9-]+)(%.+)([_A-Za-z0-9-%.]+)%s?", "%1@%2%3%4") - if Found > 0 then return NewString end -end - -local NormalCycleCount = 0 -local CustomCycleCount = 0 +-------------------------------- +--Sounds for Elv's name coloring +-------------------------------- local SoundPalyed = 0 function CH:SetTimer() if E.private.channelcheck.time == nil then @@ -103,90 +49,39 @@ function CH:SetTimer() end end ---For finding names in regular channels -local FindMyName = function(self, event, message, author, ...) - if not E.db.sle.chat.namehighlight then return end - local msg = strlower(message) - - for i = 1, #NameList do - local lowName = strlower(NameList[i]) - if strfind(msg, lowName) and lowName ~= "" then - local Start, Stop = string.find(msg, lowName) - local Name = strsub(message, Start, Stop) - local Link = FindURL(message) - if (not Link) or (Link and not strfind(Link, Name)) then - if E.db.sle.chat.sound then +function CH:CheckKeyword(message) + local replaceWords = {}; + + for i=1, #{string.split(' ', message)} do + local word = select(i, string.split(' ', message)); + if not word:find('|') then + for keyword, _ in pairs(CH.Keywords) do + if word:lower() == keyword:lower() then + replaceWords[word] = E.media.hexvaluecolor..word..'|r' + if E.db.sle.chat.sound then if SoundPalyed == 0 then --Check for sound played PlaySoundFile(LSM:Fetch("sound", E.db.sle.chat.warningsound)); SoundPalyed = 1 --Setting sound as played frame.SoundTimer = CH:ScheduleTimer('EnableSound', E.private.channelcheck.time) --Starting Timer end end - return false, gsub(message, Name, format(Wrapper, Name)), author, ... + end end end end -end - ---For finding names in custom channels -local CustomFindMyName = function(self, event, message, author, arg1, arg2, arg3, arg4, arg5, channelNum, channelName, ...) - if not E.db.sle.chat.namehighlight then return end - local msg = strlower(message) - - --Checking if the custom channel is one of Blizz's - if (channelNum == 1 and E.private.channelcheck.general) or (channelNum == 2 and E.private.channelcheck.trade) or (channelNum == 3 and E.private.channelcheck.defense) or (channelNum == 4 and E.private.channelcheck.lfg) then - for i = 1, #NameList do - local lowName = strlower(NameList[i]) - if strfind(msg, lowName) and lowName ~= "" then - local Start, Stop = string.find(msg, lowName) - local Name = strsub(message, Start, Stop) - local Link = FindURL(message) - - if (not Link) or (Link and not strfind(Link, Name)) then - if E.db.sle.chat.sound then - if SoundPalyed == 0 then - PlaySoundFile(LSM:Fetch("sound", E.db.sle.chat.warningsound)); - SoundPalyed = 1 - frame.SoundTimer = CH:ScheduleTimer('EnableSound', E.private.channelcheck.time) - end - end - return false, gsub(message, Name, format(Wrapper, Name)), author, arg1, arg2, arg3, arg4, arg5, channelNum, channelName, ... - end - end - end - else --if not then check custom channels list - local chanMatch = 0 - - if ChannelList == nil then return end - for i = 1, #ChannelList do - if channelName == ChannelList[i] then - chanMatch = 1 - end - end - - if chanMatch == 1 then - for i = 1, #NameList do - local lowName = strlower(NameList[i]) - if strfind(msg, lowName) and lowName ~= "" then - local Start, Stop = string.find(msg, lowName) - local Name = strsub(message, Start, Stop) - local Link = FindURL(message) - - if (not Link) or (Link and not strfind(Link, Name)) then - if E.db.sle.chat.sound then - if SoundPalyed == 0 then - PlaySoundFile(LSM:Fetch("sound", E.db.sle.chat.warningsound)); - SoundPalyed = 1 - frame.SoundTimer = CH:ScheduleTimer('EnableSound', E.private.channelcheck.time) - end - end - return false, gsub(message, Name, format(Wrapper, Name)), author, arg1, arg2, arg3, arg4, arg5, channelNum, channelName, ... - end - end - end + + for word, replaceWord in pairs(replaceWords) do + if message == word then + message = message:gsub(word, replaceWord) + elseif message:find(' '..word) then + message = message:gsub(' '..word, ' '..replaceWord) + elseif message:find(word..' ') then + message = message:gsub(word..' ', replaceWord..' ') end end + + return message end --Action at the end of timer @@ -194,52 +89,6 @@ function CH:EnableSound(frame) SoundPalyed = 0 end ---Checking which channel to search for toon's name -function CH:SetChannelsCheck() - if E.private.channelcheck.say then - ChatFrame_AddMessageEventFilter("CHAT_MSG_SAY", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_SAY", FindMyName) - end - if E.private.channelcheck.yell then - ChatFrame_AddMessageEventFilter("CHAT_MSG_YELL", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_YELL", FindMyName) - end - if E.private.channelcheck.party then - ChatFrame_AddMessageEventFilter("CHAT_MSG_PARTY", FindMyName) - ChatFrame_AddMessageEventFilter("CHAT_MSG_PARTY_LEADER", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_PARTY", FindMyName) - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_PARTY_LEADER", FindMyName) - end - if E.private.channelcheck.raid then - ChatFrame_AddMessageEventFilter("CHAT_MSG_RAID", FindMyName) - ChatFrame_AddMessageEventFilter("CHAT_MSG_RAID_LEADER", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_RAID", FindMyName) - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_RAID_LEADER", FindMyName) - end - if E.private.channelcheck.battleground then - ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND", FindMyName) - ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND_LEADER", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_BATTLEGROUND", FindMyName) - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_BATTLEGROUND_LEADER", FindMyName) - end - if E.private.channelcheck.guild then - ChatFrame_AddMessageEventFilter("CHAT_MSG_GUILD", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_GUILD", FindMyName) - end - if E.private.channelcheck.officer then - ChatFrame_AddMessageEventFilter("CHAT_MSG_OFFICER", FindMyName) - else - ChatFrame_RemoveMessageEventFilter("CHAT_MSG_OFFICER", FindMyName) - end - ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", CustomFindMyName) --Custom channels are always watched. their check is in other place -end - --Replacement of chat tab position and size function function CH:PositionChat(override) if (InCombatLockdown() and not override and self.initialMove) or (IsMouseButtonDown("LeftButton") and not override) then return end diff --git a/ElvUI_SLE/modules/chat/options.lua b/ElvUI_SLE/modules/chat/options.lua index 52bae50..47264d0 100644 --- a/ElvUI_SLE/modules/chat/options.lua +++ b/ElvUI_SLE/modules/chat/options.lua @@ -6,85 +6,6 @@ local selectedChannel local names local channels ---Options for selected name -local function UpdateName(reset) - if not selectedName or not E.private['namelist'][selectedName] or reset then - E.Options.args.nameplate.args.nameGroup = nil - if not reset then - return - end - end - - E.Options.args.sle.args.chat.args.nameGroup = { - type = 'group', - name = selectedName, - guiInline = true, - order = -10, - args = {}, - } - - E.Options.args.sle.args.chat.args.nameGroup.args.info = { - order = 1, - type = "description", - name = L["You can delete selected name from the list here by clicking the button below"], - } - - E.Options.args.sle.args.chat.args.nameGroup.args.delete = { - order = 2, - type = "execute", - name = L["Remove Name"], - desc = L["Delete this name from the list"], - func = function() CH:DeleteName() end, - } -end - ---Options for selected channel -local function UpdateChannel(reset) - if not selectedChannel or not E.private['channellist'][selectedChannel] or reset then - E.Options.args.nameplate.args.channelGroup = nil - if not reset then - return - end - end - - E.Options.args.sle.args.chat.args.channelGroup = { - type = 'group', - name = selectedChannel, - guiInline = true, - order = -20, - args = {}, - } - - E.Options.args.sle.args.chat.args.channelGroup.args.info = { - order = 1, - type = "description", - name = L["You can delete selected channel from the list here by clicking the button below"], - } - - E.Options.args.sle.args.chat.args.channelGroup.args.delete = { - order = 2, - type = "execute", - name = L["Remove Channel"], - desc = L["Delete this channel from the list"], - func = function() CH:DeleteChannel() end, - } -end - -function CH:DeleteName() - E.private['namelist'][selectedName] = nil - selectedName = nil; - E.Options.args.sle.args.chat.args.nameGroup = nil - UpdateName() - CH:NamesListUpdate() -end - -function CH:DeleteChannel() - E.private['channellist'][selectedChannel] = nil - selectedChannel = nil; - E.Options.args.sle.args.chat.args.channelGroup = nil - UpdateChannel() - CH:ChannelListUpdate() -end E.Options.args.sle.args.chat = { order = 8, @@ -132,19 +53,11 @@ E.Options.args.sle.args.chat = { type = "description", name = L["TOON_DESC"], }, - enable = { - order = 2, - type = "toggle", - name = L["Enable"], - get = function(info) return E.db.sle.chat.namehighlight end, - set = function(info, value) E.db.sle.chat.namehighlight = value; end - }, soundenable = { order = 3, type = "toggle", name = L["Enable Sound"], - desc = L["Play sound when your name is mentioned in chat."], - disabled = function() return not E.db.sle.chat.namehighlight end, + desc = L["Play sound when keyword is mentioned in chat."], get = function(info) return E.db.sle.chat.sound end, set = function(info, value) E.db.sle.chat.sound = value; end }, @@ -152,8 +65,8 @@ E.Options.args.sle.args.chat = { type = "select", dialogControl = 'LSM30_Sound', order = 4, name = L["Sound"], - desc = L["Sound that will play when your name is mentioned in chat."], - disabled = function() return not E.db.sle.chat.sound or not E.db.sle.chat.namehighlight end, + desc = L["Sound that will be played."], + disabled = function() return not E.db.sle.chat.sound end, values = AceGUIWidgetLSMlists.sound, get = function(info) return E.db.sle.chat.warningsound end, set = function(info, value) E.db.sle.chat.warningsound = value; end @@ -164,194 +77,10 @@ E.Options.args.sle.args.chat = { name = L["Timer"], desc = L["Sound will be played only once in this number of seconds."], min = 1, max = 20, step = 1, - disabled = function() return not E.db.sle.chat.sound or not E.db.sle.chat.namehighlight end, + disabled = function() return not E.db.sle.chat.sound end, get = function(info) return E.private.channelcheck.time end, set = function(info, value) E.private.channelcheck.time = value; end, }, - spacer1 = { - order = 6, - type = "description", - name = "", - }, - spacer2 = { - order = 7, - type = "description", - name = "", - }, - addName = { - type = 'input', - order = 8, - name = L["Add Name"], - desc = L["Add a name different from your current character's to be looked for"], - disabled = function() return not E.db.sle.chat.namehighlight end, - get = function(info) return "" end, - set = function(info, value) - if value:match("^%s*$") then - E:Print(L["Invalid name entered!"]) - return - elseif E.private['namelist'][value] then - E:Print(L["Name already exists!"]) - return end - - E.Options.args.sle.args.chat.args.nameGroup = nil - E.private['namelist'][value] = {}; - E.private['namelist'][value].enable = true - UpdateName() - CH:NamesListUpdate() - end, - }, - selectName = { - order = 9, - type = 'select', - name = L['Names list'], - get = function(info) return selectedName end, - set = function(info, value) selectedName = value; UpdateName(true) end, - disabled = function() return not E.db.sle.chat.namehighlight end, - values = function() - names = {} - for name in pairs(E.private.namelist) do - names[name] = name - end - return names - end, - }, - channels = { - order = 10, - type = "group", - name = L["Channels"], - guiInline = true, - disabled = function() return not E.db.sle.chat.namehighlight end, - args = { - say = { - order = 1, - type = "toggle", - name = SAY, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.say end, - set = function(info, value) E.private.channelcheck.say = value; CH:SetChannelsCheck() end, - }, - yell = { - order = 2, - type = "toggle", - name = YELL, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.yell end, - set = function(info, value) E.private.channelcheck.yell = value; CH:SetChannelsCheck() end, - }, - party = { - order = 3, - type = "toggle", - name = PARTY, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.party end, - set = function(info, value) E.private.channelcheck.party = value; CH:SetChannelsCheck() end, - }, - raid = { - order = 4, - type = "toggle", - name = RAID, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.raid end, - set = function(info, value) E.private.channelcheck.raid = value; CH:SetChannelsCheck() end, - }, - battleground = { - order = 5, - type = "toggle", - name = BATTLEGROUND, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.battleground end, - set = function(info, value) E.private.channelcheck.battleground = value; CH:SetChannelsCheck() end, - }, - guild = { - order = 6, - type = "toggle", - name = GUILD, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.guild end, - set = function(info, value) E.private.channelcheck.guild = value; CH:SetChannelsCheck() end, - }, - officer = { - order = 7, - type = "toggle", - name = OFFICER, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.officer end, - set = function(info, value) E.private.channelcheck.officer = value; CH:SetChannelsCheck() end, - }, - general = { - order = 8, - type = "toggle", - name = GENERAL, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.general end, - set = function(info, value) E.private.channelcheck.general = value; end, - }, - trade = { - order = 9, - type = "toggle", - name = TRADE, - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.trade end, - set = function(info, value) E.private.channelcheck.trade = value; end, - }, - defense = { - order = 10, - type = "toggle", - name = L["Defense"], - desc = L["Enable/Disable checking of this channel."], - get = function(info) return E.private.channelcheck.defense end, - set = function(info, value) E.private.channelcheck.defense = value; end, - }, - lfg = { - order = 11, - type = "toggle", - name = L["LFG"], - desc = L["Enable/disable checking of this channel."], - get = function(info) return E.private.channelcheck.lfg end, - set = function(info, value) E.private.channelcheck.lfg = value; end, - }, - spacer = { - order = 12, - type = "description", - name = "", - }, - addChannel = { - type = 'input', - order = 13, - name = L["Add Channel"], - desc = L["Add a custom channel name."], - get = function(info) return "" end, - set = function(info, value) - if value:match("^%s*$") then - E:Print(L["Invalid channel entered!"]) - return - elseif E.private['channellist'][value] then - E:Print(L["Channel already exists!"]) - return end - - E.Options.args.sle.args.chat.args.channelGroup = nil - E.private['channellist'][value] = {}; - E.private['channellist'][value].enable = true - UpdateChannel() - CH:ChannelListUpdate() - end, - }, - selectChannel = { - order = 14, - type = 'select', - name = L["Channels List"], - get = function(info) return selectedChannel end, - set = function(info, value) selectedChannel = value; UpdateChannel(true) end, - values = function() - channels = {} - for channel in pairs(E.private.channellist) do - channels[channel] = channel - end - return channels - end, - }, - }, - }, }, }, },