Skip to content

Commit

Permalink
Move around fills
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvanaar committed Aug 28, 2019
1 parent 640eaa8 commit 139e839
Showing 1 changed file with 56 additions and 52 deletions.
108 changes: 56 additions & 52 deletions modules/PlayerNames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,62 @@ Prat:AddModuleToLoad(function()
self:OnPlayerDataChanged()
end

--[[------------------------------------------------
Fill Functions
------------------------------------------------]] --

-- Use C_FriendList.GetNumWhoResults instead
local GetNumWhoResults = C_FriendList.GetNumWhoResults;

-- Use C_FriendList.GetWhoInfo instead
local function GetWhoInfo(index)
local info = C_FriendList.GetWhoInfo(index);
return info.fullName,
info.fullGuildName,
info.level,
info.raceStr,
info.classStr,
info.area,
info.filename,
info.gender;
end

-- Use C_FriendList.SendWho instead
local SendWho = C_FriendList.SendWho;

local function GetNumFriends()
return C_FriendList.GetNumFriends(),
C_FriendList.GetNumOnlineFriends();
end

-- Use C_FriendList.GetFriendInfo or C_FriendList.GetFriendInfoByIndex instead
local function GetFriendInfo(friend)
local info;
if type(friend) == "number" then
info = C_FriendList.GetFriendInfoByIndex(friend);
elseif type(friend) == "string" then
info = C_FriendList.GetFriendInfo(friend);
end

if info then
local chatFlag = "";
if info.dnd then
chatFlag = CHAT_FLAG_DND;
elseif info.afk then
chatFlag = CHAT_FLAG_AFK;
end
return info.name,
info.level,
info.className,
info.area,
info.connected,
chatFlag,
info.notes,
info.referAFriend,
info.guid;
end
end


--[[------------------------------------------------
Core Functions
Expand Down Expand Up @@ -599,58 +655,6 @@ Prat:AddModuleToLoad(function()
end


-- Use C_FriendList.GetNumWhoResults instead
local GetNumWhoResults = C_FriendList.GetNumWhoResults;

-- Use C_FriendList.GetWhoInfo instead
local function GetWhoInfo(index)
local info = C_FriendList.GetWhoInfo(index);
return info.fullName,
info.fullGuildName,
info.level,
info.raceStr,
info.classStr,
info.area,
info.filename,
info.gender;
end

-- Use C_FriendList.SendWho instead
local SendWho = C_FriendList.SendWho;

local function GetNumFriends()
return C_FriendList.GetNumFriends(),
C_FriendList.GetNumOnlineFriends();
end

-- Use C_FriendList.GetFriendInfo or C_FriendList.GetFriendInfoByIndex instead
local function GetFriendInfo(friend)
local info;
if type(friend) == "number" then
info = C_FriendList.GetFriendInfoByIndex(friend);
elseif type(friend) == "string" then
info = C_FriendList.GetFriendInfo(friend);
end

if info then
local chatFlag = "";
if info.dnd then
chatFlag = CHAT_FLAG_DND;
elseif info.afk then
chatFlag = CHAT_FLAG_AFK;
end
return info.name,
info.level,
info.className,
info.area,
info.connected,
chatFlag,
info.notes,
info.referAFriend,
info.guid;
end
end

function module:updateWho()
if self.wholib then return end

Expand Down

0 comments on commit 139e839

Please sign in to comment.