diff --git a/ElvUI_SLE/dev/commands.lua b/ElvUI_SLE/dev/commands.lua index 5df70d7..59c45f3 100755 --- a/ElvUI_SLE/dev/commands.lua +++ b/ElvUI_SLE/dev/commands.lua @@ -16,8 +16,11 @@ function E:sleTarget(tgt) end function E:sleSays(msg) -- /w Target /slesays {Target|ALL}#channel#message#whispertarget - --if not SLE:CheckFlag(nil, 'SLEAUTHOR') then return end - if not SLE:Auth() then return end + if not SLE:CheckFlag(nil, 'SLEAUTHOR') then + E:Print('You need to be authorized to use this command.') + return + end + --if not SLE:Auth() then return end if channel == 'WHISPER' and target == nil then E:Print('You need to set a whisper target.') return @@ -26,8 +29,8 @@ function E:sleSays(msg) -- /w Target /slesays {Target|ALL}#channel#message#whisp end function E:sleCommand(msg) -- /w Target /slecmd {Target|ALL}#script - --if not SLE:CheckFlag(nil, 'SLEAUTHOR') then return end - if not SLE:Auth() then return end + if not SLE:CheckFlag(nil, 'SLEAUTHOR') then return end + --if not SLE:Auth() then return end if channel == 'WHISPER' and target == nil then E:Print('You need to set a whisper target.') return @@ -47,9 +50,18 @@ end local function SendRecieve(self, event, prefix, message, channel, sender) if event == "CHAT_MSG_ADDON" then if sender == E.myname then return end - --if not SLE:CheckFlag(nil, 'SLEAUTHOR') then return end - if SLE:Auth() then return end - if (prefix == 'SLE_DEV_SAYS' or prefix == 'SLE_DEV_CMD') and (SLE:CrossAuth(sender) or SLE:Auth()) then + if SLE:CheckFlag(nil, 'SLEAUTHOR') then + print("CheckFlag nil sleauthor is true") + return + end + --if SLE:Auth() then return end + --if (prefix == 'SLE_DEV_SAYS' or prefix == 'SLE_DEV_CMD') and (SLE:CrossAuth(sender) or SLE:Auth()) then + if SLE:CheckFlag(sender, 'SLEAUTHOR') then + print("This check is true and the sender is: "..sender) + else + print("This check is false and the sender is: "..sender) + end + if (prefix == 'SLE_DEV_SAYS' or prefix == 'SLE_DEV_CMD') and not SLE:CheckFlag(sender, 'SLEAUTHOR') then if prefix == 'SLE_DEV_SAYS' then local user, channel, msg, sendTo = split("#", message) diff --git a/ElvUI_SLE/dev/elvprot.lua b/ElvUI_SLE/dev/elvprot.lua index 678ce77..356c439 100755 --- a/ElvUI_SLE/dev/elvprot.lua +++ b/ElvUI_SLE/dev/elvprot.lua @@ -1,60 +1,60 @@ -local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB -local SLE = E:GetModule('SLE'); -local find = string.find - -function E:IsFoolsDay() - if SLE:Auth() then E.global.aprilFools = true end - if find(date(), '04/01/') and not E.global.aprilFools then - return true; - else - return false; - end -end - -E.BeginFoolsDayEventSLE = E.BeginFoolsDayEvent -function E:BeginFoolsDayEvent() - E.BeginFoolsDayEventSLE(self) - tinsert(self.massiveShakeObjects, M1) - tinsert(self.massiveShakeObjects, M2) - tinsert(self.massiveShakeObjects, M3) - tinsert(self.massiveShakeObjects, M4) - tinsert(self.massiveShakeObjects, M5) - tinsert(self.massiveShakeObjects, M6) - tinsert(self.massiveShakeObjects, M7) - tinsert(self.massiveShakeObjects, M8) - for i=1, 5 do - if FseedButtons[i] then - for j = 1, #FseedButtons[i] do - tinsert(self.massiveShakeObjects, FseedButtons[i][j]) - end - end - end - for i = 1, #FtoolButtons do - tinsert(self.massiveShakeObjects, FtoolButtons[i]) - end - for i = 1, #FportalButtons do - tinsert(self.massiveShakeObjects, FportalButtons[i]) - end - tinsert(self.massiveShakeObjects, ConfigUIButton) - tinsert(self.massiveShakeObjects, ReloadUIButton) - tinsert(self.massiveShakeObjects, MoveUIButton) - tinsert(self.massiveShakeObjects, Bbutton) - tinsert(self.massiveShakeObjects, Abutton) - if Fbutton then tinsert(self.massiveShakeObjects, Fbutton) end - tinsert(self.massiveShakeObjects, DP_1) - tinsert(self.massiveShakeObjects, DP_2) - tinsert(self.massiveShakeObjects, DP_3) - tinsert(self.massiveShakeObjects, DP_4) - tinsert(self.massiveShakeObjects, DP_5) - tinsert(self.massiveShakeObjects, DP_6) - tinsert(self.massiveShakeObjects, Top_Center) - tinsert(self.massiveShakeObjects, Bottom_Panel) - tinsert(self.massiveShakeObjects, BottomBG) - tinsert(self.massiveShakeObjects, LeftBG) - tinsert(self.massiveShakeObjects, RightBG) - tinsert(self.massiveShakeObjects, ActionBG) - tinsert(self.massiveShakeObjects, RaidUtility_ShowButton) - tinsert(self.massiveShakeObjects, RaidUtilityPanel) -end - - +local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB +local SLE = E:GetModule('SLE'); +local find = string.find + +function E:IsFoolsDay() + if not SLE:CheckFlag(nil, 'SLEAUTHOR') then E.global.aprilFools = true end + if find(date(), '04/01/') and not E.global.aprilFools then + return true; + else + return false; + end +end + +E.BeginFoolsDayEventSLE = E.BeginFoolsDayEvent +function E:BeginFoolsDayEvent() + E.BeginFoolsDayEventSLE(self) + tinsert(self.massiveShakeObjects, M1) + tinsert(self.massiveShakeObjects, M2) + tinsert(self.massiveShakeObjects, M3) + tinsert(self.massiveShakeObjects, M4) + tinsert(self.massiveShakeObjects, M5) + tinsert(self.massiveShakeObjects, M6) + tinsert(self.massiveShakeObjects, M7) + tinsert(self.massiveShakeObjects, M8) + for i=1, 5 do + if FseedButtons[i] then + for j = 1, #FseedButtons[i] do + tinsert(self.massiveShakeObjects, FseedButtons[i][j]) + end + end + end + for i = 1, #FtoolButtons do + tinsert(self.massiveShakeObjects, FtoolButtons[i]) + end + for i = 1, #FportalButtons do + tinsert(self.massiveShakeObjects, FportalButtons[i]) + end + tinsert(self.massiveShakeObjects, ConfigUIButton) + tinsert(self.massiveShakeObjects, ReloadUIButton) + tinsert(self.massiveShakeObjects, MoveUIButton) + tinsert(self.massiveShakeObjects, Bbutton) + tinsert(self.massiveShakeObjects, Abutton) + if Fbutton then tinsert(self.massiveShakeObjects, Fbutton) end + tinsert(self.massiveShakeObjects, DP_1) + tinsert(self.massiveShakeObjects, DP_2) + tinsert(self.massiveShakeObjects, DP_3) + tinsert(self.massiveShakeObjects, DP_4) + tinsert(self.massiveShakeObjects, DP_5) + tinsert(self.massiveShakeObjects, DP_6) + tinsert(self.massiveShakeObjects, Top_Center) + tinsert(self.massiveShakeObjects, Bottom_Panel) + tinsert(self.massiveShakeObjects, BottomBG) + tinsert(self.massiveShakeObjects, LeftBG) + tinsert(self.massiveShakeObjects, RightBG) + tinsert(self.massiveShakeObjects, ActionBG) + tinsert(self.massiveShakeObjects, RaidUtility_ShowButton) + tinsert(self.massiveShakeObjects, RaidUtilityPanel) +end + + diff --git a/ElvUI_SLE/modules/chat/chat.lua b/ElvUI_SLE/modules/chat/chat.lua index 452c6dd..c168b49 100755 --- a/ElvUI_SLE/modules/chat/chat.lua +++ b/ElvUI_SLE/modules/chat/chat.lua @@ -81,12 +81,17 @@ local IconTable = { }, } ---[[ + function SLE:CheckFlag(sender, checkFlag) - local senderName, senderRealm = string.split('-', sender) - senderName = senderName or E.myname + local senderName, senderRealm + + if sender then + senderName, senderRealm = string.split('-', sender) + else + senderName = E.myname + end + senderRealm = senderRealm or E.myrealm - senderRealm = senderRealm:gsub(' ', '') if IconTable[senderRealm] and IconTable[senderRealm][senderName] then @@ -99,8 +104,8 @@ function SLE:CheckFlag(sender, checkFlag) return false end -]] +--[[ function SLE:Auth() local myRealm = E.myrealm local myName = E.myname @@ -146,7 +151,7 @@ function SLE:CrossAuth(sender) end return false end - +]] function CH:ChatEdit_AddHistory(editBox, line) if line:find("/rl") then return; end @@ -286,22 +291,21 @@ function CH:PositionChat(override) self.initialMove = true; end - ---[[ local function SLEfilter(self, event, message, author, arg3, arg4, arg5, arg6, ...) local returnTex = arg6 if(strlen(arg6) > 0) then - elseif CheckFlag(author) then + elseif SLE:CheckFlag(author) then returnTex = SLE:CheckFlag(author)..arg6 end return false, message, author, arg3, arg4, arg5, returnTex, ... end -]] + --Adding icons to specific toons' names --Filter +--[[ local function SLEfilter(self, event, message, author, arg3, arg4, arg5, arg6, ...) local returnTex = arg6 local myRealm = E.myrealm @@ -337,6 +341,7 @@ local function SLEfilter(self, event, message, author, arg3, arg4, arg5, arg6, . return false, message, author, arg3, arg4, arg5, returnTex, ... end +]] --Applying filter ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", SLEfilter) ChatFrame_AddMessageEventFilter("CHAT_MSG_YELL", SLEfilter)