Quantcast
Download
(2 Kb)
Download
Updated: 10/18/20 03:24 PM
Compatibility:
Stonethorn (6.1.5)
Updated:10/18/20 03:24 PM
Created:10/13/20 02:19 PM
Monthly downloads:1,730
Total downloads:1,748
Favorites:1
MD5:
6.1.5
LibCharacter
Version: 0.0.5
by: zelenin [More]
Library for getting characters data

Usage:

Install dependency:

Add dependency to manifest:
Code:
## DependsOn: LibCharacter
Code:
-- add characters from current server to your addon
for _, character in ipairs(LibCharacter:GetServerCharacters()) do
    self.sv.characters[character.id] = character.name
end
-- remove deleted characters
for characterId, character in pairs(self.sv.characterNames) do
    if LibCharacter:IsExists(characterId) == false then
        self.sv.characters[character.id] = nil
    end
end
character is:

Code:
{
    id = id,
    name = zo_strformat("<<1>>", name),
    rawName = name,
    gender = gender,
    level = level,
    classId = classId,
    raceId = raceId,
    alliance = alliance,
    server = self.server,
    account= self.account,
    avaRank = GetUnitAvARank("player")
}

API:

Code:
LibCharacter:GetCharacters([filter [, sortKey [, sortOrder]]])
LibCharacter:GetServerCharacters([server [, sortKey [, sortOrder]]])
LibCharacter:GetCharacter(characterId)
LibCharacter:Exists(characterId)
default:
Code:
filter = function(character) return true end
sortKey = LibCharacter.SORT_INDEX
sortOrder = ZO_SORT_ORDER_UP
server = GetWorldName()
Servers:
Code:
LibCharacter.NA
LibCharacter.EU
LibCharacter.PTS
sort keys:
Code:
LibCharacter.SORT_INDEX
LibCharacter.SORT_ID
LibCharacter.SORT_NAME
0.0.5:
- AvaRank fix

0.0.4:
- sort keys fix

0.0.3:
- IsExists => Exists
- AvaRank fix

0.0.2:
- fix filter order in GetServerCharacters
- add account field to character object


0.0.1:
- initial release
Archived Files (4)
File Name
Version
Size
Uploader
Date
0.0.4
2kB
zelenin
10/16/20 10:43 AM
0.0.3
2kB
zelenin
10/14/20 01:19 PM
0.0.2
2kB
zelenin
10/13/20 09:32 PM
0.0.1
2kB
10/13/20 02:19 PM


Post A Reply Comment Options
Unread 10/14/20, 01:24 PM  
zelenin
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 82
Uploads: 8
Originally Posted by Baertram
Thanks for the lib Zelenin.

Just a wording issue but maybe change the function name "IsExists" to something like
Exists
DoesExist

IsExists does not exist afaik
You're right. Thanks
Report comment to moderator  
Reply With Quote
Unread 10/14/20, 05:12 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3134
File comments: 3763
Uploads: 63
Thanks for the lib Zelenin.

Just a wording issue but maybe change the function name "IsExists" to something like
Exists
DoesExist

IsExists does not exist afaik
Last edited by Baertram : 10/14/20 at 05:12 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: