Skip to content

Commit

Permalink
Bug fix and add class earch
Browse files Browse the repository at this point in the history
- Now can search by class name
- Bug fixed with searching
  • Loading branch information
skidsh committed Feb 13, 2021
1 parent 398efbe commit a168a15
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Favorites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,27 @@ local function FriendsList_UpdateFIX(forceUpdate)
return
end
local na = nil
local class = nil
if ( buttonType == FRIENDS_BUTTON_TYPE_BNET ) then
_, _, na, _, ca, _, _, _ = BNGetFriendInfo(id);
class = C_BattleNet.GetFriendAccountInfo(id).gameAccountInfo.className;
elseif ( buttonType == FRIENDS_BUTTON_TYPE_WOW ) then
na, _, _, _, _, _, _, _, _ = GetFriendInfo(id);
local info = C_FriendList.GetFriendInfoByIndex(id);
na = info.name;
class = info.className;
end
if (na and ca) and (not string.find(string.lower(na), string.lower(friendSearchValue)) and ca and not string.find(string.lower(ca), string.lower(friendSearchValue))) then
return
elseif (na and not ca) and (not string.find(string.lower(na), string.lower(friendSearchValue))) then
return
elseif (not na and ca) and (not string.find(string.lower(ca), string.lower(friendSearchValue))) then
return
if (class and (RAID_CLASS_COLORS[string.upper(friendSearchValue)] ~= nil)) then
if (not string.find(string.lower(class), string.lower(friendSearchValue))) then
return
end
else
if (na and ca) and (not string.find(string.lower(na), string.lower(friendSearchValue)) and ca and not string.find(string.lower(ca), string.lower(friendSearchValue))) then
return
elseif (na and not ca) and (not string.find(string.lower(na), string.lower(friendSearchValue))) then
return
elseif (not na and ca) and (not string.find(string.lower(ca), string.lower(friendSearchValue))) then
return
end
end
end
addButtonIndex = addButtonIndex + 1;
Expand Down

0 comments on commit a168a15

Please sign in to comment.