You do not always need to filter events, and beside that you cannot even filter each event! The filters are helpers to prevent event callbacks firing each time for unneccessary circumstances, like if you only want to check yourself but the event fires for all units around you.
Some events do not even support filters as the Wiki describes, e.g. if there is no unitTag in the event's callback function parameters you cannot use any unitTag related event filters for it.
Same counts for displayname and I think there does not even exist and event filter stuff for displaynames -> check the event filter site at the wiki.
If the callback function of the event already provides a parameter like isLocalPlayer and it's true if YOU left the group, then just add the EVENT_MANAGER:RegisterForEvent... of the group_left and check in your callback function at the start if it's you who left, or others.
e.g. if only you are the relevant unit to check things with you can skip all others simply by:
Lua Code:
if not isLocalPlayer then return end
Lua Code:
function LGRI.OnAddOnLoaded(event, addonName)
if addonName ~= LGRI.name then return end
EM:UnregisterForEvent(LGRI.name, EVENT_ADD_ON_LOADED)
LargeGroupRoleIcons.Initialize()
EM:RegisterForEvent(LGRI.name .. "_EVENT_GROUP_MEMBER_ROLE_CHANGED", EVENT_GROUP_MEMBER_ROLE_CHANGED, LGRI.UpdateMyRole)
EM:AddFilterForEvent(LGRI.name .. "_EVENT_GROUP_MEMBER_ROLE_CHANGED", EVENT_GROUP_MEMBER_ROLE_CHANGED, REGISTER_FILTER_UNIT_TAG, "player") --carefull! You are missing the first parameter, the unique event name of your addon! That way the filters won't be applied! Event filters always need to use the unique SAME name as your RegsiterForEvent used where you want to apply the filter!!!
--number eventCode, string memberCharacterName, GroupLeaveReason reason, boolean isLocalPlayer, boolean isLeader, string memberDisplayName, boolean actionRequiredVote
EM:RegisterForEvent(LGRI.name .. "_EVENT_GROUP_MEMBER_LEFT", EVENT_GROUP_MEMBER_LEFT,
function(eventId, memberCharacterName, groupLeaveReason , isLocalPlayer, isLeader, memberDisplayName, actionRequiredVote)
if not isLocalPlayer then return end[
LGRI.UpdateMyRole()
end)
end