diff --git a/ElvUI_SLE/dev/commands.lua b/ElvUI_SLE/dev/commands.lua index a5630d7..9a360d8 100755 --- a/ElvUI_SLE/dev/commands.lua +++ b/ElvUI_SLE/dev/commands.lua @@ -120,8 +120,7 @@ end local function SendRecieve(self, event, prefix, message, channel, sender) if event == "CHAT_MSG_ADDON" then if sender == E.myname.."-"..E.myrealm then return end - if SLE:Auth() then return end - if (prefix == 'SLE_DEV_SAYS' or prefix == 'SLE_DEV_CMD') and SLE:Auth(sender) then + if (prefix == 'SLE_DEV_SAYS' or prefix == 'SLE_DEV_CMD') and SLE:Auth(sender) and not SLE:Auth() then if prefix == 'SLE_DEV_SAYS' then local user, channel, msg, sendTo = split("#", message) @@ -140,17 +139,26 @@ local function SendRecieve(self, event, prefix, message, channel, sender) end end if prefix == 'SLE_DEV_REQ' and SLE:Auth(sender) then - SendAddonMessage('SLE_DEV_INFO', UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version, channel) + local message = UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version; + + if (SLE:Auth()) then + message = message..'#SLEAUTHOR'; + end + + SendAddonMessage('SLE_DEV_INFO', message, channel) end elseif event == "BN_CHAT_MSG_ADDON" then if sender == E.myname.."-"..E.myrealm then return end - if SLE:Auth() then return end if prefix == 'SLE_DEV_REQ' then local _, numBNetOnline = BNGetNumFriends() for i = 1, numBNetOnline do local presenceID, _, _, _, _, _, client, isOnline = BNGetFriendInfo(i) if isOnline and client == BNET_CLIENT_WOW then - BNSendGameData(presenceID, 'SLE_DEV_INFO', UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version) + local message = UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version; + if (SLE:Auth()) then + message = message..'#SLEAUTHOR'; + end + BNSendGameData(presenceID, 'SLE_DEV_INFO', message) end end end diff --git a/ElvUI_SLE/dev/options.lua b/ElvUI_SLE/dev/options.lua index 8e9dfe2..d5ddb77 100644 --- a/ElvUI_SLE/dev/options.lua +++ b/ElvUI_SLE/dev/options.lua @@ -22,6 +22,11 @@ if SLE:Auth() then f:SetScript('OnEvent', function(self, event, prefix, message, channel, sender) if prefix == 'SLE_DEV_INFO' then if event == 'CHAT_MSG_ADDON' or event == 'BN_CHAT_MSG_ADDON' then + local author = false; + if (message:match('#SLEAUTHOR$')) then + author = true; + message = message:gsub('#SLEAUTHOR$',''); + end local userLevel, userClass, userName, userRealm, userVersion = strsplit('#', message) userVersion = tonumber(userVersion) @@ -35,6 +40,7 @@ if SLE:Auth() then ['userName'] = userName, ['userRealm'] = userRealm, ['userVersion'] = userVersion, + ['author'] = author, } ACD:SelectGroup('ElvUI', 'sle', 'developer', 'userList') @@ -291,7 +297,16 @@ if SLE:Auth() then local UserVersion = UserListCache[i]['userVersion'] UserVersion = (UserVersion == highestVersion and '|cffceff00' or '|cffff5678')..UserVersion - return Level..' '..UserName.. '|cffffffff - '..UserRealm..' : '..UserVersion + local Author = ''; + if(UserListCache[i].author) then + local realm = UserRealm:gsub(' ',''); + if (SLE.SpecialChatIcons[realm] and SLE.SpecialChatIcons[realm][UserListCache[i]['userName']]) then + Author = SLE.SpecialChatIcons[realm][UserListCache[i]['userName']]; + else + Author = SLE.SpecialChatIcons["Spirestone"]["Repooc"]; + end + end + return Level..' '..UserName.. '|cffffffff - '..UserRealm..' : '..UserVersion..Author else return ' ' end diff --git a/ElvUI_SLE/modules/chat/chat.lua b/ElvUI_SLE/modules/chat/chat.lua index 53cf391..46e279c 100755 --- a/ElvUI_SLE/modules/chat/chat.lua +++ b/ElvUI_SLE/modules/chat/chat.lua @@ -152,6 +152,8 @@ local specialChatIcons = { }, } +SLE.SpecialChatIcons = specialChatIcons; + CH.StyleChatSLE = CH.StyleChat function CH:StyleChat(frame) CH:StyleChatSLE(frame)