New release

Leandro Silva [11-04-18 - 09:50]
New release
Filename
Lang/de.lua
Lang/en.lua
LeoAltholic.lua
LeoAltholic.txt
LeoAltholic.xml
LeoAltholicInit.lua
LeoAltholicUI.lua
ui/inventory.lua
ui/writs.lua
diff --git a/Lang/de.lua b/Lang/de.lua
index c50b097..7a27b01 100644
--- a/Lang/de.lua
+++ b/Lang/de.lua
@@ -51,3 +51,5 @@ ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Kompass runter schieben")
 ZO_CreateStringId("LEOALT_ACCOUNT_CONFIGURATION", "Accountweite Einstellung")
 ZO_CreateStringId("LEOALT_CHAR_CONFIGURATION", "Charakter spezifisch")
 ZO_CreateStringId("LEOALT_ENTRIES", "Einträge")
+ZO_CreateStringId("LEOALT_TOTAL_INVENTORY", "Im Inventar")
+ZO_CreateStringId("LEOALT_TOTAL", "Gesamt")
diff --git a/Lang/en.lua b/Lang/en.lua
index 952d215..d549823 100644
--- a/Lang/en.lua
+++ b/Lang/en.lua
@@ -51,3 +51,5 @@ ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Compass down")
 ZO_CreateStringId("LEOALT_ACCOUNT_CONFIGURATION", "Account Wide Configuration")
 ZO_CreateStringId("LEOALT_CHAR_CONFIGURATION", "Character Specific")
 ZO_CreateStringId("LEOALT_ENTRIES", "Items")
+ZO_CreateStringId("LEOALT_TOTAL_INVENTORY", "Total in inventory")
+ZO_CreateStringId("LEOALT_TOTAL", "Total")
diff --git a/LeoAltholic.lua b/LeoAltholic.lua
index c0fad11..d3f6545 100644
--- a/LeoAltholic.lua
+++ b/LeoAltholic.lua
@@ -235,6 +235,17 @@ local function initCharsData()
     local ridetime = GetTimeUntilCanBeTrained()/1000 or 0
     if ridetime > 1 then ridetime = ridetime + GetTimeStamp() end

