Skip to content

Commit

Permalink
Update Commands.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
eltreum0 committed Feb 19, 2022
1 parent e3a41bd commit 32995a9
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions ElvUI_EltreumUI/Core/Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ function ElvUI_EltreumUI:LoadCommands()
if E.db.ElvUI_EltreumUI.waytext.enable then
self:RegisterChatCommand('way', 'WaypointTexttoCoordinate')
self:RegisterChatCommand('waypoint', 'WaypointTexttoCoordinate')
self:RegisterChatCommand('!key', 'Keys')
self:RegisterChatCommand('!keys', 'Keys')
if E.Retail then
self:RegisterChatCommand('!key', 'Keys')
self:RegisterChatCommand('!keys', 'Keys')
end
end
end
end
Expand Down Expand Up @@ -98,7 +100,9 @@ local keys = {
}

function ElvUI_EltreumUI:Keys(event,message)
if IsInGroup() == false then
if E.TBC or E.Classic then
return
elseif IsInGroup() == false then
return
elseif message == nil then
return
Expand Down Expand Up @@ -143,11 +147,13 @@ function ElvUI_EltreumUI:Keys(event,message)
end

--frame to update using events
local keyframe = CreateFrame("FRAME")
keyframe:RegisterEvent("BAG_UPDATE_DELAYED")
keyframe:RegisterEvent("CHAT_MSG_GUILD")
keyframe:RegisterEvent("CHAT_MSG_PARTY_LEADER")
keyframe:RegisterEvent("CHAT_MSG_PARTY")
keyframe:SetScript("OnEvent", function(_,event, message)
ElvUI_EltreumUI:Keys(event, message)
end)
if E.Retail then
local keyframe = CreateFrame("FRAME")
keyframe:RegisterEvent("BAG_UPDATE_DELAYED")
keyframe:RegisterEvent("CHAT_MSG_GUILD")
keyframe:RegisterEvent("CHAT_MSG_PARTY_LEADER")
keyframe:RegisterEvent("CHAT_MSG_PARTY")
keyframe:SetScript("OnEvent", function(_,event, message)
ElvUI_EltreumUI:Keys(event, message)
end)
end

0 comments on commit 32995a9

Please sign in to comment.