Server data and tracking dailies

Leandro Silva [09-29-18 - 13:52]
Server data and tracking dailies
Filename
Bindings.xml
LeoAltholic.lua
LeoAltholic.txt
LeoAltholic.xml
LeoAltholicUI.lua
diff --git a/Bindings.xml b/Bindings.xml
index 94da3c0..d435ba7 100644
--- a/Bindings.xml
+++ b/Bindings.xml
@@ -4,6 +4,9 @@
       <Action name="LEOALTHOLIC_TOGGLE_WINDOW">
         <Down>LeoAltholic:ToggleUI()</Down>
       </Action>
+      <Action name="LEOALTHOLIC_TRACK_QUEST">
+        <Down>LeoAltholic.trackQuest(QUEST_JOURNAL_MANAGER:GetFocusedQuestIndex())</Down>
+      </Action>
     </Category>
   </Layer>
 </Bindings>
diff --git a/LeoAltholic.lua b/LeoAltholic.lua
index d72cca2..1ac076c 100644
--- a/LeoAltholic.lua
+++ b/LeoAltholic.lua
@@ -2,13 +2,13 @@
 LeoAltholic = {}
 LeoAltholic.name = "LeoAltholic"
 LeoAltholic.displayName = "Leo's Altholic"
-LeoAltholic.version = "1.0.1"
+LeoAltholic.version = "1.1.0"
 LeoAltholic.chatPrefix = "|c39B027" .. LeoAltholic.name .. "|r: "
 LeoAltholic.timerQueue = {}

 LeoAltholic.maxTraits = select(3,GetSmithingResearchLineInfo(1,1))
 LeoAltholic.jewelryMaxTraits = select(3,GetSmithingResearchLineInfo(7,1))
-LeoAltholic.panelList = { "Bio", "Stats", "Skills", "Champion", "Inventory", "Research" }
+LeoAltholic.panelList = { "Bio", "Stats", "Skills", "Champion", "Tracked", "Inventory", "Research" }
 LeoAltholic.craftResearch = {CRAFTING_TYPE_BLACKSMITHING,CRAFTING_TYPE_CLOTHIER,CRAFTING_TYPE_WOODWORKING,CRAFTING_TYPE_JEWELRYCRAFTING}

 function LeoAltholic.loadPlayerDataPart(skillType, baseElem)
@@ -103,7 +103,11 @@ function LeoAltholic.InitCharsList()
     LeoAltholic.CharName = GetUnitName("player")
     LeoAltholic.CharNum = 0
     local char = LeoAltholic.savedVariables.CharList[LeoAltholic.CharName] or {
-        bio = {}
+        bio = {},
+        quests = {
+            actives = {},
+            tracked = {}
+        }
     }

     char.bio.name = LeoAltholic.CharName
@@ -338,9 +342,158 @@ function LeoAltholic.InitCharsList()

     if char.stats == nil then char.stats = {} end

+    if char.quests == nil or char.quests.tracked == nil then
+        char.quests = {
+            actives = {},
+            tracked = {}
+        }
+    else
+        char.quests.actives = {}
+    end
+
+    local n = 0
+    for i = 1, MAX_JOURNAL_QUESTS do
+        if IsValidQuestIndex(i) then
+            local quest = LeoAltholic.createQuestEntry(i)
+            table.insert(char.quests.actives, quest)
+            n = n + 1
+        end
+    end
+    --char.achievements = LeoAltholic.CreateCharDataAchievements()
+
     LeoAltholic.savedVariables.CharList[LeoAltholic.CharName] = char
 end