+    if char.attributes and char.attributes.riding and char.attributes.riding.time and char.attributes.riding.time > 0 and
+            GetDiffBetweenTimeStamps(char.attributes.riding.time - GetTimeStamp()) < 0 then
+        local data = {
+            id = '$M' .. char.bio.name,
+            charName = char.bio.name,
+            info = ZO_CachedStrFormat(GetString(LEOALT_MOUNT_FINISHED), char.bio.name),
+            time = char.attributes.riding.time
+        }
+        LeoAltholic.AddToQueue(data)
+    end
+
     char.attributes = {
         unspent = GetAttributeUnspentPoints(),
         health = {
@@ -355,14 +366,46 @@ local function initCharsData()
         return {rank = rank, max = GetMaxSimultaneousSmithingResearch(craft) or 1}
     end

-    if GetDiffBetweenTimeStamps(char.attributes.riding.time - GetTimeStamp()) < 0 then
-        local data = {
-            id = '$M' .. char.bio.name,
-            name = char.bio.name,
-            info = ZO_CachedStrFormat(GetString(LEOALT_MOUNT_FINISHED), char.bio.name),
-            time = char.attributes.riding.time
-        }
-        LeoAltholic.AddToQueue(data)
+    if char.research.doing ~= nil then
+        for _,craft in pairs(LeoAltholic.craftResearch) do
+            if char.research.doing[craft] ~= nil then
+                for line = 1, GetNumSmithingResearchLines(craft) do
+                    local lineName, lineIcon = GetSmithingResearchLineInfo(craft, line)
+                    for trait = 1, LeoAltholic.maxTraits do
+                        local traitType, _, known = GetSmithingResearchLineTraitInfo(craft, line, trait)
+                        if known then
+                            char.research.done[craft][line][trait] = true
+                        else
+                            local _,remaining = GetSmithingResearchLineTraitTimes(craft,line,trait)
+                            if remaining and remaining > 0 then
+                                table.insert(char.research.doing[craft], {
+                                    craft = craft,
+                                    line = line,
+                                    trait = trait,
+                                    remaining = remaining,
+                                    doneAt = remaining + GetTimeStamp()
+                                })
+                                local data = {
+                                    id = '$R' .. char.bio.name..craft..line..trait,
+                                    charName = char.bio.name,
+                                    info = ZO_CachedStrFormat(
+                                            GetString(LEOALT_RESEARCH_FINISHED) .. ': |c00FF00<<C:2>> <<C:3>>|r.',
+                                            char.bio.name,
+                                            GetString('SI_ITEMTRAITTYPE',traitType),
+                                            lineName
+                                    ),
+                                    time = remaining + GetTimeStamp()
+                                }
+                                LeoAltholic.AddToQueue(data)
+                            end
+                        end
+                    end
+                end
+                table.sort(char.research.doing[craft], function(a, b)
+                    return a.remaining < b.remaining
+                end)
+            end
+        end
     end

     char.research = {}
@@ -736,7 +779,7 @@ local function createMessageQueue()
             if GetDiffBetweenTimeStamps(char.attributes.riding.time - GetTimeStamp()) < 0 then
                 local data = {
                     id = '$M' .. char.bio.name,
-                    name = char.bio.name,
+                    charName = char.bio.name,
                     info = ZO_CachedStrFormat(GetString(LEOALT_MOUNT_FINISHED), char.bio.name),
                     time = char.attributes.riding.time
                 }
diff --git a/LeoAltholic.txt b/LeoAltholic.txt
index f7946b9..bd74cb3 100644
--- a/LeoAltholic.txt
+++ b/LeoAltholic.txt
@@ -1,6 +1,6 @@
 ## Title: Leo's Altholic
 ## APIVersion: 100024 100025
-## Version: 1.6.2
+## Version: 1.6.3
 ## Author: |c39B027@LeandroSilva|r
 ## SavedVariables: LeoAltholicSavedVariables LeoAltholicCharVariables
 ## OptionalDependsOn: LibStub LibFeedback LibAddonMenu-2.0
diff --git a/LeoAltholic.xml b/LeoAltholic.xml
index 2792851..7872c60 100644
--- a/LeoAltholic.xml
+++ b/LeoAltholic.xml
@@ -1229,65 +1229,65 @@

                 <Texture name="$(parent)Craft1Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="10" offsetY="0"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="10" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft1Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Texture name="$(parent)Craft2Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Status" relativePoint="TOPRIGHT" offsetX="12"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Status" relativePoint="TOPRIGHT" offsetX="12" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft2Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Texture name="$(parent)Craft6Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Status" relativePoint="TOPRIGHT" offsetX="12"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Status" relativePoint="TOPRIGHT" offsetX="12" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft6Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Texture name="$(parent)Craft7Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Status" relativePoint="TOPRIGHT" offsetX="12"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Status" relativePoint="TOPRIGHT" offsetX="12" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft7Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Texture name="$(parent)Craft3Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Status" relativePoint="TOPRIGHT" offsetX="12"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Status" relativePoint="TOPRIGHT" offsetX="12" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft3Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Texture name="$(parent)Craft4Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Status" relativePoint="TOPRIGHT" offsetX="12"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Status" relativePoint="TOPRIGHT" offsetX="12" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft4Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Texture name="$(parent)Craft5Icon" hidden="false">
                     <Dimensions y="24" x="24"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Status" relativePoint="TOPRIGHT" offsetX="12"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Status" relativePoint="TOPRIGHT" offsetX="12" offsetY="2"/>
                 </Texture>
                 <Label name="$(parent)Craft5Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false">
                     <Dimensions x="70" y="28"/>
-                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft5Icon" relativePoint="TOPRIGHT" offsetX="2"/>
+                    <Anchor point="TOPLEFT" relativeTo="$(parent)Craft5Icon" relativePoint="TOPRIGHT" offsetX="2" offsetY="-2"/>
                 </Label>

                 <Line name="$(parent)HorizLine" color="444444" thickness="2" pixelRoundingEnabled="true">
diff --git a/LeoAltholicInit.lua b/LeoAltholicInit.lua
index cb6630b..d978ae7 100644
--- a/LeoAltholicInit.lua
+++ b/LeoAltholicInit.lua
@@ -6,7 +6,7 @@ LeoAltholicToolbarUI = LeoAltholicToolbarUI or {}

 LeoAltholic.name = "LeoAltholic"
 LeoAltholic.displayName = "Leo's Altholic"
-LeoAltholic.version = "1.6.2"
+LeoAltholic.version = "1.6.3"
 LeoAltholic.chatPrefix = "|c39B027" .. LeoAltholic.name .. "|r: "

 LeoAltholic.TAB_BIO = "Bio"
diff --git a/LeoAltholicUI.lua b/LeoAltholicUI.lua
index f285ab2..09b54a2 100644
--- a/LeoAltholicUI.lua
+++ b/LeoAltholicUI.lua
@@ -41,9 +41,13 @@ function LeoAltholic.ShowInventoryUI(charName, bagId)
     SCENE_MANAGER:ShowTopLevel(LeoAltholicInventoryWindow)
     LeoAltholicInventoryWindow:SetDrawLayer(DL_OVERLAY)
     LeoAltholicInventoryWindow:SetDrawTier(DT_MEDIUM)
+    local header = WINDOW_MANAGER:GetControlByName("LeoAltholicInventoryWindowTitle")
     local char
     if charName ~= nil then
         char = LeoAltholic.GetCharByName(charName)
+        header:SetText(GetString(SI_MAIN_MENU_INVENTORY))
+    else
+        header:SetText(GetString(SI_CURRENCYLOCATION1))
     end
     local sc = WINDOW_MANAGER:GetControlByName("LeoAltholicInventoryWindowListScrollChild")
     sc:SetHidden(false)
diff --git a/ui/inventory.lua b/ui/inventory.lua
index 4b75b03..ba643fc 100644
--- a/ui/inventory.lua
+++ b/ui/inventory.lua
@@ -145,15 +145,53 @@ function LeoAltholicUI.InitInventory()
     local panel = WINDOW_MANAGER:GetControlByName("LeoAltholicWindowInventoryPanel")
     local list = GetControl(panel, "ListScroll")

-    local bankRow = WINDOW_MANAGER:CreateControlFromVirtual("LeoAltholicWindowInventoryPanelBankRow", panel, "LeoAltholicInventoryListTemplate")
-    bankRow:SetAnchor(TOPLEFT, list, BOTTOMLEFT, 20, 0)
+    local charTotalRow = WINDOW_MANAGER:CreateControlFromVirtual("LeoAltholicWindowInventoryPanelCharTotalRow", panel, "LeoAltholicInventoryListTemplate")
+    charTotalRow:SetAnchor(TOPLEFT, list, BOTTOMLEFT, 20, 0)
+    local control = GetControl(charTotalRow, "Name")
+    control:SetText(ZO_CachedStrFormat(GetString(LEOALT_TOTAL_INVENTORY)))
+    local gold = 0
+    local soulGemFilled = 0
+    local soulGemEmpty = 0
+    local ap = 0
+    local telvar = 0
+    local writVoucher = 0
+    for _, char in ipairs(LeoAltholic.ExportCharacters()) do
+        gold = gold + char.inventory.gold
+        ap = ap + char.inventory.ap
+        telvar = telvar + char.inventory.telvar
+        writVoucher = writVoucher + char.inventory.writVoucher
+        soulGemFilled = soulGemFilled + char.inventory.soulGemFilled
+        soulGemEmpty = soulGemEmpty + char.inventory.soulGemEmpty
+    end
+    GetControl(charTotalRow, "Gold"):SetText(formatNumber(gold))
+    GetControl(charTotalRow, "AP"):SetText(formatNumber(ap))
+    GetControl(charTotalRow, "TelVar"):SetText(formatNumber(telvar))
+    GetControl(charTotalRow, "Writ"):SetText(formatNumber(writVoucher))
+    control = GetControl(charTotalRow, "SoulGems")
+    control:SetText("|c" ..LeoAltholic.color.hex.green.. soulGemFilled .. '|r / ' .. soulGemEmpty)
+    GetControl(charTotalRow, "ListButton"):SetHidden(true)

-    local control = GetControl(bankRow, "Name")
+    local bankRow = WINDOW_MANAGER:CreateControlFromVirtual("LeoAltholicWindowInventoryPanelBankRow", panel, "LeoAltholicInventoryListTemplate")
+    bankRow:SetAnchor(TOPLEFT, list, BOTTOMLEFT, 20, 30)
+    control = GetControl(bankRow, "Name")
     control:SetText(ZO_CachedStrFormat(GetString(SI_CURRENCYLOCATION1)))
-
     control = GetControl(bankRow, "ListButton")
     control:SetHandler('OnClicked', function() LeoAltholic.ShowInventoryUI(nil, BAG_BANK) end)

+    local totalRow = WINDOW_MANAGER:CreateControlFromVirtual("LeoAltholicWindowInventoryPanelTotalRow", panel, "LeoAltholicInventoryListTemplate")
+    totalRow:SetAnchor(TOPLEFT, list, BOTTOMLEFT, 20, 60)
+    control = GetControl(totalRow, "Name")
+    control:SetText(ZO_CachedStrFormat(GetString(LEOALT_TOTAL)))
+    GetControl(totalRow, "ListButton"):SetHidden(true)
+
+    GetControl(totalRow, "Gold"):SetText(formatNumber(gold + LeoAltholic.globalData.AccountData.inventory.money))
+    GetControl(totalRow, "AP"):SetText(formatNumber(ap + LeoAltholic.globalData.AccountData.inventory.ap))
+    GetControl(totalRow, "TelVar"):SetText(formatNumber(telvar + LeoAltholic.globalData.AccountData.inventory.telvar))
+    GetControl(totalRow, "Writ"):SetText(formatNumber(writVoucher + LeoAltholic.globalData.AccountData.inventory.writVoucher))
+    control = GetControl(totalRow, "SoulGems")
+    control:SetText("|c" ..LeoAltholic.color.hex.green.. (soulGemFilled+LeoAltholic.globalData.AccountData.inventory.soulGemFilled)
+            .. '|r / ' .. (soulGemEmpty+LeoAltholic.globalData.AccountData.inventory.soulGemEmpty))
+
     LeoAltholicUI.UpdateInventory()
 end

diff --git a/ui/writs.lua b/ui/writs.lua
index 256cac1..a186017 100644
--- a/ui/writs.lua
+++ b/ui/writs.lua
@@ -67,12 +67,11 @@ function LeoAltholicWritsList:SetupEntry(control, data)
                         ago = ZO_CachedStrFormat(GetString(SI_TIME_FORMAT_DAYS), math.floor(diff / 86400))
                     end
                     tooltip = ZO_CachedStrFormat(GetString(SI_TIME_DURATION_AGO), ago)
-                    tooltip = ZO_CachedStrFormat(GetString(SI_TRACKED_QUEST_STEP_DONE), tooltip)
-                elseif inProgress then
-                    ago = ""
                 else
-                    ago  = "--"
+                    ago = '?'
+                    tooltip = ZO_CachedStrFormat(GetString(SI_STR_TIME_UNKNOWN))
                 end
+                tooltip = ZO_CachedStrFormat(GetString(SI_TRACKED_QUEST_STEP_DONE), tooltip)
                 break
             end
         end