diff --git a/FurnitureCatalogue/FurnitureCatalogue.txt b/FurnitureCatalogue/FurnitureCatalogue.txt index c760828..f5a10a0 100644 --- a/FurnitureCatalogue/FurnitureCatalogue.txt +++ b/FurnitureCatalogue/FurnitureCatalogue.txt @@ -1,6 +1,6 @@ ## Title: FurnitureCatalogue ## Author: manavortex -## Version: 2.2.7 +## Version: 2.2.8 ## APIVersion: 100022 ## SavedVariables: FurnitureCatalogue_Settings ## OptionalDependsOn: pChat diff --git a/FurnitureCatalogue/data/Homestead/H_LuxuryFurnisher.lua b/FurnitureCatalogue/data/Homestead/H_LuxuryFurnisher.lua index 7e97f58..394eb21 100644 --- a/FurnitureCatalogue/data/Homestead/H_LuxuryFurnisher.lua +++ b/FurnitureCatalogue/data/Homestead/H_LuxuryFurnisher.lua @@ -53,20 +53,7 @@ FurC.LuxuryFurnisher[FURC_HOMESTEAD] = { itemDate = "2017-05-05", }, - - -- April, 14 - 16 - [120888] = { -- Bat Bloom - itemPrice = 10000, - itemDate = "2017-04-14", - }, - [120887] = { -- Fan Bush - itemPrice = 1000, - itemDate = "2017-04-14", - }, - [120889] = { -- Glow Bush, Purple - itemPrice = 20000, - itemDate = "2017-04-14", - }, + diff --git a/FurnitureCatalogue/data/LuxuryFurnisher.lua b/FurnitureCatalogue/data/LuxuryFurnisher.lua index 82a40f2..d74eb59 100644 --- a/FurnitureCatalogue/data/LuxuryFurnisher.lua +++ b/FurnitureCatalogue/data/LuxuryFurnisher.lua @@ -3,6 +3,24 @@ FurC.LuxuryFurnisher = FurC.LuxuryFurnisher or {} FurC.LuxuryFurnisher[FURC_DRAGONS] = { + [134830] = { -- Flowers, Blue Starbloom + itemPrice = 15000, + itemDate = "2017-03-31", + }, + [120888] = { -- Bat Bloom + itemPrice = 10000, + itemDate = "2017-03-31", + }, + [120887] = { -- Fan Bush + itemPrice = 1000, + itemDate = "2017-03-31", + }, + [120889] = { -- Glow Bush, Purple + itemPrice = 20000, + itemDate = "2017-03-31", + }, + + -- April, 7-9 [120885] = { -- Alik'r Cactus itemPrice = 2000, diff --git a/FurnitureCatalogue/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua b/FurnitureCatalogue/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua index b1070ca..3c4ab31 100644 --- a/FurnitureCatalogue/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua +++ b/FurnitureCatalogue/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua @@ -4,7 +4,7 @@ --Register LAM with LibStub -local MAJOR, MINOR = "LibAddonMenu-2.0", 24 +local MAJOR, MINOR = "LibAddonMenu-2.0", 25 local lam, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not lam then return end --the same or newer version of this lib is already loaded into memory @@ -441,7 +441,7 @@ local function ScrollDataIntoView(list, data) local scrollMin, scrollMax = list.scrollbar:GetMinMax() local scrollTop = list.scrollbar:GetValue() - local controlHeight = list.controlHeight + local controlHeight = list.uniformControlHeight or list.controlHeight local targetMin = controlHeight * (targetIndex - 1) - 64 -- subtracting 64 ain't arbitrary, it's the maximum fading height -- (libraries/zo_templates/scrolltemplates.lua/UpdateScrollFade) @@ -494,6 +494,7 @@ local function PopulateAddonList(addonList, filter) local entryList = ZO_ScrollList_GetDataList(addonList) local numEntries = 0 local selectedData = nil + local selectionIsFinal = false ZO_ScrollList_Clear(addonList) @@ -505,8 +506,14 @@ local function PopulateAddonList(addonList, filter) entryList[numEntries] = dataEntry -- select the first panel passing the filter, or the currently -- shown panel, but only if it passes the filter as well - if selectedData == nil or data.panel == lam.currentAddonPanel then - selectedData = data + if selectedData == nil or data.panel == lam.pendingAddonPanel or data.panel == lam.currentAddonPanel then + if not selectionIsFinal then + selectedData = data + end + if data.panel == lam.pendingAddonPanel then + lam.pendingAddonPanel = nil + selectionIsFinal = true + end end else data.sortIndex = nil @@ -600,6 +607,7 @@ function lam:OpenToPanel(panel) if addonData.panel == panel then selectedData = addonData ScrollDataIntoView(addonList, selectedData) + lam.pendingAddonPanel = addonData.panel break end end diff --git a/FurnitureCatalogue/libs/LibAddonMenu-2.0/controls/dropdown.lua b/FurnitureCatalogue/libs/LibAddonMenu-2.0/controls/dropdown.lua index f8ea731..70e23bb 100644 --- a/FurnitureCatalogue/libs/LibAddonMenu-2.0/controls/dropdown.lua +++ b/FurnitureCatalogue/libs/LibAddonMenu-2.0/controls/dropdown.lua @@ -18,7 +18,7 @@ } ]] -local widgetVersion = 17 +local widgetVersion = 18 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("dropdown", widgetVersion) then return end @@ -126,7 +126,9 @@ local function UpdateChoices(control, choices, choicesValues, choicesTooltips) if choicesTooltips then assert(#choices == #choicesTooltips, "choices and choicesTooltips need to have the same size") - SetupTooltips(control.dropdown, choicesTooltips) + if not control.scrollHelper then -- only do this for non-scrollable + SetupTooltips(control.dropdown, choicesTooltips) + end end for i = 1, #choices do @@ -135,6 +137,9 @@ local function UpdateChoices(control, choices, choicesValues, choicesTooltips) if choicesValues then entry.value = choicesValues[i] end + if choicesTooltips and control.scrollHelper then + entry.tooltip = choicesTooltips[i] + end control.choices[entry.value or entry.name] = entry.name control.dropdown:AddItem(entry, not control.data.sort and ZO_COMBOBOX_SUPRESS_UPDATE) --if sort type/order isn't specified, then don't sort end @@ -155,6 +160,7 @@ local SCROLLABLE_ENTRY_TEMPLATE_HEIGHT = 25 -- same as in zo_combobox.lua local CONTENT_PADDING = 24 local SCROLLBAR_PADDING = 16 local PADDING = GetMenuPadding() / 2 -- half the amount looks closer to the regular dropdown +local ROUNDING_MARGIN = 0.01 -- needed to avoid rare issue with too many anchors processed local ScrollableDropdownHelper = ZO_Object:Subclass() function ScrollableDropdownHelper:New(...) @@ -202,6 +208,10 @@ function ScrollableDropdownHelper:Initialize(parent, control, visibleRows) scroll:SetAnchor(anchor1[2], anchor1[3], anchor1[4], anchor1[5] + PADDING, anchor1[6] + PADDING) scroll:SetAnchor(anchor2[2], anchor2[3], anchor2[4], anchor2[5] - PADDING, anchor2[6] - PADDING) ZO_ScrollList_Commit(scrollList) + + -- hook mouse enter/exit + local function onMouseEnter(control) self:OnMouseEnter(control) end + local function onMouseExit(control) self:OnMouseExit(control) end -- adjust row setup to mimic the highlight padding local dataType1 = ZO_ScrollList_GetDataTypeTable(dropdown.m_scroll, 1) @@ -210,6 +220,15 @@ function ScrollableDropdownHelper:Initialize(parent, control, visibleRows) local function SetupEntry(control, data, list) oSetup(control, data, list) control.m_label:SetAnchor(LEFT, nil, nil, 2) + -- no need to store old ones since we have full ownership of our dropdown controls + if not control.hookedMouseHandlers then --only do it once per control + control.hookedMouseHandlers = true + ZO_PreHookHandler(control, "OnMouseEnter", onMouseEnter) + ZO_PreHookHandler(control, "OnMouseExit", onMouseExit) + -- we could also just replace the handlers + --control:SetHandler("OnMouseEnter", onMouseEnter) + --control:SetHandler("OnMouseExit", onMouseExit) + end end dataType1.setupCallback = SetupEntry dataType2.setupCallback = SetupEntry @@ -226,7 +245,7 @@ function ScrollableDropdownHelper:Initialize(parent, control, visibleRows) numItems = self.visibleRows end scrollContent:SetAnchor(BOTTOMRIGHT, nil, nil, anchorOffset) - local height = PADDING * 2 + numItems * (SCROLLABLE_ENTRY_TEMPLATE_HEIGHT + dropdown.m_spacing) - dropdown.m_spacing + local height = PADDING * 2 + numItems * (SCROLLABLE_ENTRY_TEMPLATE_HEIGHT + dropdown.m_spacing) - dropdown.m_spacing + ROUNDING_MARGIN dropdown.m_dropdown:SetWidth(width) dropdown.m_dropdown:SetHeight(height) end) @@ -282,6 +301,25 @@ function ScrollableDropdownHelper:GetMaxWidth() return maxWidth end +function ScrollableDropdownHelper:OnMouseEnter(control) + -- call original code if we replace instead of hook the handler + --ZO_ScrollableComboBox_Entry_OnMouseEnter(control) + -- show tooltip + if control.m_data.tooltip then + InitializeTooltip(InformationTooltip, control, TOPLEFT, 0, 0, BOTTOMRIGHT) + SetTooltipText(InformationTooltip, LAM.util.GetStringFromValue(control.m_data.tooltip)) + InformationTooltipTopLevel:BringWindowToTop() + end +end +function ScrollableDropdownHelper:OnMouseExit(control) + -- call original code if we replace instead of hook the handler + --ZO_ScrollableComboBox_Entry_OnMouseExit(control) + -- hide tooltip + if control.m_data.tooltip then + ClearTooltip(InformationTooltip) + end +end + function LAMCreateControl.dropdown(parent, dropdownData, controlName) local control = LAM.util.CreateLabelAndContainerControl(parent, dropdownData, controlName) control.choices = {}