+function LeoAltholic.todayReset()
+    local diff = zo_floor(GetDiffBetweenTimeStamps(GetTimeStamp(), 1538200800) / 86400)
+    return 1538200800 + (diff * 86400)
+end
+
+function LeoAltholic.createQuestEntry(questId)
+    local questName,backgroundText,activeStepText,activeStepType, activeStepTrackerOverrideText, completed, tracked, questLevel,pushed,questType,instanceDisplayType = GetJournalQuestInfo(questId)
+    local repeatType = GetJournalQuestRepeatType(questId)
+    local locationInfo
+    if questType == QUEST_TYPE_GUILD then
+        locationInfo = "Guild"
+    elseif questType == QUEST_TYPE_MAIN_STORY then
+        locationInfo = "Main Story"
+    else
+        locationInfo = GetJournalQuestLocationInfo(questId)
+    end
+    local quest = {
+        name = questName,
+        backgroundText = backgroundText,
+        activeStepText = activeStepText,
+        activeStepType = activeStepType,
+        activeStepTrackerOverrideText = activeStepTrackerOverrideText,
+        questLevel = questLevel,
+        questType = questType,
+        instanceDisplayType = instanceDisplayType,
+        location = locationInfo,
+        repeatType = repeatType,
+        isDaily = repeatType == QUEST_REPEAT_DAILY
+    }
+    return quest
+end
+
+function LeoAltholic.ParseAchievementLinkId(link)
+
+    if (link == nil or link == "") then
+        return -1, 0, 0
+    end
+
+    local linkType, itemText, achId, achData, achTimestamp = link:match("|H(.-):(.-):(.-):(.-):(.-)|h|h")
+
+    if (achId == nil or achData == nil or achTimestamp == nil) then
+        return -1, 0, 0
+    end
+
+    return achId, tonumber(achData), tonumber(achTimestamp)
+end
+
+function LeoAltholic.CreateCharDataAchievements()
+    local achievements = {}
+    local numTopLevelCategories = GetNumAchievementCategories()
+    local countCategory = 1
+
+    for topLevelIndex = 1, numTopLevelCategories do
+        local cateName, numCategories, numCateAchievements, earnedPoints, totalPoints, hidesPoints = GetAchievementCategoryInfo(topLevelIndex)
+
+        if earnedPoints > 0 then
+
+            achievements[countCategory] = {
+                id = topLevelIndex,
+                name = cateName,
+                earnedPoints = earnedPoints,
+                totalPoints = totalPoints,
+                subCategory = {}
+            }
+
+            local countSub = 1
+
+            for categoryIndex = 1, numCategories do
+                local subcategoryName, numAchievements, earnedSubSubPoints, totalSubSubPoints, hidesSubSubPoints = GetAchievementSubCategoryInfo(topLevelIndex, categoryIndex)
+
+                if earnedSubSubPoints > 0 then
+                    achievements[countCategory].subCategory[countSub] = {
+                        name = subcategoryName,
+                        earnedPoints = earnedSubSubPoints,
+                        totalPoints = totalSubSubPoints,
+                        achievements = {}
+                    }
+                    earnedPoints = earnedPoints - earnedSubSubPoints
+                    totalPoints = totalPoints - totalSubSubPoints
+
+                    local countAchiev = 1
+
+                    for achievementIndex = 1, numAchievements do
+                        local achId = GetAchievementId(topLevelIndex, categoryIndex, achievementIndex)
+                        local currentId = GetFirstAchievementInLine(achId)
+
+                        if (currentId == 0) then currentId = achId end
+
+                        while (currentId ~= nil and currentId > 0) do
+                            local achLink = GetAchievementLink(currentId)
+                            local _, progress, timestamp = LeoAltholic.ParseAchievementLinkId(achLink)
+
+                            if (progress ~= 0 or timestamp ~= 0) then
+                                achievements[countCategory].subCategory[countSub].achievements[countAchiev] = {
+                                    id = currentId,
+                                    name = GetAchievementNameFromLink(achLink),
+                                    progress = progress,
+                                    timestamp = timestamp,
+                                    completed = IsAchievementComplete(currentId),
+                                    numCriteria =  GetAchievementNumCriteria(currentId),
+                                    numCriteriaDone = 0
+                                }
+                                local numCriteria = achievements[countCategory].subCategory[countSub].achievements[countAchiev].numCriteria
+                                local numCriteriaDone = achievements[countCategory].subCategory[countSub].achievements[countAchiev].numCriteriaDone
+                                for critIndex = 1, numCriteria do
+                                    local _, numCompleted, numRequired = GetAchievementCriterion(currentId, critIndex)
+                                    if numCompleted == numRequired then
+                                        numCriteriaDone = numCriteriaDone + 1
+                                    end
+                                end
+                                achievements[countCategory].subCategory[countSub].achievements[countAchiev].numCriteriaDone = numCriteriaDone
+                                countAchiev = countAchiev + 1
+                            end
+
+                            currentId = GetNextAchievementInLine(currentId)
+                        end
+                    end
+                    countSub = countSub + 1
+                end
+            end
+            countCategory = countCategory + 1
+        end
+    end
+
+    achievements.earnedPoints = GetEarnedAchievementPoints()
+    achievements.totalPoints = GetTotalAchievementPoints()
+
+    return achievements
+end
+
 local function copy(obj, seen)
     if type(obj) ~= 'table' then return obj end
     if seen and seen[obj] then return seen[obj] end
