Quantcast
Download
(5 Kb)
Download
Updated: 11/04/14 03:53 PM
Compatibility:
Update 5 (1.5.2)
Updated:11/04/14 03:53 PM
Created:06/20/14 05:21 AM
Monthly downloads:50
Total downloads:2,177
Favorites:4
MD5:
LibReader
Version: 1.5
by: Deome [More]
LibReader is a simple library to provide parsing functions for your addons. Currently, LibReader will parse itemlinks into individual variables or entire tables, your choice.

LibReader has been greatly expanded, and now provides parsing of item and guild event constants. Versioning will subsequently be linked to API version to ensure it stays up to date with constant and function changes with each ESO update.
v1.30 (API 10008) -- Many new and wonderful things, including item and equipment SI_ tables, and functions to quickly parse them!

v1.2 (API 10008) -- Lotta new stuff, and an old favorite is back! Most of the functions should be self-explanatory for developers, but feel free to ask if you have any questions.
---v1.21: A few minor tweaks to improve functionality/prevent bugs. Biggest one is trying to make sure numbers are passed as numbers and not strings.

v1.13 -- Minor bugfix. GetLinkValue() should now properly parse strings like "ItemID" to account for caps/camelcase.

v1.12 (API 10007) -- Updated to parse new item links. Note to developers: it appears we can no longer parse item names from links.
Optional Files (0)


Archived Files (5)
File Name
Version
Size
Author
Date
1.30
5kB
Deome
10/16/14 06:16 AM
1.21
2kB
Deome
08/17/14 02:05 AM
1.13
947B
Deome
07/02/14 08:10 PM
1.1
2kB
Deome
06/22/14 02:04 AM
1.0
2kB
Deome
06/20/14 05:21 AM


Post A Reply Comment Options
Unread 04/20/15, 10:33 PM  
Subotai
 
Subotai's Avatar

Forum posts: 1
File comments: 23
Uploads: 0
Dumb question...

What does this do? I mean I read the description, but I may as well have been deciphering glyph's and Runes! Can you please Barney it down for me? Like with crayons and everything...thanks.

Report comment to moderator  
Reply With Quote
Unread 04/09/15, 06:41 AM  
Arkadius
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 31
Uploads: 3
*deleted since posted in wrong forum*
Last edited by Arkadius : 04/12/15 at 08:38 AM.
Report comment to moderator  
Reply With Quote
Unread 10/16/14, 11:01 AM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 853
File comments: 1122
Uploads: 33
I've just checked new library update and I have a few suggestions.

I believe that almost all tables defined in the library are not necessary. For example this function:
Lua Code:
  1. function LibReader:GetItemLinkStyle(ItemLink)
  2.     if not ItemLink then return nil end
  3.     local iStyle = select(5, GetItemLinkInfo(ItemLink))
  4.  
  5.     return iStyle, zo_strformat(self.Str_Item_Style[iStyle])
  6. end

If I change it, you don't need to use self.Str_Item_Style table:
Lua Code:
  1. function LibReader:GetItemLinkStyle(ItemLink)
  2.     if not ItemLink then return nil end
  3.     local iStyle = select(5, GetItemLinkInfo(ItemLink))
  4.  
  5.     return iStyle, GetString("SI_ITEMSTYLE", iStyle)
  6. end

The same change can be done to all functions which are supposed to return localized name.


Function LibReader:ParseItemLinkToTable(ItemLink) will not return the last value of itemLink data.
Here is an itemLink:
Code:
|H1:item:54381:177:50:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h
Your function will create this table:
Code:
{ "1", "item", "54381", "177", "50", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" }
(the last zero is missing)

Its probably not a big deal, but if you want to change it, try (not tested, but it should work):
Lua Code:
  1. function LibReader:ParseItemLinkToTable(ItemLink)
  2.     if type(ItemLink) == "string" then
  3.         return { zo_strsplit(":", ItemLink:match("|H(.-)|h")) }
  4.     end
  5.     return nil
  6. end
__________________
@Garkin (retired from ESO)
My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you!, ... (full list)
Report comment to moderator  
Reply With Quote
Unread 06/21/14, 01:15 AM  
Deome
 
Deome's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 76
Uploads: 8
Thumbs up Many thanks.

I'll make sure to have an update ready, or already implemented--my main project atm relies heavily on this library, so I appreciate all updates and heads-ups.
Report comment to moderator  
Reply With Quote
Unread 06/20/14, 02:05 PM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 853
File comments: 1122
Uploads: 33
__________________
@Garkin (retired from ESO)
My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you!, ... (full list)
Last edited by Garkin : 06/20/14 at 02:06 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.