diff --git a/Lang/de.lua b/Lang/de.lua index 3cf9b62..7bd2a5e 100644 --- a/Lang/de.lua +++ b/Lang/de.lua @@ -45,7 +45,8 @@ 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 Game Compass down") +ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Compass down") ZO_CreateStringId("LEOALT_ACCOUNT_CONFIGURATION", "Accountweite Einstellung") ZO_CreateStringId("LEOALT_CHAR_CONFIGURATION", "Charakter spezifisch") diff --git a/Lang/en.lua b/Lang/en.lua index 80fb885..a0a8b44 100644 --- a/Lang/en.lua +++ b/Lang/en.lua @@ -45,7 +45,8 @@ ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Track Daily Quest" ZO_CreateStringId("LEOALT_CHECKLIST", "Checklist") ZO_CreateStringId("LEOALT_CHECKLIST_UPWARDS", "Add Frames Upwards") +ZO_CreateStringId("LEOALT_CHECKLIST_HIDE_WHEN_TOOLBAR", "Hide when on toolbar") ZO_CreateStringId("LEOALT_TOOLBAR", "Toolbar") -ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Game Compass down") +ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Compass down") ZO_CreateStringId("LEOALT_ACCOUNT_CONFIGURATION", "Account Wide Configuration") ZO_CreateStringId("LEOALT_CHAR_CONFIGURATION", "Character Specific") diff --git a/Lang/fr.lua b/Lang/fr.lua index c27c79d..b0c45de 100644 --- a/Lang/fr.lua +++ b/Lang/fr.lua @@ -45,7 +45,8 @@ ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "Track Daily Quest" ZO_CreateStringId("LEOALT_CHECKLIST", "Liste de contrôle") ZO_CreateStringId("LEOALT_CHECKLIST_UPWARDS", "Add Frames Upwards") +ZO_CreateStringId("LEOALT_CHECKLIST_HIDE_WHEN_TOOLBAR", "Hide when on toolbar") ZO_CreateStringId("LEOALT_TOOLBAR", "Toolbar") -ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Game Compass down") +ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Compass down") ZO_CreateStringId("LEOALT_ACCOUNT_CONFIGURATION", "Account Wide Configuration") ZO_CreateStringId("LEOALT_CHAR_CONFIGURATION", "Character Specific") diff --git a/Lang/jp.lua b/Lang/jp.lua index 425d753..7caee4c 100644 --- a/Lang/jp.lua +++ b/Lang/jp.lua @@ -45,7 +45,8 @@ ZO_CreateStringId('SI_BINDING_NAME_LEOALTHOLIC_TRACK_QUEST', "デイリークエ ZO_CreateStringId("LEOALT_CHECKLIST", "チェックリスト") ZO_CreateStringId("LEOALT_CHECKLIST_UPWARDS", "挑発バーを上方向に追加") +ZO_CreateStringId("LEOALT_CHECKLIST_HIDE_WHEN_TOOLBAR", "Hide when on toolbar") ZO_CreateStringId("LEOALT_TOOLBAR", "Toolbar") -ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Game Compass down") +ZO_CreateStringId("LEOALT_BUMP_COMPASS", "Bump Compass down") ZO_CreateStringId("LEOALT_ACCOUNT_CONFIGURATION", "Account Wide Configuration") ZO_CreateStringId("LEOALT_CHAR_CONFIGURATION", "Character Specific") diff --git a/LeoAltholic.lua b/LeoAltholic.lua index de55e86..0b23cae 100644 --- a/LeoAltholic.lua +++ b/LeoAltholic.lua @@ -102,6 +102,40 @@ local function createQuestEntry(questId) return quest end +local function checkQuestForWrits(questName) + for i,trackedQuest in pairs(LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs) do + if (trackedQuest.name == questName) then + 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 + LeoAltholicChecklistUI.startedWrit(trackedQuest.craft) + + local numConditions = GetJournalQuestNumConditions(journalQuestIndex, QUEST_MAIN_STEP_INDEX) + local hasUpdated = false + for condition = 1, numConditions do + local current, max = GetJournalQuestConditionValues(journalQuestIndex, QUEST_MAIN_STEP_INDEX, condition) + if hasUpdated == false and current > 0 then + hasUpdated = true + end + local condText = GetJournalQuestConditionInfo(journalQuestIndex, QUEST_MAIN_STEP_INDEX, condition) + 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 + 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 + end + return + end + end +end + local function initCharsList() if LeoAltholic.globalData.CharList == nil then LeoAltholic.globalData.CharList = {} end @@ -315,7 +349,8 @@ local function initCharsList() craft = craft, line = line, trait = trait, - time = remaining + time = remaining, + timeDone = remaining + GetTimeStamp() }) local data = { id = '$R' .. char.bio.name..craft..line..trait, @@ -407,6 +442,7 @@ local function initCharsList() if IsValidQuestIndex(i) then local quest = createQuestEntry(i) table.insert(char.quests.actives, quest) + checkQuestForWrits(quest.name) n = n + 1 end end @@ -572,7 +608,8 @@ local function onResearchStarted(eventCode, craft, line, trait) craft = craft, line = line, trait = trait, - time = remaining + time = remaining, + timeDone = remaining + GetTimeStamp() }) if LeoAltholic.IsTabVisible(LeoAltholic.TAB_RESEARCH) then LeoAltholicUI.researchList:RefreshData() @@ -633,8 +670,8 @@ function LeoAltholic.AddToQueue(data) end local function processQueue() - for x,data in pairs(LeoAltholic.timerQueue) do - if GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then + for i, data in pairs(LeoAltholic.timerQueue) do + if not data.announced and GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then if data.charName ~= LeoAltholic.CharName and LeoAltholic.globalData.settings.completedResearch.chat == true then LeoAltholic.log(data.info) end @@ -643,7 +680,8 @@ local function processQueue() messageParams:SetText(formatMessage(data.info)) CENTER_SCREEN_ANNOUNCE:AddMessageWithParams(messageParams) end - table.remove(LeoAltholic.timerQueue, x) + LeoAltholic.timerQueue[i].announced = true + --table.remove(LeoAltholic.timerQueue, x) end end end @@ -665,6 +703,12 @@ 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.timeDone ~= nil then + time = research.timeDone + else + time = research.time + GetTimeStamp() + end local data = { id = '$R' .. char.bio.name..research.craft..research.line..research.trait, charName = char.bio.name, @@ -674,7 +718,7 @@ local function createMessageQueue() GetString('SI_ITEMTRAITTYPE',traitType), lineName ), - time = research.time + time = time } LeoAltholic.AddToQueue(data) end @@ -709,7 +753,7 @@ local function onUpdate() processQueue() LeoAltholicChecklistUI.checkReset() - --LeoAltholicToolbarUI:update() + LeoAltholicToolbarUI:update() LeoAltholic.numUpdates = LeoAltholic.numUpdates + 1 @@ -797,32 +841,7 @@ local function onQuestAdded(eventCode, journalQuestIndex, questName, objectiveNa trackQuest(journalQuestIndex, true) end - for i,trackedQuest in pairs(LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs) do - if (trackedQuest.name == questName) then - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastStarted = GetTimeStamp() - LeoAltholicChecklistUI.startedWrit(trackedQuest.craft) - - local numConditions = GetJournalQuestNumConditions(journalQuestIndex, QUEST_MAIN_STEP_INDEX) - local hasUpdated = false - for condition = 1, numConditions do - local current, max = GetJournalQuestConditionValues(journalQuestIndex, QUEST_MAIN_STEP_INDEX, condition) - if hasUpdated == false and current > 0 then - hasUpdated = true - end - local condText = GetJournalQuestConditionInfo(journalQuestIndex, QUEST_MAIN_STEP_INDEX, condition) - if string.find(condText, GetString(LEOALT_DELIVER)) then - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastPreDeliver = GetTimeStamp() - LeoAltholicChecklistUI.preDeliverWrit(trackedQuest.craft) - return - end - end - if hasUpdated then - LeoAltholic.globalData.CharList[LeoAltholic.CharName].quests.writs[i].lastUpdated = GetTimeStamp() - LeoAltholicChecklistUI.updateWrit(trackedQuest.craft) - end - return - end - end + checkQuestForWrits(questName) end local function onQuestCounterChanged(eventCode, journalQuestIndex, questName, conditionText, conditionType, currConditionVal, newConditionVal, conditionMax, isFailCondition, stepOverrideText, isPushed, isComplete, isConditionComplete, isStepHidden) @@ -950,6 +969,7 @@ local function initializeVars() end LeoAltholicChecklistUI.normalizeSettings() + LeoAltholicToolbarUI.normalizeSettings() if not LeoAltholic.globalData.dataVersion or LeoAltholic.globalData.dataVersion < 2 then migrateDataToV2() @@ -977,7 +997,7 @@ local function initialize() LeoAltholic.feedback = feedbackWindow LeoAltholic.RestorePosition() - --LeoAltholicToolbarUI.RestorePosition() + LeoAltholicToolbarUI.RestorePosition() LeoAltholicChecklistUI.RestorePosition() LeoAltholicUI.InitPanels() @@ -1026,7 +1046,7 @@ local function initialize() LeoAltholic.initialized = true CALLBACK_MANAGER:FireCallbacks("LeoAltholicInitialized") - --LeoAltholicToolbarUI:update() + LeoAltholicToolbarUI:update() LeoAltholicChecklistUI.updateQuests() LeoAltholicChecklistUI.update() end diff --git a/LeoAltholic.xml b/LeoAltholic.xml index d3ae14e..8507f17 100644 --- a/LeoAltholic.xml +++ b/LeoAltholic.xml @@ -1741,8 +1741,8 @@ </Label> <Line color="444444" thickness="2" pixelRoundingEnabled="true"> - <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="BOTTOMLEFT" offsetX="0" offsetY="0"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)Craft7" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="2"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="BOTTOMLEFT" offsetX="0" offsetY="2"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)Craft7" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="-1"/> </Line> </Controls> </Control> @@ -1853,7 +1853,16 @@ <Dimensions x="600" y="32"/> <Edge edgeSize="1"/> </Backdrop> - <Texture name="$(parent)RidingTexture" hidden="true" textureFile="/esoui/art/tutorial/store_indexicon_mounts_up.dds"> + <Texture name="$(parent)InventoryTexture" hidden="true" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_bagvendor.dds"> + <Dimensions y="32" x="32"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10" offsetY="0"/> + </Texture> + <Label name="$(parent)Inventory" hidden="true" font="LeoAltholicLargeFont" verticalAlignment="CENTER"> + <Dimensions x="70" y="32" /> + <Anchor point="TOPLEFT" relativeTo="$(parent)InventoryTexture" relativePoint="TOPRIGHT" offsetX="2"/> + </Label> + <Line name="$(parent)RidingLine" color="777777" hidden="true" thickness="2" pixelRoundingEnabled="true"/> + <Texture name="$(parent)RidingTexture" hidden="true" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_stablemaster.dds"> <Dimensions y="32" x="32"/> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10" offsetY="0"/> </Texture> @@ -1861,7 +1870,8 @@ <Dimensions x="80" y="32" /> <Anchor point="TOPLEFT" relativeTo="$(parent)RidingTexture" relativePoint="TOPRIGHT" offsetX="2"/> </Label> - <Texture name="$(parent)Craft1Texture" hidden="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_blacksmithing_down.dds"> + <Line name="$(parent)CraftLine" color="777777" hidden="true" thickness="2" pixelRoundingEnabled="true"/> + <Texture name="$(parent)Craft1Texture" hidden="true" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_weaponsmithingstation.dds"> <Dimensions y="32" x="32"/> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> </Texture> @@ -1869,7 +1879,7 @@ <Dimensions x="100" y="32" /> <Anchor point="TOPLEFT" relativeTo="$(parent)Craft1Texture" relativePoint="TOPRIGHT" offsetX="2" offsetY="0"/> </Label> - <Texture name="$(parent)Craft2Texture" hidden="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_clothing_down.dds"> + <Texture name="$(parent)Craft2Texture" hidden="true" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_armorsmithingstation.dds"> <Dimensions y="32" x="32"/> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> </Texture> @@ -1877,7 +1887,7 @@ <Dimensions x="100" y="32" /> <Anchor point="TOPLEFT" relativeTo="$(parent)Craft2Texture" relativePoint="TOPRIGHT" offsetX="2" offsetY="0"/> </Label> - <Texture name="$(parent)Craft6Texture" hidden="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_woodworking_down.dds"> + <Texture name="$(parent)Craft6Texture" hidden="true" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_woodworker.dds"> <Dimensions y="32" x="32"/> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> </Texture> @@ -1885,7 +1895,7 @@ <Dimensions x="100" y="32" /> <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Texture" relativePoint="TOPRIGHT" offsetX="2" offsetY="0"/> </Label> - <Texture name="$(parent)Craft7Texture" hidden="true" textureFile="/esoui/art/inventory/inventory_tabicon_craftbag_jewelrycrafting_down.dds"> + <Texture name="$(parent)Craft7Texture" hidden="true" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_jewelrycrafting.dds"> <Dimensions y="32" x="32"/> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> </Texture> @@ -1893,10 +1903,6 @@ <Dimensions x="100" y="32" /> <Anchor point="TOPLEFT" relativeTo="$(parent)Craft6Texture" relativePoint="TOPRIGHT" offsetX="2" offsetY="0"/> </Label> - <Label name="$(parent)Checklist" hidden="true" font="LeoAltholicLargeFont" verticalAlignment="CENTER"> - <Dimensions x="100" y="32" /> - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> - </Label> <Texture name="$(parent)HirelingTexture" hidden="true" textureFile="/esoui/art/chatwindow/chat_mail_up.dds"> <Dimensions y="32" x="32"/> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> @@ -1905,6 +1911,69 @@ <Dimensions x="100" y="32" /> <Anchor point="TOPLEFT" relativeTo="$(parent)HirelingTexture" relativePoint="TOPRIGHT" offsetX="2" offsetY="0"/> </Label> + + <Line name="$(parent)ChecklistLine" color="777777" hidden="true" thickness="2" pixelRoundingEnabled="true"/> + <Control name="$(parent)Checklist" hidden="false" inheritAlpha="false"> + <Dimensions x="200" y="32"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10"/> + <Controls> + <Texture name="$(parent)Craft1Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_weaponsmithingstation.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="0" offsetY="0"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE13)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)Craft2Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_armorsmithingstation.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE14)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)Craft3Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_enchantingstation.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE17)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)Craft4Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_alchemystation.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE16)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)Craft5Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_provisioner.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE18)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)Craft6Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_woodworker.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE15)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)Craft7Icon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_jewelrycrafting.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_ITEMFILTERTYPE24)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + <Texture name="$(parent)RidingIcon" hidden="true" inheritAlpha="false" color="FFFFFF" textureFile="/esoui/art/icons/servicetooltipicons/gamepad/gp_servicetooltipicon_stablemaster.dds"> + <Dimensions x="36" y="36"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="10" offsetY="44"/> + <OnMouseEnter> ZO_Tooltips_ShowTextTooltip(self, TOP, GetString(SI_STAT_GAMEPAD_RIDING_HEADER_TRAINING)) </OnMouseEnter> + <OnMouseExit> ZO_Tooltips_HideTextTooltip() </OnMouseExit> + </Texture> + </Controls> + </Control> + <Line name="$(parent)WarningLine" color="777777" hidden="true" thickness="2" pixelRoundingEnabled="true"/> + <Texture name="$(parent)WarningIcon" hidden="true" mouseEnabled="true" color="FFC000" textureFile="/esoui/art/miscellaneous/eso_icon_warning.dds"> + <Dimensions y="32" x="32"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-30" offsetY="-2"/> + <OnMouseEnter> LeoAltholicUI.TooltipWarning(self, true) </OnMouseEnter> + <OnMouseExit> LeoAltholicUI.TooltipWarning(self, false) </OnMouseExit> + </Texture> </Controls> </TopLevelControl> diff --git a/LeoAltholicInit.lua b/LeoAltholicInit.lua index 1fc33b5..648964b 100644 --- a/LeoAltholicInit.lua +++ b/LeoAltholicInit.lua @@ -54,3 +54,22 @@ LeoAltholic.craftIcons = { [CRAFTING_TYPE_PROVISIONING] = "esoui/art/inventory/inventory_tabicon_craftbag_provisioning_up.dds", [CRAFTING_TYPE_JEWELRYCRAFTING] = "esoui/art/inventory/inventory_tabicon_craftbag_jewelrycrafting_up.dds", } +LeoAltholic.color = { + hex = { + green = '10FF10', + darkGreen = '21A121', + white = 'FFFFFF', + red = 'FF1010', + darkRed = 'CB110E', + yellow = 'FFFF00', + orange = 'FFCC00', + eso = 'E8DFAF', + }, + rgba = { + green = {0,1,0,1}, + white = {1,1,1,1}, + red = {1,0.25,0.12}, + yellow = {1,1,0,1}, + orange = {1,0.8,0,1}, + } +} diff --git a/LeoAltholic_API.lua b/LeoAltholic_API.lua index df93110..7a7cf76 100644 --- a/LeoAltholic_API.lua +++ b/LeoAltholic_API.lua @@ -63,10 +63,10 @@ function LeoAltholic.FormatTime(seconds, short, colorizeCountdown) elseif mm >= 0 then result = zo_strformat(GetString(formats.ms), mmF, ssF) end if colorizeCountdown == true then - if seconds < 3600 then result = '|cFF4020'..result..'|r' - elseif seconds < 86400 then result = '|cCCCC00'..result..'|r' - elseif seconds < 604800 then result = '|cFFFFFF'..result..'|r' - else result = '|c00FF00'..result..'|r' end + if seconds < 3600 then result = '|c'..LeoAltholic.color.hex.red..result..'|r' + elseif seconds < 86400 then result = '|c'..LeoAltholic.color.hex.yellow..result..'|r' + elseif seconds < 604800 then result = '|c'..LeoAltholic.color.hex.white..result..'|r' + else result = '|c'..LeoAltholic.color.hex.green..result..'|r' end end return result else return '|cFF4020'..GetString(SI_GAMEPAD_CAMPAIGN_SCORING_DURATION_REMAINING_DONE)..'|r' end diff --git a/Settings.lua b/Settings.lua index 065a54d..74110d3 100644 --- a/Settings.lua +++ b/Settings.lua @@ -60,14 +60,13 @@ function LeoAltholic_Settings:CreatePanel() name = GetString(SI_GAMEPAD_INTERFACE_OPTIONS_PRIMARY_PLAYER_NAME), default = false, getFunc = LeoAltholicChecklistUI.DisplayName, - setFunc = LeoAltholicChecklistUI.SetDisplayName, - --[[},{ + setFunc = LeoAltholicChecklistUI.SetDisplayName + },{ type = "checkbox", - name = GetString(SI_INTERFACE_OPTIONS_CAMERA_THIRD_PERSON_HORIZONTAL_POSITION_MULTIPLIER), + name = GetString(LEOALT_CHECKLIST_HIDE_WHEN_TOOLBAR), default = false, - getFunc = LeoAltholicChecklistUI.IsHorizontal, - setFunc = LeoAltholicChecklistUI.SetHorizontal, - disabled = function() return LeoAltholicChecklistUI.DisplayName() end]] + getFunc = LeoAltholicChecklistUI.IsHideWhenToolbar, + setFunc = LeoAltholicChecklistUI.SetHideWhenToolbar },{ type = "submenu", name = GetString(SI_INVENTORY_MODE_ITEMS), @@ -155,7 +154,7 @@ function LeoAltholic_Settings:CreatePanel() setFunc = LeoAltholicChecklistUI.SetRiding, } } - --[[},{ + },{ type = "header", name = "|c3f7fff"..GetString(LEOALT_TOOLBAR).."|r" },{ @@ -165,11 +164,8 @@ function LeoAltholic_Settings:CreatePanel() type = "checkbox", name = GetString(SI_ADDON_MANAGER_ENABLED), default = true, - getFunc = function() return LeoAltholic.globalData.settings.toolbar.enabled end, - setFunc = function(value) - LeoAltholic.globalData.settings.toolbar.enabled = value - LeoAltholicToolbarUI.RestorePosition() - end, + getFunc = LeoAltholicToolbarUI.IsEnabled, + setFunc = LeoAltholicToolbarUI.SetEnabled, },{ type = "checkbox", name = GetString(LEOALT_BUMP_COMPASS), @@ -181,17 +177,29 @@ function LeoAltholic_Settings:CreatePanel() end, },{ type = "submenu", - name = GetString(SI_GAMEPAD_OPTIONS_MENU), + name = GetString(SI_INVENTORY_MODE_ITEMS), controls = { { type = "checkbox", + name = GetString(SI_GAMEPAD_PLAYER_INVENTORY_CAPACITY_FOOTER_LABEL), + default = true, + disabled = function() return not LeoAltholicToolbarUI.IsEnabled() end, + width = "half", + getFunc = function() return LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.INVENTORY) end, + setFunc = function(value) + LeoAltholicToolbarUI.SetItem(LeoAltholicToolbarUI.items.INVENTORY, value) + LeoAltholicToolbarUI.RestorePosition() + LeoAltholicToolbarUI.update() + end, + },{ + type = "checkbox", name = GetString(SI_STAT_GAMEPAD_RIDING_HEADER_TRAINING), default = true, - disabled = function() return not LeoAltholic.globalData.settings.toolbar.enabled end, + disabled = function() return not LeoAltholicToolbarUI.IsEnabled() end, width = "half", - getFunc = function() return LeoAltholic.globalData.settings.toolbar.riding end, + getFunc = function() return LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.RIDING) end, setFunc = function(value) - LeoAltholic.globalData.settings.toolbar.riding = value + LeoAltholicToolbarUI.SetItem(LeoAltholicToolbarUI.items.RIDING, value) LeoAltholicToolbarUI.RestorePosition() LeoAltholicToolbarUI.update() end, @@ -199,28 +207,28 @@ function LeoAltholic_Settings:CreatePanel() type = "checkbox", name = GetString(SI_GAMEPAD_SMITHING_CURRENT_RESEARCH_HEADER), default = true, - disabled = function() return not LeoAltholic.globalData.settings.toolbar.enabled end, + disabled = function() return not LeoAltholicToolbarUI.IsEnabled() end, width = "half", - getFunc = function() return LeoAltholic.globalData.settings.toolbar.researching end, + getFunc = function() return LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.RESEARCH) end, setFunc = function(value) - LeoAltholic.globalData.settings.toolbar.researching = value + LeoAltholicToolbarUI.SetItem(LeoAltholicToolbarUI.items.RESEARCH, value) LeoAltholicToolbarUI.RestorePosition() LeoAltholicToolbarUI.update() end, },{ type = "checkbox", - name = GetString(LEOALT_CHECKLIST) .. " ( soon )", + name = GetString(LEOALT_CHECKLIST), default = true, - disabled = true, + disabled = function() return not LeoAltholicToolbarUI.IsEnabled() or not LeoAltholicChecklistUI.IsEnabled() end, width = "half", - getFunc = function() return LeoAltholic.globalData.settings.toolbar.checklist end, + getFunc = function() return LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.CHECKLIST) end, setFunc = function(value) - LeoAltholic.globalData.settings.toolbar.checklist = value + LeoAltholicToolbarUI.SetItem(LeoAltholicToolbarUI.items.CHECKLIST, value) LeoAltholicToolbarUI.RestorePosition() LeoAltholicToolbarUI.update() end, } - }]] + } },{ type = "header", name = "|c3f7fff"..GetString(LEOALT_TRACKED_QUESTS).."|r" diff --git a/ui/champion.lua b/ui/champion.lua index 79887ef..f700440 100644 --- a/ui/champion.lua +++ b/ui/champion.lua @@ -32,9 +32,9 @@ function LeoAltholicChampionList:SetupEntry(control, data) control.disc234 = GetControl(control, "Disc234") total = data.champion[ATTRIBUTE_HEALTH].spent + data.champion[ATTRIBUTE_HEALTH].unspent - color = '|c21A121' + color = '|c'..LeoAltholic.color.hex.green if data.champion[ATTRIBUTE_HEALTH].unspent > 0 then - color = '|cCB110E' + color = '|c'..LeoAltholic.color.hex.red end control.disc234:SetText("|t24:24:esoui/art/tutorial/champion_points_health_icon.dds|t "..color .. data.champion[ATTRIBUTE_HEALTH].spent .. '/' .. total .. '|r ' .. data.champion[ATTRIBUTE_HEALTH].disciplines[2].spent .." / ".. data.champion[ATTRIBUTE_HEALTH].disciplines[3].spent .." / ".. data.champion[ATTRIBUTE_HEALTH].disciplines[4].spent) control.disc234.champion = data.champion @@ -42,9 +42,9 @@ function LeoAltholicChampionList:SetupEntry(control, data) control.disc567 = GetControl(control, "Disc567") total = data.champion[ATTRIBUTE_MAGICKA].spent + data.champion[ATTRIBUTE_MAGICKA].unspent - color = '|c21A121' + color = '|c'..LeoAltholic.color.hex.green if data.champion[ATTRIBUTE_MAGICKA].unspent > 0 then - color = '|cCB110E' + color = '|c'..LeoAltholic.color.hex.red end control.disc567:SetText("|t24:24:esoui/art/tutorial/champion_points_magicka_icon.dds|t "..color .. data.champion[ATTRIBUTE_MAGICKA].spent .. '/' .. total .. '|r ' .. data.champion[ATTRIBUTE_MAGICKA].disciplines[5].spent .." / ".. data.champion[ATTRIBUTE_MAGICKA].disciplines[6].spent .." / ".. data.champion[ATTRIBUTE_MAGICKA].disciplines[7].spent) control.disc567.champion = data.champion @@ -52,9 +52,9 @@ function LeoAltholicChampionList:SetupEntry(control, data) control.disc891 = GetControl(control, "Disc891") total = data.champion[ATTRIBUTE_STAMINA].spent + data.champion[ATTRIBUTE_STAMINA].unspent - color = '|c21A121' + color = '|c'..LeoAltholic.color.hex.green if data.champion[ATTRIBUTE_STAMINA].unspent > 0 then - color = '|cCB110E' + color = '|c'..LeoAltholic.color.hex.red end control.disc891:SetText("|t24:24:esoui/art/tutorial/champion_points_stamina_icon.dds|t "..color .. data.champion[ATTRIBUTE_STAMINA].spent .. '/' .. total .. '|r ' .. data.champion[ATTRIBUTE_STAMINA].disciplines[8].spent .." / ".. data.champion[ATTRIBUTE_STAMINA].disciplines[9].spent .." / ".. data.champion[ATTRIBUTE_STAMINA].disciplines[1].spent) control.disc891.champion = data.champion @@ -117,9 +117,9 @@ function LeoAltholicUI.TooltipChampionSkill(control, visible) local skillName = GetChampionSkillName(i, j) local points = control.champion[control.attribute].disciplines[i].skills[j] if type(points) == 'number' and points > 0 then - addLine(InformationTooltip, "|cE8DFAF" .. skillName .. "|r " .. points) + addLine(InformationTooltip, "|c" ..LeoAltholic.color.hex.eso.. skillName .. "|r " .. points) elseif points == true then - addLine(InformationTooltip, "|cE8DFAF" .. skillName .. "|r |c21A121"..GetString(LEOALT_UNLOCKED).."|r") + addLine(InformationTooltip, "|c" ..LeoAltholic.color.hex.eso.. skillName .. "|r |c21A121"..GetString(LEOALT_UNLOCKED).."|r") end end end diff --git a/ui/checklist.lua b/ui/checklist.lua index d293bee..412e69d 100644 --- a/ui/checklist.lua +++ b/ui/checklist.lua @@ -30,13 +30,13 @@ function LeoAltholicChecklistUI.DisplayName() if LeoAltholic.globalData.settings.checklist.displayName == nil then LeoAltholic.globalData.settings.checklist.displayName = true end return LeoAltholic.globalData.settings.checklist.displayName end -function LeoAltholicChecklistUI.SetHorizontal(value) - LeoAltholic.globalData.settings.checklist.horizontal = value +function LeoAltholicChecklistUI.SetHideWhenToolbar(value) + LeoAltholic.globalData.settings.checklist.hideWhenToolbar = value LeoAltholicChecklistUI.update() end -function LeoAltholicChecklistUI.IsHorizontal() - if LeoAltholic.globalData.settings.checklist.horizontal == nil then LeoAltholic.globalData.settings.checklist.horizontal = false end - return LeoAltholic.globalData.settings.checklist.horizontal +function LeoAltholicChecklistUI.IsHideWhenToolbar() + if LeoAltholic.globalData.settings.checklist.hideWhenToolbar == nil then LeoAltholic.globalData.settings.checklist.hideWhenToolbar = false end + return LeoAltholic.globalData.settings.checklist.hideWhenToolbar end function LeoAltholicChecklistUI.SetUpwards(value) @@ -52,7 +52,8 @@ function LeoAltholicChecklistUI.SetEnabled(value) LeoAltholicChecklistUI.RestorePosition() end function LeoAltholicChecklistUI.IsEnabled() - return LeoAltholic.charData.settings.checklist.enabled or true + if LeoAltholic.charData.settings.checklist.enabled == nil then LeoAltholic.charData.settings.checklist.enabled = true end + return LeoAltholic.charData.settings.checklist.enabled end function LeoAltholicChecklistUI.SetCraft(craft, value) @@ -62,14 +63,15 @@ function LeoAltholicChecklistUI.SetCraft(craft, value) end function LeoAltholicChecklistUI.GetCraft(craft) if not LeoAltholic.charData.settings.checklist.craft then LeoAltholic.charData.settings.checklist.craft = {} end - return LeoAltholic.charData.settings.checklist.craft[craft] or false + return LeoAltholic.charData.settings.checklist.craft[craft] end function LeoAltholicChecklistUI.SetRiding(value) LeoAltholic.charData.settings.checklist.riding = value LeoAltholicChecklistUI.update() end function LeoAltholicChecklistUI.GetRiding() - return LeoAltholic.charData.settings.checklist.riding or false + if LeoAltholic.charData.settings.checklist.riding == nil then LeoAltholic.charData.settings.checklist.riding = true end + return LeoAltholic.charData.settings.checklist.riding end @@ -94,7 +96,7 @@ function LeoAltholicChecklistUI.RestorePosition() LeoAltholicChecklist:ClearAnchors() LeoAltholicChecklist:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, left, top) - if LeoAltholicChecklistUI.IsEnabled() then + if LeoAltholicChecklistUI.IsEnabled() and not LeoAltholicChecklistUI.IsHideWhenToolbar() then if not LeoAltholicChecklistUI.checkAllDone() then LeoAltholicChecklist:SetHidden(false) end @@ -130,7 +132,7 @@ local function createItem(label, labelText, texture, craftIcon, canShow) else label:SetHidden(true) texture:SetHidden(true) - craftIcon:SetHidden(false) + craftIcon:SetHidden(true) end end @@ -154,8 +156,8 @@ local function startItem(label, texture) end local function updateItem(label, texture) - texture:SetTexture("esoui/art/loot/loot_finesseItem.dds") - texture:SetColor(1,0.65,0,1) + texture:SetTexture("esoui/art/buttons/pointsplus_up.dds") + texture:SetColor(1,0.9,0,1) texture.tooltip = "Quest Updated" end diff --git a/ui/inventory.lua b/ui/inventory.lua index 6a9b1d3..c1818e9 100644 --- a/ui/inventory.lua +++ b/ui/inventory.lua @@ -42,14 +42,14 @@ function LeoAltholicInventoryList:SetupEntry(control, data) control.name = GetControl(control, "Name") control.name:SetText(data.name) - local color = '|c21A121' - if data.inventory.free <= 25 then color = '|c596cfd' end - if data.inventory.free <= 10 then color = '|cCB110E' end + local color = '|c'..LeoAltholic.color.hex.green + if data.inventory.free <= 25 then color = '|c'..LeoAltholic.color.hex.orange end + if data.inventory.free <= 10 then color = '|c'..LeoAltholic.color.hex.red end control.bag = GetControl(control, "Bag") control.bag:SetText(color .. data.inventory.used .. "|r / " .. data.inventory.size) control.soulgems = GetControl(control, "SoulGems") - control.soulgems:SetText("|c21A121" .. data.inventory.soulGemFilled .. '|r / ' .. data.inventory.soulGemEmpty) + control.soulgems:SetText("|c" ..LeoAltholic.color.hex.green.. data.inventory.soulGemFilled .. '|r / ' .. data.inventory.soulGemEmpty) control.gold = GetControl(control, "Gold") control.gold:SetText(formatNumber(data.inventory.gold)) diff --git a/ui/research.lua b/ui/research.lua index 1219237..05e0e36 100644 --- a/ui/research.lua +++ b/ui/research.lua @@ -54,15 +54,15 @@ function LeoAltholicResearchList:SetupEntry(control, data) timer = LeoAltholic.FormatTime(research.time, false, true) }) end - color = '|c21A121' + color = '|c'..LeoAltholic.color.hex.green if researching < data.research.done[craft].max then - color = '|cCB110E' + color = '|c'..LeoAltholic.color.hex.red end if researching > data.research.done[craft].max then researching = data.research.done[craft].max end local output = color .. researching .. '/' .. data.research.done[craft].max .. '|r' - color = '|cFFFFFF' + color = '|c'..LeoAltholic.color.hex.white if first and first.time <= 3600 then - color = '|cFFFF00' + color = '|c'..LeoAltholic.color.hex.yellow end if #list > 0 then output = output .. " " .. color..LeoAltholic.FormatTime(first.time, false, true) .. '|r' diff --git a/ui/skills2.lua b/ui/skills2.lua index 4c9d30b..9f4d6aa 100644 --- a/ui/skills2.lua +++ b/ui/skills2.lua @@ -50,7 +50,13 @@ function LeoAltholicSkills2List:SetupEntry(control, data) control.world[i]:SetText("-") control.world[i].number = tonumber(0) end - control.world[i].max = tonumber(10) + if i == 1 then + control.world[i].max = tonumber(20) + elseif i == 2 then + control.world[i].max = tonumber(6) + else + control.world[i].max = tonumber(10) + end end control.guild = {} for i = 1, 6 do diff --git a/ui/toolbar.lua b/ui/toolbar.lua index 35cd912..7808bd9 100644 --- a/ui/toolbar.lua +++ b/ui/toolbar.lua @@ -1,27 +1,83 @@ -function LeoAltholicToolbarUI:OnWindowMoveStop() - LeoAltholic.globalData.positionToolbar = { - left = LeoAltholicToolbar:GetLeft(), - top = LeoAltholicToolbar:GetTop() +LeoAltholicToolbarUI.items = { + INVENTORY = 1, + RIDING = 2, + RESEARCH = 3, + CHECKLIST = 4 +} + +function LeoAltholicToolbarUI.normalizeSettings() + if not LeoAltholic.globalData.toolbar then LeoAltholic.globalData.toolbar = {} end + if not LeoAltholic.globalData.settings.toolbar then LeoAltholic.globalData.settings.toolbar = {} end +end + +function LeoAltholicToolbarUI.SetPosition(left, top) + LeoAltholic.globalData.toolbar.position = { + left = left, + top = top } end +function LeoAltholicToolbarUI.GetPosition() + return LeoAltholic.globalData.toolbar.position or { left = 100; top = 200; } +end + +function LeoAltholicToolbarUI.SetEnabled(value) + LeoAltholic.globalData.settings.toolbar.enabled = value + LeoAltholicToolbarUI.RestorePosition() +end +function LeoAltholicToolbarUI.IsEnabled() + if LeoAltholic.globalData.settings.toolbar.enabled == nil then LeoAltholic.globalData.settings.toolbar.enabled = true end + return LeoAltholic.globalData.settings.toolbar.enabled +end + +function LeoAltholicToolbarUI.SetBumpCompass(value) + LeoAltholic.globalData.settings.toolbar.bumpCompass = value + LeoAltholicToolbarUI.update() +end +function LeoAltholicToolbarUI.GetBumpCompass() + if LeoAltholic.globalData.settings.toolbar.bumpCompass == nil then LeoAltholic.globalData.settings.toolbar.bumpCompass = false end + return LeoAltholic.globalData.settings.toolbar.bumpCompass +end + +function LeoAltholicToolbarUI.SetItem(item, value) + if not LeoAltholic.globalData.settings.toolbar.items then LeoAltholic.globalData.settings.toolbar.items = {} end + LeoAltholic.globalData.settings.toolbar.items[item] = value + LeoAltholicToolbarUI.update() +end +function LeoAltholicToolbarUI.GetItem(item) + if not LeoAltholic.globalData.settings.toolbar.items then LeoAltholic.globalData.settings.toolbar.items = {} end + if LeoAltholic.globalData.settings.toolbar.items[item] == nil then LeoAltholic.globalData.settings.toolbar.items[item] = true end + return LeoAltholic.globalData.settings.toolbar.items[item] +end + + +function LeoAltholicToolbarUI.OnWindowMoveStop() + 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()) + end + LeoAltholicToolbarUI.SetPosition(LeoAltholicToolbar:GetLeft(), LeoAltholicToolbar:GetTop()) +end function LeoAltholicToolbarUI.RestorePosition() - local position = LeoAltholic.globalData.positionToolbar or { left = 100; top = 100; } + local position = LeoAltholicToolbarUI.GetPosition() local left = position.left local top = position.top LeoAltholicToolbar:ClearAnchors() LeoAltholicToolbar:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, left, top) - if LeoAltholic.globalData.settings.toolbar.enabled == false then - LeoAltholicToolbar:SetHidden(true) - else + if LeoAltholicToolbarUI.IsEnabled() then LeoAltholicToolbar:SetHidden(false) + else + LeoAltholicToolbar:SetHidden(true) end end -function LeoAltholicToolbarUI.bumpCompass() - if LeoAltholic.globalData.settings.toolbar.enabled and LeoAltholic.globalData.settings.toolbar.bumpCompass then +function LeoAltholicToolbarUI.BumpCompass() + if 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() @@ -38,45 +94,124 @@ function LeoAltholicToolbarUI.bumpCompass() end end +local function addLine(tooltip, text, color) + if not color then color = ZO_SELECTED_TEXT end + local r, g, b = color:UnpackRGB() + tooltip:AddLine(text, "LeoAltholicNormalFont", r, g, b, CENTER, MODIFY_TEXT_TYPE_NONE, TEXT_ALIGN_LEFT, true) +end + +local function hasExpiredQueue() + for x,data in pairs(LeoAltholic.timerQueue) do + if GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then + return true + end + end + return false +end + +function LeoAltholicUI.TooltipWarning(control, visible) + + if visible and hasExpiredQueue() then + if not parent then parent = control end + + InitializeTooltip(InformationTooltip, control, TOPLEFT, -100, 40, TOPLEFT) + + for x,data in pairs(LeoAltholic.timerQueue) do + if GetDiffBetweenTimeStamps(data.time, GetTimeStamp()) <= 0 then + addLine(InformationTooltip, data.info) + end + end + + InformationTooltip:SetHidden(false) + else + ClearTooltip(InformationTooltip) + InformationTooltip:SetHidden(true) + end +end + + function LeoAltholicToolbarUI.update() - LeoAltholicToolbarUI.bumpCompass() + if not LeoAltholicToolbarUI.IsEnabled() then return end - if not LeoAltholic.globalData.settings.toolbar.enabled then return end + LeoAltholicToolbarUI.BumpCompass() local char = LeoAltholic.GetMyself() local toolbar = WINDOW_MANAGER:GetControlByName("LeoAltholicToolbar") + local warning = GetControl(toolbar, "WarningIcon") + if hasExpiredQueue() then + warning:SetHidden(false) + local line = GetControl(toolbar, "WarningLine") + line:SetHidden(false) + line:SetAnchor(TOPLEFT, warning, TOPLEFT, 2, 0) + line:SetAnchor(BOTTOMRIGHT, warning, BOTTOMLEFT, 2, 0) + else + warning:SetHidden(true) + end + local offsetX = 0 local width = 120 local numSections = 0 + local totalWidth = 0 - local label = GetControl(toolbar, "Riding") - local texture = GetControl(toolbar, "RidingTexture") + local line + local label = GetControl(toolbar, "Inventory") + local texture = GetControl(toolbar, "InventoryTexture") label:SetHidden(true) texture:SetHidden(true) - if LeoAltholic.globalData.settings.toolbar.riding and + if LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.INVENTORY) then + local color = '|c11EE11' + if char.inventory.free <= 25 then color = '|c596cfd' end + if char.inventory.free <= 10 then color = '|cCB110E' end + label:SetText(color .. char.inventory.used .. "|r / " .. char.inventory.size) + label:SetHidden(false) + texture:SetHidden(false) + texture:SetAnchor(TOPLEFT, toolbar, TOPLEFT, offsetX, 0) + offsetX = offsetX + 95 + numSections = numSections + 1 + totalWidth = totalWidth + 105 + end + + line = GetControl(toolbar, "RidingLine") + label = GetControl(toolbar, "Riding") + texture = GetControl(toolbar, "RidingTexture") + line:SetHidden(true) + label:SetHidden(true) + texture:SetHidden(true) + if LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.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) then label:SetText(LeoAltholic.FormatTime(char.attributes.riding.time - GetTimeStamp(), true, true)) label:SetHidden(false) texture:SetHidden(false) - offsetX = offsetX + 110 + line:SetHidden(false) + texture:SetAnchor(TOPLEFT, toolbar, TOPLEFT, offsetX, 0) + line:SetAnchor(TOPLEFT, texture, TOPLEFT, 2, 0) + line:SetAnchor(BOTTOMRIGHT, texture, BOTTOMLEFT, 2, 0) + offsetX = offsetX + 100 numSections = numSections + 1 + totalWidth = totalWidth + 130 end + line = GetControl(toolbar, "CraftLine") + line:SetHidden(true) for _,craft in pairs(LeoAltholic.craftResearch) do label = GetControl(toolbar, "Craft"..craft) texture = GetControl(toolbar, "Craft"..craft.."Texture") label:SetHidden(true) texture:SetHidden(true) end - if LeoAltholic.globalData.settings.toolbar.researching then + if LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.RESEARCH) then + local firstTexture for _,craft in pairs(LeoAltholic.craftResearch) do if LeoAltholic.HasStillResearchFor(craft) then label = GetControl(toolbar, "Craft"..craft) texture = GetControl(toolbar, "Craft"..craft.."Texture") + if firstTexture == nil then + firstTexture = texture + end local researching, total, lowest = LeoAltholic.GetResearchCounters(craft) local color = '|c21A121' if researching < total then @@ -89,29 +224,79 @@ function LeoAltholicToolbarUI.update() label:SetAnchor(TOPLEFT, texture, TOPRIGHT, 2, 0) offsetX = offsetX + width numSections = numSections + 1 + totalWidth = totalWidth + 120 end end + if firstTexture ~= nil then + line:SetHidden(false) + line:SetAnchor(TOPLEFT, firstTexture, TOPLEFT, 2, 0) + line:SetAnchor(BOTTOMRIGHT, firstTexture, BOTTOMLEFT, 2, 0) + end end - --[[ - if LeoAltholic.globalData.settings.toolbar.checklist then + local checklistOffsetX = 0 + local checklist = GetControl(toolbar, "Checklist") + local shownChecklist = false + if LeoAltholicToolbarUI.GetItem(LeoAltholicToolbarUI.items.CHECKLIST) then + checklist:SetAnchor(TOPLEFT, toolbar, TOPLEFT, offsetX, 0) + checklist:SetHidden(false) + local icon + for _, craft in pairs(LeoAltholic.allCrafts) do + icon = GetControl(checklist, "Craft"..craft.."Icon") + if LeoAltholicChecklistUI.GetCraft(craft) then + + local isDone = false + for _, writ in pairs(char.quests.writs) do + if craft == writ.craft then + if writ.lastDone ~= nil and LeoAltholic.IsAfterReset(writ.lastDone) then + isDone = true + elseif writ.lastPreDeliver ~= nil and LeoAltholic.IsAfterReset(writ.lastPreDeliver) then + icon:SetColor(1,1,0,1) + elseif writ.lastUpdated ~= nil and LeoAltholic.IsAfterReset(writ.lastUpdated) then + icon:SetColor(1,0.8,0,1) + elseif writ.lastStarted ~= nil and LeoAltholic.IsAfterReset(writ.lastStarted) then + icon:SetColor(0.8,0.8,0.8,1) + else + icon:SetColor(1,0,0,1) + end + + if not isDone then + shownChecklist = true + icon:SetHidden(false) + icon:SetAnchor(TOPLEFT, checklist, TOPLEFT, checklistOffsetX, -2) + checklistOffsetX = checklistOffsetX + 35 + else + icon:SetHidden(true) + end + end + end + else + icon:SetHidden(true) + end + end + if char.attributes.riding.time - GetTimeStamp() < 0 then - label = GetControl(toolbar, "Checklist") - label:SetText("|t28:28:esoui/art/tutorial/store_indexicon_mounts_up.dds|t") - label:SetAnchor(TOPLEFT, toolbar, TOPLEFT, offsetX, 0) - label:SetHidden(false) - else - label = GetControl(toolbar, "Checklist") - label:SetText("|cFF0000|t28:28:esoui/art/tutorial/store_indexicon_mounts_up.dds|t|r") - label:SetAnchor(TOPLEFT, toolbar, TOPLEFT, offsetX, 0) - label:SetHidden(false) + shownChecklist = true + icon = GetControl(checklist, "RidingIcon") + icon:SetHidden(false) + icon:SetColor(1,0,0,1) + icon:SetAnchor(TOPLEFT, checklist, TOPLEFT, checklistOffsetX, -4) + checklistOffsetX = checklistOffsetX + 35 end + else + checklist:SetHidden(true) + end + if shownChecklist then + line = GetControl(toolbar, "ChecklistLine") + line:SetHidden(false) + line:SetAnchor(TOPLEFT, checklist, TOPLEFT, 2, 0) + line:SetAnchor(BOTTOMRIGHT, checklist, BOTTOMLEFT, 2, 0) end - ]] + totalWidth = totalWidth + checklistOffsetX if numSections > 0 then - toolbar:SetWidth(numSections * 130) - GetControl(toolbar, "BG"):SetWidth(numSections * 130) + toolbar:SetWidth(totalWidth) + GetControl(toolbar, "BG"):SetWidth(totalWidth) else toolbar:SetHidden(true) end