@@ -381,10 +534,14 @@ function LeoAltholic.GetItems(char, bagId)
     return itemLines
 end

+local function log(message)
+    d(LeoAltholic.chatPrefix .. message)
+end
+
 function LeoAltholic.ProcessQueue()
     for x,data in pairs(LeoAltholic.timerQueue) do
         if GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then
-            d(LeoAltholic.chatPrefix .. data.info)
+            log(LeoAltholic.chatPrefix .. data.info)
             table.remove(LeoAltholic.timerQueue, x)
         end
     end
@@ -422,7 +579,7 @@ function LeoAltholic.GetTimer()
                             time = traitData
                         }
                         if GetDiffBetweenTimeStamps(traitData - GetTimeStamp()) < 0 then
-                            d(LeoAltholic.chatPrefix .. data.info)
+                            log(data.info)
                         else
                             table.insert(LeoAltholic.timerQueue, data)
                         end
@@ -471,6 +628,37 @@ function LeoAltholic:OnUpdate()

 end

+function LeoAltholic.trackQuest(questId)
+    local type = GetJournalQuestRepeatType(questId)
+    if type ~= QUEST_REPEAT_DAILY then
+        log("Only daily quests can be tracked.")
+        return
+    end
+    local quest = LeoAltholic.createQuestEntry(questId)
+    for _,trackedQuest in pairs(LeoAltholic.savedVariables.CharList[LeoAltholic.CharName].quests.tracked) do
+        if (trackedQuest.name == quest.name) then
+            log("Quest " .. quest.name .. " is already being tracked.")
+            return
+        end
+    end
+    local tracked = {
+        name = quest.name,
+        lastDone = nil
+    }
+    table.insert(LeoAltholic.savedVariables.CharList[LeoAltholic.CharName].quests.tracked, tracked)
+    log("Tracking " .. tracked.name .. "...")
+end
+
+function LeoAltholic.onQuestComplete(eventCode, questName, level, previousExperience, currentExperience, rank, previousPoints, currentPoints)
+    for _,trackedQuest in pairs(LeoAltholic.savedVariables.CharList[LeoAltholic.CharName].quests.tracked) do
+        if (trackedQuest.name == questName) then
+            trackedQuest.lastDone = GetTimeStamp()
+            log("Quest " .. questName .. " done for today.")
+            return
+        end
+    end
+end
+
 function LeoAltholic.formatNumber(amount)
     if amount == nil then return nil; end
     if type(amount) == "string" then amount = tonumber( amount ) end
@@ -480,7 +668,18 @@ function LeoAltholic.formatNumber(amount)
 end

 function LeoAltholic.Initialize()
