Thread Tools Display Modes
01/30/15, 03:13 PM   #1
AliiEso
Join Date: Jan 2015
Posts: 3
[Request] Eidetic Memory addon

Hello, I know nothing about addons so this may be a rediculous request. I would love an addon that doesn't show books in the Eidetic Memory section of the journal until they have been discovered. Missed books are driving me crazy. Thanks for reading.
  Reply With Quote
01/30/15, 08:46 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
I'm not sure if it exactly what you want, but here is my book filter:




Source code:

BookFilters.txt
Code:
## Title: |cEFEBBEBook Filters|r
## Version: 0.1
## Author: |cEFEBBEGarkin|r
## APIVersion: 100010

BookFilters.lua
BookFilters.lua
Lua Code:
  1. local ADDON_NAME = "BookFilters"
  2. local BOOK_DATA_TYPE = 1
  3. local LIBRARY
  4. local savedVars
  5.  
  6. local filterData = {
  7.    "Show All",
  8.    "Show Known",
  9.    "Show Unknown",
  10. }
  11.  
  12. local function OnFilterChanged(comboBox, entryText, entry)
  13.    local container = comboBox:GetContainer()
  14.    container.filterType = entry.filterType
  15.    savedVars.filterType = entry.filterType
  16.    LIBRARY.list:FilterScrollList()
  17.    if LIBRARY.navigationTree.selectedNode then
  18.       LIBRARY.navigationTree.selectedNode:OnSelected()
  19.    end
  20. end
  21.  
  22. local function InitializeFilters(filterControl, filterChangedCallback)
  23.    local comboBox = ZO_ComboBox_ObjectFromContainer(filterControl)
  24.    comboBox:SetSortsItems(false)
  25.    comboBox:SetFont("ZoFontWinT1")
  26.    comboBox:SetSpacing(4)
  27.  
  28.    for i, text in ipairs(filterData) do
  29.       local entry = comboBox:CreateItemEntry(text, filterChangedCallback)
  30.       entry.filterType = i
  31.       comboBox:AddItem(entry)
  32.    end
  33.  
  34.    comboBox:SelectFirstItem()
  35.    filterControl.filterType = savedVars.filterType or 1
  36. end
  37.  
  38. local function FilterScrollList(self)
  39.    local categoryIndex = self.owner:GetSelectedCategoryIndex()
  40.    local collectionIndex = self.owner:GetSelectedCollectionIndex()
  41.  
  42.    local totalBooks = select(4, GetLoreCollectionInfo(categoryIndex, collectionIndex))
  43.  
  44.    local scrollData = ZO_ScrollList_GetDataList(self.list)
  45.    ZO_ScrollList_Clear(self.list)
  46.  
  47.    for bookIndex = 1, totalBooks do
  48.       local shouldAdd
  49.  
  50.       if self.filter.filterType == 1 then
  51.          shouldAdd = true
  52.       else
  53.          local _, _, known = GetLoreBookInfo(categoryIndex, collectionIndex, bookIndex)
  54.          if self.filter.filterType == 2 then
  55.             shouldAdd = known
  56.          elseif self.filter.filterType == 3 then
  57.             shouldAdd = not known
  58.          end
  59.       end
  60.  
  61.       if shouldAdd then
  62.          scrollData[#scrollData + 1] = ZO_ScrollList_CreateDataEntry(BOOK_DATA_TYPE, { categoryIndex = categoryIndex, collectionIndex = collectionIndex, bookIndex = bookIndex })
  63.       end
  64.    end  
  65. end
  66.  
  67. local function OnAddonLoaded(evt, name)
  68.    if (name == ADDON_NAME) then
  69.       EVENT_MANAGER:UnregisterForEvent(name, evt)
  70.  
  71.       savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 1, "BookFilters", { filterType = 1 })
  72.  
  73.       LIBRARY = ZO_LoreLibrary.owner
  74.       LIBRARY.list.filter = CreateControlFromVirtual("$(parent)Filter", ZO_LoreLibrary, "ZO_ComboBox")
  75.       LIBRARY.list.filter:SetDimensions(222, 32)
  76.       LIBRARY.list.filter:SetAnchor(TOPRIGHT, ZO_LoreLibrary, TOPRIGHT, -20, 15)
  77.      
  78.       InitializeFilters(LIBRARY.list.filter, OnFilterChanged)
  79.  
  80.       LIBRARY.list.FilterScrollList = FilterScrollList
  81.    end
  82. end        
  83.        
  84. EVENT_MANAGER:RegisterForEvent(ADDON_NAME, EVENT_ADD_ON_LOADED, OnAddonLoaded)

If you want downloadable version, it is BookFilters-0.1.zip in my Dropbox folder.
  Reply With Quote
01/30/15, 11:21 PM   #3
AliiEso
Join Date: Jan 2015
Posts: 3
Wow! That is incredible, I can't believe you made it so fast. Thank you.
One small thing though, is it possible to remove the counters that say x/x? Probably not possible, but I would like them to go when 'known' is selected.
  Reply With Quote
01/31/15, 08:03 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,963
As the entries in this list seem to be only text (even the x/y is included into the text) it may be possible by hooking the controls ZO_LoreLibraryNavigationContainerScrollChildZO_LabelHeaderN (where n is the number increasing from top to bottom for each entry of book categories) and filtering the shown text by regular expressions, so the numbers and the / will be hidden?
  Reply With Quote
01/31/15, 12:18 PM   #5
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by AliiEso View Post
Wow! That is incredible, I can't believe you made it so fast. Thank you.
One small thing though, is it possible to remove the counters that say x/x? Probably not possible, but I would like them to go when 'known' is selected.
I made the adjustments you asked for & fixed the dropDown box so it is in sync with your saved setting. You can thank Garkin for doing all the hard work.

You can find it on my dropbox here: Garkins BookFilters Version 2.0

Last edited by circonian : 01/31/15 at 12:20 PM.
  Reply With Quote
01/31/15, 02:00 PM   #6
AliiEso
Join Date: Jan 2015
Posts: 3
Wow, thank you so much! You are both amazing, and I really appreciate it.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » [Request] Eidetic Memory addon

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off