diff --git a/Lang/de.lua b/Lang/de.lua index 74f299f..c50b097 100644 --- a/Lang/de.lua +++ b/Lang/de.lua @@ -1,6 +1,6 @@ ZO_CreateStringId("LEOALT_FINISHED", "abgeschl.") -ZO_CreateStringId("LEOALT_UNLOCKED", "freigesch.") +ZO_CreateStringId("LEOALT_UNLOCKED", "freiges.") ZO_CreateStringId("LEOALT_REMOVED_FROM", "<<1>> wurde von <<2>> entfernt.") ZO_CreateStringId("LEOALT_NOT_DONE_TODAY", "Heute: Offen") ZO_CreateStringId("LEOALT_MOUNT_FINISHED", "<<C:1>> hat das Reittraining beendet.") @@ -45,8 +45,9 @@ ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Verfolge tägliche ZO_CreateStringId("LEOALT_CHECKLIST", "Checkliste") ZO_CreateStringId("LEOALT_CHECKLIST_UPWARDS", "Neue Anzeigen oben anfügen") -ZO_CreateStringId("LEOALT_CHECKLIST_HIDE_WHEN_TOOLBAR", "Hide when on toolbar") -ZO_CreateStringId("LEOALT_TOOLBAR", "Toolbar") -ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Compass down") +ZO_CreateStringId("LEOALT_CHECKLIST_HIDE_WHEN_TOOLBAR", "Verstecke (wenn auf Leiste)") +ZO_CreateStringId("LEOALT_TOOLBAR", "Leiste") +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") diff --git a/Lang/en.lua b/Lang/en.lua index a0a8b44..952d215 100644 --- a/Lang/en.lua +++ b/Lang/en.lua @@ -50,3 +50,4 @@ ZO_CreateStringId("LEOALT_TOOLBAR", "Toolbar") 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") diff --git a/LeoAltholic.lua b/LeoAltholic.lua index 2807ee9..dd94b0e 100644 --- a/LeoAltholic.lua +++ b/LeoAltholic.lua @@ -108,7 +108,7 @@ local function checkQuestForWrits(questName) LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastStarted = GetTimeStamp() LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastPreDeliver = nil LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastUpdated = nil - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil + --LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil LeoAltholicChecklistUI.startedWrit(trackedQuest.craft) local numConditions = GetJournalQuestNumConditions(journalQuestIndex, QUEST_MAIN_STEP_INDEX) @@ -122,14 +122,14 @@ local function checkQuestForWrits(questName) if string.find(condText, GetString(LEOALT_DELIVER)) then LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastPreDeliver = GetTimeStamp() LeoAltholicChecklistUI.preDeliverWrit(trackedQuest.craft) - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil + --LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil return end end if hasUpdated then LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastUpdated = GetTimeStamp() LeoAltholicChecklistUI.updateWrit(trackedQuest.craft) - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil + --LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil end return end @@ -139,23 +139,30 @@ end local function initAccountData() if LeoAltholic.globalData.AccountData == nil then LeoAltholic.globalData.AccountData = {} end - local data = {} - - data.inventory = {} - data.inventory[BAG_BANK] = { - size = GetBagSize(BAG_BANK), - used = GetNumBagUsedSlots(BAG_BANK), - free = GetNumBagFreeSlots(BAG_BANK) - } - data.inventory[BAG_SUBSCRIBER_BANK] = { - size = GetBagSize(BAG_SUBSCRIBER_BANK), - used = GetNumBagUsedSlots(BAG_SUBSCRIBER_BANK), - free = GetNumBagFreeSlots(BAG_SUBSCRIBER_BANK) - } - - data.inventory.money = GetBankedMoney() + if LeoAltholic.globalData.AccountData.inventory == nil then + LeoAltholic.globalData.AccountData.inventory = {} + LeoAltholic.globalData.AccountData.inventory[BAG_BANK] = { + size = GetBagSize(BAG_BANK), + used = GetNumBagUsedSlots(BAG_BANK), + free = GetNumBagFreeSlots(BAG_BANK), + list = {} + } + LeoAltholic.globalData.AccountData.inventory[BAG_SUBSCRIBER_BANK] = { + size = GetBagSize(BAG_SUBSCRIBER_BANK), + used = GetNumBagUsedSlots(BAG_SUBSCRIBER_BANK), + free = GetNumBagFreeSlots(BAG_SUBSCRIBER_BANK), + list = {} + } + end + if LeoAltholic.globalData.AccountData.inventory[BAG_BANK].list == nil then + LeoAltholic.globalData.AccountData.inventory[BAG_BANK].list = {} + LeoAltholic.globalData.AccountData.inventory[BAG_SUBSCRIBER_BANK].list = {} + end - LeoAltholic.globalData.AccountData = data + LeoAltholic.globalData.AccountData.inventory.money = GetBankedMoney() + LeoAltholic.globalData.AccountData.inventory.ap = GetCurrencyAmount(CURT_ALLIANCE_POINTS, CURRENCY_LOCATION_BANK) + LeoAltholic.globalData.AccountData.inventory.telvar = GetCurrencyAmount(CURT_TELVAR_STONES, CURRENCY_LOCATION_BANK) + LeoAltholic.globalData.AccountData.inventory.writVoucher = GetCurrencyAmount(CURT_WRIT_VOUCHERS, CURRENCY_LOCATION_BANK) end local function initCharsData() @@ -603,7 +610,16 @@ end function LeoAltholic.GetItems(char, bagId) local itemLines = {} local i = 1 - for k, v in pairs(char.inventory[bagId]) do + local list + if char ~= nil and bagId == BAG_BACKPACK then + list = char.inventory[bagId] + else + list = {} + local n = 0 + for _,v in ipairs(LeoAltholic.globalData.AccountData.inventory[BAG_BANK].list) do n=n+1; list[n]=v end + for _,v in ipairs(LeoAltholic.globalData.AccountData.inventory[BAG_SUBSCRIBER_BANK].list) do n=n+1; list[n]=v end + end + for k, v in pairs(list) do if k == nil then return end itemLines[i] = copy(v) i = i + 1 @@ -724,9 +740,7 @@ local function createMessageQueue() for _, research in pairs(char.research.doing[craft]) do local lineName, lineIcon = GetSmithingResearchLineInfo(research.craft, research.line) local traitType = GetSmithingResearchLineTraitInfo(research.craft, research.line, research.trait) - local time if research.doneAt ~= nil then - time = research.doneAt local data = { id = '$R' .. char.bio.name..research.craft..research.line..research.trait, charName = char.bio.name, @@ -736,7 +750,7 @@ local function createMessageQueue() GetString('SI_ITEMTRAITTYPE',traitType), lineName ), - time = time + time = research.doneAt } LeoAltholic.AddToQueue(data) end @@ -791,6 +805,9 @@ local function onUpdate() if LeoAltholic.IsTabVisible(LeoAltholic.TAB_RESEARCH) then LeoAltholicUI:updateResearch() end + if LeoAltholic.IsTabVisible(LeoAltholic.TAB_INVENTORY) then + LeoAltholicUI.UpdateInventory() + end --[[ if LeoAltholic.numUpdates >= 30 then -- 60 seconds @@ -918,6 +935,97 @@ local function onQuestComplete(eventCode, questName, level, previousExperience, end end +local function addToBank(bagId, slotIndex, itemLink, name, stackCount) + + if name == nil then name = GetItemName(bagId, slotIndex) end + + table.insert(LeoAltholic.globalData.AccountData.inventory[bagId].list, { + slotIndex = slotIndex, + link = itemLink, + name = name, + count = stackCount + }) +end + +local function removeFromBank(bagId, slotIndex) + for i, item in pairs(LeoAltholic.globalData.AccountData.inventory[bagId].list) do + if item.slotIndex == slotIndex then + table.remove(LeoAltholic.globalData.AccountData.inventory[bagId].list, i) + return + end + end +end + +local function updateBank(bagId, slotIndex, stackCount) + for i, item in pairs(LeoAltholic.globalData.AccountData.inventory[bagId].list) do + if item.slotIndex == slotIndex then + LeoAltholic.globalData.AccountData.inventory[bagId].list[i].count = + LeoAltholic.globalData.AccountData.inventory[bagId].list[i].count + stackCount + return + end + end +end + +local function scanBank() + + LeoAltholic.globalData.AccountData.inventory[BAG_BANK].list = {} + LeoAltholic.globalData.AccountData.inventory[BAG_SUBSCRIBER_BANK].list = {} + local numEmptySoulGems = 0 + local numFilledSoulGems = 0 + + local bagCache = SHARED_INVENTORY:GenerateFullSlotData(nil, BAG_BANK, BAG_SUBSCRIBER_BANK) + for _, data in pairs(bagCache) do + local itemLink = GetItemLink(data.bagId, data.slotIndex) + if IsItemSoulGem(SOUL_GEM_TYPE_FILLED, data.bagId, data.slotIndex) then + numFilledSoulGems = numFilledSoulGems + data.stackCount + elseif IsItemSoulGem(SOUL_GEM_TYPE_EMPTY, data.bagId, data.slotIndex) then + numEmptySoulGems = numEmptySoulGems + data.stackCount + end + addToBank(data.bagId, data.slotIndex, itemLink, data.name, data.stackCount) + end + + LeoAltholic.globalData.AccountData.inventory.soulGemEmpty = numEmptySoulGems + LeoAltholic.globalData.AccountData.inventory.soulGemFilled = numFilledSoulGems +end + +local function findIteminBank(bagId, slotIndex) + for _, item in pairs(LeoAltholic.globalData.AccountData.inventory[bagId].list) do + if item.slotIndex == slotIndex then return item.link end + end +end + +local function onUpdateBank(eventCode, bagId, slotId, isNewItem, itemSoundCategory, inventoryUpdateReason, stackCountChange) + if inventoryUpdateReason ~= INVENTORY_UPDATE_REASON_DEFAULT or (bagId ~= BAG_BANK and bagId ~= BAG_SUBSCRIBER_BANK) then return end + + local itemLink = GetItemLink(bagId, slotId) + local removed = false + local found = findIteminBank(bagId, slotId) + + if itemLink == nil or itemLink == "" then + removed = true + itemLink = findIteminBank(bagId, slotId) + end + + if not found and stackCountChange > 0 then + addToBank(bagId, slotId, itemLink, nil, stackCountChange) + elseif found and not removed then + updateBank(bagId, slotId, stackCountChange) + elseif found and removed then + removeFromBank(bagId, slotId) + end +end + +local function onCloseBank(eventCode, bagId) + EVENT_MANAGER:UnregisterForEvent(LeoAltholic.name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE) +end + +local function onOpenBank(eventCode, bagId) + if bagId ~= BAG_BANK and bagId ~= BAG_SUBSCRIBER_BANK then return end + EVENT_MANAGER:UnregisterForEvent(LeoAltholic.name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE) + EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE, onUpdateBank) + scanBank() +end + local function migrateDataToV2() LeoAltholic.globalData.settings.toolbar = { enabled = false @@ -1070,6 +1178,7 @@ local function initialize() LeoAltholicChecklistUI.initializeQuests() LeoAltholicChecklistUI.update() LeoAltholicUI:updateResearch() + LeoAltholicUI.InitInventory() end local orig_ZO_QuestJournalNavigationEntry_OnMouseUp = ZO_QuestJournalNavigationEntry_OnMouseUp @@ -1151,6 +1260,9 @@ local function onAddOnLoaded(event, addonName) EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_QUEST_REMOVED, onQuestRemoved) EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_QUEST_CONDITION_COUNTER_CHANGED, onQuestCounterChanged) + EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_OPEN_BANK, onOpenBank) + EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_CLOSE_BANK, onCloseBank) + --EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_MAIL_READABLE, onMailRedable) --EVENT_MANAGER:RegisterForEvent(LeoAltholic.name, EVENT_SKILL_POINTS_CHANGED, onUpdateSkills) EVENT_MANAGER:RegisterForUpdate(LeoAltholic.name, 2000, onUpdate) diff --git a/LeoAltholic.txt b/LeoAltholic.txt index 7ce4fe8..37df3b1 100644 --- a/LeoAltholic.txt +++ b/LeoAltholic.txt @@ -1,6 +1,6 @@ ## Title: Leo's Altholic ## APIVersion: 100024 100025 -## Version: 1.5.1 +## Version: 1.6.0 ## Author: |c39B027@LeandroSilva|r ## SavedVariables: LeoAltholicSavedVariables LeoAltholicCharVariables ## OptionalDependsOn: LibStub LibFeedback LibAddonMenu-2.0 diff --git a/LeoAltholic.xml b/LeoAltholic.xml index fdfb278..dacd1bf 100644 --- a/LeoAltholic.xml +++ b/LeoAltholic.xml @@ -984,37 +984,37 @@ </Texture> <Texture name="$(parent)2Label" mouseEnabled="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_clothing_up.dds"> <Dimensions x="38" y="38"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)1Label" relativePoint="TOPRIGHT" offsetX="44"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)1Label" relativePoint="TOPRIGHT" offsetX="70"/> <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE14)) </OnMouseEnter> <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> </Texture> <Texture name="$(parent)6Label" mouseEnabled="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_woodworking_up.dds"> <Dimensions x="38" y="38"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)2Label" relativePoint="TOPRIGHT" offsetX="44"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)2Label" relativePoint="TOPRIGHT" offsetX="70"/> <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE15)) </OnMouseEnter> <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> </Texture> <Texture name="$(parent)7Label" mouseEnabled="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_jewelrycrafting_up.dds"> <Dimensions x="38" y="38"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)6Label" relativePoint="TOPRIGHT" offsetX="44"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)6Label" relativePoint="TOPRIGHT" offsetX="70"/> <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE24)) </OnMouseEnter> <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> </Texture> <Texture name="$(parent)3Label" mouseEnabled="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_enchanting_up.dds"> <Dimensions x="38" y="38"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)7Label" relativePoint="TOPRIGHT" offsetX="44"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)7Label" relativePoint="TOPRIGHT" offsetX="70"/> <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE17)) </OnMouseEnter> <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> </Texture> <Texture name="$(parent)4Label" mouseEnabled="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_alchemy_up.dds"> <Dimensions x="38" y="38"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)3Label" relativePoint="TOPRIGHT" offsetX="44"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)3Label" relativePoint="TOPRIGHT" offsetX="70"/> <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE16)) </OnMouseEnter> <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> </Texture> <Texture name="$(parent)5Label" mouseEnabled="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_provisioning_up.dds"> <Dimensions x="38" y="38"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)4Label" relativePoint="TOPRIGHT" offsetX="44"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)4Label" relativePoint="TOPRIGHT" offsetX="70"/> <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE18)) </OnMouseEnter> <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> </Texture> @@ -1226,33 +1226,67 @@ <Dimensions x="180" y="30"/> </Label> + <Texture name="$(parent)Craft1Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="10" offsetY="0"/> + </Texture> <Label name="$(parent)Craft1Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="10" offsetY="0"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> + + <Texture name="$(parent)Craft2Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Status" relativePoint="TOPRIGHT" offsetX="12"/> + </Texture> <Label name="$(parent)Craft2Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Status" relativePoint="TOPRIGHT" offsetX="12"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> + + <Texture name="$(parent)Craft6Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Status" relativePoint="TOPRIGHT" offsetX="12"/> + </Texture> <Label name="$(parent)Craft6Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Status" relativePoint="TOPRIGHT" offsetX="12"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> + + <Texture name="$(parent)Craft7Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Status" relativePoint="TOPRIGHT" offsetX="12"/> + </Texture> <Label name="$(parent)Craft7Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Status" relativePoint="TOPRIGHT" offsetX="12"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> + + <Texture name="$(parent)Craft3Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Status" relativePoint="TOPRIGHT" offsetX="12"/> + </Texture> <Label name="$(parent)Craft3Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Craft7Status" relativePoint="TOPRIGHT" offsetX="12"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> + + <Texture name="$(parent)Craft4Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Status" relativePoint="TOPRIGHT" offsetX="12"/> + </Texture> <Label name="$(parent)Craft4Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Craft3Status" relativePoint="TOPRIGHT" offsetX="12"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> + + <Texture name="$(parent)Craft5Icon" hidden="false"> + <Dimensions y="24" x="24"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Status" relativePoint="TOPRIGHT" offsetX="12"/> + </Texture> <Label name="$(parent)Craft5Status" font="LeoAltholicLargeFont" verticalAlignment="CENTER" horizontalAlignment="LEFT" resizeToFitDescendents="false"> <Dimensions x="70" y="28"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Craft4Status" relativePoint="TOPRIGHT" offsetX="12"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Craft5Icon" relativePoint="TOPRIGHT" offsetX="2"/> </Label> <Line name="$(parent)HorizLine" color="444444" thickness="2" pixelRoundingEnabled="true"> diff --git a/LeoAltholicInit.lua b/LeoAltholicInit.lua index 0469c3d..8437eea 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.5.1" +LeoAltholic.version = "1.6.0" LeoAltholic.chatPrefix = "|c39B027" .. LeoAltholic.name .. "|r: " LeoAltholic.TAB_BIO = "Bio" diff --git a/LeoAltholicUI.lua b/LeoAltholicUI.lua index 39b28dd..9d77e3c 100644 --- a/LeoAltholicUI.lua +++ b/LeoAltholicUI.lua @@ -41,7 +41,10 @@ function LeoAltholic.ShowInventoryUI(charName, bagId) SCENE_MANAGER:ShowTopLevel(LeoAltholicInventoryWindow) LeoAltholicInventoryWindow:SetDrawLayer(DL_OVERLAY) LeoAltholicInventoryWindow:SetDrawTier(DT_MEDIUM) - local char = LeoAltholic.GetCharByName(charName) + local char + if charName ~= nil then + char = LeoAltholic.GetCharByName(charName) + end local sc = WINDOW_MANAGER:GetControlByName("LeoAltholicInventoryWindowListScrollChild") sc:SetHidden(false) diff --git a/Settings.lua b/Settings.lua index 54b9313..2cf6a1a 100644 --- a/Settings.lua +++ b/Settings.lua @@ -69,7 +69,7 @@ function LeoAltholic_Settings:CreatePanel() setFunc = LeoAltholicChecklistUI.SetHideWhenToolbar },{ type = "submenu", - name = GetString(SI_INVENTORY_MODE_ITEMS), + name = GetString(LEOALT_ENTRIES), controls = { { type = "description", @@ -175,7 +175,7 @@ function LeoAltholic_Settings:CreatePanel() setFunc = LeoAltholicToolbarUI.SetBumpCompass, },{ type = "submenu", - name = GetString(SI_INVENTORY_MODE_ITEMS), + name = GetString(LEOALT_ENTRIES), controls = { { type = "checkbox", diff --git a/ui/bio.lua b/ui/bio.lua index 03bb029..12fded7 100644 --- a/ui/bio.lua +++ b/ui/bio.lua @@ -64,8 +64,12 @@ function LeoAltholicBioList:SetupEntry(control, data) control.riding = GetControl(control, "Riding") local riding = '|t20:20:esoui/art/mounts/ridingskill_speed.dds|t' .. string.format("%02d%%", data.riding.speed) .. ' |t20:20:esoui/art/mounts/ridingskill_stamina.dds|t' .. string.format("%02d", data.riding.stamina) .. - ' |t20:20:esoui/art/mounts/ridingskill_capacity.dds|t' .. string.format("%02d", data.riding.capacity) .. - ' |t22:22:esoui/art/miscellaneous/timer_32.dds|t' .. LeoAltholic.FormatTime(data.riding.time - GetTimeStamp(), true, true) + ' |t20:20:esoui/art/mounts/ridingskill_capacity.dds|t' .. string.format("%02d", data.riding.capacity) + if (data.riding.speed < data.riding.speedMax or + data.riding.stamina < data.riding.staminaMax or + data.riding.capacity < data.riding.capacityMax) then + riding = riding .. ' |t22:22:esoui/art/miscellaneous/timer_32.dds|t' .. LeoAltholic.FormatTime(data.riding.time - GetTimeStamp(), true, true) + end control.riding:SetText(riding) control.riding.riding = data.riding @@ -142,8 +146,13 @@ function LeoAltholicUI:updateBio() local child = control:GetChild(i):GetChild(8) local riding = '|t20:20:esoui/art/mounts/ridingskill_speed.dds|t' .. string.format("%02d%%", child.riding.speed) .. ' |t20:20:esoui/art/mounts/ridingskill_stamina.dds|t' .. string.format("%02d", child.riding.stamina) .. - ' |t20:20:esoui/art/mounts/ridingskill_capacity.dds|t' .. string.format("%02d", child.riding.capacity) .. - ' |t22:22:esoui/art/miscellaneous/timer_32.dds|t' .. LeoAltholic.FormatTime(child.riding.time - GetTimeStamp(), true, true) + ' |t20:20:esoui/art/mounts/ridingskill_capacity.dds|t' .. string.format("%02d", child.riding.capacity) + + if (child.riding.speed < child.riding.speedMax or + child.riding.stamina < child.riding.staminaMax or + child.riding.capacity < child.riding.capacityMax) then + riding = riding .. ' |t22:22:esoui/art/miscellaneous/timer_32.dds|t' .. LeoAltholic.FormatTime(child.riding.time - GetTimeStamp(), true, true) + end child:SetText(riding) end end diff --git a/ui/checklist.lua b/ui/checklist.lua index 799ce18..9fc9b47 100644 --- a/ui/checklist.lua +++ b/ui/checklist.lua @@ -79,7 +79,11 @@ function LeoAltholicChecklistUI.SetRiding(value) end function LeoAltholicChecklistUI.GetRiding() if LeoAltholic.charData.settings.checklist.riding == nil then LeoAltholic.charData.settings.checklist.riding = true end - return LeoAltholic.charData.settings.checklist.riding + local char = LeoAltholic.GetMyself() + return LeoAltholic.charData.settings.checklist.riding and + (char.attributes.riding.speed < char.attributes.riding.speedMax or + char.attributes.riding.stamina < char.attributes.riding.staminaMax or + char.attributes.riding.capacity < char.attributes.riding.capacityMax) end @@ -304,7 +308,7 @@ function LeoAltholicChecklistUI.initializeQuests() LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastStarted = GetTimeStamp() LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastPreDeliver = nil LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastUpdated = nil - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil + --LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil LeoAltholicChecklistUI.startedWrit(trackedQuest.craft) local hasUpdated = false @@ -318,14 +322,14 @@ function LeoAltholicChecklistUI.initializeQuests() if string.find(condText, GetString(LEOALT_DELIVER)) then LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastPreDeliver = GetTimeStamp() LeoAltholicChecklistUI.preDeliverWrit(trackedQuest.craft) - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil + --LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil return end end if hasUpdated then LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastUpdated = GetTimeStamp() LeoAltholicChecklistUI.updateWrit(trackedQuest.craft) - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil + --LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastDone = nil end break end @@ -386,12 +390,9 @@ function LeoAltholicChecklistUI.update() end label = GetControl(panel, "Riding") - label:SetScale(scale) label:SetColor(1,1,1,1) texture = GetControl(panel, "RidingStatus") - texture:SetScale(scale) craftIcon = GetControl(panel, "RidingIcon") - craftIcon:SetScale(scale) createItem(label, GetString(SI_STAT_GAMEPAD_RIDING_HEADER_TRAINING), texture, craftIcon, LeoAltholicChecklistUI.GetRiding()) if char.attributes.riding.time - GetTimeStamp() > 0 then doneItem(label, texture) diff --git a/ui/inventory.lua b/ui/inventory.lua index 268ac50..4b75b03 100644 --- a/ui/inventory.lua +++ b/ui/inventory.lua @@ -141,10 +141,26 @@ function LeoAltholicInventoryList:FilterScrollList() end end -function LeoAltholicUI.updateInventory() +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 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) + + LeoAltholicUI.UpdateInventory() +end + +function LeoAltholicUI.UpdateInventory() local data = LeoAltholic.globalData.AccountData - local panel = WINDOW_MANAGER:GetControlByName("LeoAltholicWindowInventoryPanel") + local bankRow = WINDOW_MANAGER:GetControlByName("LeoAltholicWindowInventoryPanelBankRow") local free = data.inventory[BAG_BANK].free + data.inventory[BAG_SUBSCRIBER_BANK].free local used = data.inventory[BAG_BANK].used + data.inventory[BAG_SUBSCRIBER_BANK].used @@ -152,10 +168,23 @@ function LeoAltholicUI.updateInventory() local color = '|c'..LeoAltholic.color.hex.green if free <= 25 then color = '|c'..LeoAltholic.color.hex.orange end if free <= 10 then color = '|c'..LeoAltholic.color.hex.red end - local bank = GetControl(panel, "Bank") - bank:SetText(color .. used .. "|r / " .. size) + control = GetControl(bankRow, "Bag") + control:SetText(color .. used .. "|r / " .. size) - local control = GetControl(panel, "Gold") + control = GetControl(bankRow, "Gold") control:SetText(formatNumber(data.inventory.money)) + control = GetControl(bankRow, "SoulGems") + if data.inventory.soulGemFilled ~= nil then + control:SetText("|c" ..LeoAltholic.color.hex.green.. data.inventory.soulGemFilled .. '|r / ' .. data.inventory.soulGemEmpty) + end + + control = GetControl(bankRow, "AP") + control:SetText(formatNumber(data.inventory.ap)) + + control = GetControl(bankRow, "TelVar") + control:SetText(formatNumber(data.inventory.telvar)) + + control = GetControl(bankRow, "Writ") + control:SetText(formatNumber(data.inventory.writVoucher)) end diff --git a/ui/research.lua b/ui/research.lua index 171fd6a..dcc6416 100644 --- a/ui/research.lua +++ b/ui/research.lua @@ -143,7 +143,7 @@ function LeoAltholicUI.TooltipResearch(control, visible) addLineTitle(InformationTooltip, ZO_CachedStrFormat(SI_ABILITY_NAME, GetCraftingSkillName(control.list[1].craft))) for _, trait in pairs(control.list) do - addLine(InformationTooltip, "|t30:30:"..trait.lineIcon.."|t "..trait.lineName.." "..trait.traitName.." |cff0000"..trait.timer) + addLine(InformationTooltip, "|t30:30:"..trait.lineIcon.."|t "..trait.traitName.." "..trait.lineName.." |cff0000"..trait.timer) end InformationTooltip:SetHidden(false) diff --git a/ui/toolbar.lua b/ui/toolbar.lua index d6ddcdb..a701a89 100644 --- a/ui/toolbar.lua +++ b/ui/toolbar.lua @@ -50,16 +50,21 @@ function LeoAltholicToolbarUI.GetItem(item) return LeoAltholic.globalData.settings.toolbar.items[item] end - -function LeoAltholicToolbarUI.OnWindowMoveStop() +local function checkCenter() if LeoAltholicToolbar:GetTop() <= 60 then local x = LeoAltholicToolbar:GetCenter() local guiRootX = GuiRoot:GetCenter() - x = LeoAltholicToolbar:GetLeft() + (guiRootX - x) - LeoAltholicToolbar:ClearAnchors() - LeoAltholicToolbar:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, x, LeoAltholicToolbar:GetTop()) - LeoAltholicToolbarUI.SetPosition(x, LeoAltholicToolbar:GetTop()) + if x ~= guiRootX then + x = LeoAltholicToolbar:GetLeft() + (guiRootX - x) + LeoAltholicToolbar:ClearAnchors() + LeoAltholicToolbar:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, x, LeoAltholicToolbar:GetTop()) + LeoAltholicToolbarUI.SetPosition(x, LeoAltholicToolbar:GetTop()) + end end +end + +function LeoAltholicToolbarUI.OnWindowMoveStop() + checkCenter() LeoAltholicToolbarUI.SetPosition(LeoAltholicToolbar:GetLeft(), LeoAltholicToolbar:GetTop()) end @@ -78,7 +83,9 @@ function LeoAltholicToolbarUI.RestorePosition() end function LeoAltholicToolbarUI.BumpCompass() - if LeoAltholicToolbarUI.IsEnabled() and LeoAltholicToolbarUI.GetBumpCompass() then + local hasWykkydsToolbar = false + if WYK_Toolbar and wykkydsToolbar then hasWykkydsToolbar = true end + if not hasWykkydsToolbar and LeoAltholicToolbarUI.IsEnabled() and LeoAltholicToolbarUI.GetBumpCompass() then if LeoAltholicToolbar:GetTop() <= 60 then if math.floor(ZO_CompassFrame:GetTop()) ~= math.floor(LeoAltholicToolbar:GetTop()) + 60 then ZO_CompassFrame:ClearAnchors() @@ -300,6 +307,7 @@ function LeoAltholicToolbarUI.update() if numSections > 0 then toolbar:SetWidth(totalWidth) GetControl(toolbar, "BG"):SetWidth(totalWidth) + checkCenter() else toolbar:SetHidden(true) end diff --git a/ui/writs.lua b/ui/writs.lua index 57c2ccd..2e82856 100644 --- a/ui/writs.lua +++ b/ui/writs.lua @@ -29,9 +29,10 @@ function LeoAltholicWritsList:SetupEntry(control, data) control.name = GetControl(control, "Name") control.name:SetText(data.name) - local child + local child, texture for _, craft in pairs(LeoAltholic.allCrafts) do child = GetControl(control, "Craft"..craft.."Status") + texture = GetControl(control, "Craft"..craft.."Icon") local icon = "esoui/art/tutorial/menubar_help_up.dds" local color = {1,1,1,1} local ago = "" @@ -58,7 +59,11 @@ function LeoAltholicWritsList:SetupEntry(control, data) break end end - child:SetText("|t24:24:"..icon.."|t ".. ago) + + texture:SetTexture(icon) + texture:SetColor(unpack(color)) + + child:SetText(ago) child:SetColor(unpack(color)) end