-    LeoAltholic.savedVariables = ZO_SavedVars:NewAccountWide("LeoAltholicSavedVariables", 2)
+
+    local oldVariables = ZO_SavedVars:NewAccountWide("LeoAltholicSavedVariables", 2)
+    LeoAltholic.savedVariables = ZO_SavedVars:NewAccountWide("LeoAltholicSavedVariables", 2, nil, nil, GetWorldName())
+    if oldVariables ~= nil and oldVariables.CharList ~= nil then
+        local varCopy = copy(oldVariables)
+        LeoAltholic.savedVariables.activeTab = varCopy.activeTab
+        LeoAltholic.savedVariables.CharList = varCopy.CharList
+        LeoAltholic.savedVariables.position = varCopy.position
+        LeoAltholicSavedVariables["Default"] = nil
+    end
+
+    --LeoAltholic.savedVariables = ZO_SavedVars:NewAccountWide("LeoAltholicSavedVariables", 2)

     local LibFeedback = LibStub:GetLibrary("LibFeedback")
     local showButton, feedbackWindow = LibFeedback:initializeFeedbackWindow(LeoAltholic,
@@ -501,16 +700,64 @@ function LeoAltholic.Initialize()
     SLASH_COMMANDS["/rr"] = function(cmd)
         ReloadUI()
     end
-
-    SLASH_COMMANDS["/rc"] = function(cmd)
-        LeoAltholic.savedVariables.CharList = {}
-        ReloadUI()
-    end
     ]]

     SLASH_COMMANDS["/leoalt"] = function(cmd)
         LeoAltholic:ShowUI()
     end
+
+    local keybindStripDescriptor = {
+        alignment = KEYBIND_STRIP_ALIGN_LEFT,
+        {
+            name = "Track with " .. LeoAltholic.displayName,
+            keybind = "LEOALTHOLIC_TRACK_QUEST",
+            enabled = function() return true end,
+            visible = function() return true end,
+            order = 100,
+            callback = function()
+                LeoAltholic.trackQuest(QUEST_JOURNAL_MANAGER:GetFocusedQuestIndex())
+            end,
+        }
+    }
+
+    QUEST_JOURNAL_SCENE:RegisterCallback("StateChange",
+            function(oldState, newState)
+                if(newState == SCENE_SHOWING) then
+                    local type = GetJournalQuestRepeatType(QUEST_JOURNAL_MANAGER:GetFocusedQuestIndex())
+                    if type == QUEST_REPEAT_DAILY then
+                        KEYBIND_STRIP:AddKeybindButtonGroup(keybindStripDescriptor)
+                    else
+                        KEYBIND_STRIP:RemoveKeybindButtonGroup(keybindStripDescriptor)
+                    end
+                elseif(newState == SCENE_HIDDEN) then
+                    KEYBIND_STRIP:RemoveKeybindButtonGroup(keybindStripDescriptor)
+                end
+            end)
+
+    QUEST_JOURNAL_KEYBOARD:RegisterCallback("QuestSelected",
+            function(questId)
+                local type = GetJournalQuestRepeatType(questId)
+                if type == QUEST_REPEAT_DAILY then
+                    KEYBIND_STRIP:AddKeybindButtonGroup(keybindStripDescriptor)
+                else
+                    KEYBIND_STRIP:RemoveKeybindButtonGroup(keybindStripDescriptor)
+                end
+            end)
+end
+
+local orig_ZO_QuestJournalNavigationEntry_OnMouseUp = ZO_QuestJournalNavigationEntry_OnMouseUp
+
+function ZO_QuestJournalNavigationEntry_OnMouseUp(label, button, upInside)
+    orig_ZO_QuestJournalNavigationEntry_OnMouseUp(label, button, upInside)
+    if button == MOUSE_BUTTON_INDEX_RIGHT and upInside then
+        local questIndex = label.node.data.questIndex
+        if questIndex and GetJournalQuestRepeatType(questIndex) == QUEST_REPEAT_DAILY then
+            AddMenuItem("Track with " .. LeoAltholic.displayName, function()
+                LeoAltholic.trackQuest(questIndex)
+            end)
+            ShowMenu(label)
+        end
+    end
 end

 function LeoAltholic.NewMovementInUIMode(eventCode)
@@ -532,7 +779,7 @@ function LeoAltholic.OnAddOnLoaded(event, addonName)
     if addonName == LeoAltholic.name then
         EVENT_MANAGER:UnregisterForEvent(LeoAltholic.Name, EVENT_ADD_ON_LOADED)
         LeoAltholic.Initialize()
---        d(LeoAltholic.name .. " started.")
+        log("started.")
     end
 end

@@ -541,4 +788,5 @@ EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_ADD_ON_LOADED, LeoAltholi
 EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_PLAYER_DEACTIVATED, LeoAltholic.OnPlayerDeactivated)
 EVENT_MANAGER:RegisterForUpdate(LeoAltholic.name, 5000, function() LeoAltholic.OnUpdate() end)
 EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_NEW_MOVEMENT_IN_UI_MODE, LeoAltholic.NewMovementInUIMode)
+EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_QUEST_COMPLETE, LeoAltholic.onQuestComplete)
 CHAMPION_PERKS_SCENE:RegisterCallback('StateChange', LeoAltholic.OnChampionPerksSceneStateChange)
diff --git a/LeoAltholic.txt b/LeoAltholic.txt
index d6d45ea..a087d88 100644
--- a/LeoAltholic.txt
+++ b/LeoAltholic.txt
@@ -1,6 +1,6 @@
 ## Title: Leo's Altholic
 ## APIVersion: 100024 100025
-## Version: 1.0.1
+## Version: 1.1.0
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoAltholicSavedVariables
 ## DependsOn: LibStub LibFeedback
diff --git a/LeoAltholic.xml b/LeoAltholic.xml
index aa63de1..c1ebc83 100644
--- a/LeoAltholic.xml
+++ b/LeoAltholic.xml
@@ -15,7 +15,7 @@
                 </Backdrop>
                 <Backdrop name="$(parent)HeaderBG" centerColor="111111" edgeColor="222222">
                     <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="$(parent)" offsetX="8" offsetY="5"/>
-                    <Dimensions x="526" y="40"/>
+                    <Dimensions x="486" y="40"/>
                     <Edge edgeSize="1"/>
                 </Backdrop>
                 <Label name="$(parent)Title" color="39B027" font="ZoFontWinH3" wrapMode="ELLIPSIS"
@@ -91,9 +91,26 @@
                         </Texture>
                     </Controls>
                 </Button>
-                <Button name="$(parent)InventoryButton" clickSound="Click">
+                <Button name="$(parent)TrackedButton" clickSound="Click">
                     <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="$(parent)ChampionButton" offsetX="45"/>
                     <Dimensions x="40" y="40"/>
+                    <OnMouseEnter>ZO_Tooltips_ShowTextTooltip(self, TOP, 'Tracked Quests')</OnMouseEnter>
+                    <OnMouseExit>ZO_Tooltips_HideTextTooltip()</OnMouseExit>
+                    <OnClicked>LeoAltholic.ShowTab("Tracked")</OnClicked>
+                    <Controls>
+                        <Backdrop name="$(parent)BG" centerColor="101010" edgeColor="202020">
+                            <AnchorFill/>
+                            <Edge edgeSize="1"/>
+                        </Backdrop>
+                        <Texture name="$(parent)Texture" textureFile="esoui/art/quest/tracked_pin.dds">
+                            <Dimensions y="30" x="30"/>
+                            <Anchor point="128"/>
+                        </Texture>
+                    </Controls>
+                </Button>
+                <Button name="$(parent)InventoryButton" clickSound="Click">
+                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="$(parent)TrackedButton" offsetX="45"/>
+                    <Dimensions x="40" y="40"/>
                     <OnMouseEnter>ZO_Tooltips_ShowTextTooltip(self, TOP, 'Inventory')</OnMouseEnter>
                     <OnMouseExit>ZO_Tooltips_HideTextTooltip()</OnMouseExit>
                     <OnClicked>LeoAltholic.ShowTab("Inventory")</OnClicked>
@@ -201,6 +218,18 @@
                     </Controls>
                 </Backdrop>

+                <Backdrop name="LeoAltholicWindowTrackedPanel" tier="1" centerColor="000000" edgeColor="202020" hidden="true" clampedToScreen="true" movable="false" mouseEnabled="true" inherits="ZO_ScrollContainerBase">
+                    <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="LeoAltholicWindow" offsetX="0" offsetY="52"/>
+                    <Dimensions x="900" y="648"/>
+                    <Edge edgeSize="1"/>
+                    <OnInitialized>ZO_Scroll_Initialize(self)</OnInitialized>
+                    <Controls>
+                        <Control name="$(parent)ScrollChild">
+                            <OnInitialized>self:SetParent(self:GetParent():GetNamedChild("Scroll"));self:SetAnchor(3,nil,3,0,0)</OnInitialized>
+                        </Control>
+                    </Controls>
+                </Backdrop>
+
                 <Backdrop name="LeoAltholicWindowInventoryPanel" tier="1" centerColor="000000" edgeColor="202020" hidden="true" clampedToScreen="true" movable="false" mouseEnabled="true" inherits="ZO_ScrollContainerBase">
                     <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="LeoAltholicWindow" offsetX="0" offsetY="52"/>
                     <Dimensions x="900" y="648"/>
@@ -395,6 +424,125 @@
             </Controls>
         </Control>

+        <Control name="LeoAltholicTrackedRowTemplate" virtual="true" horizontalAlignment="LEFT" verticalAlignment="CENTER">
+            <Dimensions x="880" y="165"/>
+            <Controls>
+                <Backdrop name="$(parent)BG" centerColor="222222" edgeColor="444444" tier="LOW">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="2" offsetY="2"/>
+                    <Dimensions x="880" y="165"/>
+                    <Edge edgeSize="1"/>
+                </Backdrop>
+
+                <Label name="$(parent)Alliance" mouseEnabled="true" font="ZoFontWinH3" normalColor="ffffff" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="CENTER" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10" offsetY="10"/>
+                    <Dimensions x="60" y="75"/>
+                    <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, RIGHT, self.data) </OnMouseEnter>
+                    <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit>
+                </Label>
+
+                <Label name="$(parent)Name" mouseEnabled="true" font="ZoFontWinH3" normalColor="ffffff" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="80" offsetY="20"/>
+                    <Dimensions x="180" y="30"/>
+                </Label>
+
+                <Label name="$(parent)RaceClass" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="80" offsetY="50"/>
+                    <Dimensions x="450" y="30"/>
+                </Label>
+
+                <Label name="$(parent)Quest1Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="250" offsetY="4"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest1Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="420" offsetY="4"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest2Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="580" offsetY="4"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest2Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="760" offsetY="4"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest3Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="250" offsetY="34"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest3Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="420" offsetY="34"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest4Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="580" offsetY="34"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest4Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="760" offsetY="34"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest5Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="250" offsetY="64"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest5Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="420" offsetY="64"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest6Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="580" offsetY="64"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest6Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="760" offsetY="64"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest7Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="250" offsetY="94"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest7Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="420" offsetY="94"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest8Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="580" offsetY="94"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest8Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="760" offsetY="94"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest9Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="250" offsetY="124"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest9Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="420" offsetY="124"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+                <Label name="$(parent)Quest10Label" text="" mouseEnabled="true" font="ZoFontGame" color="E8DFAF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="RIGHT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="580" offsetY="124"/>
+                    <Dimensions x="160" y="35"/>
+                </Label>
+                <Label name="$(parent)Quest10Done" text="" mouseEnabled="true" font="ZoFontGame" color="FFFFFF" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="760" offsetY="124"/>
+                    <Dimensions x="120" y="35"/>
+                </Label>
+
+            </Controls>
+        </Control>
+
         <Control name="LeoAltholicSkillsRowTemplate" virtual="true" horizontalAlignment="LEFT" verticalAlignment="CENTER">
             <Dimensions x="880" y="520"/>
             <Controls>
@@ -906,7 +1054,7 @@
                 </Texture>
                 <Label name="$(parent)Bag" mouseEnabled="true" font="ZoFontWinH4" color="ffffff" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="340" offsetY="4"/>
-                    <Dimensions x="50" y="35"/>
+                    <Dimensions x="100" y="35"/>
                     <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, RIGHT, "Bag space") </OnMouseEnter>
                     <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit>
                 </Label>
@@ -918,7 +1066,7 @@

                 <Label name="$(parent)SoulGems" mouseEnabled="true" font="ZoFontWinH4" color="ffffff" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="340" offsetY="34"/>
-                    <Dimensions x="150" y="35"/>
+                    <Dimensions x="100" y="35"/>
                     <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, RIGHT, "Soul Gems") </OnMouseEnter>
                     <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit>
                 </Label>
@@ -929,7 +1077,7 @@
                 </Texture>
                 <Label name="$(parent)Gold" mouseEnabled="true" font="ZoFontWinH4" color="ffffff" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="340" offsetY="64"/>
-                    <Dimensions x="150" y="35"/>
+                    <Dimensions x="100" y="35"/>
                     <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, RIGHT, "Gold") </OnMouseEnter>
                     <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit>
                 </Label>
@@ -940,7 +1088,7 @@
                 </Texture>
                 <Label name="$(parent)AP" mouseEnabled="true" font="ZoFontWinH4" color="ffffff" inheritAlpha="true" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="480" offsetY="4"/>
-                    <Dimensions x="50" y="35"/>
+                    <Dimensions x="100" y="35"/>
                     <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, RIGHT, "Alliance Points") </OnMouseEnter>
                     <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit>
                 </Label>
diff --git a/LeoAltholicUI.lua b/LeoAltholicUI.lua
index 59e6ab7..253610d 100644
--- a/LeoAltholicUI.lua
+++ b/LeoAltholicUI.lua
@@ -117,6 +117,8 @@ function LeoAltholic.InitializeCharacterFrames()
             local anchorY = 109;
             if panel == "Champion" then
                 anchorY = 139
+            elseif panel == "Tracked" then
+                anchorY = 169
             elseif panel == "Research" then
                 anchorY = 262
             elseif panel == "Skills" then
@@ -330,6 +332,8 @@ function LeoAltholic.DisplayCharacterFrames()
     end
     control = WINDOW_MANAGER:GetControlByName('LeoAltholicWindowChampionPanelScrollChild')
     control:SetHeight(#LeoAltholic.GetCharacters() * 139)
+    control = WINDOW_MANAGER:GetControlByName('LeoAltholicWindowTrackedPanelScrollChild')
+    control:SetHeight(#LeoAltholic.GetCharacters() * 169)
     control = WINDOW_MANAGER:GetControlByName('LeoAltholicWindowResearchPanelScrollChild')
     control:SetHeight(#LeoAltholic.GetCharacters() * 262)
     control = WINDOW_MANAGER:GetControlByName('LeoAltholicWindowSkillsPanelScrollChild')
@@ -413,6 +417,32 @@ function LeoAltholic.DisplayCharacterFrames()
             control:SetText(char.champion[dAttribute].disciplines[i].spent)
         end

+        row = WINDOW_MANAGER:GetControlByName('LeoAltholicTrackedRow'..x)
+        for i = 1, 10 do
+            local label = row:GetNamedChild("Quest" .. i .. "Label")
+            local done = row:GetNamedChild("Quest" .. i .. "Done")
+            if char.quests.tracked[i] ~= nil then
+                label:SetText(char.quests.tracked[i].name)
+                if char.quests.tracked[i].lastDone ~= nil then
+                    if char.quests.tracked[i].lastDone <= LeoAltholic.todayReset() then
+                        done:SetText("|cCB110Enot done today|r")
+                    else
+                        local diff = GetTimeStamp() - char.quests.tracked[i].lastDone
+                        if diff < 3600 then
+                            done:SetText(zo_strformat("<<1[%d minute ago/%d minutes ago]>>",  math.floor(diff / 60)))
+                        elseif diff < 86400 then
+                            done:SetText(zo_strformat("<<1[%d hour ago/%d hours ago]>>",  math.floor(diff / 3600)))
+                        else
+                            done:SetText(zo_strformat("<<1[Yesterday/%d days ago]>>",  math.floor(diff / 86400)))
+                        end
+                    end
+                else
+                    done:SetText("|cCB110Enot done today|r")
+                end
+            end
+        end
+
+
         row = WINDOW_MANAGER:GetControlByName('LeoAltholicInventoryRow'..x)
         local color = '|c21A121'
         if char.inventory.free <= 25 then color = '|c596cfd' end
@@ -497,4 +527,5 @@ function LeoAltholic:OnUpdate()
 end

 ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TOGGLE_WINDOW', "Show/Hide Main Window")
+ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Track Daily Quest")