diff --git a/FurCContextMenu.lua b/FurCContextMenu.lua index 9246463..43b9f3b 100644 --- a/FurCContextMenu.lua +++ b/FurCContextMenu.lua @@ -5,35 +5,35 @@ local FURC_S_SHOPPINGLIST_5 = GetString(SI_FURC_FIVE_TO_SHOPPINGLIST) local FURC_S_TOGGLE_SL = GetString(SI_FURC_TOGGLE_SHOPPINGLIST) function AddFurnitureShoppingListMenuEntry(itemId, calledFromFurC) - + if calledFromFurC then - if (not FurC.GetEnableShoppingList()) then return end - if (nil == moc()) or (nil == FurnitureShoppingListAdd) then return end - local controlName = moc():GetName() or "" - if nil == moc():GetName():match("_ListItem_") then return end - end + if (not FurC.GetEnableShoppingList()) then return end + if (nil == moc()) or (nil == FurnitureShoppingListAdd) then return end + local controlName = moc():GetName() or "" + if nil == moc():GetName():match("_ListItem_") then return end + end - local itemLink = FurC.GetItemLink(itemId) - if nil == FurC.Find(itemLink) then return end - AddCustomMenuItem(FURC_S_SHOPPINGLIST_1, - function() - FurnitureShoppingListAdd(itemLink) - end, - MENU_ADD_OPTION_LABEL) - AddCustomMenuItem(FURC_S_SHOPPINGLIST_5, - function() - FurnitureShoppingListAdd(itemLink) - FurnitureShoppingListAdd(itemLink) - FurnitureShoppingListAdd(itemLink) - FurnitureShoppingListAdd(itemLink) - FurnitureShoppingListAdd(itemLink) - end, - MENU_ADD_OPTION_LABEL) - AddCustomMenuItem(FURC_S_TOGGLE_SL, - function() - FurnitureShoppingListWindow_Toggle() - end, - MENU_ADD_OPTION_LABEL) + local itemLink = FurC.GetItemLink(itemId) + if nil == FurC.Find(itemLink) then return end + AddCustomMenuItem(FURC_S_SHOPPINGLIST_1, + function() + FurnitureShoppingListAdd(itemLink) + end, + MENU_ADD_OPTION_LABEL) + AddCustomMenuItem(FURC_S_SHOPPINGLIST_5, + function() + FurnitureShoppingListAdd(itemLink) + FurnitureShoppingListAdd(itemLink) + FurnitureShoppingListAdd(itemLink) + FurnitureShoppingListAdd(itemLink) + FurnitureShoppingListAdd(itemLink) + end, + MENU_ADD_OPTION_LABEL) + AddCustomMenuItem(FURC_S_TOGGLE_SL, + function() + FurnitureShoppingListWindow_Toggle() + end, + MENU_ADD_OPTION_LABEL) end @@ -52,8 +52,8 @@ local function doNothing() return end local S_DIVIDER = "-" local function addMenuItems(itemLink, recipeArray) - recipeArray = recipeArray or FurC.Find(itemLink) - if not recipeArray or recipeArray == {} then return end + recipeArray = recipeArray or FurC.Find(itemLink) + if not recipeArray or recipeArray == {} then return end cachedItemLink = itemLink cachedRecipeArray = recipeArray @@ -61,60 +61,60 @@ local function addMenuItems(itemLink, recipeArray) if not FurC.GetSkipDivider() then AddCustomMenuItem(S_DIVIDER, doNothing, MENU_ADD_OPTION_LABEL) end - - AddCustomMenuItem(GetString(SI_FURC_MENU_HEADER), toChat, MENU_ADD_OPTION_LABEL) + + AddCustomMenuItem(GetString(SI_FURC_MENU_HEADER), toChat, MENU_ADD_OPTION_LABEL) - local faveText = FurC.IsFavorite(itemLink, recipeArray) and GetString(SI_FURC_REMOVE_FAVE) or GetString(SI_FURC_ADD_FAVE) - AddCustomMenuItem(faveText, fave, MENU_ADD_OPTION_LABEL) - - local isRecipe = IsItemLinkFurnitureRecipe(itemLink) - - -- if we hold a recipe: allow posting recipe - if not isRecipe and recipeArray.blueprint then - AddCustomMenuItem(GetString(SI_FURC_POST_RECIPE), postRecipe, MENU_ADD_OPTION_LABEL) - + local faveText = FurC.IsFavorite(itemLink, recipeArray) and GetString(SI_FURC_REMOVE_FAVE) or GetString(SI_FURC_ADD_FAVE) + AddCustomMenuItem(faveText, fave, MENU_ADD_OPTION_LABEL) + + local isRecipe = IsItemLinkFurnitureRecipe(itemLink) + + -- if we hold a recipe: allow posting recipe + if not isRecipe and recipeArray.blueprint then + AddCustomMenuItem(GetString(SI_FURC_POST_RECIPE), postRecipe, MENU_ADD_OPTION_LABEL) + -- if it's a recipe: Allow posting item - elseif isRecipe then - AddCustomMenuItem(GetString(SI_FURC_POST_ITEM), postRecipeResult, MENU_ADD_OPTION_LABEL) - end - - if recipeArray.origin ~= FURC_CRAFTING then - AddCustomMenuItem(GetString(SI_FURC_POST_ITEMSOURCE), postItemSource, MENU_ADD_OPTION_LABEL) - else + elseif isRecipe then + AddCustomMenuItem(GetString(SI_FURC_POST_ITEM), postRecipeResult, MENU_ADD_OPTION_LABEL) + end + + if recipeArray.origin ~= FURC_CRAFTING then + AddCustomMenuItem(GetString(SI_FURC_POST_ITEMSOURCE), postItemSource, MENU_ADD_OPTION_LABEL) + else - -- post material list - AddCustomMenuItem(GetString(SI_FURC_POST_MATERIAL), postMaterial, MENU_ADD_OPTION_LABEL) + -- post material list + AddCustomMenuItem(GetString(SI_FURC_POST_MATERIAL), postMaterial, MENU_ADD_OPTION_LABEL) - -- will do nothing if preferences not met - AddFurnitureShoppingListMenuEntry(itemLink, true) - end + -- will do nothing if preferences not met + AddFurnitureShoppingListMenuEntry(itemLink, true) + end end -function FurC_HandleClickEvent(itemLink, button, control) -- button being mouseButton here - if (type(itemLink) == 'string' and #itemLink > 0) then - local handled = LINK_HANDLER:FireCallbacks(LINK_HANDLER.LINK_MOUSE_UP_EVENT, itemLink, button, ZO_LinkHandler_ParseLink(itemLink)) - if (not handled) then - FurC_LinkHandlerBackup_OnLinkMouseUp(itemLink, button, control) - if (button == 2 and itemLink ~= '') then - addMenuItems(itemLink, FurC.Find(itemLink)) - end - ShowMenu(control) +function FurC_HandleClickEvent(itemLink, button, control) -- button being mouseButton here + if (type(itemLink) == 'string' and #itemLink > 0) then + local handled = LINK_HANDLER:FireCallbacks(LINK_HANDLER.LINK_MOUSE_UP_EVENT, itemLink, button, ZO_LinkHandler_ParseLink(itemLink)) + if (not handled) then + FurC_LinkHandlerBackup_OnLinkMouseUp(itemLink, button, control) + if (button == 2 and itemLink ~= '') then + addMenuItems(itemLink, FurC.Find(itemLink)) + end + ShowMenu(control) end end end function FurC_HandleMouseEnter(inventorySlot) - local inventorySlot = moc() + local inventorySlot = moc() - if nil == inventorySlot or nil == inventorySlot.dataEntry then return end - local data = inventorySlot.dataEntry.data - if nil == data then return end + if nil == inventorySlot or nil == inventorySlot.dataEntry then return end + local data = inventorySlot.dataEntry.data + if nil == data then return end - local bagId, slotIndex = data.bagId, data.slotIndex - FurC.CurrentLink = GetItemLink(bagId, slotIndex) - if nil == FurC.CurrentLink then return end + local bagId, slotIndex = data.bagId, data.slotIndex + FurC.CurrentLink = GetItemLink(bagId, slotIndex) + if nil == FurC.CurrentLink then return end end @@ -122,12 +122,12 @@ end -- thanks Randactyl for helping me with the handler :) function FurC_HandleInventoryContextMenu(control) - local st = ZO_InventorySlot_GetType(control) + local st = ZO_InventorySlot_GetType(control) local itemLink = nil if st == SLOT_TYPE_ITEM - or st == SLOT_TYPE_BANK_ITEM - or st == SLOT_TYPE_GUILD_BANK_ITEM - or st == SLOT_TYPE_TRADING_HOUSE_POST_ITEM then + or st == SLOT_TYPE_BANK_ITEM + or st == SLOT_TYPE_GUILD_BANK_ITEM + or st == SLOT_TYPE_TRADING_HOUSE_POST_ITEM then local bagId, slotId = ZO_Inventory_GetBagAndIndex(control) itemLink = GetItemLink(bagId, slotId, linkStyle) elseif st == SLOT_TYPE_STORE_BUY then @@ -138,14 +138,14 @@ function FurC_HandleInventoryContextMenu(control) itemLink = GetTradingHouseListingItemLink(ZO_Inventory_GetSlotIndex(control), linkStyle) end - local recipeArray = FurC.Find(itemLink) - -- d(recipeArray) - if nil == recipeArray then return end + local recipeArray = FurC.Find(itemLink) + -- d(recipeArray) + if nil == recipeArray then return end - zo_callLater(function() - addMenuItems(itemLink, recipeArray) - ShowMenu() - end, 50) + zo_callLater(function() + addMenuItems(itemLink, recipeArray) + ShowMenu() + end, 50) end @@ -153,28 +153,28 @@ end function FurC.OnControlMouseUp(control, button) - if nil == control then return end + if nil == control then return end - if button ~= 2 then return end - local itemLink = control.itemLink + if button ~= 2 then return end + local itemLink = control.itemLink - if nil == itemLink then return end - local recipeArray = FurC.Find(itemLink) - if nil == recipeArray then return end - zo_callLater(function() - ItemTooltip:SetHidden(true) - ClearMenu() - addMenuItems(itemLink, recipeArray) - ShowMenu() - end, 50) + if nil == itemLink then return end + local recipeArray = FurC.Find(itemLink) + if nil == recipeArray then return end + zo_callLater(function() + ItemTooltip:SetHidden(true) + ClearMenu() + addMenuItems(itemLink, recipeArray) + ShowMenu() + end, 50) end function FurC.InitRightclickMenu() - FurC_LinkHandlerBackup_OnLinkMouseUp = ZO_LinkHandler_OnLinkMouseUp - ZO_LinkHandler_OnLinkMouseUp = function(itemLink, button, control) FurC_HandleClickEvent(itemLink, button, control) end - ZO_PreHook('ZO_InventorySlot_OnMouseEnter', FurC_HandleMouseEnter) - ZO_PreHook('ZO_InventorySlot_ShowContextMenu', function(rowControl) - FurC_HandleInventoryContextMenu(rowControl) - end) + FurC_LinkHandlerBackup_OnLinkMouseUp = ZO_LinkHandler_OnLinkMouseUp + ZO_LinkHandler_OnLinkMouseUp = function(itemLink, button, control) FurC_HandleClickEvent(itemLink, button, control) end + ZO_PreHook('ZO_InventorySlot_OnMouseEnter', FurC_HandleMouseEnter) + ZO_PreHook('ZO_InventorySlot_ShowContextMenu', function(rowControl) + FurC_HandleInventoryContextMenu(rowControl) + end) end diff --git a/FurCControlBridge.lua b/FurCControlBridge.lua index b4b9533..e1f1685 100644 --- a/FurCControlBridge.lua +++ b/FurCControlBridge.lua @@ -1,258 +1,258 @@ -local FurC = FurnitureCatalogue -local control = FurnitureCatalogueControl -FurC.Visible = false +local FurC = FurnitureCatalogue +local control = FurnitureCatalogueControl +FurC.Visible = false local LAM = LibStub:GetLibrary("LibAddonMenu-2.0") local function p(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) - FurC.DebugOut(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) + FurC.DebugOut(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) end function FurC.LoadFrameInfo(calledFrom) - local settings = FurC.settings.gui + local settings = FurC.settings.gui - FurCGui:ClearAnchors() - FurCGui:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, settings.lastX, settings.lastY) + FurCGui:ClearAnchors() + FurCGui:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, settings.lastX, settings.lastY) - FurCGui:SetWidth(settings.width) - FurCGui:SetHeight(settings.height) + FurCGui:SetWidth(settings.width) + FurCGui:SetHeight(settings.height) - zo_callLater(function() FurC.UpdateInventoryScroll() end, 100) + zo_callLater(function() FurC.UpdateInventoryScroll() end, 100) end function FurC.SaveFrameInfo(calledFrom) - local settings = FurC.settings["gui"] + local settings = FurC.settings["gui"] - settings.lastX = FurCGui:GetLeft() - settings.lastY = FurCGui:GetTop() - settings.width = FurCGui:GetWidth() - settings.height = FurCGui:GetHeight() + settings.lastX = FurCGui:GetLeft() + settings.lastY = FurCGui:GetTop() + settings.width = FurCGui:GetWidth() + settings.height = FurCGui:GetHeight() - FurC.UpdateInventoryScroll() + FurC.UpdateInventoryScroll() end function FurC.OnResizeStop() - FurC.SaveFrameInfo() - FurC.UpdateLineVisibility() - FurC.UpdateInventoryScroll() + FurC.SaveFrameInfo() + FurC.UpdateLineVisibility() + FurC.UpdateInventoryScroll() end function FurC.ChangeTemplateFromButton(value) - local control = FurCGui_Header_Bar1_TemplateLarge - local otherControl = FurCGui_Header_Bar1_TemplateTiny + local control = FurCGui_Header_Bar1_TemplateLarge + local otherControl = FurCGui_Header_Bar1_TemplateTiny - if value then - otherControl = FurCGui_Header_Bar1_TemplateLarge - control = FurCGui_Header_Bar1_TemplateTiny - end - control:SetHidden(true) - otherControl:SetHidden(false) + if value then + otherControl = FurCGui_Header_Bar1_TemplateLarge + control = FurCGui_Header_Bar1_TemplateTiny + end + control:SetHidden(true) + otherControl:SetHidden(false) - FurC.SetTinyUi(value) + FurC.SetTinyUi(value) end function FurC.GUIButtonHideOnMouseUp() - FurCGui:SetHidden(true) + FurCGui:SetHidden(true) end local function forceRefresh() - FurC.WipeDatabase() + FurC.WipeDatabase() end function FurC.GUIButtonRefreshOnMouseUp(control, mouseButton) - if mouseButton == 1 then - FurC.ScanRecipes(false, true) - elseif mouseButton == 2 then - FurC.ScanRecipes(true, false) - elseif mouseButton == 3 then - if LAM and LAM.util then - LAM.util.ShowConfirmationDialog( - GetString(SI_FURC_DIALOGUE_RESET_DB_HEADER), - GetString(SI_FURC_DIALOGUE_RESET_DB_BODY), - forceRefresh - ) - end - end + if mouseButton == 1 then + FurC.ScanRecipes(false, true) + elseif mouseButton == 2 then + FurC.ScanRecipes(true, false) + elseif mouseButton == 3 then + if LAM and LAM.util then + LAM.util.ShowConfirmationDialog( + GetString(SI_FURC_DIALOGUE_RESET_DB_HEADER), + GetString(SI_FURC_DIALOGUE_RESET_DB_BODY), + forceRefresh + ) + end + end end function FurC.GuiShowTooltip(control, tooltiptext, reAnchor) - InitializeTooltip(InformationTooltip, control, BOTTOM, 0, 0, 0) - InformationTooltip:SetHidden(false) - InformationTooltip:ClearLines() - InformationTooltip:AddLine(tooltiptext) - - if reAnchor then - InformationTooltip:ClearAnchors() - InformationTooltip:SetAnchor(TOPRIGHT, control, TOPLEFT, -10) - end + InitializeTooltip(InformationTooltip, control, BOTTOM, 0, 0, 0) + InformationTooltip:SetHidden(false) + InformationTooltip:ClearLines() + InformationTooltip:AddLine(tooltiptext) + + if reAnchor then + InformationTooltip:ClearAnchors() + InformationTooltip:SetAnchor(TOPRIGHT, control, TOPLEFT, -10) + end end function FurC.GuiHideTooltip(control) - InformationTooltip:ClearLines() - InformationTooltip:SetHidden(true) + InformationTooltip:ClearLines() + InformationTooltip:SetHidden(true) end function FurC.GuiOnSearchBoxClick(control, mouseButton, doubleClick) - FurC_SearchBoxText:SetText("") - if mouseButton == 2 or doubleClick then - control:SetText("") - end + FurC_SearchBoxText:SetText("") + if mouseButton == 2 or doubleClick then + control:SetText("") + end end local FURC_S_FILTERDEFAULT = GetString(SI_FURC_TEXTBOX_FILTER_DEFAULT) function FurC.GuiOnSearchBoxFocusOut(control) - if control:GetText() and control:GetText() ~= "" then + if control:GetText() and control:GetText() ~= "" then FurC.GuiOnSliderUpdate(FurCGui_ListHolder_Slider, 0) - FurC.UpdateGui() + FurC.UpdateGui() end local text = FurC_SearchBox:GetText() FurC_SearchBoxText:SetText((#text == 0 and FURC_S_FILTERDEFAULT) or "") end function FurC.GuiOnScroll(control, delta) - if not delta then return end - if delta == 0 then return end + if not delta then return end + if delta == 0 then return end - local slider = FurCGui_ListHolder_Slider --- slider.locked = true - -- negative delta means scrolling down + local slider = FurCGui_ListHolder_Slider +-- slider.locked = true + -- negative delta means scrolling down - local value = (FurCGui_ListHolder.dataOffset - delta) - local total = #FurCGui_ListHolder.dataLines - FurCGui_ListHolder.maxLines + local value = (FurCGui_ListHolder.dataOffset - delta) + local total = #FurCGui_ListHolder.dataLines - FurCGui_ListHolder.maxLines - if value < 0 then value = 0 end - if value > total then value = total end - FurCGui_ListHolder.dataOffset = value + if value < 0 then value = 0 end + if value > total then value = total end + FurCGui_ListHolder.dataOffset = value - FurC.UpdateInventoryScroll() + FurC.UpdateInventoryScroll() - slider:SetValue(FurCGui_ListHolder.dataOffset) + slider:SetValue(FurCGui_ListHolder.dataOffset) - FurC.GuiLineOnMouseEnter(moc()) + FurC.GuiLineOnMouseEnter(moc()) end function FurC.GuiOnSliderUpdate(slider, value) - if not value or slider and slider.locked then return end - local relativeValue = math.floor(FurCGui_ListHolder.dataOffset - value) - FurC.GuiOnScroll(slider, relativeValue) + if not value or slider and slider.locked then return end + local relativeValue = math.floor(FurCGui_ListHolder.dataOffset - value) + FurC.GuiOnScroll(slider, relativeValue) end function FurC.GuiShowFilterTooltip(control, label) - label = control.tooltip or label - FurC.GuiShowTooltip(control, label) + label = control.tooltip or label + FurC.GuiShowTooltip(control, label) end local currentLink, currentId function FurC.GuiLineOnMouseEnter(lineControl) - currentLink, currentId = nil + currentLink, currentId = nil - if not lineControl or not lineControl.itemLink or lineControl.itemLink == "" then return end - currentLink = lineControl.itemLink - currentId = lineControl.itemId + if not lineControl or not lineControl.itemLink or lineControl.itemLink == "" then return end + currentLink = lineControl.itemLink + currentId = lineControl.itemId - if nil == currentLink then return end + if nil == currentLink then return end - InitializeTooltip(ItemTooltip, lineControl, LEFT, 0, 0, 0) - ItemTooltip:SetLink(currentLink) + InitializeTooltip(ItemTooltip, lineControl, LEFT, 0, 0, 0) + ItemTooltip:SetLink(currentLink) end function FurC.GuiLineOnMouseExit(lineControl) - ItemTooltip:SetHidden(true) + ItemTooltip:SetHidden(true) end function FurC.Donate(control, mouseButton) - local amount = 2000 - if mouseButton == 2 then - amount = 10000 - elseif mouseButton == 3 then - amount = 25000 - end - - SCENE_MANAGER:Show('mailSend') - zo_callLater(function() - ZO_MailSendToField:SetText("@manavortex") - ZO_MailSendSubjectField:SetText("Thank you for Furniture Catalogue!") - QueueMoneyAttachment(amount) - ZO_MailSendBodyField:TakeFocus() end, 200) + local amount = 2000 + if mouseButton == 2 then + amount = 10000 + elseif mouseButton == 3 then + amount = 25000 + end + + SCENE_MANAGER:Show('mailSend') + zo_callLater(function() + ZO_MailSendToField:SetText("@manavortex") + ZO_MailSendSubjectField:SetText("Thank you for Furniture Catalogue!") + QueueMoneyAttachment(amount) + ZO_MailSendBodyField:TakeFocus() end, 200) end function FurC.OnControlDoubleClick(control) - FurC.ToChat(control.itemLink) + FurC.ToChat(control.itemLink) end function FurC.GuiVirtualMouseOver(control) - FurC.GuiShowTooltip(control, control.tooltip) + FurC.GuiShowTooltip(control, control.tooltip) end function FurC.GuiVirtualMouseOut(control) - FurC.GuiHideTooltip(control) + FurC.GuiHideTooltip(control) end function FurC.GuiQualityMouseUp(control, button) if button == 2 then FurC.SetFilterQuality(0) end - FurC.SetFilterQuality(control.quality) + FurC.SetFilterQuality(control.quality) end function FurC.GuiCraftingTypeMouseUp(control) - FurC.SetFilterCraftingType(control.craftingType) + FurC.SetFilterCraftingType(control.craftingType) end -local sortBy = nil +local sortBy = nil local sortDirection = "down" local function getButtonTex(key) - if key ~= sortBy then - return "esoui/art/miscellaneous/list_sortheader_icon_neutral.dds" - end - return "esoui/art/miscellaneous/list_sortheader_icon_sort" .. sortDirection .. ".dds" + if key ~= sortBy then + return "esoui/art/miscellaneous/list_sortheader_icon_neutral.dds" + end + return "esoui/art/miscellaneous/list_sortheader_icon_sort" .. sortDirection .. ".dds" end function FurC.GetSortParams() - return sortBy, sortDirection + return sortBy, sortDirection end function FurC.GuiOnSort(key) - -- set icon texture - if sortBy and sortBy == key then - sortDirection = ((sortDirection == "up" and "down") or "up") - else - sortBy = key - sortDirection = "up" - end + -- set icon texture + if sortBy and sortBy == key then + sortDirection = ((sortDirection == "up" and "down") or "up") + else + sortBy = key + sortDirection = "up" + end - FurCGui_Header_SortBar_Name_Button:SetNormalTexture(getButtonTex("itemName")) - FurCGui_Header_SortBar_Quality_Button:SetNormalTexture(getButtonTex("itemQuality")) + FurCGui_Header_SortBar_Name_Button:SetNormalTexture(getButtonTex("itemName")) + FurCGui_Header_SortBar_Quality_Button:SetNormalTexture(getButtonTex("itemQuality")) - FurC.UpdateGui() + FurC.UpdateGui() end function FurC.UpdateDropdownChoice(dropdownName, value) - if nil == dropdownName then - FurC.UpdateDropdownChoice("Version", value) - FurC.UpdateDropdownChoice("Character", value) - FurC.UpdateDropdownChoice("Source", value) - return - end - InformationTooltip:SetHidden(true) - value = value or FurC.GetDropdownChoiceTextual(dropdownName) - - local controlName = "FurC_Dropdown"..dropdownName - local control = _G[controlName] - if nil == control then return end - control:GetNamedChild("SelectedItemText"):SetText(value) + if nil == dropdownName then + FurC.UpdateDropdownChoice("Version", value) + FurC.UpdateDropdownChoice("Character", value) + FurC.UpdateDropdownChoice("Source", value) + return + end + InformationTooltip:SetHidden(true) + value = value or FurC.GetDropdownChoiceTextual(dropdownName) + + local controlName = "FurC_Dropdown"..dropdownName + local control = _G[controlName] + if nil == control then return end + control:GetNamedChild("SelectedItemText"):SetText(value) end function FurC.RefreshCounter() - FurC_RecipeCount:SetText(#FurCGui_ListHolder.dataLines) + FurC_RecipeCount:SetText(#FurCGui_ListHolder.dataLines) end diff --git a/FurCData.lua b/FurCData.lua index 4a477ba..454b6f1 100644 --- a/FurCData.lua +++ b/FurCData.lua @@ -1,548 +1,548 @@ -local currentChar = FurnitureCatalogue.CharacterName -local task = LibStub("LibAsync"):Create("FurnitureCatalogue_ScanDataFiles") -local task2 = LibStub("LibAsync"):Create("FurnitureCatalogue_ScanCharacterKnowledge") -local characterAlliance = GetUnitAlliance('player') +local currentChar = FurnitureCatalogue.CharacterName +local task = LibStub("LibAsync"):Create("FurnitureCatalogue_ScanDataFiles") +local task2 = LibStub("LibAsync"):Create("FurnitureCatalogue_ScanCharacterKnowledge") +local characterAlliance = GetUnitAlliance('player') -local NUMBER_TYPE = "number" -local STRING_TYPE = "string" -local STRING_EMPTY = "" +local NUMBER_TYPE = "number" +local STRING_TYPE = "string" +local STRING_EMPTY = "" -local lastLink = nil -local recipeArray = nil +local lastLink = nil +local recipeArray = nil local FURC_STRING_TRADINGHOUSE = "Seen in trading house" local function getCurrentChar() - if nil == currentChar then currentChar = zo_strformat(GetUnitName("player")) end - return currentChar + if nil == currentChar then currentChar = zo_strformat(GetUnitName("player")) end + return currentChar end local p = FurC.DebugOut local function startupMessage(text) - if FurC.GetStartupSilently() then return end - d(text) + if FurC.GetStartupSilently() then return end + d(text) end local function getItemId(itemLink) - if nil == itemLink or STRING_EMPTY == itemLink then return end - if type(itemLink) == NUMBER_TYPE and itemLink > 9999 then return itemLink end - local _, _, _, itemId = ZO_LinkHandler_ParseLink(itemLink) - return tonumber(itemId) + if nil == itemLink or STRING_EMPTY == itemLink then return end + if type(itemLink) == NUMBER_TYPE and itemLink > 9999 then return itemLink end + local _, _, _, itemId = ZO_LinkHandler_ParseLink(itemLink) + return tonumber(itemId) end FurC.GetItemId = getItemId local function getItemLink(itemId) if nil == itemId then return end - itemId = tostring(itemId) - if #itemId > 55 then return itemId end - if #itemId < 4 then return end - return zo_strformat("|H1:item:<<1>>:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h", itemId) + itemId = tostring(itemId) + if #itemId > 55 then return itemId end + if #itemId < 4 then return end + return zo_strformat("|H1:item:<<1>>:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h", itemId) end FurC.GetItemLink = getItemLink local function printItemLink(itemId) if nil == itemId then return end - itemId = tostring(itemId) + itemId = tostring(itemId) local itemLink = nil - if #itemId > 55 then + if #itemId > 55 then itemLink = itemId end itemLink = itemLink or zo_strformat("|H1:item:<<1>>:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h", itemId) - d(zo_strformat("[<<1>>] = '',\t\t-- <<2>>", itemId, GetItemLinkName(itemLink))) + d(zo_strformat("[<<1>>] = '',\t\t-- <<2>>", itemId, GetItemLinkName(itemLink))) end FurC.PrintItemLink = printItemLink local function addDatabaseEntry(recipeKey, recipeArray) - if recipeKey and recipeArray and {} ~= recipeArray then - FurC.settings.data[recipeKey] = recipeArray - end + if recipeKey and recipeArray and {} ~= recipeArray then + FurC.settings.data[recipeKey] = recipeArray + end end local function makeMaterial(recipeKey, recipeArray, tryPlaintext, forcePlaintext) - if nil == recipeArray or (nil == recipeArray.blueprint and nil == recipeArray.recipeIndex and nil == recipeArray.recipeListIndex) then - return "couldn't get material list, please re-scan character knowledge" - end - local ret = "" - local ingredients = FurC.GetIngredients(recipeKey, recipeArray) - forcePlaintext = forcePlaintext or tryPlaintext and NonContiguousCount(ingredients) > 4 - for ingredientLink, qty in pairs(ingredients) do - -- auto-capitalize because for some reason the ZOS API doesn't - local itemText = (forcePlaintext and string.gsub(" "..GetItemLinkName(ingredientLink), "%W%l", string.upper):sub(2)) or ingredientLink - ret = zo_strformat("<<1>> <<2>>x <<3>>, ", ret, qty, itemText) - end - return ret:sub(0, -3) + if nil == recipeArray or (nil == recipeArray.blueprint and nil == recipeArray.recipeIndex and nil == recipeArray.recipeListIndex) then + return "couldn't get material list, please re-scan character knowledge" + end + local ret = "" + local ingredients = FurC.GetIngredients(recipeKey, recipeArray) + forcePlaintext = forcePlaintext or tryPlaintext and NonContiguousCount(ingredients) > 4 + for ingredientLink, qty in pairs(ingredients) do + -- auto-capitalize because for some reason the ZOS API doesn't + local itemText = (forcePlaintext and string.gsub(" "..GetItemLinkName(ingredientLink), "%W%l", string.upper):sub(2)) or ingredientLink + ret = zo_strformat("<<1>> <<2>>x <<3>>, ", ret, qty, itemText) + end + return ret:sub(0, -3) end FurC.GetMats = makeMaterial function FurC.GetIngredients(itemLink, recipeArray) - recipeArray = recipeArray or FurC.Find(itemLink) - local ingredients = {} - if recipeArray.blueprint then - local blueprintLink = FurC.GetItemLink(recipeArray.blueprint) - numIngredients = GetItemLinkRecipeNumIngredients(blueprintLink) - for ingredientIndex=1, numIngredients do - name, _, qty = GetItemLinkRecipeIngredientInfo(blueprintLink, ingredientIndex) - ingredientLink = GetItemLinkRecipeIngredientItemLink(blueprintLink, ingredientIndex) - ingredients[ingredientLink] = qty - end - else - _, name, numIngredients = GetRecipeInfo(recipeArray.recipeListIndex, recipeArray.recipeIndex) - for ingredientIndex=1, numIngredients do - name, _, qty = GetRecipeIngredientItemInfo(recipeArray.recipeListIndex, recipeArray.recipeIndex, ingredientIndex) - ingredientLink = GetRecipeIngredientItemLink(recipeArray.recipeListIndex, recipeArray.recipeIndex, ingredientIndex) - ingredients[ingredientLink] = qty - end - end - return ingredients + recipeArray = recipeArray or FurC.Find(itemLink) + local ingredients = {} + if recipeArray.blueprint then + local blueprintLink = FurC.GetItemLink(recipeArray.blueprint) + numIngredients = GetItemLinkRecipeNumIngredients(blueprintLink) + for ingredientIndex=1, numIngredients do + name, _, qty = GetItemLinkRecipeIngredientInfo(blueprintLink, ingredientIndex) + ingredientLink = GetItemLinkRecipeIngredientItemLink(blueprintLink, ingredientIndex) + ingredients[ingredientLink] = qty + end + else + _, name, numIngredients = GetRecipeInfo(recipeArray.recipeListIndex, recipeArray.recipeIndex) + for ingredientIndex=1, numIngredients do + name, _, qty = GetRecipeIngredientItemInfo(recipeArray.recipeListIndex, recipeArray.recipeIndex, ingredientIndex) + ingredientLink = GetRecipeIngredientItemLink(recipeArray.recipeListIndex, recipeArray.recipeIndex, ingredientIndex) + ingredients[ingredientLink] = qty + end + end + return ingredients end -local function parseFurnitureItem(itemLink, override) -- saves to DB, returns recipeArray +local function parseFurnitureItem(itemLink, override) -- saves to DB, returns recipeArray - if not ( - override or IsItemLinkPlaceableFurniture(itemLink) - or GetItemLinkItemType(itemLink) == ITEMTYPE_FURNITURE - ) then return end + if not ( + override or IsItemLinkPlaceableFurniture(itemLink) + or GetItemLinkItemType(itemLink) == ITEMTYPE_FURNITURE + ) then return end - local recipeKey = getItemId(itemLink) - local recipeArray = FurC.settings.data[recipeKey] - if nil ~= recipeArray then return recipeArray end + local recipeKey = getItemId(itemLink) + local recipeArray = FurC.settings.data[recipeKey] + if nil ~= recipeArray then return recipeArray end - recipeArray = {} + recipeArray = {} - addDatabaseEntry(recipeKey, recipeArray) + addDatabaseEntry(recipeKey, recipeArray) - return recipeArray + return recipeArray end -local function parseBlueprint(blueprintLink) -- saves to DB, returns recipeArray +local function parseBlueprint(blueprintLink) -- saves to DB, returns recipeArray - local itemLink = GetItemLinkRecipeResultItemLink(blueprintLink, LINK_STYLE_BRACKETS) - local blueprintId = getItemId(blueprintLink) - local recipeKey = getItemId(itemLink) - if nil == recipeKey or -- we don't have a key to access the database - nil == itemLink or -- we don't have an item link to parse - nil == GetItemLinkName(itemLink) -- we didn't find an item result for our recipe - then return end + local itemLink = GetItemLinkRecipeResultItemLink(blueprintLink, LINK_STYLE_BRACKETS) + local blueprintId = getItemId(blueprintLink) + local recipeKey = getItemId(itemLink) + if nil == recipeKey or -- we don't have a key to access the database + nil == itemLink or -- we don't have an item link to parse + nil == GetItemLinkName(itemLink) -- we didn't find an item result for our recipe + then return end - local recipeArray = FurC.settings.data[recipeKey] or {} - recipeArray.origin = recipeArray.origin or FURC_CRAFTING - recipeArray.characters = recipeArray.characters or {} - recipeArray.craftingSkill = recipeArray.craftingSkill or GetItemLinkCraftingSkillType(blueprintLink) - recipeArray.blueprint = recipeArray.blueprint or getItemId(blueprintLink) + local recipeArray = FurC.settings.data[recipeKey] or {} + recipeArray.origin = recipeArray.origin or FURC_CRAFTING + recipeArray.characters = recipeArray.characters or {} + recipeArray.craftingSkill = recipeArray.craftingSkill or GetItemLinkCraftingSkillType(blueprintLink) + recipeArray.blueprint = recipeArray.blueprint or getItemId(blueprintLink) - if (IsItemLinkRecipeKnown(blueprintLink)) then - recipeArray.characters[getCurrentChar()] = true - end - addDatabaseEntry(recipeKey, recipeArray) - return recipeArray + if (IsItemLinkRecipeKnown(blueprintLink)) then + recipeArray.characters[getCurrentChar()] = true + end + addDatabaseEntry(recipeKey, recipeArray) + return recipeArray end -function FurC.Find(itemOrBlueprintLink) -- sets recipeArray, returns it - calls scanItemLink +function FurC.Find(itemOrBlueprintLink) -- sets recipeArray, returns it - calls scanItemLink - if tonumber(itemOrBlueprintLink) == itemOrBlueprintLink then itemOrBlueprintLink = FurC.GetItemLink(itemOrBlueprintLink) end - if nil == itemOrBlueprintLink or #itemOrBlueprintLink == 0 then return end - -- p("scanItemLink(<<1>>)...", itemOrBlueprintLink) -- do not return empty arrays. If this returns nil, abort! + if tonumber(itemOrBlueprintLink) == itemOrBlueprintLink then itemOrBlueprintLink = FurC.GetItemLink(itemOrBlueprintLink) end + if nil == itemOrBlueprintLink or #itemOrBlueprintLink == 0 then return end + -- p("scanItemLink(<<1>>)...", itemOrBlueprintLink) -- do not return empty arrays. If this returns nil, abort! - if itemOrBlueprintLink == lastLink and nil ~= recipeArray then - return recipeArray - else - recipeArray = nil - lastLink = itemOrBlueprintLink - end + if itemOrBlueprintLink == lastLink and nil ~= recipeArray then + return recipeArray + else + recipeArray = nil + lastLink = itemOrBlueprintLink + end - if IsItemLinkFurnitureRecipe(itemOrBlueprintLink) then - recipeArray = parseBlueprint(itemOrBlueprintLink) - elseif IsItemLinkPlaceableFurniture(itemOrBlueprintLink) then - recipeArray = parseFurnitureItem(itemOrBlueprintLink) - end + if IsItemLinkFurnitureRecipe(itemOrBlueprintLink) then + recipeArray = parseBlueprint(itemOrBlueprintLink) + elseif IsItemLinkPlaceableFurniture(itemOrBlueprintLink) then + recipeArray = parseFurnitureItem(itemOrBlueprintLink) + end - return recipeArray + return recipeArray end -function FurC.Delete(itemOrBlueprintLink) -- sets recipeArray, returns it - calls scanItemLink - local recipeArray = scanItemLink(itemOrBlueprintLink) - if nil == recipeArray then return end - local itemLink = recipeArray.itemId - local itemKey = getItemId(itemLink) - FurC.settings.data[itemKey] = nil +function FurC.Delete(itemOrBlueprintLink) -- sets recipeArray, returns it - calls scanItemLink + local recipeArray = scanItemLink(itemOrBlueprintLink) + if nil == recipeArray then return end + local itemLink = recipeArray.itemId + local itemKey = getItemId(itemLink) + FurC.settings.data[itemKey] = nil end function FurC.GetEntry(itemOrBlueprintLink) - local itemLink = (IsItemLinkFurnitureRecipe(itemOrBlueprintLink) and GetRecipeResultItemLink(itemOrBlueprintLink)) or itemOrBlueprintLink - local recipeArray = FurC.Find(itemLink) - -- d(string.format("Trying to get entry for %s: %s", itemLink, recipeArray)) - if not recipeArray then return end - local itemId = getItemId(itemOrBlueprintLink) - if recipeArray.blueprint then - itemId = getItemId(GetItemLinkRecipeResultItemLink(blueprintLink)) - end - return itemId, recipeArray + local itemLink = (IsItemLinkFurnitureRecipe(itemOrBlueprintLink) and GetRecipeResultItemLink(itemOrBlueprintLink)) or itemOrBlueprintLink + local recipeArray = FurC.Find(itemLink) + -- d(string.format("Trying to get entry for %s: %s", itemLink, recipeArray)) + if not recipeArray then return end + local itemId = getItemId(itemOrBlueprintLink) + if recipeArray.blueprint then + itemId = getItemId(GetItemLinkRecipeResultItemLink(blueprintLink)) + end + return itemId, recipeArray end function FurC.IsFavorite(itemLink, recipeArray) - recipeArray = recipeArray or FurC.Find(itemLink) - return recipeArray.favorite + recipeArray = recipeArray or FurC.Find(itemLink) + return recipeArray.favorite end function FurC.Fave(itemLink, recipeArray) - recipeArray = recipeArray or FurC.Find(itemLink) - recipeArray.favorite = not recipeArray.favorite - if not recipeArray.favorite then - recipeArray.favorite = nil - end + recipeArray = recipeArray or FurC.Find(itemLink) + recipeArray.favorite = not recipeArray.favorite + if not recipeArray.favorite then + recipeArray.favorite = nil + end - FurC.UpdateGui() + FurC.UpdateGui() end -local function scanRecipeIndices(recipeListIndex, recipeIndex) -- returns recipeArray or nil, initialises +local function scanRecipeIndices(recipeListIndex, recipeIndex) -- returns recipeArray or nil, initialises - local itemLink = GetRecipeResultItemLink(recipeListIndex, recipeIndex, LINK_STYLE_BRACKETS) - if nil == itemLink or #itemLink == 0 or not IsItemLinkPlaceableFurniture(itemLink) then return end + local itemLink = GetRecipeResultItemLink(recipeListIndex, recipeIndex, LINK_STYLE_BRACKETS) + if nil == itemLink or #itemLink == 0 or not IsItemLinkPlaceableFurniture(itemLink) then return end - local recipeKey = getItemId(itemLink) + local recipeKey = getItemId(itemLink) - local recipeArray = FurC.settings.data[recipeKey] or {} - recipeArray.origin = FURC_CRAFTING - recipeArray.version = recipeArray.version or 2 - recipeArray.recipeListIndex = recipeArray.recipeListIndex or recipeListIndex - recipeArray.recipeIndex = recipeArray.recipeIndex or recipeIndex + local recipeArray = FurC.settings.data[recipeKey] or {} + recipeArray.origin = FURC_CRAFTING + recipeArray.version = recipeArray.version or 2 + recipeArray.recipeListIndex = recipeArray.recipeListIndex or recipeListIndex + recipeArray.recipeIndex = recipeArray.recipeIndex or recipeIndex - recipeArray.characters = recipeArray.characters or {} + recipeArray.characters = recipeArray.characters or {} - if GetRecipeInfo(recipeListIndex, recipeIndex) then - recipeArray.characters[getCurrentChar()] = true - FurC.settings.accountCharacters = FurC.settings.accountCharacters or {} - FurC.settings.accountCharacters[getCurrentChar()] = FurC.settings.accountCharacters[getCurrentChar()] or true - end + if GetRecipeInfo(recipeListIndex, recipeIndex) then + recipeArray.characters[getCurrentChar()] = true + FurC.settings.accountCharacters = FurC.settings.accountCharacters or {} + FurC.settings.accountCharacters[getCurrentChar()] = FurC.settings.accountCharacters[getCurrentChar()] or true + end - addDatabaseEntry(recipeKey, recipeArray) - return recipeArray + addDatabaseEntry(recipeKey, recipeArray) + return recipeArray end -function FurC.TryCreateRecipeEntry(recipeListIndex, recipeIndex) -- returns scanRecipeIndices, called from Events.lua - return scanRecipeIndices(recipeListIndex, recipeIndex) +function FurC.TryCreateRecipeEntry(recipeListIndex, recipeIndex) -- returns scanRecipeIndices, called from Events.lua + return scanRecipeIndices(recipeListIndex, recipeIndex) end function FurC.IsAccountKnown(recipeKey, recipeArray) - if recipeKey == nil and recipeArray == nil then return false end - recipeArray = recipeArray or FurC.settings.data[recipeKey] - return not (nil == recipeArray or nil == recipeArray.characters or NonContiguousCount(recipeArray.characters) == 0) + if recipeKey == nil and recipeArray == nil then return false end + recipeArray = recipeArray or FurC.settings.data[recipeKey] + return not (nil == recipeArray or nil == recipeArray.characters or NonContiguousCount(recipeArray.characters) == 0) end function FurC.CanCraft(recipeKey, recipeArray) - if recipeKey == nil and recipeArray == nil then return false end - recipeArray = recipeArray or FurC.settings.data[recipeKey] - if FurC.IsAccountKnown(recipeKey, recipeArray) then - return recipeArray.characters[getCurrentChar()] - end - return false + if recipeKey == nil and recipeArray == nil then return false end + recipeArray = recipeArray or FurC.settings.data[recipeKey] + if FurC.IsAccountKnown(recipeKey, recipeArray) then + return recipeArray.characters[getCurrentChar()] + end + return false end function FurC.GetCraftingSkillType(recipeKey, recipeArray) - local itemLink = FurC.GetItemLink(recipeKey) - local craftingSkillType = GetItemLinkCraftingSkillType(itemLink) + local itemLink = FurC.GetItemLink(recipeKey) + local craftingSkillType = GetItemLinkCraftingSkillType(itemLink) - if 0 == craftingSkillType and recipeArray.blueprint then - craftingSkillType = GetItemLinkRecipeCraftingSkillType(FurC.GetItemLink(recipeArray.blueprint)) - elseif 0 == craftingSkillType and recipeArray.recipeListIndex and recipeArray.recipeIndex then - _, _, _, _, _, _, craftingSkillType = GetRecipeInfo(recipeArray.recipeListIndex, recipeArray.recipeIndex) - end + if 0 == craftingSkillType and recipeArray.blueprint then + craftingSkillType = GetItemLinkRecipeCraftingSkillType(FurC.GetItemLink(recipeArray.blueprint)) + elseif 0 == craftingSkillType and recipeArray.recipeListIndex and recipeArray.recipeIndex then + _, _, _, _, _, _, craftingSkillType = GetRecipeInfo(recipeArray.recipeListIndex, recipeArray.recipeIndex) + end - return craftingSkillType + return craftingSkillType end local function scanCharacter() - local listName, numRecipes - for recipeListIndex=1, GetNumRecipeLists() do - listName, numRecipes = GetRecipeListInfo(recipeListIndex) - for recipeIndex=1, numRecipes do - scanRecipeIndices(recipeListIndex, recipeIndex) -- returns true on success - end - end - p((GetString(SI_FURC_DEBUG_CHARSCANCOMPLETE))) + local listName, numRecipes + for recipeListIndex=1, GetNumRecipeLists() do + listName, numRecipes = GetRecipeListInfo(recipeListIndex) + for recipeIndex=1, numRecipes do + scanRecipeIndices(recipeListIndex, recipeIndex) -- returns true on success + end + end + p((GetString(SI_FURC_DEBUG_CHARSCANCOMPLETE))) end FurC.ScanCharacter = scanCharacter function FurC.RescanRumourRecipes() - local function rescan() - for itemId, recipeArray in pairs(FurC.settings.data) do - if recipeArray.source == FURC_RUMOUR then - local itemLink = recipeArray[itemLink] - if not FurC.RumourRecipes[itemLink] then - recipeArray.source = FURC_CRAFTING - recipeArray.origin = nil - end - end - end - end - - task:Call(rescan) - :Then(FurC.UpdateGui) + local function rescan() + for itemId, recipeArray in pairs(FurC.settings.data) do + if recipeArray.source == FURC_RUMOUR then + local itemLink = recipeArray[itemLink] + if not FurC.RumourRecipes[itemLink] then + recipeArray.source = FURC_CRAFTING + recipeArray.origin = nil + end + end + end + end + + task:Call(rescan) + :Then(FurC.UpdateGui) end local recipeArray local function scanFromFiles(shouldScanCharacter) - local function parseZoneData(zoneName, zoneData, versionNumber, origin) - for vendorName, vendorData in pairs(zoneData) do - for itemId, itemData in pairs(vendorData) do - - recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId), true) - if not recipeArray then - p("Error when scanning <<1>>", itemId) - else - - recipeArray.origin = origin - recipeArray.version = versionNumber - addDatabaseEntry(itemId, recipeArray) - end - - end - end - end - - local function scanRecipeFile() - local recipeKey, recipeArray - local function scanArray(ary, versionNumber, origin) - if nil == ary then return end - - for key, recipeId in ipairs(ary) do - local recipeLink = FurC.GetItemLink(recipeId) - local itemLink = GetItemLinkRecipeResultItemLink(recipeLink) or FurC.GetItemLink(recipeId) - recipeArray = FurC.Find(itemLink) or parseBlueprint(recipeLink) or parseFurnitureItem(itemLink) - local recipeListIndex, recipeIndex = GetItemLinkGrantedRecipeIndices(recipeLink) - if nil == recipeArray then - p("scanRecipeFile: error for <<1>> (ID was <<2>>)", recipeLink, recipeId) - else - recipeKey = getItemId(itemLink) - recipeArray.version = versionNumber - recipeArray.origin = origin - recipeArray.blueprint = recipeId - addDatabaseEntry(recipeKey, recipeArray) - end - end - end - - for versionNumber, versionData in pairs(FurC.Recipes) do - scanArray(versionData, versionNumber, FURC_CRAFTING) - end - for versionNumber, versionData in pairs(FurC.RolisRecipes) do - scanArray(versionData, versionNumber, FURC_CRAFTING) - end - for versionNumber, versionData in pairs(FurC.FaustinaRecipes) do - scanArray(versionData, versionNumber, FURC_CRAFTING) - end - end - - local function scanRolis() - for versionNumber, versionData in pairs(FurC.Rolis) do - for itemId, itemSource in pairs(versionData) do - recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId), true) - if nil ~= recipeArray then - recipeArray.version = versionNumber - recipeArray.origin = FURC_ROLIS - addDatabaseEntry(itemId, recipeArray) - end - end - end - for versionNumber, versionData in pairs(FurC.Faustina) do - for itemId, itemSource in pairs(versionData) do - recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId), true) - if nil ~= recipeArray then - recipeArray.version = versionNumber - recipeArray.origin = FURC_ROLIS - addDatabaseEntry(itemId, recipeArray) - end - end - end - end - - local function scanFestivalFiles() - for versionNumber, versionData in pairs(FurC.EventItems) do - for eventName, eventData in pairs(versionData) do - for eventItemSource, eventItemData in pairs(eventData) do - for itemId, _ in pairs(eventItemData) do - recipeArray = {} - recipeArray.craftable = false - recipeArray.version = versionNumber - recipeArray.origin = FURC_FESTIVAL_DROP - addDatabaseEntry(itemId, recipeArray) - end - end - end - end - end - - local function scanMiscItemFile() - for versionNumber, versionData in pairs(FurC.MiscItemSources) do - for origin, originData in pairs(versionData) do - for itemId, itemSource in pairs(originData) do - local itemLink = FurC.GetItemLink(itemId) - recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId)) - if nil ~= recipeArray then - recipeArray.version = versionNumber - recipeArray.origin = origin - addDatabaseEntry(itemId, recipeArray) - else - p("scanMiscItemFile: Error when scanning <<1>> (<<2>>) -> <<3>>", itemLink, itemId, origin) - end - end - end - end - end - - local function scanVendorFiles() - - FurC.InitAchievementVendorList() - local recipeKey, recipeArray, itemSource - - for versionNumber, versionData in pairs(FurC.AchievementVendors) do - for zoneName, zoneData in pairs(versionData) do - parseZoneData(zoneName, zoneData, versionNumber, FURC_VENDOR) - end - end - - for versionNumber, vendorData in pairs(FurC.LuxuryFurnisher) do - for itemId, itemData in pairs(vendorData) do - local recipeArray = {} - - recipeArray.origin = FURC_LUXURY - recipeArray.version = versionNumber - addDatabaseEntry(itemId, recipeArray) - end - end - - for versionNumber, versionData in pairs(FurC.PVP) do - for zoneName, zoneData in pairs(versionData) do - parseZoneData(zoneName, zoneData, versionNumber, FURC_PVP) - end - end - end - - local function scanRumourRecipes() - for index, blueprintId in pairs(FurC.RumourRecipes) do - local blueprintLink = FurC.GetItemLink(blueprintId) - local itemLink = GetItemLinkRecipeResultItemLink(blueprintLink, LINK_STYLE_BRACKETS) - if #itemLink == 0 then itemLink = blueprintLink end - local itemId = getItemId(itemLink) - recipeArray = parseBlueprint(blueprintLink) or parseFurnitureItem(itemLink) or {} - if blueprintId ~= itemId then - recipeArray.blueprint = blueprintId - end - recipeArray.recipeListIndex, recipeArray.recipeIndex = GetItemLinkGrantedRecipeIndices(blueprintLink) - recipeArray.origin = FURC_RUMOUR - recipeArray.verion = FURC_HOMESTEAD - addDatabaseEntry(itemId, recipeArray) - end - end + local function parseZoneData(zoneName, zoneData, versionNumber, origin) + for vendorName, vendorData in pairs(zoneData) do + for itemId, itemData in pairs(vendorData) do + + recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId), true) + if not recipeArray then + p("Error when scanning <<1>>", itemId) + else + + recipeArray.origin = origin + recipeArray.version = versionNumber + addDatabaseEntry(itemId, recipeArray) + end + + end + end + end + + local function scanRecipeFile() + local recipeKey, recipeArray + local function scanArray(ary, versionNumber, origin) + if nil == ary then return end + + for key, recipeId in ipairs(ary) do + local recipeLink = FurC.GetItemLink(recipeId) + local itemLink = GetItemLinkRecipeResultItemLink(recipeLink) or FurC.GetItemLink(recipeId) + recipeArray = FurC.Find(itemLink) or parseBlueprint(recipeLink) or parseFurnitureItem(itemLink) + local recipeListIndex, recipeIndex = GetItemLinkGrantedRecipeIndices(recipeLink) + if nil == recipeArray then + p("scanRecipeFile: error for <<1>> (ID was <<2>>)", recipeLink, recipeId) + else + recipeKey = getItemId(itemLink) + recipeArray.version = versionNumber + recipeArray.origin = origin + recipeArray.blueprint = recipeId + addDatabaseEntry(recipeKey, recipeArray) + end + end + end + + for versionNumber, versionData in pairs(FurC.Recipes) do + scanArray(versionData, versionNumber, FURC_CRAFTING) + end + for versionNumber, versionData in pairs(FurC.RolisRecipes) do + scanArray(versionData, versionNumber, FURC_CRAFTING) + end + for versionNumber, versionData in pairs(FurC.FaustinaRecipes) do + scanArray(versionData, versionNumber, FURC_CRAFTING) + end + end + + local function scanRolis() + for versionNumber, versionData in pairs(FurC.Rolis) do + for itemId, itemSource in pairs(versionData) do + recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId), true) + if nil ~= recipeArray then + recipeArray.version = versionNumber + recipeArray.origin = FURC_ROLIS + addDatabaseEntry(itemId, recipeArray) + end + end + end + for versionNumber, versionData in pairs(FurC.Faustina) do + for itemId, itemSource in pairs(versionData) do + recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId), true) + if nil ~= recipeArray then + recipeArray.version = versionNumber + recipeArray.origin = FURC_ROLIS + addDatabaseEntry(itemId, recipeArray) + end + end + end + end + + local function scanFestivalFiles() + for versionNumber, versionData in pairs(FurC.EventItems) do + for eventName, eventData in pairs(versionData) do + for eventItemSource, eventItemData in pairs(eventData) do + for itemId, _ in pairs(eventItemData) do + recipeArray = {} + recipeArray.craftable = false + recipeArray.version = versionNumber + recipeArray.origin = FURC_FESTIVAL_DROP + addDatabaseEntry(itemId, recipeArray) + end + end + end + end + end + + local function scanMiscItemFile() + for versionNumber, versionData in pairs(FurC.MiscItemSources) do + for origin, originData in pairs(versionData) do + for itemId, itemSource in pairs(originData) do + local itemLink = FurC.GetItemLink(itemId) + recipeArray = parseFurnitureItem(FurC.GetItemLink(itemId)) + if nil ~= recipeArray then + recipeArray.version = versionNumber + recipeArray.origin = origin + addDatabaseEntry(itemId, recipeArray) + else + p("scanMiscItemFile: Error when scanning <<1>> (<<2>>) -> <<3>>", itemLink, itemId, origin) + end + end + end + end + end + + local function scanVendorFiles() + + FurC.InitAchievementVendorList() + local recipeKey, recipeArray, itemSource + + for versionNumber, versionData in pairs(FurC.AchievementVendors) do + for zoneName, zoneData in pairs(versionData) do + parseZoneData(zoneName, zoneData, versionNumber, FURC_VENDOR) + end + end + + for versionNumber, vendorData in pairs(FurC.LuxuryFurnisher) do + for itemId, itemData in pairs(vendorData) do + local recipeArray = {} + + recipeArray.origin = FURC_LUXURY + recipeArray.version = versionNumber + addDatabaseEntry(itemId, recipeArray) + end + end + + for versionNumber, versionData in pairs(FurC.PVP) do + for zoneName, zoneData in pairs(versionData) do + parseZoneData(zoneName, zoneData, versionNumber, FURC_PVP) + end + end + end + + local function scanRumourRecipes() + for index, blueprintId in pairs(FurC.RumourRecipes) do + local blueprintLink = FurC.GetItemLink(blueprintId) + local itemLink = GetItemLinkRecipeResultItemLink(blueprintLink, LINK_STYLE_BRACKETS) + if #itemLink == 0 then itemLink = blueprintLink end + local itemId = getItemId(itemLink) + recipeArray = parseBlueprint(blueprintLink) or parseFurnitureItem(itemLink) or {} + if blueprintId ~= itemId then + recipeArray.blueprint = blueprintId + end + recipeArray.recipeListIndex, recipeArray.recipeIndex = GetItemLinkGrantedRecipeIndices(blueprintLink) + recipeArray.origin = FURC_RUMOUR + recipeArray.verion = FURC_HOMESTEAD + addDatabaseEntry(itemId, recipeArray) + end + end local function scanCharacterOrMaybeNot() if shouldScanCharacter then - scanCharacter() - else - startupMessage(GetString(SI_FURC_VERBOSE_STARTUP)) - end + scanCharacter() + else + startupMessage(GetString(SI_FURC_VERBOSE_STARTUP)) + end + end + local function rescanRumourRecipes() + -- make sure that all rumour items + for recipeKey, recipeArray in pairs(FurC.settings.data) do + if FurC.RumourRecipes[recipeKey] or recipeArray.blueprint and FurC.RumourRecipes[recipeArray.blueprint] then + + end end - local function rescanRumourRecipes() - -- make sure that all rumour items - for recipeKey, recipeArray in pairs(FurC.settings.data) do - if FurC.RumourRecipes[recipeKey] or recipeArray.blueprint and FurC.RumourRecipes[recipeArray.blueprint] then - - end - end - end + end - FurC.IsLoading(true) - - -- task:Call(scanMiscItemFile) - -- :Then(scanRecipeFile) - - task:Call(scanRecipeFile) - :Then(scanMiscItemFile) - :Then(scanVendorFiles) - :Then(scanRolis) - :Then(scanFestivalFiles) - :Then(scanCharacterOrMaybeNot) - :Then(scanRumourRecipes) - :Then(FurC.UpdateGui) - startupMessage(GetString(SI_FURC_VERBOSE_DB_UPTODATE)) + FurC.IsLoading(true) + + -- task:Call(scanMiscItemFile) + -- :Then(scanRecipeFile) + + task:Call(scanRecipeFile) + :Then(scanMiscItemFile) + :Then(scanVendorFiles) + :Then(scanRolis) + :Then(scanFestivalFiles) + :Then(scanCharacterOrMaybeNot) + :Then(scanRumourRecipes) + :Then(FurC.UpdateGui) + startupMessage(GetString(SI_FURC_VERBOSE_DB_UPTODATE)) end FurC.ScanFromFiles = scanFromFiles local function getScanFromFiles() - if (FurC.settings.version < FurC.version) then - FurC.settings.version = FurC.version - return true - end + if (FurC.settings.version < FurC.version) then + FurC.settings.version = FurC.version + return true + end - return FurC.settings.data == {} + return FurC.settings.data == {} end local function getScanCharacter() - if nil == FurC.settings.accountCharacters[FurC.CharacterName] then - FurC.settings.accountCharacters[FurC.CharacterName] = false - return true - end + if nil == FurC.settings.accountCharacters[FurC.CharacterName] then + FurC.settings.accountCharacters[FurC.CharacterName] = false + return true + end end -function FurC.ScanRecipes(shouldScanFiles, shouldScanCharacter) -- returns database - - shouldScanFiles = shouldScanFiles or getScanFromFiles() - shouldScanCharacter = (shouldScanCharacter or getScanCharacter()) - if (shouldScanFiles) then - p(GetString(SI_FURC_VERBOSE_SCANNING_DATA_FILE)) - scanFromFiles(shouldScanCharacter) - elseif (shouldScanCharacter) then - p(GetString(SI_FURC_VERBOSE_SCANNING_CHARS)) - scanCharacter() - end +function FurC.ScanRecipes(shouldScanFiles, shouldScanCharacter) -- returns database + + shouldScanFiles = shouldScanFiles or getScanFromFiles() + shouldScanCharacter = (shouldScanCharacter or getScanCharacter()) + if (shouldScanFiles) then + p(GetString(SI_FURC_VERBOSE_SCANNING_DATA_FILE)) + scanFromFiles(shouldScanCharacter) + elseif (shouldScanCharacter) then + p(GetString(SI_FURC_VERBOSE_SCANNING_CHARS)) + scanCharacter() + end end function FurC.GetItemDescription(recipeKey, recipeArray, stripColor, attachItemLink) recipeKey = FurC.GetItemId(recipeKey) FurC.settings.emptyItemSources = FurC.settings.emptyItemSources or {} - recipeArray = recipeArray or FurC.Find(recipeKey, recipeArray) - if not recipeArray then return "" end - local origin = recipeArray.origin - if origin == FURC_CRAFTING or origin == FURC_WRIT_VENDOR then - return FurC.GetMats(recipeKey, recipeArray, stripColor, attachItemLink) - elseif origin == FURC_ROLIS then - return FurC.getRolisSource(recipeKey, recipeArray, stripColor, attachItemLink) - elseif origin == FURC_LUXURY then - return FurC.getLuxurySource(recipeKey, recipeArray, stripColor, attachItemLink) - elseif origin == FURC_GUILDSTORE then - return GetString(SI_FURC_SEEN_IN_GUILDSTORE) - elseif origin == FURC_VENDOR then - return FurC.getAchievementVendorSource(recipeKey, recipeArray, stripColor, attachItemLink) - elseif origin == FURC_FESTIVAL_DROP then - return FurC.getEventDropSource(recipeKey, recipeArray, stripColor, attachItemLink) - elseif origin == FURC_PVP then - return FurC.getPvpSource(recipeKey, recipeArray, stripColor, attachItemLink) - elseif origin == FURC_RUMOUR then - return FurC.getRumourSource(recipeKey, recipeArray, stripColor, attachItemLink) - else - itemSource = FurC.GetMiscItemSource(recipeKey, recipeArray, stripColor, attachItemLink) - end + recipeArray = recipeArray or FurC.Find(recipeKey, recipeArray) + if not recipeArray then return "" end + local origin = recipeArray.origin + if origin == FURC_CRAFTING or origin == FURC_WRIT_VENDOR then + return FurC.GetMats(recipeKey, recipeArray, stripColor, attachItemLink) + elseif origin == FURC_ROLIS then + return FurC.getRolisSource(recipeKey, recipeArray, stripColor, attachItemLink) + elseif origin == FURC_LUXURY then + return FurC.getLuxurySource(recipeKey, recipeArray, stripColor, attachItemLink) + elseif origin == FURC_GUILDSTORE then + return GetString(SI_FURC_SEEN_IN_GUILDSTORE) + elseif origin == FURC_VENDOR then + return FurC.getAchievementVendorSource(recipeKey, recipeArray, stripColor, attachItemLink) + elseif origin == FURC_FESTIVAL_DROP then + return FurC.getEventDropSource(recipeKey, recipeArray, stripColor, attachItemLink) + elseif origin == FURC_PVP then + return FurC.getPvpSource(recipeKey, recipeArray, stripColor, attachItemLink) + elseif origin == FURC_RUMOUR then + return FurC.getRumourSource(recipeKey, recipeArray, stripColor, attachItemLink) + else + itemSource = FurC.GetMiscItemSource(recipeKey, recipeArray, stripColor, attachItemLink) + end if not itemSource then FurC.settings.emptyItemSources[recipeKey] = ", --" .. GetItemLinkName(FurC.GetItemLink(recipeKey)) end - return itemSource or GetString(SI_FURC_ITEMSOURCE_EMPTY) + return itemSource or GetString(SI_FURC_ITEMSOURCE_EMPTY) end diff --git a/FurCDataParser.lua b/FurCDataParser.lua index dc765b3..6a248c5 100644 --- a/FurCDataParser.lua +++ b/FurCDataParser.lua @@ -1,82 +1,82 @@ -local db = FurnitureCatalogue.settings["data"] +local db = FurnitureCatalogue.settings["data"] -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args function FurC.PrintCraftingStation(itemId, recipeArray) - local craftingType = FurC.GetCraftingSkillType(itemId, recipeArray) - if not craftingType or not GetCraftingSkillName(craftingType) then return "" end - return string.format(" (%s)", GetCraftingSkillName(craftingType)) + local craftingType = FurC.GetCraftingSkillType(itemId, recipeArray) + if not craftingType or not GetCraftingSkillName(craftingType) then return "" end + return string.format(" (%s)", GetCraftingSkillName(craftingType)) end local function prefillChatBox(output, refresh) - output = zo_strformat(output) - if nil == output or FURC_EMPTY_STRING == output then return end - local editControl = CHAT_SYSTEM.textEntry.editControl - - if not refresh then - output = editControl:GetText() .. output - elseif CHAT_SYSTEM.textEntry.editControl:HasFocus() then - editControl:Clear() - end - - -- trying to get rid of that double click error... - if IsProtectedFunction("StartChatInput") then - CallSecureProtected("StartChatInput", output) - else - StartChatInput(output) - end + output = zo_strformat(output) + if nil == output or FURC_EMPTY_STRING == output then return end + local editControl = CHAT_SYSTEM.textEntry.editControl + + if not refresh then + output = editControl:GetText() .. output + elseif CHAT_SYSTEM.textEntry.editControl:HasFocus() then + editControl:Clear() + end + + -- trying to get rid of that double click error... + if IsProtectedFunction("StartChatInput") then + CallSecureProtected("StartChatInput", output) + else + StartChatInput(output) + end end function FurC.ToChat(output, refresh) - if type(output) == "number" then - output = FurC.GetItemLink(output) - end - prefillChatBox(output, refresh) + if type(output) == "number" then + output = FurC.GetItemLink(output) + end + prefillChatBox(output, refresh) end local function stripColor(aString) - if nil == aString then return "" end - return aString:gsub("|%l%l%d%d%d%d%d", ""):gsub("|%l%l%d%l%l%d%d", ""):gsub("|c25C31E", ""):gsub("|r", "") + if nil == aString then return "" end + return aString:gsub("|%l%l%d%d%d%d%d", ""):gsub("|%l%l%d%l%l%d%d", ""):gsub("|c25C31E", ""):gsub("|r", "") end local function getNameFromEntry(recipeArray) - if nil == recipeArray then return "" end - if nil == recipeArray.itemName and nil ~= recipeArray.itemId then - recipeArray.itemName = GetItemLinkName(recipeArray.itemId) - end - return recipeArray.itemName or "" + if nil == recipeArray then return "" end + if nil == recipeArray.itemName and nil ~= recipeArray.itemId then + recipeArray.itemName = GetItemLinkName(recipeArray.itemId) + end + return recipeArray.itemName or "" end function FurC.PrintSource(itemLink, recipeArray) - if nil == recipeArray then recipeArray = FurC.Find(itemLink) end - if nil == recipeArray then return end + if nil == recipeArray then recipeArray = FurC.Find(itemLink) end + if nil == recipeArray then return end - local source = FurC.GetItemDescription(FurC.GetItemId(itemLink), recipeArray, true) - local output = string.format("%s: %s", itemLink, source) - if recipeArray.achievement and recipeArray.achievement ~= "" then - output = string.format("%s, requires %s", output, recipeArray.achievement) - end + local source = FurC.GetItemDescription(FurC.GetItemId(itemLink), recipeArray, true) + local output = string.format("%s: %s", itemLink, source) + if recipeArray.achievement and recipeArray.achievement ~= "" then + output = string.format("%s, requires %s", output, recipeArray.achievement) + end - FurC.ToChat(output, true) + FurC.ToChat(output, true) end function FurC.FindByName(namePart) - local ret = {} - local itemName = "" - -- d(zo_strformat("Looking for <<1>>... \n", namePart)) - for itemId, recipeArray in pairs(FurC.settings["data"]) do - -- d(zo_strformat("<<1>>: <<2>> (<<3>>)", recipeArray.itemId, getNameFromEntry(recipeArray), string.match(string.lower(getNameFromEntry(recipeArray)), string.lower(namePart)))) - if nil ~= string.match(string.lower(getNameFromEntry(recipeArray)), string.lower(namePart)) then - table.insert(ret, recipeArray) - end - end - return ret + local ret = {} + local itemName = "" + -- d(zo_strformat("Looking for <<1>>... \n", namePart)) + for itemId, recipeArray in pairs(FurC.settings["data"]) do + -- d(zo_strformat("<<1>>: <<2>> (<<3>>)", recipeArray.itemId, getNameFromEntry(recipeArray), string.match(string.lower(getNameFromEntry(recipeArray)), string.lower(namePart)))) + if nil ~= string.match(string.lower(getNameFromEntry(recipeArray)), string.lower(namePart)) then + table.insert(ret, recipeArray) + end + end + return ret end local function capitalise(str) - str = str:gsub("^(%l)(%w*)", function(a,b) return string.upper(a)..b end) - return str + str = str:gsub("^(%l)(%w*)", function(a,b) return string.upper(a)..b end) + return str end diff --git a/FurCDatabaseQuery.lua b/FurCDatabaseQuery.lua index 52f9a31..7c9bd26 100644 --- a/FurCDatabaseQuery.lua +++ b/FurCDatabaseQuery.lua @@ -1,17 +1,17 @@ local FurC = FurC -local vendorColor = "d68957" -local goldColor = "e5da40" -local apColor = "25C31E" -local tvColor = "5EA4FF" -local voucherColor = "82BCFF" -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local vendorColor = "d68957" +local goldColor = "e5da40" +local apColor = "25C31E" +local tvColor = "5EA4FF" +local voucherColor = "82BCFF" +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args local function colorise(str, col, ret) - str = tostring(str) - if str:find("%d000$") then str = str:gsub("000$", "k") end - if ret then return str end - return string.format("|c%s%s|r", col, str) + str = tostring(str) + if str:find("%d000$") then str = str:gsub("000$", "k") end + if ret then return str end + return string.format("|c%s%s|r", col, str) end local function makeAchievementLink(achievementId) @@ -21,183 +21,183 @@ local function makeAchievementLink(achievementId) end local function getRolisSource(recipeKey, recipeArray) - recipeArray = recipeArray or FurC.Find(recipeKey) - if not recipeArray then return end + recipeArray = recipeArray or FurC.Find(recipeKey) + if not recipeArray then return end - local versionData = FurC.Rolis[recipeArray.version] + local versionData = FurC.Rolis[recipeArray.version] - if nil ~= versionData and nil ~= versionData[recipeKey] then - local itemPrice = zo_strformat(GetString(SI_FURC_STRING_FOR_VOUCHERS), colorise(versionData[recipeKey], voucherColor)) - return zo_strformat(GetString(SI_FURC_STRING_Rolis), itemPrice) - end + if nil ~= versionData and nil ~= versionData[recipeKey] then + local itemPrice = zo_strformat(GetString(SI_FURC_STRING_FOR_VOUCHERS), colorise(versionData[recipeKey], voucherColor)) + return zo_strformat(GetString(SI_FURC_STRING_Rolis), itemPrice) + end - versionData = FurC.Faustina[recipeArray.version] - if nil ~= versionData and nil ~= versionData[recipeKey] then - local itemPrice = zo_strformat(GetString(SI_FURC_STRING_FOR_VOUCHERS), colorise(versionData[recipeKey], voucherColor)) - return zo_strformat(GetString(SI_FURC_STRING_FAUSTINA), itemPrice) - end + versionData = FurC.Faustina[recipeArray.version] + if nil ~= versionData and nil ~= versionData[recipeKey] then + local itemPrice = zo_strformat(GetString(SI_FURC_STRING_FOR_VOUCHERS), colorise(versionData[recipeKey], voucherColor)) + return zo_strformat(GetString(SI_FURC_STRING_FAUSTINA), itemPrice) + end - return GetString(SI_FURC_STRING_VOUCHER_VENDOR) + return GetString(SI_FURC_STRING_VOUCHER_VENDOR) end FurC.getRolisSource = getRolisSource local function getLuxurySource(recipeKey, recipeArray, stripColor) - recipeArray = recipeArray or FurC.Find(recipeKey) - if not recipeArray then return end - local versionData = FurC.LuxuryFurnisher[recipeArray.version] - if not versionData then return GetString(SI_FURC_STRING_FETCHER) end - - local itemData = versionData[recipeKey] - - if nil ~= itemData then - local weekendString = (nil == itemData.itemDate and "") or zo_strformat(GetString(SI_FURC_STRING_WEEKEND_AROUND), itemData.itemDate) - return zo_strformat( - GetString(SI_FURC_STRING_WASSOLDBY), - colorise(GetString(SI_FURC_STRING_ASSHOLE), vendorColor, stripColor), - colorise(GetString(SI_FURC_STRING_HC), vendorColor, stripColor), - colorise(itemData.itemPrice, goldColor, stripColor), - weekendString - ) - end - return GetString(SI_FURC_STRING_FETCHER) + recipeArray = recipeArray or FurC.Find(recipeKey) + if not recipeArray then return end + local versionData = FurC.LuxuryFurnisher[recipeArray.version] + if not versionData then return GetString(SI_FURC_STRING_FETCHER) end + + local itemData = versionData[recipeKey] + + if nil ~= itemData then + local weekendString = (nil == itemData.itemDate and "") or zo_strformat(GetString(SI_FURC_STRING_WEEKEND_AROUND), itemData.itemDate) + return zo_strformat( + GetString(SI_FURC_STRING_WASSOLDBY), + colorise(GetString(SI_FURC_STRING_ASSHOLE), vendorColor, stripColor), + colorise(GetString(SI_FURC_STRING_HC), vendorColor, stripColor), + colorise(itemData.itemPrice, goldColor, stripColor), + weekendString + ) + end + return GetString(SI_FURC_STRING_FETCHER) end FurC.getLuxurySource = getLuxurySource local function getPvpSource(recipeKey, recipeArray, stripColor) - recipeArray = recipeArray or FurC.Find(recipeKey) - if not recipeArray then return end - local versionData = FurC.PVP[recipeArray.version] - if not versionData then return "getPvpSource: nil" end - - for vendorName, vendorData in pairs(versionData) do - for locationName, locationData in pairs(vendorData) do - if nil ~= locationData[recipeKey] then - return zo_strformat( - GetString(SI_FURC_STRING_VENDOR), - colorise(vendorName, vendorColor, stripColor), - colorise(locationName, vendorColor, stripColor), - colorise(locationData[recipeKey].itemPrice, apColor, stripColor), - GetString(SI_FURC_STRING_AP) - ) - end - end - end - - return "getPvpSource" + recipeArray = recipeArray or FurC.Find(recipeKey) + if not recipeArray then return end + local versionData = FurC.PVP[recipeArray.version] + if not versionData then return "getPvpSource: nil" end + + for vendorName, vendorData in pairs(versionData) do + for locationName, locationData in pairs(vendorData) do + if nil ~= locationData[recipeKey] then + return zo_strformat( + GetString(SI_FURC_STRING_VENDOR), + colorise(vendorName, vendorColor, stripColor), + colorise(locationName, vendorColor, stripColor), + colorise(locationData[recipeKey].itemPrice, apColor, stripColor), + GetString(SI_FURC_STRING_AP) + ) + end + end + end + + return "getPvpSource" end FurC.getPvpSource = getPvpSource local typeTable = "table" local function getAchievementVendorSource(recipeKey, recipeArray, stripColor) - recipeArray = recipeArray or FurC.Find(recipeKey) - if not recipeArray then return end - local versionData = FurC.AchievementVendors[recipeArray.version] - if not versionData then - return zo_strformat("getAchievementVendorSource: failed version lookup for ID <<1>> [<<2>>]", recipeKey, recipeArray.version) - end - - local databaseEntry - - for zoneName, zoneData in pairs(versionData) do - for vendorName, vendorData in pairs(zoneData) do - databaseEntry = vendorData[recipeKey] - if nil ~= databaseEntry then - return zo_strformat( - GetString(SI_FURC_STRING_VENDOR), - colorise(vendorName, vendorColor, stripColor), - colorise(zoneName, vendorColor, stripColor), - colorise(databaseEntry.itemPrice, goldColor, stripColor), + recipeArray = recipeArray or FurC.Find(recipeKey) + if not recipeArray then return end + local versionData = FurC.AchievementVendors[recipeArray.version] + if not versionData then + return zo_strformat("getAchievementVendorSource: failed version lookup for ID <<1>> [<<2>>]", recipeKey, recipeArray.version) + end + + local databaseEntry + + for zoneName, zoneData in pairs(versionData) do + for vendorName, vendorData in pairs(zoneData) do + databaseEntry = vendorData[recipeKey] + if nil ~= databaseEntry then + return zo_strformat( + GetString(SI_FURC_STRING_VENDOR), + colorise(vendorName, vendorColor, stripColor), + colorise(zoneName, vendorColor, stripColor), + colorise(databaseEntry.itemPrice, goldColor, stripColor), makeAchievementLink(databaseEntry.achievement) - ) - end - end - end - return zo_strformat("getAchievementVendorSource, found version data but no item data for <<1>> ", recipeKey) + ) + end + end + end + return zo_strformat("getAchievementVendorSource, found version data but no item data for <<1>> ", recipeKey) end FurC.getAchievementVendorSource = getAchievementVendorSource local function getEventDropSource(recipeKey, recipeArray, stripColor) - recipeArray = recipeArray or FurC.Find(recipeKey) - if not recipeArray then return end - local versionData = FurC.EventItems[recipeArray.version] - local itemPriceString = "getEventDropSource: couldn't find " .. tostring(recipeKey) - if not versionData then - return itemPriceString - end - for versionNumber, versionData in pairs(FurC.EventItems) do - for eventName, eventData in pairs(versionData) do - for eventItemSource, eventSourceData in pairs(eventData) do - if eventSourceData[recipeKey] then - itemPriceString = zo_strformat( - GetString(SI_FURC_FESTIVAL_DROP), - colorise(eventName, vendorColor, stripColor), - colorise(eventItemSource, vendorColor, stripColor) - ) - local additionalsource = tostring(eventSourceData[recipeKey]) or "" - if #additionalsource > 4 then - itemPriceString = itemPriceString .. "\n" .. additionalsource - end - return itemPriceString - end - end - end - end - - return itemPriceString + recipeArray = recipeArray or FurC.Find(recipeKey) + if not recipeArray then return end + local versionData = FurC.EventItems[recipeArray.version] + local itemPriceString = "getEventDropSource: couldn't find " .. tostring(recipeKey) + if not versionData then + return itemPriceString + end + for versionNumber, versionData in pairs(FurC.EventItems) do + for eventName, eventData in pairs(versionData) do + for eventItemSource, eventSourceData in pairs(eventData) do + if eventSourceData[recipeKey] then + itemPriceString = zo_strformat( + GetString(SI_FURC_FESTIVAL_DROP), + colorise(eventName, vendorColor, stripColor), + colorise(eventItemSource, vendorColor, stripColor) + ) + local additionalsource = tostring(eventSourceData[recipeKey]) or "" + if #additionalsource > 4 then + itemPriceString = itemPriceString .. "\n" .. additionalsource + end + return itemPriceString + end + end + end + end + + return itemPriceString end FurC.getEventDropSource = getEventDropSource function FurC.GetMiscItemSource(recipeKey, recipeArray, attachItemLink) - if not recipeArray or not recipeArray.version or not recipeArray.origin then return end + if not recipeArray or not recipeArray.version or not recipeArray.origin then return end - if recipeArray.origin == FURC_RUMOUR then - return FurC.getRumourSource(recipeKey, recipeArray) - end + if recipeArray.origin == FURC_RUMOUR then + return FurC.getRumourSource(recipeKey, recipeArray) + end - local versionFiles = FurC.MiscItemSources[recipeArray.version] - if not versionFiles then return end - local originData = versionFiles[recipeArray.origin] - if nil == originData then return end - return (not attachItemLink and originData[recipeKey]) or string.format("%s: %s", FurC.GetItemLink(recipeKey), originData[recipeKey]) + local versionFiles = FurC.MiscItemSources[recipeArray.version] + if not versionFiles then return end + local originData = versionFiles[recipeArray.origin] + if nil == originData then return end + return (not attachItemLink and originData[recipeKey]) or string.format("%s: %s", FurC.GetItemLink(recipeKey), originData[recipeKey]) end local function getRecipeSource(recipeKey, recipeArray) - if nil == recipeKey and nil == recipeArray then return end - if nil == FurC.RecipeSources then return end + if nil == recipeKey and nil == recipeArray then return end + if nil == FurC.RecipeSources then return end if nil ~= FurC.RecipeSources[recipeKey] then return FurC.RecipeSources[recipeKey] end recipeArray = recipeArray or FurC.Find(recipeKey) - recipeKey = recipeArray.blueprint or recipeKey + recipeKey = recipeArray.blueprint or recipeKey -- d(recipeKey) - return (recipeArray.origin == FURC_RUMOUR and FurC.getRumourSource(recipeKey, recipeArray)) + return (recipeArray.origin == FURC_RUMOUR and FurC.getRumourSource(recipeKey, recipeArray)) or FurC.RecipeSources[recipeKey] end FurC.getRecipeSource = getRecipeSource function FurC.getRumourSource(recipeKey, recipeArray) - return (recipeArray.blueprint and GetString(SI_FURC_RUMOUR_SOURCE_RECIPE)) or GetString(SI_FURC_RUMOUR_SOURCE_ITEM) + return (recipeArray.blueprint and GetString(SI_FURC_RUMOUR_SOURCE_RECIPE)) or GetString(SI_FURC_RUMOUR_SOURCE_ITEM) end function FurC.GetCrafterList(itemLink, recipeArray) - if nil == recipeArray and nil == itemLink then return end - recipeArray = recipeArray or FurC.Find(itemLink) - if nil == recipeArray then - return zo_strformat("FurC.GetCrafterList called for a non-craftable") - end - - if nil == recipeArray.characters or NonContiguousCount(recipeArray.characters) == 0 then - return GetString(SI_FURC_STRING_CANNOT_CRAFT) - end - local ret = GetString(SI_FURC_STRING_CRAFTABLE_BY) - for characterName, characterKnowledge in pairs(recipeArray.characters) do - ret = string.format("%s %s, ", ret, characterName) - end - return ret:sub(0, -3) + if nil == recipeArray and nil == itemLink then return end + recipeArray = recipeArray or FurC.Find(itemLink) + if nil == recipeArray then + return zo_strformat("FurC.GetCrafterList called for a non-craftable") + end + + if nil == recipeArray.characters or NonContiguousCount(recipeArray.characters) == 0 then + return GetString(SI_FURC_STRING_CANNOT_CRAFT) + end + local ret = GetString(SI_FURC_STRING_CRAFTABLE_BY) + for characterName, characterKnowledge in pairs(recipeArray.characters) do + ret = string.format("%s %s, ", ret, characterName) + end + return ret:sub(0, -3) end diff --git a/FurCEvents.lua b/FurCEvents.lua index 1d66965..06c0201 100644 --- a/FurCEvents.lua +++ b/FurCEvents.lua @@ -1,95 +1,95 @@ -local em = EVENT_MANAGER -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local em = EVENT_MANAGER +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args local function onRecipeLearned(eventCode, recipeListIndex, recipeIndex) - p(FURC_STRING_RECIPELEARNED, GetRecipeResultItemLink(recipeListIndex, recipeIndex, LINK_STYLE_BRACKETS), recipeListIndex, recipeIndex) - FurC.TryCreateRecipeEntry(recipeListIndex, recipeIndex) - FurC.UpdateGui() + p(FURC_STRING_RECIPELEARNED, GetRecipeResultItemLink(recipeListIndex, recipeIndex, LINK_STYLE_BRACKETS), recipeListIndex, recipeIndex) + FurC.TryCreateRecipeEntry(recipeListIndex, recipeIndex) + FurC.UpdateGui() end local wm = WINDOW_MANAGER local function createIcon(control) - local icon - icon = wm:CreateControlFromVirtual(control:GetName().."FurCIcon", control, "FurC_SlotIconKnownYes") - if FurC.settings["showIconOnLeft"] == nil or - FurC.settings["showIconOnLeft"] == true then - icon:SetAnchor(BOTTOMLEFT, control:GetNamedChild("Button"), BOTTOMLEFT, -15, -10) - else - icon:SetAnchor(TOPLEFT, control:GetNamedChild("TraitInfo"), TOPLEFT, 0, 0) - end - icon:SetHidden(true) - control.icon = icon - return icon + local icon + icon = wm:CreateControlFromVirtual(control:GetName().."FurCIcon", control, "FurC_SlotIconKnownYes") + if FurC.settings["showIconOnLeft"] == nil or + FurC.settings["showIconOnLeft"] == true then + icon:SetAnchor(BOTTOMLEFT, control:GetNamedChild("Button"), BOTTOMLEFT, -15, -10) + else + icon:SetAnchor(TOPLEFT, control:GetNamedChild("TraitInfo"), TOPLEFT, 0, 0) + end + icon:SetHidden(true) + control.icon = icon + return icon end local function getItemKnowledge(itemLink) - local recipeArray = FurC.Find(itemLink) - if FurC.GetUseInventoryIconsOnChar() then - return FurC.CanCraft(itemId, recipeArray) - end - return FurC.IsAccountKnown(itemId, recipeArray) + local recipeArray = FurC.Find(itemLink) + if FurC.GetUseInventoryIconsOnChar() then + return FurC.CanCraft(itemId, recipeArray) + end + return FurC.IsAccountKnown(itemId, recipeArray) end local function updateItemInInventory(control) - if 'listSlot' ~= control.slotControlType then return end - local icon = control.icon or createIcon(control) - local data = control.dataEntry.data + if 'listSlot' ~= control.slotControlType then return end + local icon = control.icon or createIcon(control) + local data = control.dataEntry.data - local bagId = data.bagId - local slotId = data.slotIndex - local itemLink = GetItemLink(bagId, slotId) + local bagId = data.bagId + local slotId = data.slotIndex + local itemLink = GetItemLink(bagId, slotId) - if not IsItemLinkFurnitureRecipe(itemLink) then - icon:SetHidden(true) - return - end - local known = getItemKnowledge(itemLink) + if not IsItemLinkFurnitureRecipe(itemLink) then + icon:SetHidden(true) + return + end + local known = getItemKnowledge(itemLink) - local hidden = known and FurC.GetHideKnownInventoryIcons() or (not FurC.GetUseInventoryIcons()) - icon:SetHidden(hidden) + local hidden = known and FurC.GetHideKnownInventoryIcons() or (not FurC.GetUseInventoryIcons()) + icon:SetHidden(hidden) - local templateName = "FurC_SlotIconKnown" .. ((known and "Yes") or "No") + local templateName = "FurC_SlotIconKnown" .. ((known and "Yes") or "No") - WINDOW_MANAGER:ApplyTemplateToControl(icon, templateName) + WINDOW_MANAGER:ApplyTemplateToControl(icon, templateName) - icon.data = {tooltipText = ((known and GetString(SI_FURC_CRAFTING_KNOWN)) or GetString(SI_FURC_CRAFTING_UNKNOWN))} + icon.data = {tooltipText = ((known and GetString(SI_FURC_CRAFTING_KNOWN)) or GetString(SI_FURC_CRAFTING_UNKNOWN))} icon:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) icon:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) end function FurC.SetupInventoryRecipeIcons(calledRecursively) - local function isValidBag(bagId, inventory) - if bagId == BAG_WORN then return false end - if bagId == BAG_VIRTUAL then return false end - local listView = inventory.listView - if not listView then return false end - if not listView.dataTypes then return false end - if not listView.dataTypes[1] then return false end - return nil ~= listView.dataTypes[1].setupCallback - end - - local inventories = PLAYER_INVENTORY.inventories - if not inventories and not calledRecursively then - return zo_callLater(function() FurC.SetupInventoryRecipeIcons(true) end, 1000) - end - -- ruthlessly stolen from Dryzler's Inventory, then tweaked - for bagId, inventory in pairs(inventories) do - if isValidBag(bagId, inventory) then - - ZO_PreHook( inventory.listView.dataTypes[1], "setupCallback", - function(control, slot) updateItemInInventory(control) end - ) - - end - end + local function isValidBag(bagId, inventory) + if bagId == BAG_WORN then return false end + if bagId == BAG_VIRTUAL then return false end + local listView = inventory.listView + if not listView then return false end + if not listView.dataTypes then return false end + if not listView.dataTypes[1] then return false end + return nil ~= listView.dataTypes[1].setupCallback + end + + local inventories = PLAYER_INVENTORY.inventories + if not inventories and not calledRecursively then + return zo_callLater(function() FurC.SetupInventoryRecipeIcons(true) end, 1000) + end + -- ruthlessly stolen from Dryzler's Inventory, then tweaked + for bagId, inventory in pairs(inventories) do + if isValidBag(bagId, inventory) then + + ZO_PreHook( inventory.listView.dataTypes[1], "setupCallback", + function(control, slot) updateItemInInventory(control) end + ) + + end + end end function FurC.RegisterEvents() - em:RegisterForEvent("FurnitureCatalogue", EVENT_RECIPE_LEARNED, onRecipeLearned) + em:RegisterForEvent("FurnitureCatalogue", EVENT_RECIPE_LEARNED, onRecipeLearned) end diff --git a/FurCFilter.lua b/FurCFilter.lua index 1fbc3ce..533a6c5 100644 --- a/FurCFilter.lua +++ b/FurCFilter.lua @@ -1,50 +1,50 @@ -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args - -local searchString = "" -local dropdownChoiceVersion = 1 -local dropdownTextVersion = "All" -local ddSource = 1 -local dropdownTextSource = "All" -local dropdownChoiceCharacter = 1 -local ddTextCharacter = "Accountwide" -local qualityFilter = {} -local craftingTypeFilter = {} - -local hideBooks = false -local hideRumours = false -local hideCrownStore = false -local mergeLuxuryAndSales = false -local filterAllOnTextSearch = false +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args + +local searchString = "" +local dropdownChoiceVersion = 1 +local dropdownTextVersion = "All" +local ddSource = 1 +local dropdownTextSource = "All" +local dropdownChoiceCharacter = 1 +local ddTextCharacter = "Accountwide" +local qualityFilter = {} +local craftingTypeFilter = {} + +local hideBooks = false +local hideRumours = false +local hideCrownStore = false +local mergeLuxuryAndSales = false +local filterAllOnTextSearch = false local sourceIndices local recipeArray, itemId, itemLink, itemType, sItemType, itemName, recipeIndex, recipeListIndex function FurC.SetFilter(useDefaults, skipRefresh) - + ClearTooltip(InformationTooltip) - sourceIndices = FurC.SourceIndices - searchString = FurC.GetSearchFilter() - - if useDefaults then - dropdownChoiceVersion = tonumber(FurC.GetDefaultDropdownChoice("Version")) - ddSource = FurC.GetDefaultDropdownChoice("Source") - dropdownChoiceCharacter = FurC.GetDefaultDropdownChoice("Character") - else - dropdownChoiceVersion = tonumber(FurC.GetDropdownChoice("Version")) - ddSource = FurC.GetDropdownChoice("Source") - dropdownChoiceCharacter = FurC.GetDropdownChoice("Character") - end - - -- we need to hold the text here, in case it's not "All" - ddTextCharacter = FurC.GetDropdownChoiceTextual("Character") - - qualityFilter = FurC.GetFilterQuality() - craftingTypeFilter = FurC.GetFilterCraftingType() - hideBooks = FurC.GetHideBooks() - hideRumours = FurC.GetHideRumourRecipes() - mergeLuxuryAndSales = FurC.GetMergeLuxuryAndSales() - hideCrownStore = FurC.GetHideCrownStoreItems() + sourceIndices = FurC.SourceIndices + searchString = FurC.GetSearchFilter() + + if useDefaults then + dropdownChoiceVersion = tonumber(FurC.GetDefaultDropdownChoice("Version")) + ddSource = FurC.GetDefaultDropdownChoice("Source") + dropdownChoiceCharacter = FurC.GetDefaultDropdownChoice("Character") + else + dropdownChoiceVersion = tonumber(FurC.GetDropdownChoice("Version")) + ddSource = FurC.GetDropdownChoice("Source") + dropdownChoiceCharacter = FurC.GetDropdownChoice("Character") + end + + -- we need to hold the text here, in case it's not "All" + ddTextCharacter = FurC.GetDropdownChoiceTextual("Character") + + qualityFilter = FurC.GetFilterQuality() + craftingTypeFilter = FurC.GetFilterCraftingType() + hideBooks = FurC.GetHideBooks() + hideRumours = FurC.GetHideRumourRecipes() + mergeLuxuryAndSales = FurC.GetMergeLuxuryAndSales() + hideCrownStore = FurC.GetHideCrownStoreItems() -- ignore filtered items when no dropdown filter is set and there's a text search? filterAllOnTextSearch = FurC.GetFilterAllOnText() and #searchString > 0 and @@ -52,39 +52,39 @@ function FurC.SetFilter(useDefaults, skipRefresh) FURC_NONE == dropdownChoiceVersion and FURC_NONE == dropdownChoiceCharacter - if not skipRefresh then - zo_callLater(FurC.UpdateLineVisibility, 200) - end + if not skipRefresh then + zo_callLater(FurC.UpdateLineVisibility, 200) + end end function FurC.InitFilters() - FurC.SetFilterCraftingType(0) - FurC.SetFilterQuality(0) - FurC.SetDropdownChoice("Source", FurC.GetDefaultDropdownChoiceText("Source"), FurC.GetDefaultDropdownChoice("Source")) - FurC.SetDropdownChoice("Character", FurC.GetDefaultDropdownChoiceText("Character"), FurC.GetDefaultDropdownChoice("Character")) - FurC.SetDropdownChoice("Version", FurC.GetDefaultDropdownChoiceText("Version"), FurC.GetDefaultDropdownChoice("Version")) + FurC.SetFilterCraftingType(0) + FurC.SetFilterQuality(0) + FurC.SetDropdownChoice("Source", FurC.GetDefaultDropdownChoiceText("Source"), FurC.GetDefaultDropdownChoice("Source")) + FurC.SetDropdownChoice("Character", FurC.GetDefaultDropdownChoiceText("Character"), FurC.GetDefaultDropdownChoice("Character")) + FurC.SetDropdownChoice("Version", FurC.GetDefaultDropdownChoiceText("Version"), FurC.GetDefaultDropdownChoice("Version")) end local function isRecipeArrayKnown() - if nil == recipeArray or nil == recipeArray.characters then return end - if dropdownChoiceCharacter == 1 then - for name, value in pairs(recipeArray.characters) do - if (value) then return true end - end - else - return recipeArray.characters[ddTextCharacter] - end + if nil == recipeArray or nil == recipeArray.characters then return end + if dropdownChoiceCharacter == 1 then + for name, value in pairs(recipeArray.characters) do + if (value) then return true end + end + else + return recipeArray.characters[ddTextCharacter] + end end -- Version: All, Homestead, Morrowind local function matchVersionDropdown() - return dropdownChoiceVersion == 1 or recipeArray.version == dropdownChoiceVersion + return dropdownChoiceVersion == 1 or recipeArray.version == dropdownChoiceVersion end local function shouldBeHidden() - return (ddSource ~= FURC_RUMOUR and recipeArray.origin == FURC_RUMOUR and hideRumours) or - (ddSource ~= FURC_CROWN and recipeArray.origin == FURC_CROWN and hideCrownStore) + return (ddSource ~= FURC_RUMOUR and recipeArray.origin == FURC_RUMOUR and hideRumours) or + (ddSource ~= FURC_CROWN and recipeArray.origin == FURC_CROWN and hideCrownStore) end local validSourcesForOther = { @@ -98,39 +98,39 @@ local validSourcesForOther = { -- Source: All, All (craftable), Craftable (known), craftable (unknown), purchaseable local function matchSourceDropdown() - -- "All", don't care - if FURC_NONE == ddSource then - return true + -- "All", don't care + if FURC_NONE == ddSource then + return true end - if FURC_FAVE == ddSource then - return recipeArray.favorite + if FURC_FAVE == ddSource then + return recipeArray.favorite end if recipeArray.origin == FURC_CRAFTING then if ddSource == FURC_CRAFTING then return true end local matchingDropdownSource = (isRecipeArrayKnown(recipeArray) and FURC_CRAFTING_KNOWN) or FURC_CRAFTING_UNKNOWN return matchingDropdownSource == ddSource end - if FURC_VENDOR == ddSource then - return (recipeArray.origin == FURC_VENDOR or (mergeLuxuryAndSales and recipeArray.origin == FURC_LUXURY)) + if FURC_VENDOR == ddSource then + return (recipeArray.origin == FURC_VENDOR or (mergeLuxuryAndSales and recipeArray.origin == FURC_LUXURY)) end - if FURC_WRIT_VENDOR == ddSource then - return recipeArray.origin == FURC_ROLIS + if FURC_WRIT_VENDOR == ddSource then + return recipeArray.origin == FURC_ROLIS end - if FURC_OTHER == ddSource then - return validSourcesForOther[recipeArray.origin] + if FURC_OTHER == ddSource then + return validSourcesForOther[recipeArray.origin] end - -- we're checking character knowledge - return recipeArray.origin == ddSource + -- we're checking character knowledge + return recipeArray.origin == ddSource end local function matchDropdownFilter() - return matchVersionDropdown() and matchSourceDropdown() + return matchVersionDropdown() and matchSourceDropdown() end local function matchSearchString() - if #searchString == 0 then return true end + if #searchString == 0 then return true end local caseSensitive = nil ~= string.match(searchString, "%u") local itemName = GetItemLinkName(itemLink) local matchme = (caseSensitive and itemName) or string.lower(itemName) @@ -138,32 +138,32 @@ local function matchSearchString() end local function matchCraftingTypeFilter() - if not recipeArray.origin == FURC_CRAFTING then return false end - local filterType = FurC.GetCraftingSkillType(itemId, recipeArray) - return filterType and filterType > 0 and craftingTypeFilter[filterType] + if not recipeArray.origin == FURC_CRAFTING then return false end + local filterType = FurC.GetCraftingSkillType(itemId, recipeArray) + return filterType and filterType > 0 and craftingTypeFilter[filterType] end local function matchQualityFilter() - return qualityFilter[GetItemLinkQuality(itemLink)] + return qualityFilter[GetItemLinkQuality(itemLink)] end local function filterBooks(itemId, recipeArray) - if not (hideBooks or filterAllOnTextSearch and FurC.GetFilterAllOnTextNoBooks()) then return false end - local versionData = FurC.Books[recipeArray.version] - if nil == versionData then return end - return nil ~= versionData[itemId] + if not (hideBooks or filterAllOnTextSearch and FurC.GetFilterAllOnTextNoBooks()) then return false end + local versionData = FurC.Books[recipeArray.version] + if nil == versionData then return end + return nil ~= versionData[itemId] end function FurC.MatchFilter(currentItemId, currentRecipeArray) - itemId = currentItemId - itemLink = FurC.GetItemLink(itemId) - recipeArray = currentRecipeArray or FurC.Find(itemLink) - itemType, sItemType = GetItemLinkItemType(itemLink) + itemId = currentItemId + itemLink = FurC.GetItemLink(itemId) + recipeArray = currentRecipeArray or FurC.Find(itemLink) + itemType, sItemType = GetItemLinkItemType(itemLink) if 0 == itemType and 0 == sItemType then p("invalid item type for <<1>>", currentItemId) return false end - if filterBooks(itemId, recipeArray) then return false end + if filterBooks(itemId, recipeArray) then return false end if recipeArray.origin == FURC_RUMOUR then @@ -181,9 +181,9 @@ function FurC.MatchFilter(currentItemId, currentRecipeArray) if not (filterAllOnTextSearch or matchDropdownFilter()) then return false end - if not matchSearchString() then return false end - if not (FurC.settings.filterCraftingTypeAll or matchCraftingTypeFilter()) then return false end - if not (FurC.settings.filterQualityAll or matchQualityFilter()) then return false end + if not matchSearchString() then return false end + if not (FurC.settings.filterCraftingTypeAll or matchCraftingTypeFilter()) then return false end + if not (FurC.settings.filterQualityAll or matchQualityFilter()) then return false end - return true + return true end diff --git a/FurCGui.lua b/FurCGui.lua index 5cc45be..9bf8002 100644 --- a/FurCGui.lua +++ b/FurCGui.lua @@ -1,132 +1,132 @@ -FurC.SlotTemplate = "FurC_SlotTemplate" -FurC.KnowledgeFilter = "All (Accountwide)" -FurC.SearchString = "" -FurC.ScrollSortUp = true -local checkWasUpdated = false -local task = LibStub("LibAsync"):Create("FurnitureCatalogue_updateLineVisibility") -local otherTask = LibStub("LibAsync"):Create("FurnitureCatalogue_ToggleGui") -local async = LibStub("LibAsync"):Create("FurnitureCatalogue_forLoop") +FurC.SlotTemplate = "FurC_SlotTemplate" +FurC.KnowledgeFilter = "All (Accountwide)" +FurC.SearchString = "" +FurC.ScrollSortUp = true +local checkWasUpdated = false +local task = LibStub("LibAsync"):Create("FurnitureCatalogue_updateLineVisibility") +local otherTask = LibStub("LibAsync"):Create("FurnitureCatalogue_ToggleGui") +local async = LibStub("LibAsync"):Create("FurnitureCatalogue_forLoop") -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args local sortTable = FurC.SortTable local function sort(myTable) - local sortName, sortDirection = FurC.GetSortParams() - sortName = sortName or "itemName" - local sortUp = ((ZO_SORT_ORDER_UP and sortDirection == "up") or ZO_SORT_ORDER_DOWN) - return sortTable(myTable, sortName, sortUp) + local sortName, sortDirection = FurC.GetSortParams() + sortName = sortName or "itemName" + local sortUp = ((ZO_SORT_ORDER_UP and sortDirection == "up") or ZO_SORT_ORDER_DOWN) + return sortTable(myTable, sortName, sortUp) end local headerHeight = FurCGui_Header:GetHeight() function FurC.CalculateMaxLines() - FurCGui_ListHolder:SetHeight(FurCGui:GetHeight() - headerHeight) - FurCGui_ListHolder.maxLines = math.floor((FurCGui_ListHolder:GetHeight()) / FurCGui_ListHolder.lines[1]:GetHeight() ) - return FurCGui_ListHolder.maxLines + FurCGui_ListHolder:SetHeight(FurCGui:GetHeight() - headerHeight) + FurCGui_ListHolder.maxLines = math.floor((FurCGui_ListHolder:GetHeight()) / FurCGui_ListHolder.lines[1]:GetHeight() ) + return FurCGui_ListHolder.maxLines end local function updateLineVisibility() - local function fillLine(curLine, curData, lineIndex) - if nil == curLine then return end - - local dataLines = FurCGui_ListHolder.dataLines - local maxLines = FurCGui_ListHolder.maxLines - - local hidden = lineIndex > #dataLines or lineIndex > maxLines - curLine:SetHidden(hidden) - if nil == curData or curLine:IsHidden() then - curLine.itemLink = "" - curLine.itemId = 0 - curLine.icon:SetTexture(nil) - curLine.icon:SetAlpha(0) - curLine.text:SetText("") - curLine.mats:SetText("") - else - curLine.itemLink = curData.itemLink - curLine.itemId = curData.itemId - curLine.icon:SetTexture(GetItemLinkIcon(curData.itemLink)) - curLine.icon:SetAlpha(1) - local text = curData.itemLink:gsub("H1", "H0") - curLine.text:SetText(((curData.favorite and "* ") or "").. text) - local mats = FurC.GetItemDescription(curData.itemId, curData) - curLine.mats:SetText(mats) - end - end - - local isEmpty = #FurCGui_ListHolder.dataLines == 0 - - FurCGui_ListHolder:SetHidden( isEmpty) - FurCGui_Empty:SetHidden( not isEmpty) - - if isEmpty then return end - - FurC.CalculateMaxLines() - - task:Call(function() - local maxLines = FurCGui_ListHolder.maxLines - local dataLines = FurCGui_ListHolder.dataLines - - local offset = FurCGui_ListHolder_Slider:GetValue() - if offset > #dataLines then offset = 0 end - FurCGui_ListHolder_Slider:SetValue(offset) - - local curLine, curData - - for i=1, FurCGui_ListHolder:GetNumChildren() do - curLine = FurCGui_ListHolder.lines[i] - curData = FurCGui_ListHolder.dataLines[offset + i] - fillLine(curLine, curData, i) - end - FurCGui_ListHolder_Slider:SetMinMax(0, #dataLines) - - end) + local function fillLine(curLine, curData, lineIndex) + if nil == curLine then return end + + local dataLines = FurCGui_ListHolder.dataLines + local maxLines = FurCGui_ListHolder.maxLines + + local hidden = lineIndex > #dataLines or lineIndex > maxLines + curLine:SetHidden(hidden) + if nil == curData or curLine:IsHidden() then + curLine.itemLink = "" + curLine.itemId = 0 + curLine.icon:SetTexture(nil) + curLine.icon:SetAlpha(0) + curLine.text:SetText("") + curLine.mats:SetText("") + else + curLine.itemLink = curData.itemLink + curLine.itemId = curData.itemId + curLine.icon:SetTexture(GetItemLinkIcon(curData.itemLink)) + curLine.icon:SetAlpha(1) + local text = curData.itemLink:gsub("H1", "H0") + curLine.text:SetText(((curData.favorite and "* ") or "").. text) + local mats = FurC.GetItemDescription(curData.itemId, curData) + curLine.mats:SetText(mats) + end + end + + local isEmpty = #FurCGui_ListHolder.dataLines == 0 + + FurCGui_ListHolder:SetHidden( isEmpty) + FurCGui_Empty:SetHidden( not isEmpty) + + if isEmpty then return end + + FurC.CalculateMaxLines() + + task:Call(function() + local maxLines = FurCGui_ListHolder.maxLines + local dataLines = FurCGui_ListHolder.dataLines + + local offset = FurCGui_ListHolder_Slider:GetValue() + if offset > #dataLines then offset = 0 end + FurCGui_ListHolder_Slider:SetValue(offset) + + local curLine, curData + + for i=1, FurCGui_ListHolder:GetNumChildren() do + curLine = FurCGui_ListHolder.lines[i] + curData = FurCGui_ListHolder.dataLines[offset + i] + fillLine(curLine, curData, i) + end + FurCGui_ListHolder_Slider:SetMinMax(0, #dataLines) + + end) end -FurC.UpdateLineVisibility = updateLineVisibility +FurC.UpdateLineVisibility = updateLineVisibility function FurC.IsLoading(isBuffering) - FurCGui_Wait:SetHidden(not isBuffering) + FurCGui_Wait:SetHidden(not isBuffering) - local isEmpty = #FurCGui_ListHolder.dataLines == 0 + local isEmpty = #FurCGui_ListHolder.dataLines == 0 - FurCGui_ListHolder:SetHidden(isBuffering or isEmpty) - FurCGui_Empty:SetHidden(isBuffering or not isEmpty) + FurCGui_ListHolder:SetHidden(isBuffering or isEmpty) + FurCGui_Empty:SetHidden(isBuffering or not isEmpty) end -- fill the shown item list with items that match current filter(s) local function updateScrollDataLinesData() - local dataLines = {} - task:Call(function() - local index = 0 - - data = FurC.settings.data - - local itemLink - -- async:For(pairs(data)):Do( function(itemId, recipeArray) - for itemId, recipeArray in pairs(data) do - if FurC.MatchFilter(itemId, recipeArray) then - itemLink = FurC.GetItemLink(itemId) - if itemLink then - tempDataLine = ZO_DeepTableCopy({}, recipeArray) - tempDataLine.itemId = itemId - tempDataLine.itemLink = itemLink - tempDataLine.itemName = GetItemLinkName(itemLink) - table.insert(dataLines, tempDataLine) - end - end - end - -- end) - - end) - :Then(function() - dataLines = sort(dataLines) - FurCGui_ListHolder.dataLines = dataLines - FurC_RecipeCount:SetText(#dataLines) - end) + local dataLines = {} + task:Call(function() + local index = 0 + + data = FurC.settings.data + + local itemLink + -- async:For(pairs(data)):Do( function(itemId, recipeArray) + for itemId, recipeArray in pairs(data) do + if FurC.MatchFilter(itemId, recipeArray) then + itemLink = FurC.GetItemLink(itemId) + if itemLink then + tempDataLine = ZO_DeepTableCopy({}, recipeArray) + tempDataLine.itemId = itemId + tempDataLine.itemLink = itemLink + tempDataLine.itemName = GetItemLinkName(itemLink) + table.insert(dataLines, tempDataLine) + end + end + end + -- end) + + end) + :Then(function() + dataLines = sort(dataLines) + FurCGui_ListHolder.dataLines = dataLines + FurC_RecipeCount:SetText(#dataLines) + end) end local FURC_S_FILTERDEFAULT = GetString(SI_FURC_TEXTBOX_FILTER_DEFAULT) @@ -147,341 +147,341 @@ local function stopLoadingWithDelay() end function FurC.UpdateGui(useDefaults) - if FurCGui:IsHidden() then return end + if FurCGui:IsHidden() then return end cachedDefaults = useDefaults - otherTask:Call(startLoading) - :Then(updateScrollDataLinesData) - :Then(stopLoadingWithDelay) + otherTask:Call(startLoading) + :Then(updateScrollDataLinesData) + :Then(stopLoadingWithDelay) end function FurC.UpdateInventoryScroll() - local index = 0 - FurCGui_ListHolder.dataOffset = FurCGui_ListHolder.dataOffset or 0 - FurCGui_ListHolder.dataOffset = math.max(FurCGui_ListHolder.dataOffset, 0) + local index = 0 + FurCGui_ListHolder.dataOffset = FurCGui_ListHolder.dataOffset or 0 + FurCGui_ListHolder.dataOffset = math.max(FurCGui_ListHolder.dataOffset, 0) - FurC.CalculateMaxLines() + FurC.CalculateMaxLines() - local total = #FurCGui_ListHolder.dataLines - FurCGui_ListHolder.maxLines - if total > 0 then - FurCGui_ListHolder_Slider:SetMinMax(0, total) - end + local total = #FurCGui_ListHolder.dataLines - FurCGui_ListHolder.maxLines + if total > 0 then + FurCGui_ListHolder_Slider:SetMinMax(0, total) + end - updateLineVisibility() + updateLineVisibility() end function FurC.SetLineHeight(applyTemplate) - local curLine - local size = FurC.GetFontSize() - - local nameFont = string.format("$(%s)|$(KB_%s)|soft-shadow-thin", (FurC.GetTinyUi() and "MEDIUM_FONT") or "BOLD_FONT", size) - local matsFont = string.format("$(MEDIUM_FONT)|$(KB_%s)|soft-shadow-thin", size) - - for i = 1, #FurCGui_ListHolder.lines do - curLine = FurCGui_ListHolder.lines[i] - if applyTemplate then - WINDOW_MANAGER:ApplyTemplateToControl(curLine, FurC.SlotTemplate) - end - curLine:GetNamedChild("Name"):SetFont(nameFont) - curLine:GetNamedChild("Mats"):SetFont(matsFont) - curLine:SetHeight( size + (FurC.GetTinyUi() and 8 or 20)) - end - FurC.CalculateMaxLines() + local curLine + local size = FurC.GetFontSize() + + local nameFont = string.format("$(%s)|$(KB_%s)|soft-shadow-thin", (FurC.GetTinyUi() and "MEDIUM_FONT") or "BOLD_FONT", size) + local matsFont = string.format("$(MEDIUM_FONT)|$(KB_%s)|soft-shadow-thin", size) + + for i = 1, #FurCGui_ListHolder.lines do + curLine = FurCGui_ListHolder.lines[i] + if applyTemplate then + WINDOW_MANAGER:ApplyTemplateToControl(curLine, FurC.SlotTemplate) + end + curLine:GetNamedChild("Name"):SetFont(nameFont) + curLine:GetNamedChild("Mats"):SetFont(matsFont) + curLine:SetHeight( size + (FurC.GetTinyUi() and 8 or 20)) + end + FurC.CalculateMaxLines() end function FurC.ApplyLineTemplate() - local function resizeDropdowns(controlSize) - local contRolist = { - [1] = FurC_DropdownSource, - [2] = FurC_DropdownCharacter, - [3] = FurC_DropdownVersion - } - for _, control in pairs(contRolist) do - control:SetWidth(controlSize) - end - FurC_Search:SetWidth(controlSize-19) - end - if FurC.GetTinyUi() then - FurC.SlotTemplate = "FurC_SlotTemplateTiny" - resizeDropdowns(230) -- first column width: 230 - FurCGui_Header_SortBar_Quality:ClearAnchors() - FurCGui_Header_SortBar_Quality:SetAnchor(TOPLEFT, FurCGui_Header_SortBar_Name, TOPRIGHT, -82) - else - FurC.SlotTemplate = "FurC_SlotTemplate" - resizeDropdowns(300) -- first column width: 280 - FurCGui_Header_SortBar_Quality:ClearAnchors() - FurCGui_Header_SortBar_Quality:SetAnchor(TOPLEFT, FurCGui_Header_SortBar_Name, TOPRIGHT, 0) - end - - FurC.SetLineHeight(true) - - local minWidth = 2*(FurC_DropdownCharacter:GetWidth()) + FurC_TypeFilter:GetWidth() + 40 - local minHeight = 2*FurCGui_Header:GetHeight() - FurCGui:SetDimensionConstraints(minWidth, minHeight) - - task:Call(function() updateLineVisibility() end) + local function resizeDropdowns(controlSize) + local contRolist = { + [1] = FurC_DropdownSource, + [2] = FurC_DropdownCharacter, + [3] = FurC_DropdownVersion + } + for _, control in pairs(contRolist) do + control:SetWidth(controlSize) + end + FurC_Search:SetWidth(controlSize-19) + end + if FurC.GetTinyUi() then + FurC.SlotTemplate = "FurC_SlotTemplateTiny" + resizeDropdowns(230) -- first column width: 230 + FurCGui_Header_SortBar_Quality:ClearAnchors() + FurCGui_Header_SortBar_Quality:SetAnchor(TOPLEFT, FurCGui_Header_SortBar_Name, TOPRIGHT, -82) + else + FurC.SlotTemplate = "FurC_SlotTemplate" + resizeDropdowns(300) -- first column width: 280 + FurCGui_Header_SortBar_Quality:ClearAnchors() + FurCGui_Header_SortBar_Quality:SetAnchor(TOPLEFT, FurCGui_Header_SortBar_Name, TOPRIGHT, 0) + end + + FurC.SetLineHeight(true) + + local minWidth = 2*(FurC_DropdownCharacter:GetWidth()) + FurC_TypeFilter:GetWidth() + 40 + local minHeight = 2*FurCGui_Header:GetHeight() + FurCGui:SetDimensionConstraints(minWidth, minHeight) + + task:Call(function() updateLineVisibility() end) end local addedDropdownCharacterNames = {} local function createGui() - local function createInventoryScroll() - -- FurC.DebugOut("CreateInventoryScroll") + local function createInventoryScroll() + -- FurC.DebugOut("CreateInventoryScroll") - local function createLine(i, predecessor) + local function createLine(i, predecessor) - predecessor = predecessor or FurCGui_ListHolder + predecessor = predecessor or FurCGui_ListHolder - local line = WINDOW_MANAGER:CreateControlFromVirtual("FurC_ListItem_".. i, FurCGui_ListHolder, FurC.SlotTemplate) - line.icon = line:GetNamedChild("Button"):GetNamedChild("Icon") - line.text = line:GetNamedChild("Name") - line.mats = line:GetNamedChild("Mats") + local line = WINDOW_MANAGER:CreateControlFromVirtual("FurC_ListItem_".. i, FurCGui_ListHolder, FurC.SlotTemplate) + line.icon = line:GetNamedChild("Button"):GetNamedChild("Icon") + line.text = line:GetNamedChild("Name") + line.mats = line:GetNamedChild("Mats") - line:SetHidden(false) - line:SetMouseEnabled(true) + line:SetHidden(false) + line:SetMouseEnabled(true) - if i == 1 then - line:SetAnchor(TOPLEFT, FurCGui_ListHolder, TOPLEFT, 0, 4) - line:SetAnchor(TOPRIGHT, FurCGui_ListHolder, TOPRIGHT, 0, 0) - else - line:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, 0) - line:SetAnchor(TOPRIGHT, predecessor, BOTTOMRIGHT, 0, 0) - end - return line - end + if i == 1 then + line:SetAnchor(TOPLEFT, FurCGui_ListHolder, TOPLEFT, 0, 4) + line:SetAnchor(TOPRIGHT, FurCGui_ListHolder, TOPRIGHT, 0, 0) + else + line:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, 0) + line:SetAnchor(TOPRIGHT, predecessor, BOTTOMRIGHT, 0, 0) + end + return line + end - FurCGui_ListHolder.dataOffset = 0 - FurCGui_ListHolder.maxLines = 60 - FurCGui_ListHolder.dataLines = {} - FurCGui_ListHolder.lines = {} - FurCGui_ListHolder.NameSort = FurCGui_Header_SortBar:GetNamedChild("_Name") - FurCGui_ListHolder.NameSort.icon = FurCGui_ListHolder.NameSort:GetNamedChild("_Button") - FurCGui_ListHolder.QualitySort = FurCGui_Header_SortBar:GetNamedChild("_Quality") - FurCGui_ListHolder.QualitySort.icon = FurCGui_ListHolder.QualitySort:GetNamedChild("_Button") + FurCGui_ListHolder.dataOffset = 0 + FurCGui_ListHolder.maxLines = 60 + FurCGui_ListHolder.dataLines = {} + FurCGui_ListHolder.lines = {} + FurCGui_ListHolder.NameSort = FurCGui_Header_SortBar:GetNamedChild("_Name") + FurCGui_ListHolder.NameSort.icon = FurCGui_ListHolder.NameSort:GetNamedChild("_Button") + FurCGui_ListHolder.QualitySort = FurCGui_Header_SortBar:GetNamedChild("_Quality") + FurCGui_ListHolder.QualitySort.icon = FurCGui_ListHolder.QualitySort:GetNamedChild("_Button") - --local width = 250 -- FurCGui_ListHolder:GetWidth() - local text = " No Collected Data" + --local width = 250 -- FurCGui_ListHolder:GetWidth() + local text = " No Collected Data" - for i=1, FurCGui_ListHolder.maxLines do - FurCGui_ListHolder.lines[i] = createLine(i, predecessor) - predecessor = FurCGui_ListHolder.lines[i] - end + for i=1, FurCGui_ListHolder.maxLines do + FurCGui_ListHolder.lines[i] = createLine(i, predecessor) + predecessor = FurCGui_ListHolder.lines[i] + end - -- setup slider - FurCGui_ListHolder_Slider:SetMinMax(0, #FurCGui_ListHolder.dataLines - FurCGui_ListHolder.maxLines) + -- setup slider + FurCGui_ListHolder_Slider:SetMinMax(0, #FurCGui_ListHolder.dataLines - FurCGui_ListHolder.maxLines) - return FurCGui_ListHolder.lines - end + return FurCGui_ListHolder.lines + end - local function createQualityFilters() - local buttons = {} - local quality = 0 - local function createQualityFilter(name, color, tooltip) - local parent = FurC_QualityFilter + local function createQualityFilters() + local buttons = {} + local quality = 0 + local function createQualityFilter(name, color, tooltip) + local parent = FurC_QualityFilter - local predecessor = buttons[#buttons] or parent - local controlType = "FurC_QualityFilterButton" + local predecessor = buttons[#buttons] or parent + local controlType = "FurC_QualityFilterButton" - local button = WINDOW_MANAGER:CreateControlFromVirtual(parent:GetName()..name, parent, controlType) - local ctrlName = string.lower(name) - button:SetNormalTexture( string.format("FurnitureCatalogue/textures/%s_up.dds", ctrlName)) - button:SetNormalTexture( string.format("FurnitureCatalogue/textures/%s_over.dds", ctrlName)) - button:SetNormalTexture( string.format("FurnitureCatalogue/textures/%s_down.dds", ctrlName)) - button.quality = quality - button.tooltip = tooltip + local button = WINDOW_MANAGER:CreateControlFromVirtual(parent:GetName()..name, parent, controlType) + local ctrlName = string.lower(name) + button:SetNormalTexture( string.format("FurnitureCatalogue/textures/%s_up.dds", ctrlName)) + button:SetNormalTexture( string.format("FurnitureCatalogue/textures/%s_over.dds", ctrlName)) + button:SetNormalTexture( string.format("FurnitureCatalogue/textures/%s_down.dds", ctrlName)) + button.quality = quality + button.tooltip = tooltip - local otherAnchor = ((predecessor == parent) and LEFT) or RIGHT - local xOffset = ((predecessor == parent) and 0) or 6 - button:SetAnchor(LEFT, predecessor, otherAnchor, xOffset) - quality = quality +1 + local otherAnchor = ((predecessor == parent) and LEFT) or RIGHT + local xOffset = ((predecessor == parent) and 0) or 6 + button:SetAnchor(LEFT, predecessor, otherAnchor, xOffset) + quality = quality +1 - return button + return button - end + end - buttons[quality+1] = createQualityFilter("All", nil, "All Items") + buttons[quality+1] = createQualityFilter("All", nil, "All Items") - buttons[quality+1] = createQualityFilter("White", ITEM_QUALITY_NORMAL, "White quality") - buttons[quality+1] = createQualityFilter("Magic", ITEM_QUALITY_MAGIC, "Magic quality") - buttons[quality+1] = createQualityFilter("Arcane", ITEM_QUALITY_ARCANE, "Superior quality") - buttons[quality+1] = createQualityFilter("Artifact", ITEM_QUALITY_ARTIFACT, "Epic quality") - buttons[quality+1] = createQualityFilter("Legendary", ITEM_QUALITY_LEGENDARY, "Legendary quality") - - FurC.GuiElements.qualityButtons = buttons - - end - - local function createCraftingTypeFilters() - local buttons = {} - - local function createCraftingTypeFilter(craftingType, textureName) - local parent = FurC_TypeFilter - local predecessor = buttons[#buttons] or parent - - local name = parent:GetName() .. "Button" .. tostring(craftingType) - - local button = WINDOW_MANAGER:CreateControlFromVirtual(name, parent, "FurC_CraftingTypeFilterButton") - - button:SetNormalTexture( string.format("%s%s", textureName, "_up.dds")) - button:SetMouseOverTexture( string.format("%s%s", textureName, "_over.dds")) - button:SetPressedTexture( string.format("%s%s", textureName,"_down.dds")) - button.craftingType = craftingType - button.tooltip = (craftingType > 0 and GetCraftingSkillName(craftingType)) or GetString("SI_ITEMFILTERTYPE", ITEMFILTERTYPE_ALL) - - local otherAnchor = ((predecessor == parent) and TOPLEFT) or TOPRIGHT - button:SetAnchor(TOPLEFT, predecessor, otherAnchor, 0) - - return button - - end - - buttons[CRAFTING_TYPE_INVALID] = createCraftingTypeFilter(CRAFTING_TYPE_INVALID, "esoui/art/inventory/inventory_tabicon_all") - buttons[CRAFTING_TYPE_BLACKSMITHING] = createCraftingTypeFilter(CRAFTING_TYPE_BLACKSMITHING, "esoui/art/inventory/inventory_tabicon_craftbag_blacksmithing") - buttons[CRAFTING_TYPE_CLOTHIER] = createCraftingTypeFilter(CRAFTING_TYPE_CLOTHIER, "esoui/art/inventory/inventory_tabicon_craftbag_clothing") - buttons[CRAFTING_TYPE_ENCHANTING] = createCraftingTypeFilter(CRAFTING_TYPE_ENCHANTING, "esoui/art/inventory/inventory_tabicon_craftbag_enchanting") - buttons[CRAFTING_TYPE_ALCHEMY] = createCraftingTypeFilter(CRAFTING_TYPE_ALCHEMY, "esoui/art/inventory/inventory_tabicon_craftbag_alchemy") - buttons[CRAFTING_TYPE_WOODWORKING] = createCraftingTypeFilter(CRAFTING_TYPE_WOODWORKING, "esoui/art/inventory/inventory_tabicon_craftbag_woodworking") - buttons[CRAFTING_TYPE_PROVISIONING] = createCraftingTypeFilter(CRAFTING_TYPE_PROVISIONING, "esoui/art/inventory/inventory_tabicon_craftbag_provisioning") - - FurC.GuiElements.craftingTypeFilters = buttons - - end - - local function createInventoryDropdown(dropdownName) - local controlName = string.format("%s%s", "FurC_Dropdown", dropdownName) - local control = _G[controlName] - local dropdownData = FurnitureCatalogue.DropdownData - local validChoices = dropdownData[string.format("%s%s", "Choices", dropdownName)] - local choicesTooltips = dropdownData[string.format("%s%s", "Tooltips", dropdownName)] - local comboBox - - - control.comboBox = control.comboBox or ZO_ComboBox_ObjectFromContainer(control) - comboBox = control.comboBox - - local function HideTooltip(control) - ClearTooltip(InformationTooltip) - end - - -- ruthlessly stolen from LAM - local function SetupTooltips(comboBox, choicesTooltips) - local function ShowTooltip(control) - InitializeTooltip(InformationTooltip, control, TOPRIGHT, -10, 0, TOPLEFT) - SetTooltipText(InformationTooltip, control.tooltip) - InformationTooltipTopLevel:BringWindowToTop() - end - - - -- allow for tooltips on the drop down entries - local originalShow = comboBox.ShowDropdownInternal - comboBox.ShowDropdownInternal = function(comboBox) - originalShow(comboBox) - local entries = ZO_Menu.items - for i = 1, #entries do - - local entry = entries[i] - local control = entries[i].item - control.tooltip = choicesTooltips[i] - if control.tooltip then - entry.onMouseEnter = control:GetHandler("OnMouseEnter") - entry.onMouseExit = control:GetHandler("OnMouseExit") - ZO_PreHookHandler(control, "OnMouseEnter", ShowTooltip) - ZO_PreHookHandler(control, "OnMouseExit", HideTooltip) - end - - end - end - - local originalHide = comboBox.HideDropdownInternal - comboBox.HideDropdownInternal = function(self) - local entries = ZO_Menu.items - for i = 1, #entries do - local entry = entries[i] - local control = entries[i].item - control:SetHandler("OnMouseEnter", entry.onMouseEnter) - control:SetHandler("OnMouseExit", entry.onMouseExit) - control.tooltip = nil - end - HideTooltip(self) - originalHide(self) - end - end - - function OnItemSelect(control, choiceText, somethingElse) - local dropdownName = tostring(control.m_name):gsub("FurC_Dropdown", "") - FurC.SetDropdownChoice(dropdownName, choiceText) - HideTooltip(control) - PlaySound(SOUNDS.POSITIVE_CLICK) - end - - comboBox:SetSortsItems(false) - local originalShow = comboBox.ShowDropdownInternal - - if dropdownName == "Character" then - for _, characterName in ipairs(FurC.GetAccountCrafters()) do - addedDropdownCharacterNames[characterName] = true - table.insert(validChoices, characterName) - table.insert(dropdownData["Tooltips"..dropdownName], zo_strformat(GetString(SI_FURC_STRING_RECIPESFORCHAR), characterName)) - end - end - - for i = 1, #validChoices do - entry = comboBox:CreateItemEntry(validChoices[i], OnItemSelect) - comboBox:AddItem(entry) - if validChoices[i] == FurC.GetDropdownChoiceTextual(dropdownName) then - comboBox:SetSelectedItem(validChoices[i]) - end - end - - SetupTooltips(comboBox, dropdownData["Tooltips"..dropdownName]) - - return control - end - - createInventoryScroll() - createQualityFilters() - createCraftingTypeFilters() - createInventoryDropdown("Source") - createInventoryDropdown("Version") - createInventoryDropdown("Character") - FurC.ChangeTemplateFromButton(FurC.GetTinyUi()) - FurC.SetFontSize(FurC.GetFontSize()) - FurC.LoadFrameInfo() - FurC.InitFilters() + buttons[quality+1] = createQualityFilter("White", ITEM_QUALITY_NORMAL, "White quality") + buttons[quality+1] = createQualityFilter("Magic", ITEM_QUALITY_MAGIC, "Magic quality") + buttons[quality+1] = createQualityFilter("Arcane", ITEM_QUALITY_ARCANE, "Superior quality") + buttons[quality+1] = createQualityFilter("Artifact", ITEM_QUALITY_ARTIFACT, "Epic quality") + buttons[quality+1] = createQualityFilter("Legendary", ITEM_QUALITY_LEGENDARY, "Legendary quality") + + FurC.GuiElements.qualityButtons = buttons + + end + + local function createCraftingTypeFilters() + local buttons = {} + + local function createCraftingTypeFilter(craftingType, textureName) + local parent = FurC_TypeFilter + local predecessor = buttons[#buttons] or parent + + local name = parent:GetName() .. "Button" .. tostring(craftingType) + + local button = WINDOW_MANAGER:CreateControlFromVirtual(name, parent, "FurC_CraftingTypeFilterButton") + + button:SetNormalTexture( string.format("%s%s", textureName, "_up.dds")) + button:SetMouseOverTexture( string.format("%s%s", textureName, "_over.dds")) + button:SetPressedTexture( string.format("%s%s", textureName,"_down.dds")) + button.craftingType = craftingType + button.tooltip = (craftingType > 0 and GetCraftingSkillName(craftingType)) or GetString("SI_ITEMFILTERTYPE", ITEMFILTERTYPE_ALL) + + local otherAnchor = ((predecessor == parent) and TOPLEFT) or TOPRIGHT + button:SetAnchor(TOPLEFT, predecessor, otherAnchor, 0) + + return button + + end + + buttons[CRAFTING_TYPE_INVALID] = createCraftingTypeFilter(CRAFTING_TYPE_INVALID, "esoui/art/inventory/inventory_tabicon_all") + buttons[CRAFTING_TYPE_BLACKSMITHING] = createCraftingTypeFilter(CRAFTING_TYPE_BLACKSMITHING, "esoui/art/inventory/inventory_tabicon_craftbag_blacksmithing") + buttons[CRAFTING_TYPE_CLOTHIER] = createCraftingTypeFilter(CRAFTING_TYPE_CLOTHIER, "esoui/art/inventory/inventory_tabicon_craftbag_clothing") + buttons[CRAFTING_TYPE_ENCHANTING] = createCraftingTypeFilter(CRAFTING_TYPE_ENCHANTING, "esoui/art/inventory/inventory_tabicon_craftbag_enchanting") + buttons[CRAFTING_TYPE_ALCHEMY] = createCraftingTypeFilter(CRAFTING_TYPE_ALCHEMY, "esoui/art/inventory/inventory_tabicon_craftbag_alchemy") + buttons[CRAFTING_TYPE_WOODWORKING] = createCraftingTypeFilter(CRAFTING_TYPE_WOODWORKING, "esoui/art/inventory/inventory_tabicon_craftbag_woodworking") + buttons[CRAFTING_TYPE_PROVISIONING] = createCraftingTypeFilter(CRAFTING_TYPE_PROVISIONING, "esoui/art/inventory/inventory_tabicon_craftbag_provisioning") + + FurC.GuiElements.craftingTypeFilters = buttons + + end + + local function createInventoryDropdown(dropdownName) + local controlName = string.format("%s%s", "FurC_Dropdown", dropdownName) + local control = _G[controlName] + local dropdownData = FurnitureCatalogue.DropdownData + local validChoices = dropdownData[string.format("%s%s", "Choices", dropdownName)] + local choicesTooltips = dropdownData[string.format("%s%s", "Tooltips", dropdownName)] + local comboBox + + + control.comboBox = control.comboBox or ZO_ComboBox_ObjectFromContainer(control) + comboBox = control.comboBox + + local function HideTooltip(control) + ClearTooltip(InformationTooltip) + end + + -- ruthlessly stolen from LAM + local function SetupTooltips(comboBox, choicesTooltips) + local function ShowTooltip(control) + InitializeTooltip(InformationTooltip, control, TOPRIGHT, -10, 0, TOPLEFT) + SetTooltipText(InformationTooltip, control.tooltip) + InformationTooltipTopLevel:BringWindowToTop() + end + + + -- allow for tooltips on the drop down entries + local originalShow = comboBox.ShowDropdownInternal + comboBox.ShowDropdownInternal = function(comboBox) + originalShow(comboBox) + local entries = ZO_Menu.items + for i = 1, #entries do + + local entry = entries[i] + local control = entries[i].item + control.tooltip = choicesTooltips[i] + if control.tooltip then + entry.onMouseEnter = control:GetHandler("OnMouseEnter") + entry.onMouseExit = control:GetHandler("OnMouseExit") + ZO_PreHookHandler(control, "OnMouseEnter", ShowTooltip) + ZO_PreHookHandler(control, "OnMouseExit", HideTooltip) + end + + end + end + + local originalHide = comboBox.HideDropdownInternal + comboBox.HideDropdownInternal = function(self) + local entries = ZO_Menu.items + for i = 1, #entries do + local entry = entries[i] + local control = entries[i].item + control:SetHandler("OnMouseEnter", entry.onMouseEnter) + control:SetHandler("OnMouseExit", entry.onMouseExit) + control.tooltip = nil + end + HideTooltip(self) + originalHide(self) + end + end + + function OnItemSelect(control, choiceText, somethingElse) + local dropdownName = tostring(control.m_name):gsub("FurC_Dropdown", "") + FurC.SetDropdownChoice(dropdownName, choiceText) + HideTooltip(control) + PlaySound(SOUNDS.POSITIVE_CLICK) + end + + comboBox:SetSortsItems(false) + local originalShow = comboBox.ShowDropdownInternal + + if dropdownName == "Character" then + for _, characterName in ipairs(FurC.GetAccountCrafters()) do + addedDropdownCharacterNames[characterName] = true + table.insert(validChoices, characterName) + table.insert(dropdownData["Tooltips"..dropdownName], zo_strformat(GetString(SI_FURC_STRING_RECIPESFORCHAR), characterName)) + end + end + + for i = 1, #validChoices do + entry = comboBox:CreateItemEntry(validChoices[i], OnItemSelect) + comboBox:AddItem(entry) + if validChoices[i] == FurC.GetDropdownChoiceTextual(dropdownName) then + comboBox:SetSelectedItem(validChoices[i]) + end + end + + SetupTooltips(comboBox, dropdownData["Tooltips"..dropdownName]) + + return control + end + + createInventoryScroll() + createQualityFilters() + createCraftingTypeFilters() + createInventoryDropdown("Source") + createInventoryDropdown("Version") + createInventoryDropdown("Character") + FurC.ChangeTemplateFromButton(FurC.GetTinyUi()) + FurC.SetFontSize(FurC.GetFontSize()) + FurC.LoadFrameInfo() + FurC.InitFilters() end function FurnitureCatalogue_Toggle() - SCENE_MANAGER:ToggleTopLevel(FurCGui) - if FurCGui:IsHidden() then return end - FurCGui_Empty:SetHidden(true) - zo_callLater(function() FurC.UpdateGui(FurC.GetResetDropdownChoice()) end, 500) + SCENE_MANAGER:ToggleTopLevel(FurCGui) + if FurCGui:IsHidden() then return end + FurCGui_Empty:SetHidden(true) + zo_callLater(function() FurC.UpdateGui(FurC.GetResetDropdownChoice()) end, 500) end function FurC.InitGui() - local control = FurCGui - local settings = FurC.settings["gui"] - FurC.GuiElements = {} - if nil ~= control then - control:SetHeight(settings.height) - control:SetWidth(settings.width) - end + local control = FurCGui + local settings = FurC.settings["gui"] + FurC.GuiElements = {} + if nil ~= control then + control:SetHeight(settings.height) + control:SetWidth(settings.width) + end - createGui() + createGui() - local slider = FurCGui_ListHolder_Slider - slider:SetMinMax(1, #FurCGui_ListHolder.dataLines) + local slider = FurCGui_ListHolder_Slider + slider:SetMinMax(1, #FurCGui_ListHolder.dataLines) - FurC.UpdateGui(FurC.GetResetDropdownChoice()) + FurC.UpdateGui(FurC.GetResetDropdownChoice()) - FurC_Label:GetNamedChild("_2"):SetText(GetString(SI_FURC_LABEL_ENTRIES)) + FurC_Label:GetNamedChild("_2"):SetText(GetString(SI_FURC_LABEL_ENTRIES)) - SCENE_MANAGER:RegisterTopLevel(FurCGui, false) + SCENE_MANAGER:RegisterTopLevel(FurCGui, false) end diff --git a/FurCMenu.lua b/FurCMenu.lua index 9bc0b99..5d20737 100644 --- a/FurCMenu.lua +++ b/FurCMenu.lua @@ -1,228 +1,228 @@ function FurC.CreateSettings(savedVars, defaults) - local LAM = LibStub:GetLibrary("LibAddonMenu-2.0") - local panelData = { - type = "panel", - name = FurC.name, - displayName = name, - author = FurC.author, - version = FurC.version, - registerForRefresh = true, - registerForDefaults = true, - slashCommand = "/furc", } - LAM:RegisterAddonPanel("FurC_OptionsPanel", panelData) - local optionsData = { -- optionsData + local LAM = LibStub:GetLibrary("LibAddonMenu-2.0") + local panelData = { + type = "panel", + name = FurC.name, + displayName = name, + author = FurC.author, + version = FurC.version, + registerForRefresh = true, + registerForDefaults = true, + slashCommand = "/furc", } + LAM:RegisterAddonPanel("FurC_OptionsPanel", panelData) + local optionsData = { -- optionsData - -- first section - { -- checkbox: Debug output - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_DEBUG), - tooltip = "", - getFunc = function() return FurC.GetEnableDebug() end, - setFunc = function(value) FurC.SetEnableDebug(value) end - }, - { -- button: Reset database - type = "button", - name = GetString(SI_FURC_STRING_MENU_RESET_DB_NAME), - tooltip = GetString(SI_FURC_STRING_MENU_RESET_DB_TT), - warning = GetString(SI_FURC_STRING_MENU_RESET_DB_WARNING), - func = function() - FurC.WipeDatabase() - end, - }, - { -- button: Reset database - type = "button", - name = GetString(SI_FURC_STRING_MENU_RESCAN_RUMOUR_NAME), - width = "half", - tooltip = GetString(SI_FURC_STRING_MENU_RESCAN_RUMOUR_TT), - func = function() FurC.RescanRumourRecipes() end, - }, - { -- button: Re-scan data - type = "button", - name = GetString(SI_FURC_STRING_MENU_SCAN_FILES_NAME), - tooltip = GetString(SI_FURC_STRING_MENU_SCAN_FILES_TT), - width = "half", - func = function() - FurC.ScanRecipes(true, false) - FurC.UpdateGui() - end, - }, - { -- button: Re-scan data - type = "button", - name = GetString(SI_FURC_STRING_MENU_SCAN_CHAR_NAME), - tooltip = GetString(SI_FURC_STRING_MENU_SCAN_CHAR_TT), - width = "half", - func = function() - FurC.ScanRecipes(false, true) - FurC.UpdateGui() - end, - }, - { -- dropdown: delete character - type = "dropdown", - name = GetString(SI_FURC_STRING_MENU_DELETE_CHAR_NAME), - tooltip = GetString(SI_FURC_STRING_MENU_DELETE_CHAR_TT), - warning = GetString(SI_FURC_STRING_MENU_DELETE_CHAR_WARNING), - choices = FurC.GetAccountCharacters(), - getFunc = function() return end, - setFunc = function(value) - FurC.DeleteCharacter(value) - end, - }, + -- first section + { -- checkbox: Debug output + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_DEBUG), + tooltip = "", + getFunc = function() return FurC.GetEnableDebug() end, + setFunc = function(value) FurC.SetEnableDebug(value) end + }, + { -- button: Reset database + type = "button", + name = GetString(SI_FURC_STRING_MENU_RESET_DB_NAME), + tooltip = GetString(SI_FURC_STRING_MENU_RESET_DB_TT), + warning = GetString(SI_FURC_STRING_MENU_RESET_DB_WARNING), + func = function() + FurC.WipeDatabase() + end, + }, + { -- button: Reset database + type = "button", + name = GetString(SI_FURC_STRING_MENU_RESCAN_RUMOUR_NAME), + width = "half", + tooltip = GetString(SI_FURC_STRING_MENU_RESCAN_RUMOUR_TT), + func = function() FurC.RescanRumourRecipes() end, + }, + { -- button: Re-scan data + type = "button", + name = GetString(SI_FURC_STRING_MENU_SCAN_FILES_NAME), + tooltip = GetString(SI_FURC_STRING_MENU_SCAN_FILES_TT), + width = "half", + func = function() + FurC.ScanRecipes(true, false) + FurC.UpdateGui() + end, + }, + { -- button: Re-scan data + type = "button", + name = GetString(SI_FURC_STRING_MENU_SCAN_CHAR_NAME), + tooltip = GetString(SI_FURC_STRING_MENU_SCAN_CHAR_TT), + width = "half", + func = function() + FurC.ScanRecipes(false, true) + FurC.UpdateGui() + end, + }, + { -- dropdown: delete character + type = "dropdown", + name = GetString(SI_FURC_STRING_MENU_DELETE_CHAR_NAME), + tooltip = GetString(SI_FURC_STRING_MENU_DELETE_CHAR_TT), + warning = GetString(SI_FURC_STRING_MENU_DELETE_CHAR_WARNING), + choices = FurC.GetAccountCharacters(), + getFunc = function() return end, + setFunc = function(value) + FurC.DeleteCharacter(value) + end, + }, - -- ======================================================================================= - -- header: Furniture Shopping List integration - -- ======================================================================================= - { -- header: Furniture Shopping List integration - type = "header", - name = "Furniture Shopping List", - }, - { -- checkbox: Enable - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_ENABLE_SHOPPINGLIST), - getFunc = function() return (FurC.GetEnableShoppingList()) end, - setFunc = function(value) FurC.SetEnableShoppingList(value) end - }, + -- ======================================================================================= + -- header: Furniture Shopping List integration + -- ======================================================================================= + { -- header: Furniture Shopping List integration + type = "header", + name = "Furniture Shopping List", + }, + { -- checkbox: Enable + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_ENABLE_SHOPPINGLIST), + getFunc = function() return (FurC.GetEnableShoppingList()) end, + setFunc = function(value) FurC.SetEnableShoppingList(value) end + }, - -- ======================================================================================= - -- header: UI and performance - -- ======================================================================================= - { -- header: UI and performance - type = "header", - name = "Performance", - }, + -- ======================================================================================= + -- header: UI and performance + -- ======================================================================================= + { -- header: UI and performance + type = "header", + name = "Performance", + }, - { -- checkbox: Skip Initial Scan - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_SKIP_INITIALSCAN), - tooltip = GetString(SI_FURC_STRING_MENU_SKIP_INITIALSCAN_TT), - getFunc = function() return FurC.GetSkipInitialScan() end, - setFunc = function(value) FurC.SetSkipInitialScan(value) end - }, - -- ======================================================================================= - -- header: Inventory and bank - -- ======================================================================================= - { -- header: Inventory and bank - type = "submenu", - name = GetString(SI_FURC_STRING_MENU_HEADER_ICONS), - controls = { - { -- checkbox: Add items to known/unknown recipes? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_ADD_ITEMS_NAME), - tooltip = GetString(SI_FURC_STRING_MENU_ADD_ITEMS_TT), - getFunc = function() return FurC.GetUseInventoryIcons() end, - setFunc = function(value) FurC.SetUseInventoryIcons(value) end - }, - { -- checkbox: Only mark unknown recipes - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_IT_UNKNOWN_NAME), - getFunc = function() return FurC.GetHideKnownInventoryIcons() end, - setFunc = function(value) FurC.SetHideKnownInventoryIcons(value) end - }, - { -- checkbox: Add items to known/unknown recipes? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_IT_THIS_ONLY), - tooltip = GetString(SI_FURC_STRING_MENU_IT_THIS_ONLY_TT), - getFunc = function() return FurC.GetUseInventoryIconsOnChar() end, - setFunc = function(value) FurC.SetUseInventoryIconsOnChar(value) end - }, - }, - }, - -- ======================================================================================= - -- header: UI and performance - -- ======================================================================================= - { -- header: UI and performance - type = "header", - name = "User Interface", - }, - { -- checkbox: use small interface? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_USETINY), - tooltip = GetString(SI_FURC_STRING_MENU_USETINY_TT), - getFunc = function() return FurC.GetTinyUi() end, - setFunc = function(value) FurC.SetTinyUi(value) end - }, - { -- checkbox: start silently? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_STARTSILENT), - tooltip = GetString(SI_FURC_STRING_MENU_STARTSILENT_TT), - getFunc = function() return FurC.GetStartupSilently() end, - setFunc = function(value) FurC.SetStartupSilently(value) end - }, - { -- checkbox: show Icon on left of items? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_SHOWICONONLEFT), - tooltip = GetString(SI_FURC_STRING_MENU_SHOWICONONLEFT_TT), - getFunc = function() return FurC.GetShowIconOnLeft() end, - setFunc = function(value) FurC.SetShowIconOnLeft(value) end, - requiresReload = true - }, - { -- slider: font size - type = "slider", - name = GetString(SI_FURC_STRING_MENU_FONTSIZE), - tooltip = GetString(SI_FURC_STRING_MENU_FONTSIZE_TT), - min = 10, - max = 28, - getFunc = function() return FurC.GetFontSize() end, - setFunc = function(value) FurC.SetFontSize(value) end - }, - { -- checkbox: use right click menu divider? - type = "checkbox", - name = GetString(SI_FURC_STRING_CONTEXTMENU_DIVIDER), - tooltip = GetString(SI_FURC_STRING_CONTEXTMENU_DIVIDER_TT), - getFunc = function() return FurC.GetSkipDivider() end, - setFunc = function(value) FurC.SetSkipDivider(value) end, - requiresReload = true - }, - { type = "submenu", - name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD), - controls = { - { -- description: Default dropdown - type = "description", - name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_USE), - text = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_USE_TT), - }, + { -- checkbox: Skip Initial Scan + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_SKIP_INITIALSCAN), + tooltip = GetString(SI_FURC_STRING_MENU_SKIP_INITIALSCAN_TT), + getFunc = function() return FurC.GetSkipInitialScan() end, + setFunc = function(value) FurC.SetSkipInitialScan(value) end + }, + -- ======================================================================================= + -- header: Inventory and bank + -- ======================================================================================= + { -- header: Inventory and bank + type = "submenu", + name = GetString(SI_FURC_STRING_MENU_HEADER_ICONS), + controls = { + { -- checkbox: Add items to known/unknown recipes? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_ADD_ITEMS_NAME), + tooltip = GetString(SI_FURC_STRING_MENU_ADD_ITEMS_TT), + getFunc = function() return FurC.GetUseInventoryIcons() end, + setFunc = function(value) FurC.SetUseInventoryIcons(value) end + }, + { -- checkbox: Only mark unknown recipes + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_IT_UNKNOWN_NAME), + getFunc = function() return FurC.GetHideKnownInventoryIcons() end, + setFunc = function(value) FurC.SetHideKnownInventoryIcons(value) end + }, + { -- checkbox: Add items to known/unknown recipes? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_IT_THIS_ONLY), + tooltip = GetString(SI_FURC_STRING_MENU_IT_THIS_ONLY_TT), + getFunc = function() return FurC.GetUseInventoryIconsOnChar() end, + setFunc = function(value) FurC.SetUseInventoryIconsOnChar(value) end + }, + }, + }, + -- ======================================================================================= + -- header: UI and performance + -- ======================================================================================= + { -- header: UI and performance + type = "header", + name = "User Interface", + }, + { -- checkbox: use small interface? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_USETINY), + tooltip = GetString(SI_FURC_STRING_MENU_USETINY_TT), + getFunc = function() return FurC.GetTinyUi() end, + setFunc = function(value) FurC.SetTinyUi(value) end + }, + { -- checkbox: start silently? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_STARTSILENT), + tooltip = GetString(SI_FURC_STRING_MENU_STARTSILENT_TT), + getFunc = function() return FurC.GetStartupSilently() end, + setFunc = function(value) FurC.SetStartupSilently(value) end + }, + { -- checkbox: show Icon on left of items? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_SHOWICONONLEFT), + tooltip = GetString(SI_FURC_STRING_MENU_SHOWICONONLEFT_TT), + getFunc = function() return FurC.GetShowIconOnLeft() end, + setFunc = function(value) FurC.SetShowIconOnLeft(value) end, + requiresReload = true + }, + { -- slider: font size + type = "slider", + name = GetString(SI_FURC_STRING_MENU_FONTSIZE), + tooltip = GetString(SI_FURC_STRING_MENU_FONTSIZE_TT), + min = 10, + max = 28, + getFunc = function() return FurC.GetFontSize() end, + setFunc = function(value) FurC.SetFontSize(value) end + }, + { -- checkbox: use right click menu divider? + type = "checkbox", + name = GetString(SI_FURC_STRING_CONTEXTMENU_DIVIDER), + tooltip = GetString(SI_FURC_STRING_CONTEXTMENU_DIVIDER_TT), + getFunc = function() return FurC.GetSkipDivider() end, + setFunc = function(value) FurC.SetSkipDivider(value) end, + requiresReload = true + }, + { type = "submenu", + name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD), + controls = { + { -- description: Default dropdown + type = "description", + name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_USE), + text = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_USE_TT), + }, - { -- checkbox: Persistent? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_RESET), - tooltip = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_RESET_TT), - getFunc = function() return FurC.GetResetDropdownChoice() end, - setFunc = function(value) FurC.SetResetDropdownChoice(value) end - }, - { -- dropdown: default source - type = "dropdown", - name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_SOURCE), - choices = FurC.GetChoicesSource(), - getFunc = function() return FurC.GetDefaultDropdownChoiceText("Source") end, - setFunc = function(value) FurC.SetDefaultDropdownChoice("Source", value) end - }, - { -- dropdown: default character - type = "dropdown", - name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_CHAR), - choices = FurnitureCatalogue.DropdownData.ChoicesCharacter, - getFunc = function() return FurC.GetDefaultDropdownChoiceText("Character") end, - setFunc = function(value) FurC.SetDefaultDropdownChoice("Character", value) end - }, - { -- dropdown: default version - type = "dropdown", - name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_VERSION), - choices = FurnitureCatalogue.DropdownData.ChoicesVersion, - getFunc = function() return FurC.GetDefaultDropdownChoiceText("Version") end, - setFunc = function(value) FurC.SetDefaultDropdownChoice("Version", value) end - }, - }, - }, + { -- checkbox: Persistent? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_RESET), + tooltip = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_RESET_TT), + getFunc = function() return FurC.GetResetDropdownChoice() end, + setFunc = function(value) FurC.SetResetDropdownChoice(value) end + }, + { -- dropdown: default source + type = "dropdown", + name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_SOURCE), + choices = FurC.GetChoicesSource(), + getFunc = function() return FurC.GetDefaultDropdownChoiceText("Source") end, + setFunc = function(value) FurC.SetDefaultDropdownChoice("Source", value) end + }, + { -- dropdown: default character + type = "dropdown", + name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_CHAR), + choices = FurnitureCatalogue.DropdownData.ChoicesCharacter, + getFunc = function() return FurC.GetDefaultDropdownChoiceText("Character") end, + setFunc = function(value) FurC.SetDefaultDropdownChoice("Character", value) end + }, + { -- dropdown: default version + type = "dropdown", + name = GetString(SI_FURC_STRING_MENU_DEFAULT_DD_VERSION), + choices = FurnitureCatalogue.DropdownData.ChoicesVersion, + getFunc = function() return FurC.GetDefaultDropdownChoiceText("Version") end, + setFunc = function(value) FurC.SetDefaultDropdownChoice("Version", value) end + }, + }, + }, - -- ======================================================================================= - -- submenu: Catalogue filtering - -- ======================================================================================= - { type = "submenu", - name = GetString(SI_FURC_STRING_MENU_FILTERING), - controls = { - { type = "submenu", + -- ======================================================================================= + -- submenu: Catalogue filtering + -- ======================================================================================= + { type = "submenu", + name = GetString(SI_FURC_STRING_MENU_FILTERING), + controls = { + { type = "submenu", name = GetString(SI_FURC_STRING_MENU_HEADER_F_ALL_ON_TEXT), controls = { { -- description: Default dropdown @@ -232,31 +232,31 @@ function FurC.CreateSettings(savedVars, defaults) }, { -- checkbox: Filter everything when text searching without dropdown - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_FILTER_ALL_ON_TEXT), + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_FILTER_ALL_ON_TEXT), tooltip = GetString(SI_FURC_STRING_MENU_FILTER_ALL_ON_TEXT_TT), getFunc = function() return FurC.GetFilterAllOnText() end, setFunc = function(value) FurC.SetFilterAllOnText(value) end }, { -- checkbox: Exclude books from these - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_FALL_HIDE_BOOKS), + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_FALL_HIDE_BOOKS), tooltip = GetString(SI_FURC_STRING_MENU_FALL_HIDE_BOOKS_TT), getFunc = function() return FurC.GetFilterAllOnTextNoBooks() end, setFunc = function(value) FurC.SetFilterAllOnTextNoBooks(value) end, disabled = not FurC.GetFilterAllOnText() }, { -- checkbox: Exclude crown store items from these - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_FALL_HIDE_CROWN), + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_FALL_HIDE_CROWN), tooltip = GetString(SI_FURC_STRING_MENU_FALL_HIDE_CROWN_TT), getFunc = function() return FurC.GetFilterAllOnTextNoCrown() end, setFunc = function(value) FurC.GetFilterAllOnTextNoCrown(value) end, disabled = not FurC.GetFilterAllOnText() }, { -- checkbox: Exclude crown store items from these - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_FALL_HIDE_RUMOUR), + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_FALL_HIDE_RUMOUR), tooltip = GetString(SI_FURC_STRING_MENU_FALL_HIDE_RUMOUR_TT), getFunc = function() return FurC.GetFilterAllOnTextNoRumour() end, setFunc = function(value) FurC.SetFilterAllOnTextNoRumour(value) end, @@ -266,136 +266,136 @@ function FurC.CreateSettings(savedVars, defaults) }, - -- =============================================================================== - -- header: Mages guild books - -- =============================================================================== - { -- header: Mages guild books - type = "header", - name = GetString(SI_FURC_STRING_MENU_FILTER_BOOKS), - }, - { -- checkbox: Hide Mages' guild books - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_FILTER_BOOKS_N), - tooltip = GetString(SI_FURC_STRING_MENU_FILTER_BOOKS_TT), - getFunc = function() return FurC.GetHideBooks() end, - setFunc = function(value) FurC.SetHideBooks(value) end - }, + -- =============================================================================== + -- header: Mages guild books + -- =============================================================================== + { -- header: Mages guild books + type = "header", + name = GetString(SI_FURC_STRING_MENU_FILTER_BOOKS), + }, + { -- checkbox: Hide Mages' guild books + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_FILTER_BOOKS_N), + tooltip = GetString(SI_FURC_STRING_MENU_FILTER_BOOKS_TT), + getFunc = function() return FurC.GetHideBooks() end, + setFunc = function(value) FurC.SetHideBooks(value) end + }, - { -- header: Luxury items - type = "header", - name = GetString(SI_FURC_STRING_MENU_LUXURY), - }, - { -- checkbox: Hide Mages' guild books - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_LUXURY_N), - tooltip = GetString(SI_FURC_STRING_MENU_LUXURY_TT), - warning = GetString(SI_FURC_STRING_MENU_LUXURY_WARN), - getFunc = function() return FurC.GetMergeLuxuryAndSales() end, - setFunc = function(value) FurC.SetMergeLuxuryAndSales(value) end - }, + { -- header: Luxury items + type = "header", + name = GetString(SI_FURC_STRING_MENU_LUXURY), + }, + { -- checkbox: Hide Mages' guild books + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_LUXURY_N), + tooltip = GetString(SI_FURC_STRING_MENU_LUXURY_TT), + warning = GetString(SI_FURC_STRING_MENU_LUXURY_WARN), + getFunc = function() return FurC.GetMergeLuxuryAndSales() end, + setFunc = function(value) FurC.SetMergeLuxuryAndSales(value) end + }, - -- =============================================================================== - -- header: Rumour Recipes - -- =============================================================================== - { -- header: rumour recipes - type = "header", - name = "Rumour Recipes", - }, - { -- checkbox: Hide doubtful recipes - type = "description", - name = GetString(SI_FURC_STRING_MENU_RUMOUR), - text = GetString(SI_FURC_STRING_MENU_RUMOUR_DESC), - }, - { -- checkbox: Hide doubtful recipes - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_RUMOUR_N), - getFunc = function() return FurC.GetHideRumourRecipes() end, - setFunc = function(value) FurC.SetHideRumourRecipes(value) end - }, - { -- header: rumour recipes - type = "header", - name = "Crown store", - }, - { -- checkbox: Hide doubtful recipes - type = "description", - name = GetString(SI_FURC_STRING_MENU_CROWN), - text = GetString(SI_FURC_STRING_MENU_CROWN_DESC), - }, - { -- checkbox: Hide doubtful recipes - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_CROWN_N), - getFunc = function() return FurC.GetHideCrownStoreItems() end, - setFunc = function(value) FurC.SetHideCrownStoreItems(value) end - }, - }, - }, + -- =============================================================================== + -- header: Rumour Recipes + -- =============================================================================== + { -- header: rumour recipes + type = "header", + name = "Rumour Recipes", + }, + { -- checkbox: Hide doubtful recipes + type = "description", + name = GetString(SI_FURC_STRING_MENU_RUMOUR), + text = GetString(SI_FURC_STRING_MENU_RUMOUR_DESC), + }, + { -- checkbox: Hide doubtful recipes + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_RUMOUR_N), + getFunc = function() return FurC.GetHideRumourRecipes() end, + setFunc = function(value) FurC.SetHideRumourRecipes(value) end + }, + { -- header: rumour recipes + type = "header", + name = "Crown store", + }, + { -- checkbox: Hide doubtful recipes + type = "description", + name = GetString(SI_FURC_STRING_MENU_CROWN), + text = GetString(SI_FURC_STRING_MENU_CROWN_DESC), + }, + { -- checkbox: Hide doubtful recipes + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_CROWN_N), + getFunc = function() return FurC.GetHideCrownStoreItems() end, + setFunc = function(value) FurC.SetHideCrownStoreItems(value) end + }, + }, + }, - -- ======================================================================================= - -- header: Tooltip - -- ======================================================================================= - { -- header: Tooltip - type = "header", - name = "Tooltip", - }, - { -- checkbox: Disable - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP), - getFunc = function() return (not FurC.GetDisableTooltips()) end, - setFunc = function(value) FurC.SetDisableTooltips(not value) end - }, - { -- checkbox: Colorize tooltips for clarity? - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP_COLOR), - tooltip = GetString(SI_FURC_STRING_MENU_TOOLTIP_COLOR_TT), - disabled = FurC.GetDisableTooltips(), - getFunc = function() return FurC.GetColouredTooltips() end, - setFunc = function(value) FurC.SetColouredTooltips(value) end - }, - { -- checkbox: Hide 'known by' from tooltip - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_KNOWN), - tooltip = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_KNOWN_TT), - width = "half", - disabled = FurC.GetDisableTooltips(), - getFunc = function() return (FurC.GetHideKnowledge()) end, - setFunc = function(value) FurC.SetHideKnowledge(value) end - }, - { -- checkbox: Hide 'known by' from tooltip - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_UNKNOWN), - tooltip = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_UNKNOWN_TT), - width = "half", - disabled = FurC.GetDisableTooltips(), - getFunc = function() return (FurC.GetHideUnknown()) end, - setFunc = function(value) FurC.SetHideUnknown(value) end - }, - { -- checkbox: Hide item source - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_SOURCE), - tooltip = "", - disabled = FurC.GetDisableTooltips(), - getFunc = function() return (FurC.GetHideSource()) end, - setFunc = function(value) FurC.SetHideSource(value) end - }, - { -- checkbox: Hide item source - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_STATION), - tooltip = "", - disabled = FurC.GetDisableTooltips(), - getFunc = function() return (FurC.GetHideCraftingStation()) end, - setFunc = function(value) FurC.SetHideCraftingStation(value) end - }, - { -- checkbox: Hide materials from tooltip - type = "checkbox", - name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_MATERIAL), - tooltip = "", - disabled = FurC.GetDisableTooltips(), - getFunc = function() return (FurC.GetHideMats()) end, - setFunc = function(value) FurC.SetHideMats(value) end - }, - } -- optionsData end + -- ======================================================================================= + -- header: Tooltip + -- ======================================================================================= + { -- header: Tooltip + type = "header", + name = "Tooltip", + }, + { -- checkbox: Disable + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP), + getFunc = function() return (not FurC.GetDisableTooltips()) end, + setFunc = function(value) FurC.SetDisableTooltips(not value) end + }, + { -- checkbox: Colorize tooltips for clarity? + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP_COLOR), + tooltip = GetString(SI_FURC_STRING_MENU_TOOLTIP_COLOR_TT), + disabled = FurC.GetDisableTooltips(), + getFunc = function() return FurC.GetColouredTooltips() end, + setFunc = function(value) FurC.SetColouredTooltips(value) end + }, + { -- checkbox: Hide 'known by' from tooltip + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_KNOWN), + tooltip = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_KNOWN_TT), + width = "half", + disabled = FurC.GetDisableTooltips(), + getFunc = function() return (FurC.GetHideKnowledge()) end, + setFunc = function(value) FurC.SetHideKnowledge(value) end + }, + { -- checkbox: Hide 'known by' from tooltip + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_UNKNOWN), + tooltip = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_UNKNOWN_TT), + width = "half", + disabled = FurC.GetDisableTooltips(), + getFunc = function() return (FurC.GetHideUnknown()) end, + setFunc = function(value) FurC.SetHideUnknown(value) end + }, + { -- checkbox: Hide item source + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_SOURCE), + tooltip = "", + disabled = FurC.GetDisableTooltips(), + getFunc = function() return (FurC.GetHideSource()) end, + setFunc = function(value) FurC.SetHideSource(value) end + }, + { -- checkbox: Hide item source + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_STATION), + tooltip = "", + disabled = FurC.GetDisableTooltips(), + getFunc = function() return (FurC.GetHideCraftingStation()) end, + setFunc = function(value) FurC.SetHideCraftingStation(value) end + }, + { -- checkbox: Hide materials from tooltip + type = "checkbox", + name = GetString(SI_FURC_STRING_MENU_TOOLTIP_HIDE_MATERIAL), + tooltip = "", + disabled = FurC.GetDisableTooltips(), + getFunc = function() return (FurC.GetHideMats()) end, + setFunc = function(value) FurC.SetHideMats(value) end + }, + } -- optionsData end - LAM:RegisterOptionControls("FurC_OptionsPanel", optionsData) + LAM:RegisterOptionControls("FurC_OptionsPanel", optionsData) end diff --git a/FurCSettingsAdapter.lua b/FurCSettingsAdapter.lua index 60af629..b59af83 100644 --- a/FurCSettingsAdapter.lua +++ b/FurCSettingsAdapter.lua @@ -1,87 +1,87 @@ -local task = LibStub("LibAsync"):Create("FurnitureCatalogue_Settings") -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local task = LibStub("LibAsync"):Create("FurnitureCatalogue_Settings") +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args function FurC.GetEnableDebug() - return FurC.settings["enableDebug"] + return FurC.settings["enableDebug"] end function FurC.SetEnableDebug(value) - FurC.settings["enableDebug"] = value + FurC.settings["enableDebug"] = value end function FurC.GetHideRumourRecipes() - return FurC.settings["hideDoubtfuls"] + return FurC.settings["hideDoubtfuls"] end function FurC.SetHideRumourRecipes(value) - FurC.settings["hideDoubtfuls"] = value - FurC.updateDropdownData() - FurC.UpdateGui() + FurC.settings["hideDoubtfuls"] = value + FurC.updateDropdownData() + FurC.UpdateGui() end function FurC.GetHideCrownStoreItems() - return FurC.settings["hideCrownstore"] + return FurC.settings["hideCrownstore"] end function FurC.SetHideCrownStoreItems(value) - FurC.settings["hideCrownstore"] = value - FurC.updateDropdownData() - FurC.UpdateGui() + FurC.settings["hideCrownstore"] = value + FurC.updateDropdownData() + FurC.UpdateGui() end function FurC.GetFilterAllOnText() - return FurC.settings["filterAllOnText"] + return FurC.settings["filterAllOnText"] end function FurC.SetFilterAllOnText(value) - FurC.settings["filterAllOnText"] = value - FurC.UpdateGui() + FurC.settings["filterAllOnText"] = value + FurC.UpdateGui() end function FurC.GetFilterAllOnTextNoRumour() - return FurC.settings["filterAllOnTextNoRumour"] + return FurC.settings["filterAllOnTextNoRumour"] end function FurC.SetFilterAllOnTextNoRumour(value) - FurC.settings["filterAllOnTextNoRumour"] = value - FurC.UpdateGui() + FurC.settings["filterAllOnTextNoRumour"] = value + FurC.UpdateGui() end function FurC.GetSkipDivider() - return FurC.settings["skipDivider"] + return FurC.settings["skipDivider"] end function FurC.SetSkipDivider(value) - FurC.settings["skipDivider"] = value + FurC.settings["skipDivider"] = value end function FurC.GetFilterAllOnTextNoBooks() - return FurC.settings["filterAllOnTextNoBooks"] + return FurC.settings["filterAllOnTextNoBooks"] end function FurC.GetFilterAllOnTextNoBooks(value) - FurC.settings["filterAllOnTextNoBooks"] = value - FurC.UpdateGui() + FurC.settings["filterAllOnTextNoBooks"] = value + FurC.UpdateGui() end function FurC.GetFilterAllOnTextNoCrown() - return FurC.settings["filterAllOnTextNoCrown"] + return FurC.settings["filterAllOnTextNoCrown"] end function FurC.GetFilterAllOnTextNoCrown(value) - FurC.settings["filterAllOnTextNoCrown"] = value - FurC.UpdateGui() + FurC.settings["filterAllOnTextNoCrown"] = value + FurC.UpdateGui() end function FurC.GetFontSize() - if FurC.settings["fontSize"] < 10 then - FurC.settings["fontSize"] = 10 - end - return FurC.settings["fontSize"] + if FurC.settings["fontSize"] < 10 then + FurC.settings["fontSize"] = 10 + end + return FurC.settings["fontSize"] end function FurC.SetFontSize(value) - if nil == value then value = FurC.GetFontSize() end - if value == 0 then value = 18 end - FurC.settings["fontSize"] = value + if nil == value then value = FurC.GetFontSize() end + if value == 0 then value = 18 end + FurC.settings["fontSize"] = value - local size = tostring(value) + local size = tostring(value) - FurC.SetLineHeight() + FurC.SetLineHeight() - task:Call(function() FurC.UpdateGui() end) + task:Call(function() FurC.UpdateGui() end) end @@ -89,58 +89,58 @@ end --------- Tooltip --------- --------------------------- function FurC.GetDisableTooltips() - return FurC.settings["disableTooltips"] + return FurC.settings["disableTooltips"] end function FurC.SetDisableTooltips(value) - FurC.settings["disableTooltips"] = value + FurC.settings["disableTooltips"] = value end function FurC.GetColouredTooltips() - return FurC.settings["coloredTooltips"] + return FurC.settings["coloredTooltips"] end function FurC.SetColouredTooltips(value) - FurC.settings["coloredTooltips"] = value + FurC.settings["coloredTooltips"] = value end function FurC.GetHideKnowledge() - return FurC.settings["hideKnowledge"] + return FurC.settings["hideKnowledge"] end function FurC.SetHideKnowledge(value) - FurC.settings["hideKnowledge"] = value + FurC.settings["hideKnowledge"] = value end function FurC.GetHideUnknown() - return FurC.settings["hideUnknown"] + return FurC.settings["hideUnknown"] end function FurC.SetHideUnknown(value) - FurC.settings["hideUnknown"] = value + FurC.settings["hideUnknown"] = value end function FurC.GetHideMats() - return FurC.settings["hideMats"] + return FurC.settings["hideMats"] end function FurC.SetHideMats(value) - FurC.settings["hideMats"] = value + FurC.settings["hideMats"] = value end function FurC.GetHideSource() - return FurC.settings["hideSource"] + return FurC.settings["hideSource"] end function FurC.SetHideSource(value) - FurC.settings["hideSource"] = value + FurC.settings["hideSource"] = value end function FurC.GetHideCraftingStation() - return FurC.settings["hideCraftingStation"] + return FurC.settings["hideCraftingStation"] end function FurC.SetHideCraftingStation(value) - FurC.settings["hideCraftingStation"] = value + FurC.settings["hideCraftingStation"] = value end function FurC.GetEnableShoppingList() - return FurC.settings["enableShoppingList"] + return FurC.settings["enableShoppingList"] end function FurC.SetEnableShoppingList(value) - FurC.settings["enableShoppingList"] = value + FurC.settings["enableShoppingList"] = value end --------------------------- @@ -153,11 +153,11 @@ end --------------------------- function FurC.GetShowIconOnLeft() - return FurC.settings["showIconOnLeft"] == nil or - FurC.settings["showIconOnLeft"] == true + return FurC.settings["showIconOnLeft"] == nil or + FurC.settings["showIconOnLeft"] == true end function FurC.SetShowIconOnLeft(value) - FurC.settings["showIconOnLeft"] = value + FurC.settings["showIconOnLeft"] = value end --------------------------- @@ -171,73 +171,73 @@ end local function containsTrue(ary) - for key, value in pairs(ary) do - if value then return true end - end + for key, value in pairs(ary) do + if value then return true end + end end function FurC.GetFilterQuality() - return FurC.settings.filterQuality + return FurC.settings.filterQuality end function FurC.SetFilterQuality(quality) - local controls = FurC.GuiElements.qualityButtons - local filterArray = FurC.settings.filterQuality + local controls = FurC.GuiElements.qualityButtons + local filterArray = FurC.settings.filterQuality - quality = quality or 0 + quality = quality or 0 - if quality == 0 then - for key, value in pairs (filterArray) do - FurC.settings.filterQuality[key] = false - end - else - filterArray[quality] = not filterArray[quality] - end - FurC.settings.filterQualityAll = not containsTrue(filterArray) + if quality == 0 then + for key, value in pairs (filterArray) do + FurC.settings.filterQuality[key] = false + end + else + filterArray[quality] = not filterArray[quality] + end + FurC.settings.filterQualityAll = not containsTrue(filterArray) - for key, control in pairs (controls) do - control:SetState((filterArray[key-1] and BSTATE_PRESSED) or BSTATE_NORMAL) - end - FurC.GuiOnScroll(nil, 0) - FurC.SetFilter() - FurC.UpdateGui() + for key, control in pairs (controls) do + control:SetState((filterArray[key-1] and BSTATE_PRESSED) or BSTATE_NORMAL) + end + FurC.GuiOnScroll(nil, 0) + FurC.SetFilter() + FurC.UpdateGui() end function FurC.GetFilterCraftingType() - return FurC.settings.filterCraftingType + return FurC.settings.filterCraftingType end function FurC.SetFilterCraftingType(craftingType) - local controls = FurC.GuiElements.craftingTypeFilters - local filterArray = FurC.settings.filterCraftingType + local controls = FurC.GuiElements.craftingTypeFilters + local filterArray = FurC.settings.filterCraftingType - if craftingType == 0 then - for key, value in pairs (filterArray) do - filterArray[key] = false - end - else - filterArray[craftingType] = not filterArray[craftingType] - end + if craftingType == 0 then + for key, value in pairs (filterArray) do + filterArray[key] = false + end + else + filterArray[craftingType] = not filterArray[craftingType] + end - FurC.settings.filterCraftingTypeAll = not containsTrue(filterArray) + FurC.settings.filterCraftingTypeAll = not containsTrue(filterArray) - for key, control in pairs (controls) do - control:SetState((filterArray[key] and BSTATE_PRESSED) or BSTATE_NORMAL) - end + for key, control in pairs (controls) do + control:SetState((filterArray[key] and BSTATE_PRESSED) or BSTATE_NORMAL) + end - FurC.GuiOnScroll(FurCGui_ListHolder_Slider, 0) - FurC.SetFilter() - FurC.UpdateGui() + FurC.GuiOnScroll(FurCGui_ListHolder_Slider, 0) + FurC.SetFilter() + FurC.UpdateGui() end local FURC_S_FILTERDEFAULT = GetString(SI_FURC_TEXTBOX_FILTER_DEFAULT) function FurC.GetSearchFilter() - if (not FurC.SearchFilter) or FurC.SearchFilter == FURC_S_FILTERDEFAULT then - FurC.SearchFilter = FurC_SearchBox:GetText() or "" - end - return FurC.SearchFilter or "" + if (not FurC.SearchFilter) or FurC.SearchFilter == FURC_S_FILTERDEFAULT then + FurC.SearchFilter = FurC_SearchBox:GetText() or "" + end + return FurC.SearchFilter or "" end local alreadySearching = false @@ -265,23 +265,23 @@ end function FurC.GuiSetSearchboxTextFrom(control) control = control or FurC_SearchBox - -- call asynchronely to prevent lagging. Praise votan. - task:Call(doSearchOnUpdate) + -- call asynchronely to prevent lagging. Praise votan. + task:Call(doSearchOnUpdate) end function FurC.GetHideBooks() - return FurC.settings["hideBooks"] + return FurC.settings["hideBooks"] end function FurC.SetHideBooks(value) - FurC.settings["hideBooks"] = value - FurC.UpdateGui() + FurC.settings["hideBooks"] = value + FurC.UpdateGui() end function FurC.GetMergeLuxuryAndSales() - return FurC.settings["mergeLuxuryAndSales"] + return FurC.settings["mergeLuxuryAndSales"] end function FurC.SetMergeLuxuryAndSales(value) - FurC.settings["mergeLuxuryAndSales"] = value - FurC.UpdateGui() + FurC.settings["mergeLuxuryAndSales"] = value + FurC.UpdateGui() end @@ -289,25 +289,25 @@ end --------- Dropdown -------- --------------------------- FurC.DropdownChoices = { - ["Source"] = nil, - ["Version"] = nil, - ["Character"] = nil, + ["Source"] = nil, + ["Version"] = nil, + ["Character"] = nil, } function FurC.GetDropdownChoice(dropdownName) - return (FurC.DropdownChoices[dropdownName] or FurC.GetDefaultDropdownChoice(dropdownName)) + return (FurC.DropdownChoices[dropdownName] or FurC.GetDefaultDropdownChoice(dropdownName)) end function FurC.GetDropdownText(dropdownName) - local dropdown = FurC.DropdownData[dropdownName] - local key = FurC.GetDropdownChoice(dropdownName) - return dropdown[key] + local dropdown = FurC.DropdownData[dropdownName] + local key = FurC.GetDropdownChoice(dropdownName) + return dropdown[key] end local function getDropdownIndex(dropdownName, value) - local dropdown = FurC.DropdownData["Choices"..dropdownName] - for listKey, listValue in pairs(dropdown) do - if listValue == value then return listKey end - end - dropdown[#dropdown+1] = value - return #dropdown + local dropdown = FurC.DropdownData["Choices"..dropdownName] + for listKey, listValue in pairs(dropdown) do + if listValue == value then return listKey end + end + dropdown[#dropdown+1] = value + return #dropdown end @@ -317,85 +317,85 @@ local dropdownData = FurC.DropdownData -- Character: Accountwide, crafter1, crafter2... -- Version: All, Homestead, Morrowind function FurC.SetDropdownChoice(dropdownName, textValue, dropdownIndex) - textValue = textValue or FurC.GetDefaultDropdownChoice(dropdownName) - local dropdownIndex = dropdownIndex or getDropdownIndex(dropdownName, textValue) or 0 + textValue = textValue or FurC.GetDefaultDropdownChoice(dropdownName) + local dropdownIndex = dropdownIndex or getDropdownIndex(dropdownName, textValue) or 0 - -- p("FurC.SetDropdownChoice(<<1>>, <<2>> (Index: <<3>>))", dropdownName, textValue, dropdownIndex) + -- p("FurC.SetDropdownChoice(<<1>>, <<2>> (Index: <<3>>))", dropdownName, textValue, dropdownIndex) - -- if we're setting the dropdown menu "source" to "purchaseable", set "character" to "All" - FurC.DropdownChoices[dropdownName] = dropdownIndex + -- if we're setting the dropdown menu "source" to "purchaseable", set "character" to "All" + FurC.DropdownChoices[dropdownName] = dropdownIndex - if dropdownName == "Source" then - if dropdownIndex > FURC_CRAFTING_UNKNOWN or dropdownIndex < FURC_CRAFTING then - FurC.DropdownChoices["Character"] = 1 - FurC_DropdownCharacter:GetNamedChild("SelectedItemText"):SetText(FurnitureCatalogue.DropdownData.ChoicesCharacter[1]) - end - end - -- if we're setting the characters array to something other than 1, we can't use source 1 or 5 - if dropdownName == "Character" and (dropdownIndex > 1) then - if FurC.DropdownChoices["Source"] > FURC_CRAFTING_UNKNOWN or FurC.DropdownChoices["Source"] < FURC_CRAFTING then - local knownIndex = FURC_CRAFTING_KNOWN - FurC.DropdownChoices["Source"] = knownIndex - FurC_DropdownSource:GetNamedChild("SelectedItemText"):SetText(FurnitureCatalogue.DropdownData.ChoicesSource[knownIndex]) - end - end + if dropdownName == "Source" then + if dropdownIndex > FURC_CRAFTING_UNKNOWN or dropdownIndex < FURC_CRAFTING then + FurC.DropdownChoices["Character"] = 1 + FurC_DropdownCharacter:GetNamedChild("SelectedItemText"):SetText(FurnitureCatalogue.DropdownData.ChoicesCharacter[1]) + end + end + -- if we're setting the characters array to something other than 1, we can't use source 1 or 5 + if dropdownName == "Character" and (dropdownIndex > 1) then + if FurC.DropdownChoices["Source"] > FURC_CRAFTING_UNKNOWN or FurC.DropdownChoices["Source"] < FURC_CRAFTING then + local knownIndex = FURC_CRAFTING_KNOWN + FurC.DropdownChoices["Source"] = knownIndex + FurC_DropdownSource:GetNamedChild("SelectedItemText"):SetText(FurnitureCatalogue.DropdownData.ChoicesSource[knownIndex]) + end + end - FurC.DropdownChoices[dropdownName] = dropdownIndex + FurC.DropdownChoices[dropdownName] = dropdownIndex - zo_callLater(function() FurC.UpdateGui() end, 500) + zo_callLater(function() FurC.UpdateGui() end, 500) end function FurC.GetDefaultDropdownChoiceText(dropdownName) - return FurC.DropdownData["Choices"..dropdownName][FurC.GetDefaultDropdownChoice(dropdownName)] + return FurC.DropdownData["Choices"..dropdownName][FurC.GetDefaultDropdownChoice(dropdownName)] end function FurC.GetDefaultDropdownChoice(dropdownName) - return FurC.settings.dropdownDefaults[dropdownName] + return FurC.settings.dropdownDefaults[dropdownName] end function FurC.SetDefaultDropdownChoice(dropdownName, value) - local dropdownIndex = getDropdownIndex(dropdownName, value) - local dropdown = FurC.DropdownData["Choices"..dropdownName] - FurC.settings.dropdownDefaults[dropdownName] = dropdownIndex - -- FurC.UpdateDropdownChoice(dropdownName, value, dropdownIndex) - -- FurC.UpdateGui() + local dropdownIndex = getDropdownIndex(dropdownName, value) + local dropdown = FurC.DropdownData["Choices"..dropdownName] + FurC.settings.dropdownDefaults[dropdownName] = dropdownIndex + -- FurC.UpdateDropdownChoice(dropdownName, value, dropdownIndex) + -- FurC.UpdateGui() end function FurC.GetResetDropdownChoice() - return FurC.settings["resetDropdownChoice"] + return FurC.settings["resetDropdownChoice"] end function FurC.SetResetDropdownChoice(value) - FurC.settings["resetDropdownChoice"] = value + FurC.settings["resetDropdownChoice"] = value end function FurC.GetDropdownChoiceTextual(dropdownName) - local value = FurC.GetDropdownChoice(dropdownName) - local dropdown = FurC.DropdownData["Choices"..dropdownName] - return FurC.DropdownData["Choices"..dropdownName][value] + local value = FurC.GetDropdownChoice(dropdownName) + local dropdown = FurC.DropdownData["Choices"..dropdownName] + return FurC.DropdownData["Choices"..dropdownName][value] end function FurC.GetDefaultDropdownChoiceTextual() - return FurC.DropdownData["Choices"..dropdownName][FurC.GetDefaultDropdownChoice(dropdownName)] + return FurC.DropdownData["Choices"..dropdownName][FurC.GetDefaultDropdownChoice(dropdownName)] end function FurC.GetAccountCrafters() - local ret = {} - for characterName, isCrafter in pairs(FurC.settings.accountCharacters) do - if isCrafter then table.insert(ret, characterName) end - end - return ret + local ret = {} + for characterName, isCrafter in pairs(FurC.settings.accountCharacters) do + if isCrafter then table.insert(ret, characterName) end + end + return ret end function FurC.GetAccountCharacters() - local ret = {} - for characterName, isCrafter in pairs(FurC.settings.accountCharacters) do - table.insert(ret, characterName) - end - return ret + local ret = {} + for characterName, isCrafter in pairs(FurC.settings.accountCharacters) do + table.insert(ret, characterName) + end + return ret end function FurC.GetSkipInitialScan() - return FurC.settings["skipInitialScan"] + return FurC.settings["skipInitialScan"] end function FurC.SetSkipInitialScan(value) - FurC.settings["skipInitialScan"] = value + FurC.settings["skipInitialScan"] = value end --------------------------- @@ -404,92 +404,92 @@ end --------------------------- function FurC.GetUseInventoryIcons() - return FurC.settings["useInventoryIcons"] + return FurC.settings["useInventoryIcons"] end function FurC.SetUseInventoryIcons(value) - FurC.settings["useInventoryIcons"] = value + FurC.settings["useInventoryIcons"] = value end function FurC.GetUseInventoryIconsOnChar() - return FurC.settings["useInventoryIconsOnChar"] + return FurC.settings["useInventoryIconsOnChar"] end function FurC.SetUseInventoryIconsOnChar(value) - FurC.settings["useInventoryIconsOnChar"] = value + FurC.settings["useInventoryIconsOnChar"] = value end function FurC.GetHideKnownInventoryIcons() - return FurC.settings["hideKnownInventoryIcons"] + return FurC.settings["hideKnownInventoryIcons"] end function FurC.SetHideKnownInventoryIcons(value) - FurC.settings["hideKnownInventoryIcons"] = value + FurC.settings["hideKnownInventoryIcons"] = value end function FurC.GetStartupSilently() - return FurC.settings["startupSilently"] + return FurC.settings["startupSilently"] end function FurC.SetStartupSilently(value) - FurC.settings["startupSilently"] = value; + FurC.settings["startupSilently"] = value; end function FurC.GetTinyUi() - return FurC.settings["useTinyUi"] + return FurC.settings["useTinyUi"] end function FurC.SetTinyUi(value) - FurC.settings["useTinyUi"] = value - FurC.SlotTemplate = "FurC_SlotTemplate" .. ((value and "Tiny") or "") - FurC.ApplyLineTemplate() + FurC.settings["useTinyUi"] = value + FurC.SlotTemplate = "FurC_SlotTemplate" .. ((value and "Tiny") or "") + FurC.ApplyLineTemplate() end function FurC.GetListOffset() - return FurC.ListOffset or 0 + return FurC.ListOffset or 0 end function FurC.SetListOffset(value) - FurC.ListOffset = value + FurC.ListOffset = value end function FurC.WipeDatabase() - d("|cFFFFFFresetting |r|c2266ffFurniture Catalogue |r|cFFFFFFdata...|r") - FurC.settings.data = {} - FurC.settings.accountCharacters = {} - FurC.settings.excelExport = {} - FurC.ScanRecipes(true, true) - -- d("FurnitureCatalogue: Scan complete") + d("|cFFFFFFresetting |r|c2266ffFurniture Catalogue |r|cFFFFFFdata...|r") + FurC.settings.data = {} + FurC.settings.accountCharacters = {} + FurC.settings.excelExport = {} + FurC.ScanRecipes(true, true) + -- d("FurnitureCatalogue: Scan complete") end function FurC.DeleteCharacter(characterName) - d("Now deleting recipe knowledge for " .. characterName) + d("Now deleting recipe knowledge for " .. characterName) - for key, value in pairs(FurC.settings.accountCharacters) do - if value == characterName then - FurC.settings.accountCharacters[key] = false - end - end - - for recipeKey, recipeArray in pairs(FurC.settings.data) do - if recipeArray.craftable then - recipeArray.characters[characterName] = nil - end - end + for key, value in pairs(FurC.settings.accountCharacters) do + if value == characterName then + FurC.settings.accountCharacters[key] = false + end + end - local guiDropdownEntries = FurC_Dropdown.comboBox.m_sortedItems - if nil == guiDropdownEntries then return end - for index, data in pairs(guiDropdownEntries) do - if data.name == characterName then - FurC_Dropdown.comboBox.m_sortedItems[index] = nil - return - end - end - d(zo_strformat("<<1>> deleted from |c2266ffFurniture Catalogue|r database. Entry will disappear from settings dropdown after the next reloadui.", characterName)) + for recipeKey, recipeArray in pairs(FurC.settings.data) do + if recipeArray.craftable then + recipeArray.characters[characterName] = nil + end + end + + local guiDropdownEntries = FurC_Dropdown.comboBox.m_sortedItems + if nil == guiDropdownEntries then return end + for index, data in pairs(guiDropdownEntries) do + if data.name == characterName then + FurC_Dropdown.comboBox.m_sortedItems[index] = nil + return + end + end + d(zo_strformat("<<1>> deleted from |c2266ffFurniture Catalogue|r database. Entry will disappear from settings dropdown after the next reloadui.", characterName)) end function FurC.GetCurrentCharacterName() - if nil == FurC.CharacterName then FurC.CharacterName = zo_strformat(GetUnitName('player')) end - return FurC.CharacterName + if nil == FurC.CharacterName then FurC.CharacterName = zo_strformat(GetUnitName('player')) end + return FurC.CharacterName end diff --git a/FurCTooltip.lua b/FurCTooltip.lua index c7acbb0..d5bd202 100644 --- a/FurCTooltip.lua +++ b/FurCTooltip.lua @@ -1,112 +1,112 @@ local async = LibStub("LibAsync") local task = async:Create("FurnitureCatalogue_Tooltip") -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args local function tryColorize(text) - if not (text and FurC.GetColouredTooltips()) then return text end - return text:gsub("cannot craft", "|cFF0000cannot craft|r"):gsub("Can be crafted", "|c00FF00Can be crafted|r") + if not (text and FurC.GetColouredTooltips()) then return text end + return text:gsub("cannot craft", "|cFF0000cannot craft|r"):gsub("Can be crafted", "|c00FF00Can be crafted|r") end local function addTooltipData(control, itemLink) - if FurC.GetDisableTooltips() then return end - local itemId, recipeArray = nil - if nil == itemLink or FURC_EMPTY_STRING == itemLink then return end - local isRecipe = IsItemLinkFurnitureRecipe(itemLink) + if FurC.GetDisableTooltips() then return end + local itemId, recipeArray = nil + if nil == itemLink or FURC_EMPTY_STRING == itemLink then return end + local isRecipe = IsItemLinkFurnitureRecipe(itemLink) - itemLink = (isRecipe and GetItemLinkRecipeResultItemLink(itemLink)) or itemLink + itemLink = (isRecipe and GetItemLinkRecipeResultItemLink(itemLink)) or itemLink if not (isRecipe or IsItemLinkPlaceableFurniture(itemLink)) then return end - itemId = FurC.GetItemId(itemLink) - recipeArray = FurC.Find(itemLink) - - -- |H0:item:118206:5:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h - - if not recipeArray then return end - - - local unknown = not FurC.CanCraft(itemId, recipeArray) - local stringTable = {} - - - local function add(t, arg) - if nil ~= arg then t[#t + 1] = arg end - return t - end - - -- if craftable: - if isRecipe or recipeArray.origin == FURC_CRAFTING then - if unknown and not FurC.GetHideUnknown() or not FurC.GetHideKnowledge() then - local crafterList = FurC.GetCrafterList(itemLink, recipeArray) - if crafterList then - stringTable = add(stringTable, tryColorize(crafterList)) - end - end - if not isRecipe and (not FurC.GetHideCraftingStation()) then - stringTable = add(stringTable, FurC.PrintCraftingStation(itemId, recipeArray)) - end - if isRecipe then - stringTable = add(stringTable, FurC.getRecipeSource(itemId, recipeArray)) - end - -- check if we should show mats - if not (FurC.GetHideMats() or isRecipe) then - stringTable = add(stringTable, FurC.GetMats(itemLink, recipeArray, true):gsub(", ", "\n")) - end - else - if not FurC.GetHideSource() then - stringTable = add(stringTable, FurC.GetItemDescription(itemId, recipeArray)) - end - stringTable = add(stringTable, recipeArray.achievement) - end - - if #stringTable == 0 then return end - - control:AddVerticalPadding(8) - ZO_Tooltip_AddDivider(control) - - for i = 1, #stringTable do - control:AddLine(zo_strformat("<<C:1>>", stringTable[i])) - end + itemId = FurC.GetItemId(itemLink) + recipeArray = FurC.Find(itemLink) + + -- |H0:item:118206:5:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h + + if not recipeArray then return end + + + local unknown = not FurC.CanCraft(itemId, recipeArray) + local stringTable = {} + + + local function add(t, arg) + if nil ~= arg then t[#t + 1] = arg end + return t + end + + -- if craftable: + if isRecipe or recipeArray.origin == FURC_CRAFTING then + if unknown and not FurC.GetHideUnknown() or not FurC.GetHideKnowledge() then + local crafterList = FurC.GetCrafterList(itemLink, recipeArray) + if crafterList then + stringTable = add(stringTable, tryColorize(crafterList)) + end + end + if not isRecipe and (not FurC.GetHideCraftingStation()) then + stringTable = add(stringTable, FurC.PrintCraftingStation(itemId, recipeArray)) + end + if isRecipe then + stringTable = add(stringTable, FurC.getRecipeSource(itemId, recipeArray)) + end + -- check if we should show mats + if not (FurC.GetHideMats() or isRecipe) then + stringTable = add(stringTable, FurC.GetMats(itemLink, recipeArray, true):gsub(", ", "\n")) + end + else + if not FurC.GetHideSource() then + stringTable = add(stringTable, FurC.GetItemDescription(itemId, recipeArray)) + end + stringTable = add(stringTable, recipeArray.achievement) + end + + if #stringTable == 0 then return end + + control:AddVerticalPadding(8) + ZO_Tooltip_AddDivider(control) + + for i = 1, #stringTable do + control:AddLine(zo_strformat("<<C:1>>", stringTable[i])) + end end local function TooltipHook(tooltipControl, method, linkFunc) - local origMethod = tooltipControl[method] + local origMethod = tooltipControl[method] - tooltipControl[method] = function(self, ...) - origMethod(self, ...) - addTooltipData(self, linkFunc(...)) - end + tooltipControl[method] = function(self, ...) + origMethod(self, ...) + addTooltipData(self, linkFunc(...)) + end end local function ReturnItemLink(itemLink) - return FurC.GetItemLink(itemLink) + return FurC.GetItemLink(itemLink) end do - local identifier = FurC.name .. "Tooltips" - -- hook real late - local function HookToolTips() - EVENT_MANAGER:UnregisterForUpdate(identifier) - TooltipHook(ItemTooltip, "SetBagItem", GetItemLink) - TooltipHook(ItemTooltip, "SetTradeItem", GetTradeItemLink) - TooltipHook(ItemTooltip, "SetBuybackItem", GetBuybackItemLink) - TooltipHook(ItemTooltip, "SetStoreItem", GetStoreItemLink) - TooltipHook(ItemTooltip, "SetAttachedMailItem", GetAttachedItemLink) - TooltipHook(ItemTooltip, "SetLootItem", GetLootItemLink) - TooltipHook(ItemTooltip, "SetTradingHouseItem", GetTradingHouseSearchResultItemLink) - TooltipHook(ItemTooltip, "SetTradingHouseListing", GetTradingHouseListingItemLink) - TooltipHook(ItemTooltip, "SetLink", ReturnItemLink) - TooltipHook(PopupTooltip, "SetLink", ReturnItemLink) - end - -- hook late - local function DeferHookToolTips() - EVENT_MANAGER:UnregisterForEvent(identifier, EVENT_PLAYER_ACTIVATED) - EVENT_MANAGER:RegisterForUpdate(identifier, 100, HookToolTips) - end - function FurC.CreateTooltips() - EVENT_MANAGER:RegisterForEvent(identifier, EVENT_PLAYER_ACTIVATED, DeferHookToolTips) - end + local identifier = FurC.name .. "Tooltips" + -- hook real late + local function HookToolTips() + EVENT_MANAGER:UnregisterForUpdate(identifier) + TooltipHook(ItemTooltip, "SetBagItem", GetItemLink) + TooltipHook(ItemTooltip, "SetTradeItem", GetTradeItemLink) + TooltipHook(ItemTooltip, "SetBuybackItem", GetBuybackItemLink) + TooltipHook(ItemTooltip, "SetStoreItem", GetStoreItemLink) + TooltipHook(ItemTooltip, "SetAttachedMailItem", GetAttachedItemLink) + TooltipHook(ItemTooltip, "SetLootItem", GetLootItemLink) + TooltipHook(ItemTooltip, "SetTradingHouseItem", GetTradingHouseSearchResultItemLink) + TooltipHook(ItemTooltip, "SetTradingHouseListing", GetTradingHouseListingItemLink) + TooltipHook(ItemTooltip, "SetLink", ReturnItemLink) + TooltipHook(PopupTooltip, "SetLink", ReturnItemLink) + end + -- hook late + local function DeferHookToolTips() + EVENT_MANAGER:UnregisterForEvent(identifier, EVENT_PLAYER_ACTIVATED) + EVENT_MANAGER:RegisterForUpdate(identifier, 100, HookToolTips) + end + function FurC.CreateTooltips() + EVENT_MANAGER:RegisterForEvent(identifier, EVENT_PLAYER_ACTIVATED, DeferHookToolTips) + end end diff --git a/FurCUtil.lua b/FurCUtil.lua index 8b7f6b7..8e36d04 100644 --- a/FurCUtil.lua +++ b/FurCUtil.lua @@ -1,40 +1,40 @@ -local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args +local p = FurC.DebugOut -- debug function calling zo_strformat with up to 10 args -- ruthlessly stolen from TextureIt function FurC.SortTable(tTable, sortKey, SortOrderUp) - local keys = {} - for k in pairs(tTable) do table.insert(keys, k) end - table.sort(keys, function(a, b) - if nil == tTable[a] or nil == tTable[b] then + local keys = {} + for k in pairs(tTable) do table.insert(keys, k) end + table.sort(keys, function(a, b) + if nil == tTable[a] or nil == tTable[b] then - elseif nil == tTable[a][sortKey] then + elseif nil == tTable[a][sortKey] then return false - -- d(tTable[a]) - elseif nil == tTable[b][sortKey] then + -- d(tTable[a]) + elseif nil == tTable[b][sortKey] then return true - -- d(tTable[b]) - else - if SortOrderUp then - return tTable[a][sortKey] > tTable[b][sortKey] - else - return tTable[a][sortKey] < tTable[b][sortKey] - end - end + -- d(tTable[b]) + else + if SortOrderUp then + return tTable[a][sortKey] > tTable[b][sortKey] + else + return tTable[a][sortKey] < tTable[b][sortKey] + end + end - end) + end) - local ret = {} - local scannedLinks = {} - local itemLink, entry - for _, k in ipairs(keys) do - entry = tTable[k] - -- d(entry) - itemLink = entry["itemLink"] - ingredients = entry["ingredients"] - local index = scannedLinks[itemLink] or k + local ret = {} + local scannedLinks = {} + local itemLink, entry + for _, k in ipairs(keys) do + entry = tTable[k] + -- d(entry) + itemLink = entry["itemLink"] + ingredients = entry["ingredients"] + local index = scannedLinks[itemLink] or k - table.insert(ret, entry) - end + table.insert(ret, entry) + end - return ret + return ret end diff --git a/FurnitureCatalogue_DevUtility/00_startup.lua b/FurnitureCatalogue_DevUtility/00_startup.lua index 14deaba..90727ff 100644 --- a/FurnitureCatalogue_DevUtility/00_startup.lua +++ b/FurnitureCatalogue_DevUtility/00_startup.lua @@ -20,21 +20,21 @@ local active = string.find(GetWorldName(), "PTS") local function p(output, a1, a2, a3, a4, a5) - if a5 then - d(zo_strformat(output, a1, a2, a3, a4, a5)) - elseif a4 then - d(zo_strformat(output, a1, a2, a3, a4)) - elseif a3 then - d(zo_strformat(output, a1, a2, a3)) - elseif a2 then - d(zo_strformat(output, a1, a2)) - elseif a1 then - d(zo_strformat(output, a1)) - elseif output then - d(zo_strformat(output)) - else - d("\n") - end + if a5 then + d(zo_strformat(output, a1, a2, a3, a4, a5)) + elseif a4 then + d(zo_strformat(output, a1, a2, a3, a4)) + elseif a3 then + d(zo_strformat(output, a1, a2, a3)) + elseif a2 then + d(zo_strformat(output, a1, a2)) + elseif a1 then + d(zo_strformat(output, a1)) + elseif output then + d(zo_strformat(output)) + else + d("\n") + end end this.p = p @@ -70,7 +70,7 @@ SLASH_COMMANDS["/furcdev"] = slash_cmd function FurCDevUtility_Initialize(eventCode, addonName) - if addonName ~= this.name then return end + if addonName ~= this.name then return end this.textbox = FurCDevControlBox this.textbox:SetMaxInputChars(3000) this.InitRightclickMenu() diff --git a/FurnitureCatalogue_DevUtility/Bindings.xml b/FurnitureCatalogue_DevUtility/Bindings.xml index 26c8274..3783365 100644 --- a/FurnitureCatalogue_DevUtility/Bindings.xml +++ b/FurnitureCatalogue_DevUtility/Bindings.xml @@ -3,8 +3,8 @@ <Category name="Furniture Catalogue Dev"> <Action name="FURC_CONCAT_TO_TEXTBOX"> <Down> - FurnitureCatalogueDevUtility_AddToTextbox() - </Down> + FurnitureCatalogueDevUtility_AddToTextbox() + </Down> </Action> </Category> </Layer> diff --git a/FurnitureCatalogue_DevUtility/ContextMenu.lua b/FurnitureCatalogue_DevUtility/ContextMenu.lua index 18514d3..ad4f1ec 100644 --- a/FurnitureCatalogue_DevUtility/ContextMenu.lua +++ b/FurnitureCatalogue_DevUtility/ContextMenu.lua @@ -103,23 +103,23 @@ local function doNothing() return end local S_ADD_TO_BOX = "Add data to textbox" local S_DIVIDER = "-" local function addMenuItems() - AddCustomMenuItem(S_DIVIDER, doNothing, MENU_ADD_OPTION_LABEL) - AddCustomMenuItem(S_ADD_TO_BOX, concatToTextbox, MENU_ADD_OPTION_LABEL) + AddCustomMenuItem(S_DIVIDER, doNothing, MENU_ADD_OPTION_LABEL) + AddCustomMenuItem(S_ADD_TO_BOX, concatToTextbox, MENU_ADD_OPTION_LABEL) end -function FurCDevControl_HandleClickEvent(itemLink, button, control) -- button being mouseButton here +function FurCDevControl_HandleClickEvent(itemLink, button, control) -- button being mouseButton here if not isMana then return end if (type(itemLink) == 'string' and #itemLink > 0) then - local handled = LINK_HANDLER:FireCallbacks(LINK_HANDLER.LINK_MOUSE_UP_EVENT, itemLink, button, ZO_LinkHandler_ParseLink(itemLink)) - if (not handled) then - FurCDevControl_LinkHandlerBackup_OnLinkMouseUp(itemLink, button, control) + local handled = LINK_HANDLER:FireCallbacks(LINK_HANDLER.LINK_MOUSE_UP_EVENT, itemLink, button, ZO_LinkHandler_ParseLink(itemLink)) + if (not handled) then + FurCDevControl_LinkHandlerBackup_OnLinkMouseUp(itemLink, button, control) -- end - if (button == 2 and itemLink and #itemLink > 0) then - addMenuItems() - end - ShowMenu(control) + if (button == 2 and itemLink and #itemLink > 0) then + addMenuItems() + end + ShowMenu(control) end end end @@ -130,12 +130,12 @@ function FurCDevControl_HandleInventoryContextMenu(control) control = control or moc() local name, price, canBuy, currencyQuantity1, currencyQuantity2 - local st = ZO_InventorySlot_GetType(control) + local st = ZO_InventorySlot_GetType(control) cachedItemLink = nil if st == SLOT_TYPE_ITEM - or st == SLOT_TYPE_BANK_ITEM - or st == SLOT_TYPE_GUILD_BANK_ITEM - or st == SLOT_TYPE_TRADING_HOUSE_POST_ITEM then + or st == SLOT_TYPE_BANK_ITEM + or st == SLOT_TYPE_GUILD_BANK_ITEM + or st == SLOT_TYPE_TRADING_HOUSE_POST_ITEM then local bagId, slotId = ZO_Inventory_GetBagAndIndex(control) cachedItemLink = GetItemLink(bagId, slotId, linkStyle) name = GetItemLinkName(cachedItemLink) @@ -154,10 +154,10 @@ function FurCDevControl_HandleInventoryContextMenu(control) if not FurC.Find(cachedItemLink) then return end - zo_callLater(function() - addMenuItems() - ShowMenu() - end, 80) + zo_callLater(function() + addMenuItems() + ShowMenu() + end, 80) end @@ -165,28 +165,28 @@ end function this.OnControlMouseUp(control, button) if not isMana then return end - if (not control) or button ~= 2 then return end + if (not control) or button ~= 2 then return end - if not control.itemLink or #control.itemLink == 0 then return end + if not control.itemLink or #control.itemLink == 0 then return end cachedItemLink = control.itemLink - zo_callLater(function() - ItemTooltip:SetHidden(true) - ClearMenu() - addMenuItems() - ShowMenu() - end, 50) + zo_callLater(function() + ItemTooltip:SetHidden(true) + ClearMenu() + addMenuItems() + ShowMenu() + end, 50) end function this.InitRightclickMenu() if not isMana then return end - FurCDevControl_LinkHandlerBackup_OnLinkMouseUp = ZO_LinkHandler_OnLinkMouseUp - ZO_LinkHandler_OnLinkMouseUp = function(itemLink, button, control) + FurCDevControl_LinkHandlerBackup_OnLinkMouseUp = ZO_LinkHandler_OnLinkMouseUp + ZO_LinkHandler_OnLinkMouseUp = function(itemLink, button, control) FurCDevControl_HandleClickEvent(itemLink, button, control) end - ZO_PreHook('ZO_InventorySlot_ShowContextMenu', function(rowControl) - FurCDevControl_HandleInventoryContextMenu(rowControl) - end) + ZO_PreHook('ZO_InventorySlot_ShowContextMenu', function(rowControl) + FurCDevControl_HandleInventoryContextMenu(rowControl) + end) end diff --git a/FurnitureCatalogue_DevUtility/xml.xml b/FurnitureCatalogue_DevUtility/xml.xml index e4553d9..e3c8e44 100644 --- a/FurnitureCatalogue_DevUtility/xml.xml +++ b/FurnitureCatalogue_DevUtility/xml.xml @@ -1,29 +1,29 @@ <GuiXml> - <Controls> - <TopLevelControl name="FurCDevControl" clampedToScreen="true" movable="true" mouseEnabled="true" hidden="true" resizeHandleSize="10"> - <Dimensions x="600" y="500"/> - <Anchor point="CENTER" relativeTo="GUI_ROOT" relativePoint="CENTER" offsetX="-125" offsetY="-140" /> - <Controls> - <Backdrop name="$(parent)_BG" inherits="ZO_DefaultBackdrop"><AnchorFill/></Backdrop> + <Controls> + <TopLevelControl name="FurCDevControl" clampedToScreen="true" movable="true" mouseEnabled="true" hidden="true" resizeHandleSize="10"> + <Dimensions x="600" y="500"/> + <Anchor point="CENTER" relativeTo="GUI_ROOT" relativePoint="CENTER" offsetX="-125" offsetY="-140" /> + <Controls> + <Backdrop name="$(parent)_BG" inherits="ZO_DefaultBackdrop"><AnchorFill/></Backdrop> <Button name="$(parent)_hide" inherits="ZO_ButtonBehaviorClickSound" > <OnClicked>FurCDevUtility.setHidden(true)</OnClicked> - <Dimensions x="30" y="30" /> + <Dimensions x="30" y="30" /> <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="10" offsetY="10" /> <Textures - normal ="/esoui/art/buttons/decline_up.dds" - pressed ="/esoui/art/buttons/decline_down.dds" - mouseOver ="/esoui/art/buttons/decline_over.dds" - /> + normal ="/esoui/art/buttons/decline_up.dds" + pressed ="/esoui/art/buttons/decline_down.dds" + mouseOver ="/esoui/art/buttons/decline_over.dds" + /> </Button> <Button name="$(parent)_clear" inherits="ZO_ButtonBehaviorClickSound" > <OnClicked>FurCDevUtility.clearControl()</OnClicked> - <Dimensions x="40" y="40" /> + <Dimensions x="40" y="40" /> <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-10" offsetY="10" /> <Textures - normal ="/esoui/art/help/help_tabicon_feedback_up.dds" - pressed ="/esoui/art/help/help_tabicon_feedback_down.dds " - mouseOver ="/esoui/art/help/help_tabicon_feedback_over.dds" - /> + normal ="/esoui/art/help/help_tabicon_feedback_up.dds" + pressed ="/esoui/art/help/help_tabicon_feedback_down.dds " + mouseOver ="/esoui/art/help/help_tabicon_feedback_over.dds" + /> </Button> <EditBox name="$(parent)Box" inherits="ZO_DefaultEditMultiLine ZO_DefaultEditForDarkBackdrop" > diff --git a/FurnitureCatalogue_Export/FurCDataExport.lua b/FurnitureCatalogue_Export/FurCDataExport.lua index 77d218f..96f2e94 100644 --- a/FurnitureCatalogue_Export/FurCDataExport.lua +++ b/FurnitureCatalogue_Export/FurCDataExport.lua @@ -1,49 +1,49 @@ -FurnitureCatalogue_Export = {} -FurCExport = FurnitureCatalogue_Export +FurnitureCatalogue_Export = {} +FurCExport = FurnitureCatalogue_Export -local defaults = { +local defaults = { } local function getSortTable(tbl) - list = {} - for name, value in pairs(tbl) do - list[#list+1] = name - end - table.sort(list) - return list + list = {} + for name, value in pairs(tbl) do + list[#list+1] = name + end + table.sort(list) + return list end function FurCExport.Export() - - local itemNames = {} - local itemName - for itemId, recipeArray in pairs(FurC.settings.data) do - if recipeArray.origin == FURC_CRAFTING then - itemNames[GetItemLinkName(FurC.GetItemLink(itemId))] = FurC.GetItemLink(itemId) - end - end - - local tkeys = getSortTable(itemNames) - local exportKnown = {} - local exportUnknown = {} - for key, itemName in pairs(tkeys) do - local itemLink = itemNames[itemName] - local recipeArray = FurC.Find(itemLink) - local known = FurC.IsAccountKnown(itemLink, recipeArray) - - local exportArray = (known and exportKnown) or exportUnknown - local mats = FurC.GetMats(itemLink, recipeArray, false, true) - local knowledge = (known and (FurC.GetCrafterList(itemLink, recipeArray) .. ": "):gsub("Can be crafted by ", "")) or "" - local exportString = zo_strformat("<<1>><<2>>", knowledge, mats) - exportArray[itemName] = exportString - end - - FurCExport.settings.known = exportKnown - FurCExport.settings.unknown = exportUnknown - ReloadUI() - + + local itemNames = {} + local itemName + for itemId, recipeArray in pairs(FurC.settings.data) do + if recipeArray.origin == FURC_CRAFTING then + itemNames[GetItemLinkName(FurC.GetItemLink(itemId))] = FurC.GetItemLink(itemId) + end + end + + local tkeys = getSortTable(itemNames) + local exportKnown = {} + local exportUnknown = {} + for key, itemName in pairs(tkeys) do + local itemLink = itemNames[itemName] + local recipeArray = FurC.Find(itemLink) + local known = FurC.IsAccountKnown(itemLink, recipeArray) + + local exportArray = (known and exportKnown) or exportUnknown + local mats = FurC.GetMats(itemLink, recipeArray, false, true) + local knowledge = (known and (FurC.GetCrafterList(itemLink, recipeArray) .. ": "):gsub("Can be crafted by ", "")) or "" + local exportString = zo_strformat("<<1>><<2>>", knowledge, mats) + exportArray[itemName] = exportString + end + + FurCExport.settings.known = exportKnown + FurCExport.settings.unknown = exportUnknown + ReloadUI() + end SLASH_COMMANDS["/furcexport"] = function() FurCExport.Export() end @@ -51,11 +51,11 @@ SLASH_COMMANDS["/furcexport"] = function() FurCExport.Export() end -- initialization stuff function FurCExport_Initialize(eventCode, addOnName) - if (addOnName ~= "FurnitureCatalogue_Export") then return end - - FurCExport.settings = ZO_SavedVars:NewAccountWide("FurnitureCatalogue_Export", nil, 0, defaults) - FurCExport.makeSettings() - EVENT_MANAGER:UnregisterForEvent("FurnitureCatalogue_Export", EVENT_ADD_ON_LOADED) + if (addOnName ~= "FurnitureCatalogue_Export") then return end + + FurCExport.settings = ZO_SavedVars:NewAccountWide("FurnitureCatalogue_Export", nil, 0, defaults) + FurCExport.makeSettings() + EVENT_MANAGER:UnregisterForEvent("FurnitureCatalogue_Export", EVENT_ADD_ON_LOADED) end diff --git a/FurnitureCatalogue_Export/FurCDataExport_Menu.lua b/FurnitureCatalogue_Export/FurCDataExport_Menu.lua index f20166d..6f1ce05 100644 --- a/FurnitureCatalogue_Export/FurCDataExport_Menu.lua +++ b/FurnitureCatalogue_Export/FurCDataExport_Menu.lua @@ -1,41 +1,41 @@ function FurCExport.makeSettings() - - local settings = FurCExport.settings + + local settings = FurCExport.settings - local LAM = LibStub:GetLibrary("LibAddonMenu-2.0") - local panelData = { - type = "panel", - name = "FurnitureCatalogue_Export", - displayName = "FurnitureCatalogue Export", - author = "manavortex", - version = "1.0.0", - registerForRefresh = true, - registerForDefaults = true, - } + local LAM = LibStub:GetLibrary("LibAddonMenu-2.0") + local panelData = { + type = "panel", + name = "FurnitureCatalogue_Export", + displayName = "FurnitureCatalogue Export", + author = "manavortex", + version = "1.0.0", + registerForRefresh = true, + registerForDefaults = true, + } - LAM:RegisterAddonPanel("FurnitureCatalogueExport_OptionsPanel", panelData) - local optionsData = { -- optionsData - - - { -- description - type = "description", - name = "FurnitureCatalogue Export", - text = ( - "After an UI reload, FurnitureCatalogue's database can be found in your \n" .. - "SavedVariables folder inside FurnitureCatalogue_Export.lua \n" - ), - }, - { -- button: Reset database - type = "button", - name = "Export data", - warning = "This will reload the UI", - func = function() - FurCExport.Export() - end, - }, - } - - - LAM:RegisterOptionControls("FurnitureCatalogueExport_OptionsPanel", optionsData) + LAM:RegisterAddonPanel("FurnitureCatalogueExport_OptionsPanel", panelData) + local optionsData = { -- optionsData + + + { -- description + type = "description", + name = "FurnitureCatalogue Export", + text = ( + "After an UI reload, FurnitureCatalogue's database can be found in your \n" .. + "SavedVariables folder inside FurnitureCatalogue_Export.lua \n" + ), + }, + { -- button: Reset database + type = "button", + name = "Export data", + warning = "This will reload the UI", + func = function() + FurCExport.Export() + end, + }, + } + + + LAM:RegisterOptionControls("FurnitureCatalogueExport_OptionsPanel", optionsData) end \ No newline at end of file diff --git a/data/01_Homestead/H_Rolis.lua b/data/01_Homestead/H_Rolis.lua index 131ec7c..757bf4f 100644 --- a/data/01_Homestead/H_Rolis.lua +++ b/data/01_Homestead/H_Rolis.lua @@ -1,34 +1,34 @@ -FurC.Rolis = FurC.Rolis or {} +FurC.Rolis = FurC.Rolis or {} FurC.Rolis_Recipes = FurC.Rolis_Recipes or {} FurC.Rolis[FURC_HOMESTEAD] = { - -- Alchemy station - [118328] = 35, - -- Blacksmithing station - [119781] = 35, - -- Clothing station - [119707] = 35, - -- Dye Station - [118329] = 35, - -- Enchanting station - [118330] = 35, - -- Provisioning station - [118327] = 35, - -- Woodworking station - [119744] = 35, + -- Alchemy station + [118328] = 35, + -- Blacksmithing station + [119781] = 35, + -- Clothing station + [119707] = 35, + -- Dye Station + [118329] = 35, + -- Enchanting station + [118330] = 35, + -- Provisioning station + [118327] = 35, + -- Woodworking station + [119744] = 35, - -- Attunable Blacksmithing station - [119594] = 250, - -- Attunable Clothing station - [119821] = 250, - -- Attunable Woodworking station - [119822] = 250, + -- Attunable Blacksmithing station + [119594] = 250, + -- Attunable Clothing station + [119821] = 250, + -- Attunable Woodworking station + [119822] = 250, } FurC.Rolis_Recipes[FURC_HOMESTEAD] = { - 121207, -- Target Skeleton - 121315, -- Robust Target Skeleton - 126582, -- Target Centurion - 126583, -- Robust Target Centurion + 121207, -- Target Skeleton + 121315, -- Robust Target Skeleton + 126582, -- Target Centurion + 126583, -- Robust Target Centurion } diff --git a/data/03_Reach/HotR_LuxuryFurnisher.lua b/data/03_Reach/HotR_LuxuryFurnisher.lua index ada7933..e38a7eb 100644 --- a/data/03_Reach/HotR_LuxuryFurnisher.lua +++ b/data/03_Reach/HotR_LuxuryFurnisher.lua @@ -4,18 +4,7 @@ FurC.LuxuryFurnisher[FURC_REACH] = { -- Oct. 21 [132155] = { - -- Witch's Torch, Wretched - itemPrice = 5000, - itemDate = "2017-10-20", - }, - [132154] = { -- Witch's Totem, Bog - itemPrice = 50000, - itemDate = "2017-10-20", - }, - [132153] = { -- Witch's Tree, Captive - itemPrice = 35000, - itemDate = "2017-10-20", - }, + -- Oct. 14 [119977] = { -- Orcish War Totem diff --git a/data/03_Reach/HotR_Rollis.lua b/data/03_Reach/HotR_Rollis.lua index f421cad..1d443b5 100644 --- a/data/03_Reach/HotR_Rollis.lua +++ b/data/03_Reach/HotR_Rollis.lua @@ -1,10 +1,10 @@ FurC.Rolis_Recipes = FurC.Rolis_Recipes or {} FurC.Rolis_Recipes[FURC_REACH] = { - [132195] = true, -- Telvanni Candelabra, Masterwork - [132194] = true, -- Mammoth Cheese, Mastercrafted - [132191] = true, -- Dwarven Gyroscope - [132190] = true, -- Mages Apparatus, Master - [132192] = true, -- Dres Sewing Kit - [132193] = true, -- Hlaalu Bathtub, Masterwork + [132195] = true, -- Telvanni Candelabra, Masterwork + [132194] = true, -- Mammoth Cheese, Mastercrafted + [132191] = true, -- Dwarven Gyroscope + [132190] = true, -- Mages Apparatus, Master + [132192] = true, -- Dres Sewing Kit + [132193] = true, -- Hlaalu Bathtub, Masterwork } diff --git a/data/100025.lua b/data/100025.lua index 98e4c87..c2bf35c 100644 --- a/data/100025.lua +++ b/data/100025.lua @@ -109,8 +109,8 @@ FurC.MiscItemSources[FURC_SLAVES] = { [145403] = GetString(SI_FURC_RUMOUR_SOURCE_ITEM), -- Jel Parchment [146047] = GetString(SI_FURC_RUMOUR_SOURCE_ITEM), -- From Old Life To New }, - - + + [FURC_CROWN] = { [145433] = getCrownPrice(1), -- Plant, Rafflesia [145459] = getCrownPrice(1), -- Murkmire Kiln, Ancient Stone diff --git a/data/LuxuryFurnisher.lua b/data/LuxuryFurnisher.lua index d44c0fa..5a1df08 100644 --- a/data/LuxuryFurnisher.lua +++ b/data/LuxuryFurnisher.lua @@ -2,27 +2,44 @@ FurC.LuxuryFurnisher = FurC.LuxuryFurnisher or {} FurC.LuxuryFurnisher[FURC_WEREWOLF] = { - - [141759] = { -- Orcish Gazebo, Orsinium - itemPrice = 20000, - itemDate = "2018-10-13", - }, - [132152] = { -- Orsinium Sarcophagus, Warrior's - itemPrice = 35000, - itemDate = "2018-10-13", - }, - [132150] = { -- Orsinium Totem, Honor - itemPrice = 20000, - itemDate = "2018-10-13", - }, - [132151] = { -- Orsinium Totem, Obedience - itemPrice = 20000, - itemDate = "2018-10-13", - }, - [132149] = { -- Orsinium Totem, Strength - itemPrice = 20000, - itemDate = "2018-10-13", - }, + + [141760] = { -- Witch's Tree, Charred + itemPrice = 5000, + itemDate = "2018-10-20", + }, +-- Witch's Torch, Wretched + itemPrice = 5000, + itemDate = "2018-10-20", + }, + [132154] = { -- Witch's Totem, Bog + itemPrice = 50000, + itemDate = "2018-10-20", + }, + [132153] = { -- Witch's Tree, Captive + itemPrice = 35000, + itemDate = "2018-10-20", + }, + + [141759] = { -- Orcish Gazebo, Orsinium + itemPrice = 20000, + itemDate = "2018-10-13", + }, + [132152] = { -- Orsinium Sarcophagus, Warrior's + itemPrice = 35000, + itemDate = "2018-10-13", + }, + [132150] = { -- Orsinium Totem, Honor + itemPrice = 20000, + itemDate = "2018-10-13", + }, + [132151] = { -- Orsinium Totem, Obedience + itemPrice = 20000, + itemDate = "2018-10-13", + }, + [132149] = { -- Orsinium Totem, Strength + itemPrice = 20000, + itemDate = "2018-10-13", + }, [141758] = { -- Orcish Wagon, Merchant diff --git a/data/MiscItemSources.lua b/data/MiscItemSources.lua index 10746a2..eda6736 100644 --- a/data/MiscItemSources.lua +++ b/data/MiscItemSources.lua @@ -1,30 +1,30 @@ -- use constants because it's a huge performance gain due to how LUA handles strings... at least unless siri lied :P -local FURC_CANBEPICKED_WW = GetString(SI_FURC_CANBEPICKED) .. " from woodworkers" -local FURC_CANBEPICKED_ASS = GetString(SI_FURC_CANBEPICKED) .. " from outlaws and assassins" -local FURC_CANBEPICKED_GUARD = GetString(SI_FURC_CANBEPICKED) .. " from guards" +local FURC_CANBEPICKED_WW = GetString(SI_FURC_CANBEPICKED) .. " from woodworkers" +local FURC_CANBEPICKED_ASS = GetString(SI_FURC_CANBEPICKED) .. " from outlaws and assassins" +local FURC_CANBEPICKED_GUARD = GetString(SI_FURC_CANBEPICKED) .. " from guards" -local FURC_CANBESTOLENINCC = GetString(SI_FURC_CANBESTOLEN) .. " in Clockwork City" +local FURC_CANBESTOLENINCC = GetString(SI_FURC_CANBESTOLEN) .. " in Clockwork City" local FURC_CANBESTOLEN_SCHOLARS = GetString(SI_FURC_CANBESTOLEN) .. " from scholars" -local FURC_CANBESTOLEN_NERDS = FURC_CANBESTOLEN_SCHOLARS .. " and mages" -local FURC_CANBESTOLEN_RELIG = GetString(SI_FURC_CANBESTOLEN) .. " from priests and pilgrims" -local FURC_CANBESTOLEN_THIEF = GetString(SI_FURC_CANBESTOLEN) .. " from thieves" -local FURC_CANBESTOLEN_WW = GetString(SI_FURC_CANBESTOLEN) .. " from woodworkers" +local FURC_CANBESTOLEN_NERDS = FURC_CANBESTOLEN_SCHOLARS .. " and mages" +local FURC_CANBESTOLEN_RELIG = GetString(SI_FURC_CANBESTOLEN) .. " from priests and pilgrims" +local FURC_CANBESTOLEN_THIEF = GetString(SI_FURC_CANBESTOLEN) .. " from thieves" +local FURC_CANBESTOLEN_WW = GetString(SI_FURC_CANBESTOLEN) .. " from woodworkers" local FURC_CANBESTOLEN_DRUNK = GetString(SI_FURC_CANBESTOLEN) .. " from drunkards" -local FURC_PLANTS_VVARDENFELL = GetString(FURC_PLANTS) .. " on Vvardenfell" -local FURC_CANBESTOLEN_WROTHGAR = GetString(SI_FURC_CANBESTOLEN) .. " in Wrothgar" +local FURC_PLANTS_VVARDENFELL = GetString(SI_FURC_PLANTS) .. " on Vvardenfell" +local FURC_CANBESTOLEN_WROTHGAR = GetString(SI_FURC_CANBESTOLEN) .. " in Wrothgar" -local FURC_AUTOMATON_CC = GetString(SI_FURC_AUTOMATON) .. " in Clockwork City" -local FURC_AUTOMATON_VV = GetString(SI_FURC_AUTOMATON) .. " on Vvardenfell" +local FURC_AUTOMATON_CC = GetString(SI_FURC_AUTOMATON) .. " in Clockwork City" +local FURC_AUTOMATON_VV = GetString(SI_FURC_AUTOMATON) .. " on Vvardenfell" local FURC_HARVEST_CHARBOR = GetString(SI_FURC_HARVEST) .. " in Coldharbour" local FURC_SCAMBOX_F_ATRO = zo_strformat("<<1>> (<<2>>)", GetString(SI_FURC_SCAMBOX), GetString(SI_FURC_FLAME_ATRONACH)) local FURC_SCAMBOX_DWEMER = zo_strformat("<<1>> (<<2>>)", GetString(SI_FURC_SCAMBOX), GetString(SI_FURC_DWEMER)) -local FURC_DB_POISON = zo_strformat("<<1>> <<2>>", GetString(SI_FURC_DB), GetString(SI_FURC_DB_POISON)) -local FURC_DB_SNEAKY = zo_strformat("<<1>> <<2>>", GetString(SI_FURC_DB), GetString(SI_FURC_DB_STEALTH)) +local FURC_DB_POISON = zo_strformat("<<1>> <<2>>", GetString(SI_FURC_DB), GetString(SI_FURC_DB_POISON)) +local FURC_DB_SNEAKY = zo_strformat("<<1>> <<2>>", GetString(SI_FURC_DB), GetString(SI_FURC_DB_STEALTH)) local onSummerset = " on Summerset" @@ -48,19 +48,19 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [141847] = GetString(SI_FURC_WW_DUNGEON_DROP), -- Animal Bones, Gnawed [141848] = GetString(SI_FURC_WW_DUNGEON_DROP), -- Animal Bones, Jumbled [141849] = GetString(SI_FURC_WW_DUNGEON_DROP), -- Animal Bones, Fresh - - + + [141921] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Bowl, Geometric Pattern - + [141923] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Amphora, Seed Pattern [141922] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Dish, Geometric Pattern [141924] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Vase, Scale Pattern [141925] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Hearth Shrine, Sithis Relief [141926] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Hearth Shrine, Sithis Figure [141920] = GetString(SI_FURC_SLAVES_PREQUEST), -- Murkmire Brazier, Ceremonial - + }, - [FURC_RUMOUR] = { + [FURC_RUMOUR] = { [141832] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tree, Robust Fig [141833] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tree, Ancient Fig [141834] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tree, Towering Fig @@ -72,7 +72,7 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [141844] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Plants, Amber Spadeleaf Cluster [141845] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Mushrooms, Climbing Ambershine [141846] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Mushrooms, Ambershine Cluster - + [141853] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Statue of Hircine's Bitter Mercy [141854] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Decorative Hollowjack Flame-Skull [141855] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Decorative Hollowjack Wraith-Lantern @@ -117,20 +117,20 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [141819] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Shrub, Blooming Sunbird [141768] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ayleid Constellation Stele, The Lover [141769] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ayleid Constellation Stele, The Atronach - + [134251] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Coldharbour Bookshelf, Filled - [134252] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Coldharbour Bookshelf, Black Laboratory + [134252] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Coldharbour Bookshelf, Black Laboratory [120873] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Coffin [120871] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Deadric Vase, Spiked [120867] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Pike, Clannfear Head [120866] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Brazier, Tabletop [120865] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Table [120863] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Light Pillar - + [120984] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Plant, Goldenrod Cluster [120985] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dark Elf Lightpost, Single [120987] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dark Elf Lightpost, Capped - + [126114] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Statue of Azura, Queen of Dawn and Dusk [126115] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Statue of Azura's Moon [126116] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Statue of Azura's Sun @@ -142,7 +142,7 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [126132] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Resplendent Sweetroll [121015] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Shrub, Sparse Green [120000] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Broken Chain - + [126136] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dwarven Lantern, Powered [126138] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- A Guide to Dwemer Mega-Structures [126140] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Vivec's Grand Bed @@ -161,23 +161,23 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [121049] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Parcels, Wrapped [134475] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Statue of Malacath, Orc-Father [131424] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Fogs of the Hag Fen - - + + [134686] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Sithis, The Dread Father [125480] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Banner, Clavicus Vile [125489] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Brazier, Flaming - + [134853] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Peryite, The Taskmaster [134854] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tapestry of Peryite [134855] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Banner of Peryite [134856] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dragon Skeleton, Mid-Flight [134861] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- The History of Zaan The Scalecaller - + [134857] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dragon Priest Frieze: Triumph [134858] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dragon Priest Frieze: Exodus [134859] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dragon Priest Frieze: Restoration [134860] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dragon Priest Frieze: Ascension - + [134864] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dragon Cranium, Ancient [134865] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Unidentified Bones, Gargantuan [134866] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Lamia Cranium, Ancient @@ -185,7 +185,7 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [134868] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Khajiit Skull, Complete [134869] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Orc Skull, Complete [125654] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tapestry, Clavicus Vile - + [134871] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ancient Nord Urn, Dragon Crest [134873] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ancient Nord Bookshelf, Wide [134874] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ancient Nord Bookshelf, Narrow @@ -195,11 +195,11 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [134862] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ancient Nord Runestone, Memorial [134870] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ancient Nord Chest, Dragon Crest [134878] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ancient Nord Funerary Jar, Dragon Crest - + [134879] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Hubalajad's Reflection [134881] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- In Defense of Prince Hubalajad [134882] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Gold Drakes, Pristine - + [134880] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ra Gada Reliquary, Miniature Palace [134883] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ra Gada Funerary Statue, Stone Cat [134884] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ra Gada Funerary Statue, Gilded Cat @@ -208,17 +208,17 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [134887] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ra Gada Guardian Statue, Lion Ibis [134888] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ra Gada Guardian Statue, Winged Bull [134889] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Ra Gada Guardian Statue, Riding Camel - + [125680] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Vines, Ashen Moss [125681] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Vines, Volcanic Roses - + [134898] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Flowers, Midnight Sage [134899] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Flower Spray, Crimson Daisies [134900] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Flowers, Red Poppy [134901] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Flower Spray, Starlight Daisies [134902] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Flowers, Violet Bellflower [134903] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Flowers, Midnight Glory - + [134961] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dibella's Mysteries and Revelations [126771] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Velothi Podium of Illumination [126776] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Indoril Tapestry, House @@ -231,7 +231,7 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [130088] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Fragment, Coldharbour [134248] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Grand Mnemograph [134249] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Sotha Sil, The Clockwork God - + [134460] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Riekling Lean-To, Boar Pelt [134464] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Riekling Bonfire, Ceremonial [130090] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Daedric Sconce, Molag Bal @@ -242,7 +242,7 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [121010] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tree, Young Green Birch [121008] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tree, Autumn Maple [121007] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Tree, Strong Maple - + [121004] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Hedge, Solid Arc [121000] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Shrub, Trimmed Green [120485] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Cactus, Columnar @@ -263,10 +263,10 @@ FurC.MiscItemSources[FURC_WEREWOLF] = { [130093] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Coldharbour Compact [134890] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dibella, Lady of Love }, - + [FURC_CROWN] = { - - + + [134904] = getCrownPrice(260), -- Seal of Dibella [134905] = getCrownPrice(260), -- Ritual Stone, Dibella [134906] = getCrownPrice(240), -- Ritual Brazier, Gilded @@ -397,28 +397,28 @@ FurC.MiscItemSources[FURC_ALTMER] = { [139066] = getCrownPrice(30), -- Plant, Redtop Grass [139067] = getCrownPrice(20), -- Flower, Yellow Oleander [139068] = getCrownPrice(20), -- Plants, Springwheeze - + [139069] = getCrownPrice(410), -- Painting of Griffin Nest, Refined [139070] = getCrownPrice(410), -- Painting of College of the Sapiarchs, Refined [139071] = getCrownPrice(410), -- Painting of High Elf Tower, Refined - [139073] = getCrownPrice(410), -- Painting of Summerset Coast, Refined + [139073] = getCrownPrice(410), -- Painting of Summerset Coast, Refined [139074] = getCrownPrice(410), -- Painting of Aldmeri Ruins, Refined [139075] = getCrownPrice(410), -- Painting of Sinkhole, Refined [139076] = getCrownPrice(410), -- Painting of Ancient Road, Refined - + [139078] = getCrownPrice(20), -- Coral Formation, Tree Antler - + [139083] = getCrownPrice(30), -- Plants, Grasswort Patch - - + + [139088] = getCrownPrice(50), -- Alinor Table Runner, Verdant [139089] = getCrownPrice(50), -- Alinor Table Runner, Coiled [139090] = getCrownPrice(100), -- Alinor Table Runner, Cloth of Silver - + [139097] = mephalaItemSet, -- Spiral Skein Glowstalks, Sprouts - + [139126] = getCrownPrice(50), -- Sapling, Ginkgo - + [139140] = getCrownPrice(340), -- Crystals, Crimson Spray [139141] = getCrownPrice(310), -- Crystals, Crimson Bed [139142] = getCrownPrice(380), -- Crystals, Crimson Spikes @@ -426,26 +426,26 @@ FurC.MiscItemSources[FURC_ALTMER] = { [139144] = getCrownPrice(400), -- Crystals, Midnight Spire [139145] = getCrownPrice(430), -- Crystals, Midnight Tower [139146] = getCrownPrice(490), -- Crystals, Midnight Bloom - + [139147] = getCrownPrice(30), -- Plants, Scarlet Sawleaf [139148] = getCrownPrice(70), -- Mushroom, Nettlecap - + [139150] = getCrownPrice(70), -- Mushrooms, Midnight Cluster [139151] = getCrownPrice(140), -- Mushrooms, Shadowpalm Cluster - + [139152] = getCrownPrice(360), -- Cocoon, Enormous Empty [139153] = getCrownPrice(40), -- Cocoon, Dormant [139154] = getCrownPrice(40), -- Cocoons, Dormant Cluster [139155] = getCrownPrice(80), -- Cocoon, Food Storage [139156] = getCrownPrice(360), -- Cocoon, Skeleton [139157] = getCrownPrice(90), -- Webs, Thick Sheet - + [139158] = getCrownPrice(150), -- Daedric Candelabra, Tall [139159] = getCrownPrice(920), -- Daedric Chandelier, Gruesome [139160] = getCrownPrice(200), -- Daedric Armchair, Severe [139161] = getCrownPrice(1500), -- Daedric Table, Grand Necropolis [139162] = getCrownPrice(140), -- Webs, Cone - + [139198] = getCrownPrice(190), -- Alinor Lantern, Hanging [139199] = getCrownPrice(190), -- Alinor Lantern, Stationary [139201] = getCrownPrice(220), -- Alinor Sconce, Arched Glass @@ -458,45 +458,45 @@ FurC.MiscItemSources[FURC_ALTMER] = { [139208] = getCrownPrice(60), -- Alinor Candles, Tall Stand [139209] = getCrownPrice(60), -- Alinor Candles, Tall [139210] = getCrownPrice(140), -- Alinor Brazier, Hanging Coals - [139212] = getCrownPrice(410), -- Alinor Streetlight, Wrought Iron - + [139212] = getCrownPrice(410), -- Alinor Streetlight, Wrought Iron + [139163] = mephalaItemSet, -- Mephala, The Webspinner (statue) - + [139293] = getCrownPrice(30), -- Alinor Chalice, Silver Ornate - + [139237] = getCrownPrice(190), -- Alinor Wall Mirror, Noble - + [139329] = getCrownPrice(45), -- Coral Formation, Heart [139330] = getCrownPrice(45), -- Coral Formation, Waving Hands [139331] = getCrownPrice(45), -- Coral Formation, Tree Antler [139332] = getCrownPrice(45), -- Coral Formation, Tree Shelf [139333] = getCrownPrice(45), -- Coral Formation, Trees Capped [139334] = getCrownPrice(20), -- Coral Formation, Tree Capped (green) - + [139335] = getCrownPrice(310), -- Tree, Shade Ancient [139336] = getCrownPrice(90), -- Trees, Shade Interwoven - [139337] = getCrownPrice(580), -- Tree, Ancient Blooming Ginkgo - + [139337] = getCrownPrice(580), -- Tree, Ancient Blooming Ginkgo + [139338] = getCrownPrice(25), -- Vines, Sun-Bronzed Ivy Swath [139339] = getCrownPrice(25), -- Vines, Sun-Bronzed Ivy Climber - + [139340] = getCrownPrice(310), -- Tree, Ancient Summerset Spruce - [139341] = getCrownPrice(310), -- Tree, Towering Poplar + [139341] = getCrownPrice(310), -- Tree, Towering Poplar [139342] = getCrownPrice(45), -- Tree, Vibrant Pink [139343] = getCrownPrice(45), -- Tree, Cloud White - + [139344] = getCrownPrice(45), -- Flowers, Hummingbird Mint Cluster [139345] = getCrownPrice(45), -- Flowers, Lizard Tail Cluster [139346] = getCrownPrice(45), -- Flowers, Lizard Tail Patch [139347] = getCrownPrice(45), -- Flowers, Yellow Oleander Cluster - + [139348] = getCrownPrice(940), -- Alinor Pergola, Purple Wisteria [139349] = getCrownPrice(940), -- Alinor Pergola, Blue Wisteria Peaked [139350] = getCrownPrice(940), -- Alinor Pergola, Purple Wisteria Overhang - - [139351] = getCrownPrice(200), -- Alinor Monument, Marble - [139352] = getCrownPrice(1000), -- Alinor Tomb, Ornate - + + [139351] = getCrownPrice(200), -- Alinor Monument, Marble + [139352] = getCrownPrice(1000), -- Alinor Tomb, Ornate + [139353] = getCrownPrice(340), -- Mind Trap Coral Spire, Branched [139354] = getCrownPrice(340), -- Mind Trap Coral Spire, Bulbous [139355] = getCrownPrice(340), -- Mind Trap Coral Formation, Heart @@ -506,27 +506,27 @@ FurC.MiscItemSources[FURC_ALTMER] = { [139359] = getCrownPrice(340), -- Mind Trap Coral Formation, Trees Capped [139360] = getCrownPrice(510), -- Mind Trap Kelp, Cluster [139361] = getCrownPrice(270), -- Mind Trap Kelp, Young - + [139362] = getCrownPrice(340), -- Sload Astral Nodule, Small [139363] = getCrownPrice(340), -- Sload Astral Nodule, Large [139364] = getCrownPrice(1500), -- Sload Neural Tree, Active - + [139365] = getCrownPrice(370), -- Psijic Lighting Globe, Framed - - [139366] = getCrownPrice(2000), -- Alinor Fountain, Regal + + [139366] = getCrownPrice(2000), -- Alinor Fountain, Regal [139368] = getCrownPrice(100), -- Alinor Bathing Robes, Decorative - - [139376] = getCrownPrice(260), -- Alinor Banner, Hanging - + + [139376] = getCrownPrice(260), -- Alinor Banner, Hanging + [139481] = getCrownPrice(200), -- Alinor Column, Jagged Timeworn [139482] = getCrownPrice(200), -- Alinor Column, Huge Timeworn [139483] = getCrownPrice(90), -- Alinor Column, Tumbled Timeworn - + [139480] = getCrownPrice(30), -- Plants, Redtop Grass Tuft [139650] = getCrownPrice(30), -- Bushes, Ivy Cluster - + [140220] = mephalaItemSet, -- Rumours of the Spiral Skein - + [130071] = getCrownPrice(300), -- Daedric Torch, Coldharbour", [130075] = getCrownPrice(380), -- Daedric Altar, Molag Bal [130078] = getCrownPrice(380), -- Soul Gem, Single @@ -564,37 +564,37 @@ FurC.MiscItemSources[FURC_ALTMER] = { [134275] = getCrownPrice(200), -- Coldharbour Bin, Black Soul Gem [130197] = getCrownPrice(170), -- Ayleid Bookcase, Filled [130199] = getCrownPrice(170), -- Ayleid Bookshelf, Bare - - }, + + }, [FURC_DROP] = { - + [139059] = GetString(SI_FURC_DROP), -- Ivory, Polished - drops from Echatere, and probably alot else [139066] = GetString(SI_FURC_HARVEST), -- Plant, Redtop Grass - + [139060] = GetString(SI_FURC_GIANT_CLAM), -- Giant Clam, Ancient [139062] = GetString(SI_FURC_GIANT_CLAM), -- Pearl, Large [139063] = GetString(SI_FURC_GIANT_CLAM), -- Pearl, Enormous - + [139073] = questRewardLilandril, -- Painting of Summerset Coast, Refined - [139072] = GetString(SI_FURC_ELF_PIC), -- Painting of Monastery of Serene Harmony, Refined - - [87709] = GetString(SI_FURC_LEVELUP), -- Imperial Brazier, Spiked - [94098] = GetString(SI_FURC_LEVELUP), -- Imperial Bed, Single - - + [139072] = GetString(SI_FURC_ELF_PIC), -- Painting of Monastery of Serene Harmony, Refined + + [87709] = GetString(SI_FURC_LEVELUP), -- Imperial Brazier, Spiked + [94098] = GetString(SI_FURC_LEVELUP), -- Imperial Bed, Single + + }, [FURC_FISHING] = { [139080] = FURC_FISHING_SUMMERSET, -- Coral Formation, Ancient Pillar Polyps [139079] = FURC_FISHING_SUMMERSET, -- Coral Formation, Fan Cluster - [139081] = FURC_FISHING_SUMMERSET, -- Plant, Sea Grapes + [139081] = FURC_FISHING_SUMMERSET, -- Plant, Sea Grapes [139084] = FURC_FISHING_SUMMERSET, -- Plants, Pearlwort Cluster [139085] = FURC_FISHING_SUMMERSET, -- Plants, Pearlwort Cluster [139068] = FURC_FISHING_SUMMERSET, -- Plants, Springwheeze [139077] = FURC_FISHING_SUMMERSET, -- Coral Formation, Bulwark - [139078] = FURC_FISHING_SUMMERSET, -- Coral Formation, Pillar Polyps + [139078] = FURC_FISHING_SUMMERSET, -- Coral Formation, Pillar Polyps [139067] = FURC_FISHING_SUMMERSET, -- Flower, Yellow Oleander [139082] = FURC_FISHING_SUMMERSET, -- Plants, Ruby Glasswort Patch - [139068] = FURC_FISHING_SUMMERSET, -- Plants, Springwheeze + [139068] = FURC_FISHING_SUMMERSET, -- Plants, Springwheeze }, [FURC_RUMOUR] = { [130193] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Robust Target Minotaur Handler @@ -696,7 +696,7 @@ FurC.MiscItemSources[FURC_CLOCKWORK] = { -- Reach [134405] = FURC_AUTOMATON_CC, -- Factotum Arm, Obsolete [134409] = FURC_AUTOMATON_CC, -- Factotum Head, Obsolete [134406] = FURC_AUTOMATON_CC, -- Factotum Body, Obsolete - + [132348] = GetString(SI_FURC_QUESTREWARD) .. "the Brass Citadel", -- The Precursor }, [FURC_JUSTICE] = { @@ -733,15 +733,15 @@ FurC.MiscItemSources[FURC_CLOCKWORK] = { -- Reach [134396] = getCrownPrice(410), -- Clockwork Wall Machinery, Tall [134397] = getCrownPrice(410), -- Clockwork Wall Machinery, Ovoid [134398] = getCrownPrice(1300), -- Clockwork Gazebo, Copper and Basalt - }, + }, [FURC_RUMOUR] = { - + [134422] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Clockwork Sextant, Surveyor's [134403] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Spool, Red Thread [134427] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Clockwork Orrery, Intricate [134437] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Clockwork Spinning Wheel, Sturdy [134441] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Animo Core, Full - + [134384] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Fabricant Tree, Decorative Electrum [134386] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Fabricant Tree, Forked Cherry Blossom [134389] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Fabricant Tree, Decorative Brass @@ -750,8 +750,8 @@ FurC.MiscItemSources[FURC_CLOCKWORK] = { -- Reach [134441] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Animo Core, Full [125509] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Replica Dwarven Crown Crate [125516] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Dwarven Gear Assembly, Grinding - - + + } } @@ -773,7 +773,7 @@ FurC.MiscItemSources[FURC_REACH] = { -- Reach [131420] = GetString(SI_FURC_HARVEST), -- Shrub, Glowing Thistle [130281] = GetString(SI_FURC_HARVEST), -- Glowstalk, Towering [130282] = GetString(SI_FURC_HARVEST), -- Glowstalk, Strong - + [130067] = GetString(SI_FURC_DAEDRA_SOURCE), -- Daedric Chain Segment }, } @@ -781,11 +781,11 @@ FurC.MiscItemSources[FURC_REACH] = { -- Reach local questRewardSuran = GetString(SI_FURC_QUESTREWARD) .. " Suran" FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [FURC_DROP] = { - + -- Dwemer parts [126660] = FURC_AUTOMATON_VV, -- Dwemer Gear, Tiered [126659] = FURC_AUTOMATON_VV, -- Dwemer Gear, Flat - + -- lootable in tombs [126754] = GetString(SI_FURC_TOMBS), -- Velothi Shroud, Seeker [126705] = GetString(SI_FURC_TOMBS), -- Velothi Shroud, Wisdom @@ -799,31 +799,31 @@ FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [126752] = GetString(SI_FURC_TOMBS), -- Velothi Shroud, Discovery [126755] = GetString(SI_FURC_TOMBS), -- Velothi Shroud, Change [126756] = GetString(SI_FURC_TOMBS), -- Velothi Shroud, Mercy - + [126773] = GetString(SI_FURC_TOMBS), -- Velothi Caisson, Crypt [126753] = GetString(SI_FURC_TOMBS), -- Velothi Cerecloth, Austere [126758] = GetString(SI_FURC_TOMBS), -- Velothi Mat, Prayer [126757] = GetString(SI_FURC_TOMBS), - + [126462] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Oversized Volcanic [126463] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Oversized Forest [126464] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Oversized Valley - + [126465] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Modest Volcanic [126466] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Modest Forest [126467] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Modest Valley - + [126468] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Classic Volcanic [126469] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Classic Forest [126470] = GetString(SI_FURC_CHEST_VV), -- Telvanni Painting, Classic Valley - + [126592] = GetString(SI_FURC_VV_PAINTING), -- Velothi Panels, Volcano [126593] = GetString(SI_FURC_VV_PAINTING), -- Velothi Tryptich, Volcano [126594] = GetString(SI_FURC_VV_PAINTING), -- Velothi Painting, Classic Volcano [126595] = GetString(SI_FURC_VV_PAINTING), -- Velothi Painting, Modest Volcano [126596] = GetString(SI_FURC_VV_PAINTING), -- Velothi Tapestry, Volcano [126597] = GetString(SI_FURC_VV_PAINTING), -- Velothi Painting, Oversized Volcano - + [126605] = GetString(SI_FURC_VV_PAINTING), -- Velothi Tryptich, Waterfall [126606] = GetString(SI_FURC_VV_PAINTING), -- Velothi Tapestry, Waterfall [126607] = GetString(SI_FURC_VV_PAINTING), -- Velothi Painting, Oversized Waterfall @@ -836,11 +836,11 @@ FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [126602] = GetString(SI_FURC_VV_PAINTING), -- Velothi Painting, Classic Geyser [126603] = GetString(SI_FURC_VV_PAINTING), -- Velothi Painting, Modest Geyser [126604] = GetString(SI_FURC_VV_PAINTING), -- Velothi Panels, Geyser - + -- Ashlander dailies [126119] = GetString(SI_FURC_DAILY_ASH), -- Crimson Shard of Moonshadow [126393] = GetString(SI_FURC_DAILY_ASH), -- Crimson Shard of Moonshadow - + -- drops from plants [125631] = FURC_PLANTS_VVARDENFELL, -- Plants, Ash Frond [125647] = FURC_PLANTS_VVARDENFELL, -- Plants, Ash Frond @@ -850,49 +850,49 @@ FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [125552] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage Patch [125543] = FURC_PLANTS_VVARDENFELL, -- Fern, Ashen [125633] = FURC_PLANTS_VVARDENFELL, -- Plants, Hanging Pitcher Pair - - [125551] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage - [125552] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage Patch - [125553] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage Stalks - [125562] = FURC_PLANTS_VVARDENFELL, -- Grass, Foxtail Cluster - [125595] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Poison Pax Shelf - [125596] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Poison Pax Stool - [125600] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Spongecap Patch - [125606] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Young Milkcap - [125608] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Buttercake Cluster - [125609] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Buttercake Stack - [125613] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Lavaburst Sprouts - [125590] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Lavaburst Cluster - [125617] = FURC_PLANTS_VVARDENFELL, -- Plant, Bitter Stalk - [125618] = FURC_PLANTS_VVARDENFELL, -- Plant, Golden Lichen - [125619] = FURC_PLANTS_VVARDENFELL, -- Plant, Hanging Pitcher - [125620] = FURC_PLANTS_VVARDENFELL, -- Plant, Hefty Elkhorn - [125621] = FURC_PLANTS_VVARDENFELL, -- Plant, Lava Brier - [125622] = FURC_PLANTS_VVARDENFELL, -- Plant, Lava Leaf - [125630] = FURC_PLANTS_VVARDENFELL, -- Plant, Young Elkhorn - [125631] = FURC_PLANTS_VVARDENFELL, -- Plants, Ash Frond - [125632] = FURC_PLANTS_VVARDENFELL, -- Plants, Hanging Pitcher Cluster - [125633] = FURC_PLANTS_VVARDENFELL, -- Plants, Hanging Pitcher Pair - [125634] = FURC_PLANTS_VVARDENFELL, -- Plants, Lava Pitcher Cluster - [125635] = FURC_PLANTS_VVARDENFELL, -- Plants, Lava Pitcher Shoots - [125636] = FURC_PLANTS_VVARDENFELL, -- Plants, Swamp Pitcher Cluster - [125637] = FURC_PLANTS_VVARDENFELL, -- Plants, Swamp Pitcher Shoots - [125647] = FURC_PLANTS_VVARDENFELL, -- Shrub, Bitter Brush - [125648] = FURC_PLANTS_VVARDENFELL, -- Shrub, Bitter Cluster - [125649] = FURC_PLANTS_VVARDENFELL, -- Shrub, Flowering Dusk - [125650] = FURC_PLANTS_VVARDENFELL, -- Shrub, Golden Lichen - [125670] = FURC_PLANTS_VVARDENFELL, -- Toadstool, Bloodtooth - [125671] = FURC_PLANTS_VVARDENFELL, -- Toadstool, Bloodtooth Cap - [125672] = FURC_PLANTS_VVARDENFELL, -- Toadstool, Bloodtooth Cluster - + + [125551] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage + [125552] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage Patch + [125553] = FURC_PLANTS_VVARDENFELL, -- Flowers, Netch Cabbage Stalks + [125562] = FURC_PLANTS_VVARDENFELL, -- Grass, Foxtail Cluster + [125595] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Poison Pax Shelf + [125596] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Poison Pax Stool + [125600] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Spongecap Patch + [125606] = FURC_PLANTS_VVARDENFELL, -- Mushroom, Young Milkcap + [125608] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Buttercake Cluster + [125609] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Buttercake Stack + [125613] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Lavaburst Sprouts + [125590] = FURC_PLANTS_VVARDENFELL, -- Mushrooms, Lavaburst Cluster + [125617] = FURC_PLANTS_VVARDENFELL, -- Plant, Bitter Stalk + [125618] = FURC_PLANTS_VVARDENFELL, -- Plant, Golden Lichen + [125619] = FURC_PLANTS_VVARDENFELL, -- Plant, Hanging Pitcher + [125620] = FURC_PLANTS_VVARDENFELL, -- Plant, Hefty Elkhorn + [125621] = FURC_PLANTS_VVARDENFELL, -- Plant, Lava Brier + [125622] = FURC_PLANTS_VVARDENFELL, -- Plant, Lava Leaf + [125630] = FURC_PLANTS_VVARDENFELL, -- Plant, Young Elkhorn + [125631] = FURC_PLANTS_VVARDENFELL, -- Plants, Ash Frond + [125632] = FURC_PLANTS_VVARDENFELL, -- Plants, Hanging Pitcher Cluster + [125633] = FURC_PLANTS_VVARDENFELL, -- Plants, Hanging Pitcher Pair + [125634] = FURC_PLANTS_VVARDENFELL, -- Plants, Lava Pitcher Cluster + [125635] = FURC_PLANTS_VVARDENFELL, -- Plants, Lava Pitcher Shoots + [125636] = FURC_PLANTS_VVARDENFELL, -- Plants, Swamp Pitcher Cluster + [125637] = FURC_PLANTS_VVARDENFELL, -- Plants, Swamp Pitcher Shoots + [125647] = FURC_PLANTS_VVARDENFELL, -- Shrub, Bitter Brush + [125648] = FURC_PLANTS_VVARDENFELL, -- Shrub, Bitter Cluster [125649] = FURC_PLANTS_VVARDENFELL, -- Shrub, Flowering Dusk - + [125650] = FURC_PLANTS_VVARDENFELL, -- Shrub, Golden Lichen + [125670] = FURC_PLANTS_VVARDENFELL, -- Toadstool, Bloodtooth + [125671] = FURC_PLANTS_VVARDENFELL, -- Toadstool, Bloodtooth Cap + [125672] = FURC_PLANTS_VVARDENFELL, -- Toadstool, Bloodtooth Cluster + + [125649] = FURC_PLANTS_VVARDENFELL, -- Shrub, Flowering Dusk + [126759] = questRewardSuran, -- Sir Sock's Ball of Yarn - + [126592] = GetString(SI_FURC_PLANTS), -- Plants, Hanging Pitcher Pair - + [126039] = FURC_SCAMBOX_DWEMER, -- Statue of masked Clavicus Vile with Barbas - + }, [FURC_CROWN] = { [125566] = getHouseString(1243), -- Hlaalu Shed, Enclosed @@ -904,7 +904,7 @@ FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [125567] = getHouseString(1244), -- Hlaalu Shed, Open [125580] = getHouseString(1244), -- Hlaalu Well, Covered Sillar Stone [118663] = getHouseString(1078, 1079), -- Dark Elf Bed of Coals - + [126475] = getCrownPrice(260), -- Telvanni Lantern, Organic Amber [126476] = getCrownPrice(200), -- Telvanni Lamp, Organic Amber [126477] = getCrownPrice(560), -- Telvanni Streetlight, Organic Amber @@ -1007,7 +1007,7 @@ FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [125610] = getCrownPrice(25), -- Mushrooms, Cave Bracket Cluster [120491] = getCrownPrice(30), -- Fern, Hearty Autumn [125616] = getCrownPrice(5), -- Pebble, Volcanic Chunk - [125628] = getCrownPrice(70), -- Plant, Rosetted Sundew + [125628] = getCrownPrice(70), -- Plant, Rosetted Sundew [126686] = getCrownPrice(400), -- Dwarven Chest, Relic [120481] = getCrownPrice(150), -- Tree, Ancient Juniper }, @@ -1015,7 +1015,7 @@ FurC.MiscItemSources[FURC_MORROWIND] = { -- Morrowind [126481] = FURC_CANBESTOLEN_RELIG .. " on Vvardenfell", -- Indoril Incense, Burning [126772] = FURC_CANBESTOLEN_THIEF -- Khajiiti Ponder sphere }, - [FURC_RUMOUR] = { + [FURC_RUMOUR] = { [132531] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Hlaalu Planter, Tall [120411] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Noble's Chalice of Wine [120417] = GetString(SI_FURC_DATAMINED_UNCLEAR), -- Redguard Barrel, Corded @@ -1045,7 +1045,7 @@ FurC.MiscItemSources[FURC_HOMESTEAD] = { [118487] = FURC_CANBESTOLEN_SCHOLARS, -- Letter, Personal [120008] = FURC_CANBESTOLEN_NERDS, -- Lesser Soul Gem, Empty [120005] = FURC_CANBESTOLEN_NERDS, -- Papers, Stack - + -- Bounty Sheets [118711] = FURC_CANBEPICKED_GUARD, -- Argonian Male [118709] = FURC_CANBEPICKED_GUARD, -- Breton Male @@ -1056,11 +1056,11 @@ FurC.MiscItemSources[FURC_HOMESTEAD] = { [118713] = FURC_CANBEPICKED_GUARD, -- Khajiiti Male [118716] = FURC_CANBEPICKED_GUARD, -- Orc Female [118717] = FURC_CANBEPICKED_GUARD, -- Orc Male - + [121055] = FURC_CANBESTOLEN_DRUNK, -- Breton Mug, Full - + [116512] = FURC_CANBESTOLEN_WROTHGAR, -- Orcish Carpet Blood - + }, [FURC_FISHING] = { -- fishing @@ -1078,15 +1078,15 @@ FurC.MiscItemSources[FURC_HOMESTEAD] = { [118898] = GetString(SI_FURC_CANBEFISHED), -- Seashell, White Scallop [118899] = GetString(SI_FURC_CANBEFISHED), -- Seashell, Starfish [118900] = GetString(SI_FURC_CANBEFISHED), -- Seashell, Noble Starfish - + }, [FURC_DROP] = { [121058] = FURC_DB_SNEAKY, -- Candles of Silence - + [119936] = FURC_DB_POISON, -- Poisoned Blood [119938] = FURC_DB_POISON, -- Light and Shadow [119952] = FURC_DB_POISON, -- Sacrificial Heart - + -- Paintings [118216] = GetString(SI_FURC_CHESTS), -- Painting of Spring, Sturdy [118217] = GetString(SI_FURC_CHESTS), -- Painting of Pasture, Sturdy @@ -1100,7 +1100,7 @@ FurC.MiscItemSources[FURC_HOMESTEAD] = { [118266] = GetString(SI_FURC_CHESTS), -- Painting of Bridge, Bolted [118267] = GetString(SI_FURC_CHESTS), -- Painting of Autumn, Bolted [118268] = GetString(SI_FURC_CHESTS), -- Painting of Great Ruins, Bolted - + }, [FURC_CROWN] = { [118096] = getCrownPrice(10), -- Bread, Plain @@ -1110,41 +1110,41 @@ FurC.MiscItemSources[FURC_HOMESTEAD] = { [118056] = getCrownPrice(15), -- Common Stewpot, Hanging [118121] = getCrownPrice(15), -- Knife, Carving [118066] = getCrownPrice(15), -- Steak Dinner - + [118057] = getCrownPrice(20), -- Sack of Beans [118060] = getCrownPrice(20), -- Sack of Grain [118059] = getCrownPrice(20), -- Sack of Millet, [118058] = getCrownPrice(20), -- Sack of Rice [118351] = getCrownPrice(25), -- Box of Peaches - - + + [134473] = FURC_SCAMBOX_F_ATRO, -- Tapestry, Malacath - + [118064] = getCrownPrice(45), -- Common Barrel, Dry [118065] = getCrownPrice(45), -- Common Cargo Crate, Dry [118064] = getCrownPrice(45), -- Common Barrel, Dry - + [118054] = getCrownPrice(80), -- Common Firepit, Outdoor [118055] = getCrownPrice(80), -- Common Firepit, Piled [118126] = getCrownPrice(95), -- Plaque, Standard - + [118068] = getCrownPrice(120), -- Simple Brown Banner [118069] = getCrownPrice(120), -- Simple Gray Banner [118071] = getCrownPrice(120), -- Simple Red Banner [118070] = getCrownPrice(120), -- Simple Purple Banner - - + + [94098] = getCrownPrice(95), -- Imperial Bed, Single - + [120607] = getCrownPrice(50), -- Sapling, Lanky Ash - - + + [115698] = getCrownPrice(1100), -- Khajiit Statue, Guardian - + [120413] = getCrownPrice(30), -- Breton Pitcher, Clay", }, [FURC_RUMOUR] = { - + [118290] = GetString(SI_FURC_RUMOUR_SOURCE_ITEM), -- Antlers, Wall Mount [118299] = GetString(SI_FURC_RUMOUR_SOURCE_ITEM), -- Bottle, Beaker [118300] = GetString(SI_FURC_RUMOUR_SOURCE_ITEM), -- Bottle, Poison diff --git a/libs/LibAsync/LibAsync.lua b/libs/LibAsync/LibAsync.lua index 0f592fb..37e2f97 100644 --- a/libs/LibAsync/LibAsync.lua +++ b/libs/LibAsync/LibAsync.lua @@ -3,38 +3,38 @@ local async, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not async then return end -- the same or newer version of this lib is already loaded into memory if async.Unload then - async:Unload() + async:Unload() end local em = GetEventManager() local remove, min = table.remove, math.min local function RemoveCall(job, callstackIndex) - remove(job.callstack, callstackIndex) - job.lastCallIndex = min(job.lastCallIndex, #job.callstack) + remove(job.callstack, callstackIndex) + job.lastCallIndex = min(job.lastCallIndex, #job.callstack) end local current, call local function safeCall() return call(current) end local function DoCallback(job, callstackIndex) - local success, shouldContinue = pcall(safeCall) - if success then - -- If the call returns true, the call wants to be called again - if not shouldContinue then RemoveCall(job, callstackIndex) end - else - -- shouldContinue is the value returned by error or assert - job.Error = shouldContinue - RemoveCall(job, callstackIndex) - - call = job.onError - if call then - pcall(safeCall) - else - job:Suspend() - error(job.Error) - end - end + local success, shouldContinue = pcall(safeCall) + if success then + -- If the call returns true, the call wants to be called again + if not shouldContinue then RemoveCall(job, callstackIndex) end + else + -- shouldContinue is the value returned by error or assert + job.Error = shouldContinue + RemoveCall(job, callstackIndex) + + call = job.onError + if call then + pcall(safeCall) + else + job:Suspend() + error(job.Error) + end + end end local jobs = async.jobs or { } @@ -42,18 +42,18 @@ async.jobs = jobs -- async.registered = { } local function DoJob(job) - current = job - local index = #job.callstack - call = job.callstack[index] - if call then - DoCallback(job, index) - else - -- assert(index == 0, "No call on non-empty stack?!") - jobs[job.name] = nil - call = job.finally - if call then pcall(safeCall) end - end - current, call = nil, nil + current = job + local index = #job.callstack + call = job.callstack[index] + if call then + DoCallback(job, index) + else + -- assert(index == 0, "No call on non-empty stack?!") + jobs[job.name] = nil + call = job.finally + if call then pcall(safeCall) end + end + current, call = nil, nil end -- time we can spend until the next frame must be shown @@ -70,62 +70,62 @@ local running local GetFrameTimeMilliseconds, GetGameTimeMilliseconds = GetFrameTimeMilliseconds, GetGameTimeMilliseconds local function GetThreshold() - return(HUD_SCENE:IsShowing() or HUD_UI_SCENE:IsShowing()) and spendTimeDef or spendTimeDefNoHUD + return(HUD_SCENE:IsShowing() or HUD_UI_SCENE:IsShowing()) and spendTimeDef or spendTimeDefNoHUD end local job = nil local cpuLoad = 0 local name local function Scheduler() - if not running then return end - - job = nil - local start = GetFrameTimeMilliseconds() - local runTime, cpuLoad = start, GetGameTimeMilliseconds() - start - if cpuLoad > spendTime then - spendTime = math.min(30, spendTime + spendTime * 0.02) - if debug then - df("initial gap: %ims. skip. new threshold: %ims", GetGameTimeMilliseconds() - start, spendTime) - end - return - end - if debug then - df("initial gap: %ims", GetGameTimeMilliseconds() - start) - end - while (GetGameTimeMilliseconds() - start) <= spendTime do - name, job = next(jobs, name) - if not job then name, job = next(jobs) end - if job then - runTime = GetGameTimeMilliseconds() - DoJob(job) - else - -- Finished - running = false - spendTime = GetThreshold() - return - end - end - -- spendTime = GetThreshold() - if debug and job then - local now = GetGameTimeMilliseconds() - local freezeTime = now - start - if freezeTime >= 16 then - runTime = now - runTime - df("%s freeze. allowed: %ims, used %ims, resulting fps %i.", job.name, spendTime, runTime, 1000 / freezeTime) - end - end + if not running then return end + + job = nil + local start = GetFrameTimeMilliseconds() + local runTime, cpuLoad = start, GetGameTimeMilliseconds() - start + if cpuLoad > spendTime then + spendTime = math.min(30, spendTime + spendTime * 0.02) + if debug then + df("initial gap: %ims. skip. new threshold: %ims", GetGameTimeMilliseconds() - start, spendTime) + end + return + end + if debug then + df("initial gap: %ims", GetGameTimeMilliseconds() - start) + end + while (GetGameTimeMilliseconds() - start) <= spendTime do + name, job = next(jobs, name) + if not job then name, job = next(jobs) end + if job then + runTime = GetGameTimeMilliseconds() + DoJob(job) + else + -- Finished + running = false + spendTime = GetThreshold() + return + end + end + -- spendTime = GetThreshold() + if debug and job then + local now = GetGameTimeMilliseconds() + local freezeTime = now - start + if freezeTime >= 16 then + runTime = now - runTime + df("%s freeze. allowed: %ims, used %ims, resulting fps %i.", job.name, spendTime, runTime, 1000 / freezeTime) + end + end end function async:GetDebug() - return debug + return debug end function async:SetDebug(enabled) - debug = enabled + debug = enabled end function async:GetCpuLoad() - return cpuLoad / frameTimeTarget + return cpuLoad / frameTimeTarget end -- Class task @@ -135,214 +135,214 @@ async.task = task -- Called from async:Create() function task:New(name) - local instance = ZO_Object.New(self) - instance.name = name or tostring(instance) - instance:Initialize() - return instance + local instance = ZO_Object.New(self) + instance.name = name or tostring(instance) + instance:Initialize() + return instance end function task:Initialize() - self.callstack = { } - self.lastCallIndex = 0 - -- async.registered[#async.registered + 1] = self + self.callstack = { } + self.lastCallIndex = 0 + -- async.registered[#async.registered + 1] = self end -- Resume the execution context. function task:Resume() - running = true - jobs[self.name] = self - return self + running = true + jobs[self.name] = self + return self end -- Suspend the execution context and allow to resume anytime later. function task:Suspend() - jobs[self.name] = nil - return self + jobs[self.name] = nil + return self end -- Interupt and fully stop the execution context. Can be called from outside to stop everything. function task:Cancel() - ZO_ClearNumericallyIndexedTable(self.callstack) - self.lastCallIndex = 0 - if jobs[self.name] then - if not self.finally then - jobs[self.name] = nil - -- else run job with empty callstack to run finalizer - end - end - return self + ZO_ClearNumericallyIndexedTable(self.callstack) + self.lastCallIndex = 0 + if jobs[self.name] then + if not self.finally then + jobs[self.name] = nil + -- else run job with empty callstack to run finalizer + end + end + return self end do - -- Run the given FuncOfTask in your task context execution. - function task:Call(funcOfTask) - self.lastCallIndex = #self.callstack + 1 - self.callstack[self.lastCallIndex] = funcOfTask - return self:Resume() - end - - local insert = table.insert - -- Continue your task context execution with the given FuncOfTask after the previous as finished. - function task:Then(funcOfTask) - -- assert(self.lastCallIndex > 0 and self.lastCallIndex <= #self.callstack, "cap!") - insert(self.callstack, self.lastCallIndex, funcOfTask) - return self - end + -- Run the given FuncOfTask in your task context execution. + function task:Call(funcOfTask) + self.lastCallIndex = #self.callstack + 1 + self.callstack[self.lastCallIndex] = funcOfTask + return self:Resume() + end + + local insert = table.insert + -- Continue your task context execution with the given FuncOfTask after the previous as finished. + function task:Then(funcOfTask) + -- assert(self.lastCallIndex > 0 and self.lastCallIndex <= #self.callstack, "cap!") + insert(self.callstack, self.lastCallIndex, funcOfTask) + return self + end end -- Start an interruptible for-loop. function task:For(p1, p2, p3) - -- If called as a normal job, false will prevent it is kept in callstack doing an endless loop - self.callstack[#self.callstack + 1] = function() return false, p1, p2, p3 end - return self + -- If called as a normal job, false will prevent it is kept in callstack doing an endless loop + self.callstack[#self.callstack + 1] = function() return false, p1, p2, p3 end + return self end do - local function ForConditionAlreadyFalse() end - local function ContinueForward(index, endIndex) return index <= endIndex end - local function ContinueBackward(index, endIndex) return index >= endIndex end - - local function asyncForWithStep(self, func, index, endIndex, step) - step = step or 1 - if step == 0 then error("step is zero") end - - local ShouldContinue - if step > 0 then - if index > endIndex then return ForConditionAlreadyFalse end - ShouldContinue = ContinueForward - else - if index < endIndex then return ForConditionAlreadyFalse end - ShouldContinue = ContinueBackward - end - return function() - if func(index) ~= async.BREAK then - index = index + step - return ShouldContinue(index, endIndex) - end - end - end - - local function asyncForPairs(self, func, iter, list, key) - return function() - local value - key, value = iter(list, key) - return key and func(key, value) ~= async.BREAK - end - end - - -- Execute the async-for with the given step-function. The parameters of the step-function are those you would use in your for body. - function task:Do(func) - local callstackIndex = #self.callstack - local shouldBeFalse, p1, p2, p3 = self.callstack[callstackIndex]() - assert(shouldBeFalse == false and p1, "Do without For") - remove(self.callstack, callstackIndex) - - local DoLoop = type(p1) == "number" and - asyncForWithStep(self, func, p1, p2, p3) or - asyncForPairs(self, func, p1, p2, p3) - - if current or #self.callstack == 0 then return self:Call(DoLoop) else return self:Then(DoLoop) end - end + local function ForConditionAlreadyFalse() end + local function ContinueForward(index, endIndex) return index <= endIndex end + local function ContinueBackward(index, endIndex) return index >= endIndex end + + local function asyncForWithStep(self, func, index, endIndex, step) + step = step or 1 + if step == 0 then error("step is zero") end + + local ShouldContinue + if step > 0 then + if index > endIndex then return ForConditionAlreadyFalse end + ShouldContinue = ContinueForward + else + if index < endIndex then return ForConditionAlreadyFalse end + ShouldContinue = ContinueBackward + end + return function() + if func(index) ~= async.BREAK then + index = index + step + return ShouldContinue(index, endIndex) + end + end + end + + local function asyncForPairs(self, func, iter, list, key) + return function() + local value + key, value = iter(list, key) + return key and func(key, value) ~= async.BREAK + end + end + + -- Execute the async-for with the given step-function. The parameters of the step-function are those you would use in your for body. + function task:Do(func) + local callstackIndex = #self.callstack + local shouldBeFalse, p1, p2, p3 = self.callstack[callstackIndex]() + assert(shouldBeFalse == false and p1, "Do without For") + remove(self.callstack, callstackIndex) + + local DoLoop = type(p1) == "number" and + asyncForWithStep(self, func, p1, p2, p3) or + asyncForPairs(self, func, p1, p2, p3) + + if current or #self.callstack == 0 then return self:Call(DoLoop) else return self:Then(DoLoop) end + end end -- Suspend the execution of your task context for the given delay in milliseconds and then call the given FuncOfTask to continue. function task:Delay(delay, funcOfTask) - self:StopTimer() - if delay < 10 then return self:Call(funcOfTask) end - self:Suspend() - em:RegisterForUpdate(self.name, delay, function() - em:UnregisterForUpdate(self.name) - self:Call(funcOfTask) - end ) - return self + self:StopTimer() + if delay < 10 then return self:Call(funcOfTask) end + self:Suspend() + em:RegisterForUpdate(self.name, delay, function() + em:UnregisterForUpdate(self.name) + self:Call(funcOfTask) + end ) + return self end -- Stop the delay created by task:Delay or task:Interval. function task:StopTimer() - em:UnregisterForUpdate(self.name) - return self + em:UnregisterForUpdate(self.name) + return self end -- Set a FuncOfTask as a final handler. If you call Called if something went wrong in your context. function task:Finally(funcOfTask) - self.finally = funcOfTask - return self + self.finally = funcOfTask + return self end -- Set a FuncOfTask as an error handler. Called if something went wrong in your context. function task:OnError(funcOfTask) - self.onError = funcOfTask - return self + self.onError = funcOfTask + return self end do - -- Thanks to: https://de.wikipedia.org/wiki/Quicksort - - local function simpleCompare(a, b) return a < b end - local function sort(task, array, compare) - local function quicksort(left, right) - if left >= right then return end - - -- partition - local i, j, pivot = left, right - 1, array[right] - - task:Call( function() - while i < right and compare(array[i], pivot) do i = i + 1 end - while j > left and not compare(array[j], pivot) do j = j - 1 end - if i < j then - array[i], array[j] = array[j], array[i] - -- repeatly call this function until i >= j - return true - end - end ) - task:Then( function() - if compare(pivot, array[i]) then array[i], array[right] = array[right], array[i] end - quicksort(left, i - 1) - quicksort(i + 1, right) - end ) - end - quicksort(1, #array) - end - - -- This sort function works like table.sort(). The compare function is optional. - function task:Sort(array, compare) - local sortJob = function(task) sort(task, array, compare or simpleCompare) end - if current or #self.callstack == 0 then return self:Call(sortJob) else return self:Then(sortJob) end - end + -- Thanks to: https://de.wikipedia.org/wiki/Quicksort + + local function simpleCompare(a, b) return a < b end + local function sort(task, array, compare) + local function quicksort(left, right) + if left >= right then return end + + -- partition + local i, j, pivot = left, right - 1, array[right] + + task:Call( function() + while i < right and compare(array[i], pivot) do i = i + 1 end + while j > left and not compare(array[j], pivot) do j = j - 1 end + if i < j then + array[i], array[j] = array[j], array[i] + -- repeatly call this function until i >= j + return true + end + end ) + task:Then( function() + if compare(pivot, array[i]) then array[i], array[right] = array[right], array[i] end + quicksort(left, i - 1) + quicksort(i + 1, right) + end ) + end + quicksort(1, #array) + end + + -- This sort function works like table.sort(). The compare function is optional. + function task:Sort(array, compare) + local sortJob = function(task) sort(task, array, compare or simpleCompare) end + if current or #self.callstack == 0 then return self:Call(sortJob) else return self:Then(sortJob) end + end end -- Class async -- Get the current context, if you are within a FuncOfTask or nil. function async:GetCurrent() - return current + return current end -- Create an interruptible task context. function async:Create(name) - return task:New(name) + return task:New(name) end do - local Default = task:New("*Default Task*") - function Default:Cancel() error("Not allowed on default task. Use your_lib_var:Create(optional_name) for an interruptible task context.") end - Default.Finally = Default.Cancel - Default.OnError = Default.Cancel - - -- Start a non-interruptible task or start a nested call in the current context. - function async:Call(funcOfTask) - -- if async:Call is called from within a task callback (the moment where GetCurrent() is not nil) use it for nested calls - return(async:GetCurrent() or Default):Call(funcOfTask) - end - -- Start a non-interruptible for-loop or start a nested for-loop in the current context. - function async:For(p1, p2, p3) - return(self:GetCurrent() or Default):For(p1, p2, p3) - end - - -- Start a non-interruptible sort or start a nested sort in the current context. - function async:Sort(array, compare) - return(self:GetCurrent() or Default):Sort(array, compare) - end + local Default = task:New("*Default Task*") + function Default:Cancel() error("Not allowed on default task. Use your_lib_var:Create(optional_name) for an interruptible task context.") end + Default.Finally = Default.Cancel + Default.OnError = Default.Cancel + + -- Start a non-interruptible task or start a nested call in the current context. + function async:Call(funcOfTask) + -- if async:Call is called from within a task callback (the moment where GetCurrent() is not nil) use it for nested calls + return(async:GetCurrent() or Default):Call(funcOfTask) + end + -- Start a non-interruptible for-loop or start a nested for-loop in the current context. + function async:For(p1, p2, p3) + return(self:GetCurrent() or Default):For(p1, p2, p3) + end + + -- Start a non-interruptible sort or start a nested sort in the current context. + function async:Sort(array, compare) + return(self:GetCurrent() or Default):Sort(array, compare) + end end -- async.BREAK is the new 'break' for breaking loops. As Lua would not allowed the keyword 'break' in that context. @@ -350,9 +350,9 @@ end async.BREAK = true local function stateChange(oldState, newState) - if newState == SCENE_SHOWN or newState == SCENE_HIDING then - spendTime = GetThreshold() - end + if newState == SCENE_SHOWN or newState == SCENE_HIDING then + spendTime = GetThreshold() + end end local identifier = "ASYNCTASKS_JOBS" @@ -361,8 +361,8 @@ HUD_SCENE:RegisterCallback("StateChange", stateChange) HUD_UI_SCENE:RegisterCallback("StateChange", stateChange) function async:Unload() - HUD_SCENE:UnregisterCallback("StateChange", stateChange) - HUD_UI_SCENE:UnregisterCallback("StateChange", stateChange) + HUD_SCENE:UnregisterCallback("StateChange", stateChange) + HUD_UI_SCENE:UnregisterCallback("StateChange", stateChange) end em:UnregisterForUpdate(identifier) diff --git a/locale/de.lua b/locale/de.lua index ec63da8..65a17cd 100644 --- a/locale/de.lua +++ b/locale/de.lua @@ -38,10 +38,10 @@ local strings = { -- GUI and debug SI_FURC_MENU_HEADER = "- |cD3B830Furniture|r:", SI_FURC_REMOVE_FAVE = " Remove Favorite", - SI_FURC_ADD_FAVE = " Add Favorite", + SI_FURC_ADD_FAVE = " Add Favorite", SI_FURC_POST_ITEMSOURCE = " Post item source", SI_FURC_POST_RECIPE = " Post recipe", - SI_FURC_POST_ITEM = " Post item", + SI_FURC_POST_ITEM = " Post item", SI_FURC_POST_MATERIAL = " Post material", SI_FURC_DIALOGUE_RESET_DB_HEADER = "Really re-create furniture database?", SI_FURC_DIALOGUE_RESET_DB_BODY = "This will re-create the FurnitureCatalogue database from scratch", diff --git a/locale/en.lua b/locale/en.lua index c57d6f3..5ee0223 100644 --- a/locale/en.lua +++ b/locale/en.lua @@ -38,10 +38,10 @@ local strings = { -- GUI and debug SI_FURC_MENU_HEADER = "- |cD3B830Furniture|r:", SI_FURC_REMOVE_FAVE = " Remove Favorite", - SI_FURC_ADD_FAVE = " Add Favorite", + SI_FURC_ADD_FAVE = " Add Favorite", SI_FURC_POST_ITEMSOURCE = " Post item source", SI_FURC_POST_RECIPE = " Post recipe", - SI_FURC_POST_ITEM = " Post item", + SI_FURC_POST_ITEM = " Post item", SI_FURC_POST_MATERIAL = " Post material", SI_FURC_DIALOGUE_RESET_DB_HEADER = "Really re-create furniture database?", SI_FURC_DIALOGUE_RESET_DB_BODY = "This will re-create the FurnitureCatalogue database from scratch", diff --git a/locale/fr.lua b/locale/fr.lua index aeae4f2..3b91a81 100644 --- a/locale/fr.lua +++ b/locale/fr.lua @@ -38,10 +38,10 @@ local strings = { -- GUI and debug SI_FURC_MENU_HEADER = "- |cD3B830Furniture|r:", SI_FURC_REMOVE_FAVE = " Remove Favorite", - SI_FURC_ADD_FAVE = " Add Favorite", + SI_FURC_ADD_FAVE = " Add Favorite", SI_FURC_POST_ITEMSOURCE = " Post item source", SI_FURC_POST_RECIPE = " Post recipe", - SI_FURC_POST_ITEM = " Post item", + SI_FURC_POST_ITEM = " Post item", SI_FURC_POST_MATERIAL = " Post material", SI_FURC_DIALOGUE_RESET_DB_HEADER = "Really re-create furniture database?", SI_FURC_DIALOGUE_RESET_DB_BODY = "This will re-create the FurnitureCatalogue database from scratch", diff --git a/locale/jp.lua b/locale/jp.lua index ec63da8..65a17cd 100644 --- a/locale/jp.lua +++ b/locale/jp.lua @@ -38,10 +38,10 @@ local strings = { -- GUI and debug SI_FURC_MENU_HEADER = "- |cD3B830Furniture|r:", SI_FURC_REMOVE_FAVE = " Remove Favorite", - SI_FURC_ADD_FAVE = " Add Favorite", + SI_FURC_ADD_FAVE = " Add Favorite", SI_FURC_POST_ITEMSOURCE = " Post item source", SI_FURC_POST_RECIPE = " Post recipe", - SI_FURC_POST_ITEM = " Post item", + SI_FURC_POST_ITEM = " Post item", SI_FURC_POST_MATERIAL = " Post material", SI_FURC_DIALOGUE_RESET_DB_HEADER = "Really re-create furniture database?", SI_FURC_DIALOGUE_RESET_DB_BODY = "This will re-create the FurnitureCatalogue database from scratch", diff --git a/locale/ru.lua b/locale/ru.lua index ec63da8..65a17cd 100644 --- a/locale/ru.lua +++ b/locale/ru.lua @@ -38,10 +38,10 @@ local strings = { -- GUI and debug SI_FURC_MENU_HEADER = "- |cD3B830Furniture|r:", SI_FURC_REMOVE_FAVE = " Remove Favorite", - SI_FURC_ADD_FAVE = " Add Favorite", + SI_FURC_ADD_FAVE = " Add Favorite", SI_FURC_POST_ITEMSOURCE = " Post item source", SI_FURC_POST_RECIPE = " Post recipe", - SI_FURC_POST_ITEM = " Post item", + SI_FURC_POST_ITEM = " Post item", SI_FURC_POST_MATERIAL = " Post material", SI_FURC_DIALOGUE_RESET_DB_HEADER = "Really re-create furniture database?", SI_FURC_DIALOGUE_RESET_DB_BODY = "This will re-create the FurnitureCatalogue database from scratch", diff --git a/startup.lua b/startup.lua index 16d5009..ee38bbc 100644 --- a/startup.lua +++ b/startup.lua @@ -1,193 +1,193 @@ -FurnitureCatalogue = {} -FurnitureCatalogue.name = "FurnitureCatalogue" -FurnitureCatalogue.author = "manavortex" -FurnitureCatalogue.version = 2.82 -FurnitureCatalogue.CharacterName = nil -FurnitureCatalogue.settings = {} - -FurC = FurnitureCatalogue - -FurC.AchievementVendors = {} -FurC.LuxuryFurnisher = {} -FurC.Recipes = {} -FurC.Rolis = {} -FurC.Faustina = {} -FurC.RolisRecipes = {} -FurC.FaustinaRecipes = {} -FurC.Books = {} -FurC.EventItems = {} -FurC.PVP = {} -FurC.MiscItemSources = {} +FurnitureCatalogue = {} +FurnitureCatalogue.name = "FurnitureCatalogue" +FurnitureCatalogue.author = "manavortex" +FurnitureCatalogue.version = 2.83 +FurnitureCatalogue.CharacterName = nil +FurnitureCatalogue.settings = {} + +FurC = FurnitureCatalogue + +FurC.AchievementVendors = {} +FurC.LuxuryFurnisher = {} +FurC.Recipes = {} +FurC.Rolis = {} +FurC.Faustina = {} +FurC.RolisRecipes = {} +FurC.FaustinaRecipes = {} +FurC.Books = {} +FurC.EventItems = {} +FurC.PVP = {} +FurC.MiscItemSources = {} -- versioning -FURC_HOMESTEAD = 2 -FURC_MORROWIND = 3 -FURC_REACH = 4 -FURC_CLOCKWORK = 5 -FURC_DRAGONS = 6 -FURC_ALTMER = 7 -FURC_WEREWOLF = 8 -FURC_SLAVES = 9 +FURC_HOMESTEAD = 2 +FURC_MORROWIND = 3 +FURC_REACH = 4 +FURC_CLOCKWORK = 5 +FURC_DRAGONS = 6 +FURC_ALTMER = 7 +FURC_WEREWOLF = 8 +FURC_SLAVES = 9 FurC.Const = { - vendorColor = "d68957", - goldColor = "e5da40", - apColor = "25C31E", - tvColor = "5EA4FF", - voucherColor = "82BCFF", + vendorColor = "d68957", + goldColor = "e5da40", + apColor = "25C31E", + tvColor = "5EA4FF", + voucherColor = "82BCFF", } -local defaults = { +local defaults = { - hideMats = true, - dontScanTradingHouse = false, - enableDebug = false, + hideMats = true, + dontScanTradingHouse = false, + enableDebug = false, - data = {}, - filterCraftingType = {}, - filterQuality = {}, + data = {}, + filterCraftingType = {}, + filterQuality = {}, - resetDropdownChoice = false, - useTinyUi = false, - useInventoryIcons = true, - fontSize = 18, + resetDropdownChoice = false, + useTinyUi = false, + useInventoryIcons = true, + fontSize = 18, - gui = { - lastX = 100, - lastY = 100, - width = 650, - height = 550, - }, + gui = { + lastX = 100, + lastY = 100, + width = 650, + height = 550, + }, - dropdownDefaults = { - Source = 1, - Character = 1, - Version = 1, - }, + dropdownDefaults = { + Source = 1, + Character = 1, + Version = 1, + }, - accountCharacters = {}, + accountCharacters = {}, - version = 2.0, + version = 2.0, - -- tooltips - disableTooltips = false, - coloredTooltips = true, - hideKnowledge = false, + -- tooltips + disableTooltips = false, + coloredTooltips = true, + hideKnowledge = false, - hideBooks = true, - hideDoubtfuls = true, - hideCrownstore = true, - hideRumourEntry = false, - hideCrownStoreEntry = false, - wipeDatabase = false, - startupSilently = true, + hideBooks = true, + hideDoubtfuls = true, + hideCrownstore = true, + hideRumourEntry = false, + hideCrownStoreEntry = false, + wipeDatabase = false, + startupSilently = true, } -FURC_NONE = 1 -FURC_FAVE = FURC_NONE +1 -FURC_CRAFTING = FURC_FAVE +1 -FURC_CRAFTING_KNOWN = FURC_CRAFTING +1 -FURC_CRAFTING_UNKNOWN = FURC_CRAFTING_KNOWN +1 -FURC_VENDOR = FURC_CRAFTING_UNKNOWN +1 -FURC_PVP = FURC_VENDOR +1 -FURC_CROWN = FURC_PVP +1 -FURC_RUMOUR = FURC_CROWN +1 -FURC_LUXURY = FURC_RUMOUR +1 -FURC_OTHER = FURC_LUXURY +1 -FURC_ROLIS = FURC_OTHER +1 -FURC_DROP = FURC_ROLIS +1 -FURC_WRIT_VENDOR = FURC_DROP +1 -FURC_JUSTICE = FURC_WRIT_VENDOR +1 -FURC_FISHING = FURC_JUSTICE +1 -FURC_GUILDSTORE = FURC_FISHING +1 -FURC_FESTIVAL_DROP = FURC_GUILDSTORE +1 -FURC_EMPTY_STRING = "" +FURC_NONE = 1 +FURC_FAVE = FURC_NONE +1 +FURC_CRAFTING = FURC_FAVE +1 +FURC_CRAFTING_KNOWN = FURC_CRAFTING +1 +FURC_CRAFTING_UNKNOWN = FURC_CRAFTING_KNOWN +1 +FURC_VENDOR = FURC_CRAFTING_UNKNOWN +1 +FURC_PVP = FURC_VENDOR +1 +FURC_CROWN = FURC_PVP +1 +FURC_RUMOUR = FURC_CROWN +1 +FURC_LUXURY = FURC_RUMOUR +1 +FURC_OTHER = FURC_LUXURY +1 +FURC_ROLIS = FURC_OTHER +1 +FURC_DROP = FURC_ROLIS +1 +FURC_WRIT_VENDOR = FURC_DROP +1 +FURC_JUSTICE = FURC_WRIT_VENDOR +1 +FURC_FISHING = FURC_JUSTICE +1 +FURC_GUILDSTORE = FURC_FISHING +1 +FURC_FESTIVAL_DROP = FURC_GUILDSTORE +1 +FURC_EMPTY_STRING = "" local sourceIndicesKeys = {} local function getSourceIndicesKeys() - sourceIndicesKeys[FURC_NONE] = "off" - sourceIndicesKeys[FURC_FAVE] = "favorites" - sourceIndicesKeys[FURC_CRAFTING] = "craft_all" - sourceIndicesKeys[FURC_CRAFTING_KNOWN] = "craft_known" - sourceIndicesKeys[FURC_CRAFTING_UNKNOWN] = "craft_unknown" - sourceIndicesKeys[FURC_VENDOR] = "purch_gold" - sourceIndicesKeys[FURC_PVP] = "purch_ap" - sourceIndicesKeys[FURC_CROWN] = "crownstore" - sourceIndicesKeys[FURC_RUMOUR] = "rumour" - sourceIndicesKeys[FURC_LUXURY] = "luxury" - sourceIndicesKeys[FURC_OTHER] = "other" - sourceIndicesKeys[FURC_WRIT_VENDOR] = "writ_vendor" - return sourceIndicesKeys + sourceIndicesKeys[FURC_NONE] = "off" + sourceIndicesKeys[FURC_FAVE] = "favorites" + sourceIndicesKeys[FURC_CRAFTING] = "craft_all" + sourceIndicesKeys[FURC_CRAFTING_KNOWN] = "craft_known" + sourceIndicesKeys[FURC_CRAFTING_UNKNOWN] = "craft_unknown" + sourceIndicesKeys[FURC_VENDOR] = "purch_gold" + sourceIndicesKeys[FURC_PVP] = "purch_ap" + sourceIndicesKeys[FURC_CROWN] = "crownstore" + sourceIndicesKeys[FURC_RUMOUR] = "rumour" + sourceIndicesKeys[FURC_LUXURY] = "luxury" + sourceIndicesKeys[FURC_OTHER] = "other" + sourceIndicesKeys[FURC_WRIT_VENDOR] = "writ_vendor" + return sourceIndicesKeys end FurC.GetSourceIndicesKeys = getSourceIndicesKeys local choicesSource = {} local function getChoicesSource() - choicesSource[FURC_NONE] = GetString(SI_FURC_NONE) - choicesSource[FURC_FAVE] = GetString(SI_FURC_FAVE) - choicesSource[FURC_CRAFTING] = GetString(SI_FURC_CRAFTING) - choicesSource[FURC_CRAFTING_KNOWN] = GetString(SI_FURC_CRAFTING_KNOWN) - choicesSource[FURC_CRAFTING_UNKNOWN] = GetString(SI_FURC_CRAFTING_UNKNOWN) - choicesSource[FURC_VENDOR] = GetString(SI_FURC_VENDOR) - choicesSource[FURC_PVP] = GetString(SI_FURC_PVP) - choicesSource[FURC_WRIT_VENDOR] = GetString(SI_FURC_STRING_WRIT_VENDOR) - choicesSource[FURC_CROWN] = GetString(SI_FURC_CROWN) - choicesSource[FURC_RUMOUR] = GetString(SI_FURC_RUMOUR) - choicesSource[FURC_LUXURY] = GetString(SI_FURC_LUXURY) - choicesSource[FURC_OTHER] = GetString(SI_FURC_OTHER) - - return choicesSource + choicesSource[FURC_NONE] = GetString(SI_FURC_NONE) + choicesSource[FURC_FAVE] = GetString(SI_FURC_FAVE) + choicesSource[FURC_CRAFTING] = GetString(SI_FURC_CRAFTING) + choicesSource[FURC_CRAFTING_KNOWN] = GetString(SI_FURC_CRAFTING_KNOWN) + choicesSource[FURC_CRAFTING_UNKNOWN] = GetString(SI_FURC_CRAFTING_UNKNOWN) + choicesSource[FURC_VENDOR] = GetString(SI_FURC_VENDOR) + choicesSource[FURC_PVP] = GetString(SI_FURC_PVP) + choicesSource[FURC_WRIT_VENDOR] = GetString(SI_FURC_STRING_WRIT_VENDOR) + choicesSource[FURC_CROWN] = GetString(SI_FURC_CROWN) + choicesSource[FURC_RUMOUR] = GetString(SI_FURC_RUMOUR) + choicesSource[FURC_LUXURY] = GetString(SI_FURC_LUXURY) + choicesSource[FURC_OTHER] = GetString(SI_FURC_OTHER) + + return choicesSource end FurC.GetChoicesSource = getChoicesSource local tooltipsSource = {} local function getTooltipsSource() - tooltipsSource[FURC_NONE] = GetString(SI_FURC_NONE_TT) - tooltipsSource[FURC_FAVE] = GetString(SI_FURC_FAVE_TT) - tooltipsSource[FURC_CRAFTING] = GetString(SI_FURC_CRAFTING_TT) - tooltipsSource[FURC_CRAFTING_KNOWN] = GetString(SI_FURC_CRAFTING_KNOWN_TT) - tooltipsSource[FURC_CRAFTING_UNKNOWN] = GetString(SI_FURC_CRAFTING_UNKNOWN_TT) - tooltipsSource[FURC_VENDOR] = GetString(SI_FURC_VENDOR_TT) - tooltipsSource[FURC_PVP] = GetString(SI_FURC_PVP_TT) - tooltipsSource[FURC_CROWN] = GetString(SI_FURC_CROWN_TT) - tooltipsSource[FURC_WRIT_VENDOR] = GetString(SI_FURC_STRING_WRIT_VENDOR_TT) - tooltipsSource[FURC_RUMOUR] = GetString(SI_FURC_RUMOUR_TT) - tooltipsSource[FURC_LUXURY] = GetString(SI_FURC_LUXURY_TT) - tooltipsSource[FURC_OTHER] = GetString(SI_FURC_OTHER_TT) - - return tooltipsSource + tooltipsSource[FURC_NONE] = GetString(SI_FURC_NONE_TT) + tooltipsSource[FURC_FAVE] = GetString(SI_FURC_FAVE_TT) + tooltipsSource[FURC_CRAFTING] = GetString(SI_FURC_CRAFTING_TT) + tooltipsSource[FURC_CRAFTING_KNOWN] = GetString(SI_FURC_CRAFTING_KNOWN_TT) + tooltipsSource[FURC_CRAFTING_UNKNOWN] = GetString(SI_FURC_CRAFTING_UNKNOWN_TT) + tooltipsSource[FURC_VENDOR] = GetString(SI_FURC_VENDOR_TT) + tooltipsSource[FURC_PVP] = GetString(SI_FURC_PVP_TT) + tooltipsSource[FURC_CROWN] = GetString(SI_FURC_CROWN_TT) + tooltipsSource[FURC_WRIT_VENDOR] = GetString(SI_FURC_STRING_WRIT_VENDOR_TT) + tooltipsSource[FURC_RUMOUR] = GetString(SI_FURC_RUMOUR_TT) + tooltipsSource[FURC_LUXURY] = GetString(SI_FURC_LUXURY_TT) + tooltipsSource[FURC_OTHER] = GetString(SI_FURC_OTHER_TT) + + return tooltipsSource end FurnitureCatalogue.DropdownData = { - ChoicesVersion = { - [1] = GetString(SI_FURC_FILTER_VERSION_OFF), - [2] = GetString(SI_FURC_FILTER_VERSION_HS ), - [3] = GetString(SI_FURC_FILTER_VERSION_M ), - [4] = GetString(SI_FURC_FILTER_VERSION_R ), - [5] = GetString(SI_FURC_FILTER_VERSION_CC ), - [6] = GetString(SI_FURC_FILTER_VERSION_DRAGON), - [7] = GetString(SI_FURC_FILTER_VERSION_ALTMER), - }, - TooltipsVersion = { - [1] = GetString(SI_FURC_FILTER_VERSION_OFF_TT), - [2] = GetString(SI_FURC_FILTER_VERSION_HS_TT), - [3] = GetString(SI_FURC_FILTER_VERSION_M_TT), - [4] = GetString(SI_FURC_FILTER_VERSION_R_TT), - [5] = GetString(SI_FURC_FILTER_VERSION_CC_TT), - [6] = GetString(SI_FURC_FILTER_VERSION_DRAGON_TT), - [7] = GetString(SI_FURC_FILTER_VERSION_ALTMER_TT), - }, - ChoicesCharacter = { - [1] = GetString(SI_FURC_FILTER_CHAR_OFF), - }, - TooltipsCharacter = { - [1] = GetString(SI_FURC_FILTER_CHAR_OFF_TT), - }, - - -- will be set in setupSourceDropdown - ChoicesSource = {}, - TooltipsSource = {}, + ChoicesVersion = { + [1] = GetString(SI_FURC_FILTER_VERSION_OFF), + [2] = GetString(SI_FURC_FILTER_VERSION_HS ), + [3] = GetString(SI_FURC_FILTER_VERSION_M ), + [4] = GetString(SI_FURC_FILTER_VERSION_R ), + [5] = GetString(SI_FURC_FILTER_VERSION_CC ), + [6] = GetString(SI_FURC_FILTER_VERSION_DRAGON), + [7] = GetString(SI_FURC_FILTER_VERSION_ALTMER), + }, + TooltipsVersion = { + [1] = GetString(SI_FURC_FILTER_VERSION_OFF_TT), + [2] = GetString(SI_FURC_FILTER_VERSION_HS_TT), + [3] = GetString(SI_FURC_FILTER_VERSION_M_TT), + [4] = GetString(SI_FURC_FILTER_VERSION_R_TT), + [5] = GetString(SI_FURC_FILTER_VERSION_CC_TT), + [6] = GetString(SI_FURC_FILTER_VERSION_DRAGON_TT), + [7] = GetString(SI_FURC_FILTER_VERSION_ALTMER_TT), + }, + ChoicesCharacter = { + [1] = GetString(SI_FURC_FILTER_CHAR_OFF), + }, + TooltipsCharacter = { + [1] = GetString(SI_FURC_FILTER_CHAR_OFF_TT), + }, + + -- will be set in setupSourceDropdown + ChoicesSource = {}, + TooltipsSource = {}, } if GetAPIVersion() == 100024 then FurnitureCatalogue.DropdownData.ChoicesVersion[FURC_WEREWOLF] = GetString(SI_FURC_FILTER_VERSION_WEREWOLF) @@ -195,94 +195,94 @@ if GetAPIVersion() == 100024 then end local function updateDropdownData() - FurnitureCatalogue.DropdownData.ChoicesSource = getChoicesSource() - FurnitureCatalogue.DropdownData.TooltipsSource = getTooltipsSource() + FurnitureCatalogue.DropdownData.ChoicesSource = getChoicesSource() + FurnitureCatalogue.DropdownData.TooltipsSource = getTooltipsSource() end FurnitureCatalogue.updateDropdownData = updateDropdownData local function setupSourceDropdown() - updateDropdownData() - sourceIndices = {} + updateDropdownData() + sourceIndices = {} - for idx, key in ipairs(getSourceIndicesKeys()) do - sourceIndices[key] = idx - end - FurC.SourceIndices = sourceIndices + for idx, key in ipairs(getSourceIndicesKeys()) do + sourceIndices[key] = idx + end + FurC.SourceIndices = sourceIndices end function FurnitureCatalogue.DebugOut(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) - if not FurC.GetEnableDebug() then return end - if a10 then - d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)) - elseif a9 then - d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8, a9)) - elseif a8 then - d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8)) - elseif a7 then - d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7)) - elseif a6 then - d(zo_strformat(output, a1, a2, a3, a4, a5, a6)) - elseif a5 then - d(zo_strformat(output, a1, a2, a3, a4, a5)) - elseif a4 then - d(zo_strformat(output, a1, a2, a3, a4)) - elseif a3 then - d(zo_strformat(output, a1, a2, a3)) - elseif a2 then - d(zo_strformat(output, a1, a2)) - elseif a1 then - d(zo_strformat(output, a1)) - elseif output then - d(zo_strformat(output)) - else - d("\n") - end + if not FurC.GetEnableDebug() then return end + if a10 then + d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)) + elseif a9 then + d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8, a9)) + elseif a8 then + d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8)) + elseif a7 then + d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7)) + elseif a6 then + d(zo_strformat(output, a1, a2, a3, a4, a5, a6)) + elseif a5 then + d(zo_strformat(output, a1, a2, a3, a4, a5)) + elseif a4 then + d(zo_strformat(output, a1, a2, a3, a4)) + elseif a3 then + d(zo_strformat(output, a1, a2, a3)) + elseif a2 then + d(zo_strformat(output, a1, a2)) + elseif a1 then + d(zo_strformat(output, a1)) + elseif output then + d(zo_strformat(output)) + else + d("\n") + end end local function p(...) - FurC.DebugOut(...) + FurC.DebugOut(...) end function whoami() - return FurnitureCatalogue.CharacterName + return FurnitureCatalogue.CharacterName end -- initialization stuff function FurnitureCatalogue_Initialize(eventCode, addOnName) - if (addOnName ~= FurnitureCatalogue.name) then return end + if (addOnName ~= FurnitureCatalogue.name) then return end - FurnitureCatalogue.settings = ZO_SavedVars:NewAccountWide("FurnitureCatalogue_Settings", 2, nil, defaults) + FurnitureCatalogue.settings = ZO_SavedVars:NewAccountWide("FurnitureCatalogue_Settings", 2, nil, defaults) - -- setup the "source" dropdown for the menu - setupSourceDropdown() + -- setup the "source" dropdown for the menu + setupSourceDropdown() - FurnitureCatalogue.CreateSettings(FurnitureCatalogue.settings, defaults, FurnitureCatalogue) + FurnitureCatalogue.CreateSettings(FurnitureCatalogue.settings, defaults, FurnitureCatalogue) - FurnitureCatalogue.CharacterName = zo_strformat(GetUnitName('player')) + FurnitureCatalogue.CharacterName = zo_strformat(GetUnitName('player')) - FurC.RegisterEvents() + FurC.RegisterEvents() - FurC.InitGui() + FurC.InitGui() - FurnitureCatalogue.CreateTooltips() - FurC.InitRightclickMenu() + FurnitureCatalogue.CreateTooltips() + FurC.InitRightclickMenu() - FurC.SetupInventoryRecipeIcons() + FurC.SetupInventoryRecipeIcons() - local scanFiles = false - if FurC.settings.version < FurC.version then - FurC.settings.version = FurC.version - scanFiles = true - end + local scanFiles = false + if FurC.settings.version < FurC.version then + FurC.settings.version = FurC.version + scanFiles = true + end - FurnitureCatalogue.ScanRecipes(scanFiles, not FurC.GetSkipInitialScan()) - FurC.settings.databaseVersion = FurC.version - SLASH_COMMANDS["/fur"] = FurnitureCatalogue_Toggle + FurnitureCatalogue.ScanRecipes(scanFiles, not FurC.GetSkipInitialScan()) + FurC.settings.databaseVersion = FurC.version + SLASH_COMMANDS["/fur"] = FurnitureCatalogue_Toggle - FurC.SetFilter(true) + FurC.SetFilter(true) - EVENT_MANAGER:UnregisterForEvent("FurnitureCatalogue", EVENT_ADD_ON_LOADED) + EVENT_MANAGER:UnregisterForEvent("FurnitureCatalogue", EVENT_ADD_ON_LOADED) end diff --git a/xml/Bindings.xml b/xml/Bindings.xml index 5e8856b..898bda4 100644 --- a/xml/Bindings.xml +++ b/xml/Bindings.xml @@ -3,8 +3,8 @@ <Category name="Furniture Catalogue"> <Action name="TOGGLE_FURNITURE_CATALOGUE"> <Down> - FurnitureCatalogue_Toggle() - </Down> + FurnitureCatalogue_Toggle() + </Down> </Action> </Category> </Layer> diff --git a/xml/FurnitureCatalogue.xml b/xml/FurnitureCatalogue.xml index 79f723c..b555e6e 100644 --- a/xml/FurnitureCatalogue.xml +++ b/xml/FurnitureCatalogue.xml @@ -1,365 +1,365 @@ <GuiXml> - <Controls> - <TopLevelControl name="FurCGui" clampedToScreen="true" movable="true" mouseEnabled="true" hidden="true" resizeHandleSize="10"> - <DimensionConstraints x="800" y="500" minX="850" minY="200" maxY="2000"/> - <Anchor point="TOPRIGHT" relativeTo="GUI_ROOT" relativePoint="TOPRIGHT" offsetX="-25" offsetY="40" /> - <OnMoveStop>FurC.SaveFrameInfo("onMoveStop")</OnMoveStop> - - <OnResizeStop>FurC.SaveFrameInfo("onResizeStop")</OnResizeStop> - <Controls> - <Backdrop name="$(parent)_BG" inherits="ZO_DefaultBackdrop" > - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT"/> - </Backdrop> - - <Control name="$(parent)_Header" resizeToFitDescendents="true" > - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> - <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT"/> - - <Controls> - <Control name="$(parent)_Bar1"> - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetY="50"/> - <Controls> - <Button name="$(parent)_Feedback"> - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="20" offsetY="10"/> - <OnMouseEnter>FurC.GuiShowTooltip(self, "Click to say thank you:\nLeft: 2k\nRight: 10k\nMiddle: 25k\nYour feedback and/or donation is appreciated!")</OnMouseEnter> - <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> - <OnMouseUp>FurC.Donate(self, button)</OnMouseUp> - <Dimensions x="40" y="40" /> - <Textures - normal ="esoui/art/mail/mail_tabicon_compose_up.dds" - pressed ="esoui/art/mail/mail_tabicon_compose_down.dds" - mouseOver ="esoui/art/mail/mail_tabicon_compose_over.dds" - /> - </Button> - <Control name ="FurC_Label" resizeToFitDescendents="true"> - <Anchor point="TOP" relativeTo="$(parent)" relativePoint="TOP" offsetX="0" offsetY="10" /> - <Dimensions y="54"/> - <Controls> - <Label name="$(parent)_1" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="-Furniture Catalogue: " > - <Anchor point="LEFT" relativeTo="$(parent)" relativePoint="LEFT" offsetX="-40"/> - </Label> - <Label name="FurC_RecipeCount" font="$(STONE_TABLET_FONT)|24|soft-shadow-thick" mouseEnabled="true" resizeToFitDescendents="true"> - <Anchor point="LEFT" relativeTo="$(parent)_1" relativePoint="RIGHT" offsetX="10" offsetY="1"/> - <OnMouseEnter> FurC.GuiShowTooltip(self, "number of recipes below")</OnMouseEnter> - <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> - <OnMouseUp>FurC.RefreshCounter()</OnMouseUp> - </Label> - <Label name="$(parent)_2" font="$(STONE_TABLET_FONT)|26|soft-shadow-thick" text=" entries -" > - <Anchor point="LEFT" relativeTo="FurC_RecipeCount" relativePoint="RIGHT" offsetY="-1" /> - </Label> - </Controls> - </Control> - <Button name="$(parent)_Hide"> - <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-15" offsetY="15"/> - <OnMouseEnter>FurC.GuiShowTooltip(self, "Hide window")</OnMouseEnter> - <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> - <OnMouseUp>FurnitureCatalogue_Toggle()</OnMouseUp> - <Dimensions x="25" y="25" /> - <Textures - normal ="/esoui/art/buttons/decline_up.dds" - pressed ="/esoui/art/buttons/decline_down.dds" - mouseOver ="/esoui/art/buttons/decline_over.dds" - /> - </Button> - - <Button name="$(parent)_Reload"> - <Anchor point="TOPRIGHT" relativeTo="$(parent)_Hide" relativePoint="TOPLEFT" offsetX="-25" offsetY="-5"/> - <OnMouseEnter>FurC.GuiShowTooltip(self, "Click: Scan character knowledge to database\n\nRight-click: Re-scans data files\n\nMiddle-click: Re-create database (will ask you first)")</OnMouseEnter> - <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> - <OnMouseUp>FurC.GUIButtonRefreshOnMouseUp(self, button)</OnMouseUp> - - - <Dimensions x="35" y="35" /> - <Textures - normal ="/esoui/art/help/help_tabicon_feedback_up.dds" - pressed ="/esoui/art/help/help_tabicon_feedback_down.dds " - mouseOver ="/esoui/art/help/help_tabicon_feedback_over.dds" - /> - </Button> - <Button name="$(parent)_TemplateTiny"> - <Anchor point="TOPRIGHT" relativeTo="$(parent)_Reload" relativePoint="TOPLEFT" offsetX="-15" offsetY="-2"/> - <OnMouseEnter>FurC.GuiShowTooltip(self, "change template")</OnMouseEnter> - <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> - <OnMouseUp>FurC.ChangeTemplateFromButton(true)</OnMouseUp> - - <Dimensions x="35" y="35" /> - <Textures - normal ="/esoui/art/buttons/minus_up.dds" - pressed ="/esoui/art/buttons/minus_down.dds" - mouseOver ="/esoui/art/buttons/minus_over.dds" - /> - </Button> - - <Button name="$(parent)_TemplateLarge" hidden="true"> - <Anchor point="TOPRIGHT" relativeTo="$(parent)_Reload" relativePoint="TOPLEFT" offsetX="-15" offsetY="-2"/> - - <OnMouseEnter>FurC.GuiShowTooltip(self, "change template")</OnMouseEnter> - <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> - <OnMouseUp>FurC.ChangeTemplateFromButton(false)</OnMouseUp> - - <Dimensions x="35" y="35" /> - <Textures - normal ="/esoui/art/buttons/plus_up.dds" - pressed ="/esoui/art/buttons/plus_down.dds" - mouseOver ="/esoui/art/buttons/plus_over.dds" - /> - </Button> - - </Controls> - </Control> - <Control name="$(parent)_Bar2"> - <Anchor point="TOPLEFT" relativeTo="$(parent)_Bar1" relativePoint="BOTTOMLEFT" offsetX="20"/> - <Anchor point="TOPRIGHT" relativeTo="$(parent)_Bar1" relativePoint="BOTTOMRIGHT" offsetX="-20" /> - <Dimensions y="35" /> - - <Controls> - <Control name="FurC_DropdownSource" inherits="ZO_ComboBox" mouseEnabled="true" > - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/> - <Dimensions x="230" y="28" /> - <OnShow> FurC.GuiSetupDropdown(self)</OnShow> - <OnMouseEnter> FurC.GuiShowTooltip(self, "Filter: Knowledge and source", true)</OnMouseEnter> - <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> - </Control> - - <Control name="FurC_QualityFilter" mouseEnabled="true"> - <Anchor point="TOPLEFT" relativeTo="FurC_DropdownSource" relativePoint="TOPRIGHT" offsetX = "38" offsetY="3"/> - <Anchor point="BOTTOMRIGHT" relativeTo="FurC_DropdownSource" relativePoint="BOTTOMRIGHT" offsetX = "300" /> - </Control> - - <Control name="FurC_DropdownVersion" inherits="ZO_ComboBox" mouseEnabled="true" > - <Anchor point="TOPLEFT" relativeTo="FurC_QualityFilter" relativePoint="TOPRIGHT" offsetX="10"/> - <Dimensions x="235" y="28" /> - <OnShow> FurC.GuiSetupDropdown(self)</OnShow> - <OnMouseEnter> FurC.GuiShowTooltip(self, "Filter: game version", true)</OnMouseEnter> - <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> - </Control> - </Controls> - </Control> - <!-- 3rd bar --> - <Control name="$(parent)_Bar3" mouseEnabled="true"> - - <Dimensions y="55" /> - <Anchor point="TOPLEFT" relativeTo="$(parent)_Bar2" relativePoint="BOTTOMLEFT" offsetY="10"/> - <Anchor point="TOPRIGHT" relativeTo="$(parent)_Bar2" relativePoint="BOTTOMRIGHT"/> - <Dimensions y="45" /> - <Controls> - <!-- control above: FurC_DropdownSource --> - <Control name="FurC_DropdownCharacter" inherits="ZO_ComboBox" mouseEnabled="true" > - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/> - <Dimensions x="230" y="28" /> - <OnShow> FurC.GuiSetupDropdown(self)</OnShow> - <OnMouseEnter> FurC.GuiShowTooltip(self, "Filter: Character", true)</OnMouseEnter> - <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> - </Control> - - <!-- Crafting type filter --> - <Control name="FurC_TypeFilter" mouseEnabled="true" resizeToFitDescendents="true"> - <Anchor point="TOPLEFT" relativeTo="FurC_DropdownCharacter" relativePoint="TOPRIGHT" offsetX="17" offsetY="-5" /> - <Anchor point="BOTTOMRIGHT" relativeTo="FurC_DropdownCharacter" relativePoint="BOTTOMRIGHT" offsetX="340"/> - - </Control> - - <!-- control above: FurC_DropdownVersion --> - <Control name="FurC_Search" mouseEnabled="true"> - - <Anchor point="TOPLEFT" relativeTo="FurC_TypeFilter" relativePoint="TOPRIGHT" offsetX="9" offsetY="10"/> - <Anchor point="BOTTOMLEFT" relativeTo="FurC_TypeFilter" relativePoint="BOTTOMRIGHT" offsetX="9" /> - <Dimensions x="215" /> - <Controls> - - <EditBox name="$(parent)Box" inherits="ZO_InventorySearchBox" > - - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-40" offsetY="-10"/> - <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-20" offsetY="0"/> - - <OnTextChanged>FurC.GuiSetSearchboxTextFrom(self)</OnTextChanged> - <OnMouseUp>FurC.GuiOnSearchBoxClick(self, button)</OnMouseUp> - <OnMouseDoubleClick>FurC.GuiOnSearchBoxClick(self, nil, true)</OnMouseDoubleClick> - <OnFocusLost>FurC.GuiOnSearchBoxFocusOut(self)</OnFocusLost> - - </EditBox> - </Controls> - </Control> - - - - - - </Controls> - </Control> - - - <!-- #4, sorts the list holder --> - <Control name="$(parent)_SortBar" mouseEnabled="true"> - - <Anchor point="TOPLEFT" relativeTo="$(parent)_Bar3" relativePoint="BOTTOMLEFT" offsetX="25" offsetY="20"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)_Bar3" relativePoint="BOTTOMRIGHT" offsetY="40"/> - <Dimensions y="20" /> - - <Controls> - <Label name="$(parent)_Name" mouseEnabled="true" font="ZoFontGameSmall" text="Name" > - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" /> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMLEFT" offsetX="330"/> - <OnMouseUp>FurC.GuiOnSort("itemName")</OnMouseUp> - <Controls> - <Button name="$(parent)_Button" verticalAlignment="LEFT" mouseEnabled="true"> - <Dimensions y="20" x="20"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-25" /> - <Textures - normal="esoui/art/miscellaneous/list_sortheader_icon_neutral.dds" - mouseOver="esoui/art/miscellaneous/list_sortheader_icon_over.dds" - /> - </Button> - </Controls> - </Label> - - <Label name="$(parent)_Quality" mouseEnabled="true" font="ZoFontGameSmall" text="Quality" > - <Anchor point="TOPLEFT" relativeTo="$(parent)_Name" relativePoint="TOPRIGHT" /> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT"/> - <OnMouseUp>FurC.GuiOnSort("itemQuality")</OnMouseUp> - <Controls> - <Button name="$(parent)_Button" verticalAlignment="LEFT" mouseEnabled="true"> - <Dimensions y="20" x="20"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-25" /> - <Textures - normal="esoui/art/miscellaneous/list_sortheader_icon_neutral.dds" - mouseOver="esoui/art/miscellaneous/list_sortheader_icon_over.dds" - /> - </Button> - </Controls> - </Label> - - - </Controls> - - </Control> - - </Controls> - <!-- $(parent)_Header --> - </Control> - - <Label name="$(parent)_Wait" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="Please wait... loading data" > - <Anchor point="TOP" relativeTo="$(parent)_Header" relativePoint="BOTTOM" offsetY="35" /> - </Label> - <Label name="$(parent)_Empty" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="No results, please check filter" hidden="true" > - <Anchor point="TOP" relativeTo="$(parent)_Header" relativePoint="BOTTOM" offsetY="35" /> - </Label> - - <Control name="$(parent)_ListHolder" mouseEnabled="true"> - - <DimensionConstraints minY="52"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)_Header" relativePoint="BOTTOMLEFT" offsetX="25" /> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="-35" offsetY="-20"/> - - <OnMouseWheel>FurC.GuiOnScroll(self, delta)</OnMouseWheel> - - <Controls> - <Slider name="$(parent)_Slider" mouseEnabled="true" step="1" inherits="ZO_VerticalScrollbarBase"> - <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="20" /> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="20" offsetY="-25" /> - - <OnMouseDown>self.locked = false</OnMouseDown> - <OnMouseUp>self.locked = true</OnMouseUp> - <OnValueChanged>FurC.GuiOnSliderUpdate(self, value)</OnValueChanged> - </Slider> - </Controls> - - </Control> - </Controls> - - </TopLevelControl> - - <Button name="FurC_QualityFilterButton" virtual="true"> - <Dimensions x="35" y="35" /> - <OnMouseEnter> FurC.GuiVirtualMouseOver(self) </OnMouseEnter> - <OnMouseExit> FurC.GuiVirtualMouseOut(self) </OnMouseExit> - <OnMouseUp> FurC.GuiQualityMouseUp(self, button) </OnMouseUp> - </Button> - <Button name="FurC_CraftingTypeFilterButton" virtual="true"> - <Dimensions x="40" y="40" /> - <OnMouseEnter> FurC.GuiVirtualMouseOver(self) </OnMouseEnter> - <OnMouseExit> FurC.GuiVirtualMouseOut(self) </OnMouseExit> - <OnMouseUp> FurC.GuiCraftingTypeMouseUp(self) </OnMouseUp> - </Button> - - <Control name="FurC_SlotTemplate" inherits="ZO_ListInventorySlotBehavior" virtual="true" mouseEnabled="true"> - <Dimensions x="300"/> - <OnMouseEnter> FurC.GuiLineOnMouseEnter(self) </OnMouseEnter> - <OnMouseExit> FurC.GuiLineOnMouseExit(self) </OnMouseExit> - <OnMouseUp> FurC.OnControlMouseUp(self, button) </OnMouseUp> - <OnMouseDoubleClick> FurC.OnControlDoubleClick(self) </OnMouseDoubleClick> - - <Controls> - <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds" alpha="0.4"> - <AnchorFill /> - <TextureCoords left="0" right="1" top="0" bottom=".8125" /> - </Texture> - - <Button name="$(parent)Button" inherits="ZO_InventorySlotNoMouseover" hidden="false"> - <Dimensions x="40" y="40" /> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="-10" offsetY="3" /> - </Button> - - <Label name="$(parent)Name" font="ZoFontGameShadow" wrapMode="ELLIPSIS" verticalAlignment="CENTER"> - <Dimensions y="50" x="280"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Button" relativePoint="TOPRIGHT" offsetX="18"/> - <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Button" relativePoint="BOTTOMRIGHT" offsetX="0"/> - </Label> - <Label name="$(parent)Mats" font="ZoFontGame" wrapMode="ELLIPSIS" verticalAlignment="LEFT"> - <Dimensions y="50" /> - <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="18"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="-10"/> - </Label> - - </Controls> - </Control> - - <Control name="FurC_SlotTemplateTiny" inherits="ZO_ListInventorySlotBehavior" virtual="true" mouseEnabled="true"> - <Dimensions x="300" /> - <OnMouseEnter> FurC.GuiLineOnMouseEnter(self) </OnMouseEnter> - <OnMouseExit> FurC.GuiLineOnMouseExit(self) </OnMouseExit> - <OnMouseUp> FurC.OnControlMouseUp(self, button) </OnMouseUp> - <OnMouseDoubleClick> FurC.OnControlDoubleClick(self) </OnMouseDoubleClick> - - <Controls> - <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds" alpha="0.4"> - <AnchorFill /> - <TextureCoords left="0" right="1" top="0" bottom=".8125" /> - </Texture> - - <Button name="$(parent)Button" inherits="ZO_InventorySlotNoMouseover" hidden="true"> - <Dimensions x="1"/> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="0" offsetY="3" /> - </Button> - <Label name="$(parent)Name" font="ZoFontGame" wrapMode="ELLIPSIS" verticalAlignment="CENTER"> - <Dimensions y="50" x="230"/> - <Anchor point="TOPLEFT" relativeTo="$(parent)Button" relativePoint="TOPRIGHT" /> - <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Button" relativePoint="BOTTOMRIGHT" /> - </Label> - <Label name="$(parent)Mats" font="ZoFontGame" wrapMode="ELLIPSIS" verticalAlignment="LEFT"> - <Dimensions y="50" /> - <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="18"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="-10"/> - </Label> - - </Controls> - </Control> - - <Texture name="FurC_SlotIconKnownNo" color="FF0000" mouseEnabled="true" textureFile="esoui/art/buttons/decline_up.dds" virtual="true"> - <Dimensions x="24" y="24" /> - </Texture> - <Texture name="FurC_SlotIconKnownYes" color="00FF00" mouseEnabled="true" textureFile="esoui/art/cadwell/check.dds" virtual="true"> - <Dimensions x="24" y="24" /> - </Texture> + <Controls> + <TopLevelControl name="FurCGui" clampedToScreen="true" movable="true" mouseEnabled="true" hidden="true" resizeHandleSize="10"> + <DimensionConstraints x="800" y="500" minX="850" minY="200" maxY="2000"/> + <Anchor point="TOPRIGHT" relativeTo="GUI_ROOT" relativePoint="TOPRIGHT" offsetX="-25" offsetY="40" /> + <OnMoveStop>FurC.SaveFrameInfo("onMoveStop")</OnMoveStop> + + <OnResizeStop>FurC.SaveFrameInfo("onResizeStop")</OnResizeStop> + <Controls> + <Backdrop name="$(parent)_BG" inherits="ZO_DefaultBackdrop" > + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT"/> + </Backdrop> + + <Control name="$(parent)_Header" resizeToFitDescendents="true" > + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> + <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT"/> + + <Controls> + <Control name="$(parent)_Bar1"> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetY="50"/> + <Controls> + <Button name="$(parent)_Feedback"> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="20" offsetY="10"/> + <OnMouseEnter>FurC.GuiShowTooltip(self, "Click to say thank you:\nLeft: 2k\nRight: 10k\nMiddle: 25k\nYour feedback and/or donation is appreciated!")</OnMouseEnter> + <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> + <OnMouseUp>FurC.Donate(self, button)</OnMouseUp> + <Dimensions x="40" y="40" /> + <Textures + normal ="esoui/art/mail/mail_tabicon_compose_up.dds" + pressed ="esoui/art/mail/mail_tabicon_compose_down.dds" + mouseOver ="esoui/art/mail/mail_tabicon_compose_over.dds" + /> + </Button> + <Control name ="FurC_Label" resizeToFitDescendents="true"> + <Anchor point="TOP" relativeTo="$(parent)" relativePoint="TOP" offsetX="0" offsetY="10" /> + <Dimensions y="54"/> + <Controls> + <Label name="$(parent)_1" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="-Furniture Catalogue: " > + <Anchor point="LEFT" relativeTo="$(parent)" relativePoint="LEFT" offsetX="-40"/> + </Label> + <Label name="FurC_RecipeCount" font="$(STONE_TABLET_FONT)|24|soft-shadow-thick" mouseEnabled="true" resizeToFitDescendents="true"> + <Anchor point="LEFT" relativeTo="$(parent)_1" relativePoint="RIGHT" offsetX="10" offsetY="1"/> + <OnMouseEnter> FurC.GuiShowTooltip(self, "number of recipes below")</OnMouseEnter> + <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> + <OnMouseUp>FurC.RefreshCounter()</OnMouseUp> + </Label> + <Label name="$(parent)_2" font="$(STONE_TABLET_FONT)|26|soft-shadow-thick" text=" entries -" > + <Anchor point="LEFT" relativeTo="FurC_RecipeCount" relativePoint="RIGHT" offsetY="-1" /> + </Label> + </Controls> + </Control> + <Button name="$(parent)_Hide"> + <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-15" offsetY="15"/> + <OnMouseEnter>FurC.GuiShowTooltip(self, "Hide window")</OnMouseEnter> + <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> + <OnMouseUp>FurnitureCatalogue_Toggle()</OnMouseUp> + <Dimensions x="25" y="25" /> + <Textures + normal ="/esoui/art/buttons/decline_up.dds" + pressed ="/esoui/art/buttons/decline_down.dds" + mouseOver ="/esoui/art/buttons/decline_over.dds" + /> + </Button> + + <Button name="$(parent)_Reload"> + <Anchor point="TOPRIGHT" relativeTo="$(parent)_Hide" relativePoint="TOPLEFT" offsetX="-25" offsetY="-5"/> + <OnMouseEnter>FurC.GuiShowTooltip(self, "Click: Scan character knowledge to database\n\nRight-click: Re-scans data files\n\nMiddle-click: Re-create database (will ask you first)")</OnMouseEnter> + <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> + <OnMouseUp>FurC.GUIButtonRefreshOnMouseUp(self, button)</OnMouseUp> + + + <Dimensions x="35" y="35" /> + <Textures + normal ="/esoui/art/help/help_tabicon_feedback_up.dds" + pressed ="/esoui/art/help/help_tabicon_feedback_down.dds " + mouseOver ="/esoui/art/help/help_tabicon_feedback_over.dds" + /> + </Button> + <Button name="$(parent)_TemplateTiny"> + <Anchor point="TOPRIGHT" relativeTo="$(parent)_Reload" relativePoint="TOPLEFT" offsetX="-15" offsetY="-2"/> + <OnMouseEnter>FurC.GuiShowTooltip(self, "change template")</OnMouseEnter> + <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> + <OnMouseUp>FurC.ChangeTemplateFromButton(true)</OnMouseUp> + + <Dimensions x="35" y="35" /> + <Textures + normal ="/esoui/art/buttons/minus_up.dds" + pressed ="/esoui/art/buttons/minus_down.dds" + mouseOver ="/esoui/art/buttons/minus_over.dds" + /> + </Button> + + <Button name="$(parent)_TemplateLarge" hidden="true"> + <Anchor point="TOPRIGHT" relativeTo="$(parent)_Reload" relativePoint="TOPLEFT" offsetX="-15" offsetY="-2"/> + + <OnMouseEnter>FurC.GuiShowTooltip(self, "change template")</OnMouseEnter> + <OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit> + <OnMouseUp>FurC.ChangeTemplateFromButton(false)</OnMouseUp> + + <Dimensions x="35" y="35" /> + <Textures + normal ="/esoui/art/buttons/plus_up.dds" + pressed ="/esoui/art/buttons/plus_down.dds" + mouseOver ="/esoui/art/buttons/plus_over.dds" + /> + </Button> + + </Controls> + </Control> + <Control name="$(parent)_Bar2"> + <Anchor point="TOPLEFT" relativeTo="$(parent)_Bar1" relativePoint="BOTTOMLEFT" offsetX="20"/> + <Anchor point="TOPRIGHT" relativeTo="$(parent)_Bar1" relativePoint="BOTTOMRIGHT" offsetX="-20" /> + <Dimensions y="35" /> + + <Controls> + <Control name="FurC_DropdownSource" inherits="ZO_ComboBox" mouseEnabled="true" > + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/> + <Dimensions x="230" y="28" /> + <OnShow> FurC.GuiSetupDropdown(self)</OnShow> + <OnMouseEnter> FurC.GuiShowTooltip(self, "Filter: Knowledge and source", true)</OnMouseEnter> + <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> + </Control> + + <Control name="FurC_QualityFilter" mouseEnabled="true"> + <Anchor point="TOPLEFT" relativeTo="FurC_DropdownSource" relativePoint="TOPRIGHT" offsetX = "38" offsetY="3"/> + <Anchor point="BOTTOMRIGHT" relativeTo="FurC_DropdownSource" relativePoint="BOTTOMRIGHT" offsetX = "300" /> + </Control> + + <Control name="FurC_DropdownVersion" inherits="ZO_ComboBox" mouseEnabled="true" > + <Anchor point="TOPLEFT" relativeTo="FurC_QualityFilter" relativePoint="TOPRIGHT" offsetX="10"/> + <Dimensions x="235" y="28" /> + <OnShow> FurC.GuiSetupDropdown(self)</OnShow> + <OnMouseEnter> FurC.GuiShowTooltip(self, "Filter: game version", true)</OnMouseEnter> + <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> + </Control> + </Controls> + </Control> + <!-- 3rd bar --> + <Control name="$(parent)_Bar3" mouseEnabled="true"> + + <Dimensions y="55" /> + <Anchor point="TOPLEFT" relativeTo="$(parent)_Bar2" relativePoint="BOTTOMLEFT" offsetY="10"/> + <Anchor point="TOPRIGHT" relativeTo="$(parent)_Bar2" relativePoint="BOTTOMRIGHT"/> + <Dimensions y="45" /> + <Controls> + <!-- control above: FurC_DropdownSource --> + <Control name="FurC_DropdownCharacter" inherits="ZO_ComboBox" mouseEnabled="true" > + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/> + <Dimensions x="230" y="28" /> + <OnShow> FurC.GuiSetupDropdown(self)</OnShow> + <OnMouseEnter> FurC.GuiShowTooltip(self, "Filter: Character", true)</OnMouseEnter> + <OnMouseExit> FurC.GuiHideTooltip(self)</OnMouseExit> + </Control> + + <!-- Crafting type filter --> + <Control name="FurC_TypeFilter" mouseEnabled="true" resizeToFitDescendents="true"> + <Anchor point="TOPLEFT" relativeTo="FurC_DropdownCharacter" relativePoint="TOPRIGHT" offsetX="17" offsetY="-5" /> + <Anchor point="BOTTOMRIGHT" relativeTo="FurC_DropdownCharacter" relativePoint="BOTTOMRIGHT" offsetX="340"/> + + </Control> + + <!-- control above: FurC_DropdownVersion --> + <Control name="FurC_Search" mouseEnabled="true"> + + <Anchor point="TOPLEFT" relativeTo="FurC_TypeFilter" relativePoint="TOPRIGHT" offsetX="9" offsetY="10"/> + <Anchor point="BOTTOMLEFT" relativeTo="FurC_TypeFilter" relativePoint="BOTTOMRIGHT" offsetX="9" /> + <Dimensions x="215" /> + <Controls> + + <EditBox name="$(parent)Box" inherits="ZO_InventorySearchBox" > + + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-40" offsetY="-10"/> + <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-20" offsetY="0"/> + + <OnTextChanged>FurC.GuiSetSearchboxTextFrom(self)</OnTextChanged> + <OnMouseUp>FurC.GuiOnSearchBoxClick(self, button)</OnMouseUp> + <OnMouseDoubleClick>FurC.GuiOnSearchBoxClick(self, nil, true)</OnMouseDoubleClick> + <OnFocusLost>FurC.GuiOnSearchBoxFocusOut(self)</OnFocusLost> + + </EditBox> + </Controls> + </Control> + + + + + + </Controls> + </Control> + + + <!-- #4, sorts the list holder --> + <Control name="$(parent)_SortBar" mouseEnabled="true"> + + <Anchor point="TOPLEFT" relativeTo="$(parent)_Bar3" relativePoint="BOTTOMLEFT" offsetX="25" offsetY="20"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)_Bar3" relativePoint="BOTTOMRIGHT" offsetY="40"/> + <Dimensions y="20" /> + + <Controls> + <Label name="$(parent)_Name" mouseEnabled="true" font="ZoFontGameSmall" text="Name" > + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMLEFT" offsetX="330"/> + <OnMouseUp>FurC.GuiOnSort("itemName")</OnMouseUp> + <Controls> + <Button name="$(parent)_Button" verticalAlignment="LEFT" mouseEnabled="true"> + <Dimensions y="20" x="20"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-25" /> + <Textures + normal="esoui/art/miscellaneous/list_sortheader_icon_neutral.dds" + mouseOver="esoui/art/miscellaneous/list_sortheader_icon_over.dds" + /> + </Button> + </Controls> + </Label> + + <Label name="$(parent)_Quality" mouseEnabled="true" font="ZoFontGameSmall" text="Quality" > + <Anchor point="TOPLEFT" relativeTo="$(parent)_Name" relativePoint="TOPRIGHT" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT"/> + <OnMouseUp>FurC.GuiOnSort("itemQuality")</OnMouseUp> + <Controls> + <Button name="$(parent)_Button" verticalAlignment="LEFT" mouseEnabled="true"> + <Dimensions y="20" x="20"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-25" /> + <Textures + normal="esoui/art/miscellaneous/list_sortheader_icon_neutral.dds" + mouseOver="esoui/art/miscellaneous/list_sortheader_icon_over.dds" + /> + </Button> + </Controls> + </Label> + + + </Controls> + + </Control> + + </Controls> + <!-- $(parent)_Header --> + </Control> + + <Label name="$(parent)_Wait" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="Please wait... loading data" > + <Anchor point="TOP" relativeTo="$(parent)_Header" relativePoint="BOTTOM" offsetY="35" /> + </Label> + <Label name="$(parent)_Empty" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="No results, please check filter" hidden="true" > + <Anchor point="TOP" relativeTo="$(parent)_Header" relativePoint="BOTTOM" offsetY="35" /> + </Label> + + <Control name="$(parent)_ListHolder" mouseEnabled="true"> + + <DimensionConstraints minY="52"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)_Header" relativePoint="BOTTOMLEFT" offsetX="25" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="-35" offsetY="-20"/> + + <OnMouseWheel>FurC.GuiOnScroll(self, delta)</OnMouseWheel> + + <Controls> + <Slider name="$(parent)_Slider" mouseEnabled="true" step="1" inherits="ZO_VerticalScrollbarBase"> + <Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="20" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="20" offsetY="-25" /> + + <OnMouseDown>self.locked = false</OnMouseDown> + <OnMouseUp>self.locked = true</OnMouseUp> + <OnValueChanged>FurC.GuiOnSliderUpdate(self, value)</OnValueChanged> + </Slider> + </Controls> + + </Control> + </Controls> + + </TopLevelControl> + + <Button name="FurC_QualityFilterButton" virtual="true"> + <Dimensions x="35" y="35" /> + <OnMouseEnter> FurC.GuiVirtualMouseOver(self) </OnMouseEnter> + <OnMouseExit> FurC.GuiVirtualMouseOut(self) </OnMouseExit> + <OnMouseUp> FurC.GuiQualityMouseUp(self, button) </OnMouseUp> + </Button> + <Button name="FurC_CraftingTypeFilterButton" virtual="true"> + <Dimensions x="40" y="40" /> + <OnMouseEnter> FurC.GuiVirtualMouseOver(self) </OnMouseEnter> + <OnMouseExit> FurC.GuiVirtualMouseOut(self) </OnMouseExit> + <OnMouseUp> FurC.GuiCraftingTypeMouseUp(self) </OnMouseUp> + </Button> + + <Control name="FurC_SlotTemplate" inherits="ZO_ListInventorySlotBehavior" virtual="true" mouseEnabled="true"> + <Dimensions x="300"/> + <OnMouseEnter> FurC.GuiLineOnMouseEnter(self) </OnMouseEnter> + <OnMouseExit> FurC.GuiLineOnMouseExit(self) </OnMouseExit> + <OnMouseUp> FurC.OnControlMouseUp(self, button) </OnMouseUp> + <OnMouseDoubleClick> FurC.OnControlDoubleClick(self) </OnMouseDoubleClick> + + <Controls> + <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds" alpha="0.4"> + <AnchorFill /> + <TextureCoords left="0" right="1" top="0" bottom=".8125" /> + </Texture> + + <Button name="$(parent)Button" inherits="ZO_InventorySlotNoMouseover" hidden="false"> + <Dimensions x="40" y="40" /> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="-10" offsetY="3" /> + </Button> + + <Label name="$(parent)Name" font="ZoFontGameShadow" wrapMode="ELLIPSIS" verticalAlignment="CENTER"> + <Dimensions y="50" x="280"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Button" relativePoint="TOPRIGHT" offsetX="18"/> + <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Button" relativePoint="BOTTOMRIGHT" offsetX="0"/> + </Label> + <Label name="$(parent)Mats" font="ZoFontGame" wrapMode="ELLIPSIS" verticalAlignment="LEFT"> + <Dimensions y="50" /> + <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="18"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="-10"/> + </Label> + + </Controls> + </Control> + + <Control name="FurC_SlotTemplateTiny" inherits="ZO_ListInventorySlotBehavior" virtual="true" mouseEnabled="true"> + <Dimensions x="300" /> + <OnMouseEnter> FurC.GuiLineOnMouseEnter(self) </OnMouseEnter> + <OnMouseExit> FurC.GuiLineOnMouseExit(self) </OnMouseExit> + <OnMouseUp> FurC.OnControlMouseUp(self, button) </OnMouseUp> + <OnMouseDoubleClick> FurC.OnControlDoubleClick(self) </OnMouseDoubleClick> + + <Controls> + <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds" alpha="0.4"> + <AnchorFill /> + <TextureCoords left="0" right="1" top="0" bottom=".8125" /> + </Texture> + + <Button name="$(parent)Button" inherits="ZO_InventorySlotNoMouseover" hidden="true"> + <Dimensions x="1"/> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="0" offsetY="3" /> + </Button> + <Label name="$(parent)Name" font="ZoFontGame" wrapMode="ELLIPSIS" verticalAlignment="CENTER"> + <Dimensions y="50" x="230"/> + <Anchor point="TOPLEFT" relativeTo="$(parent)Button" relativePoint="TOPRIGHT" /> + <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Button" relativePoint="BOTTOMRIGHT" /> + </Label> + <Label name="$(parent)Mats" font="ZoFontGame" wrapMode="ELLIPSIS" verticalAlignment="LEFT"> + <Dimensions y="50" /> + <Anchor point="TOPLEFT" relativeTo="$(parent)Name" relativePoint="TOPRIGHT" offsetX="18"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="-10"/> + </Label> + + </Controls> + </Control> + + <Texture name="FurC_SlotIconKnownNo" color="FF0000" mouseEnabled="true" textureFile="esoui/art/buttons/decline_up.dds" virtual="true"> + <Dimensions x="24" y="24" /> + </Texture> + <Texture name="FurC_SlotIconKnownYes" color="00FF00" mouseEnabled="true" textureFile="esoui/art/cadwell/check.dds" virtual="true"> + <Dimensions x="24" y="24" /> + </Texture> <!-- - <Texture name="FurC_SlotIconKnownNo" color="FF0000" textureFile="esoui/art/miscellaneous/search_icon.dds" virtual="true"> - <Dimensions x="30" y="30" /> - </Texture> - <Texture name="FurC_SlotIconKnownNo" color="00FF00" textureFile="esoui/art/cadwell/check.dds" virtual="true"> - <Dimensions x="30" y="30" /> - </Texture> + <Texture name="FurC_SlotIconKnownNo" color="FF0000" textureFile="esoui/art/miscellaneous/search_icon.dds" virtual="true"> + <Dimensions x="30" y="30" /> + </Texture> + <Texture name="FurC_SlotIconKnownNo" color="00FF00" textureFile="esoui/art/cadwell/check.dds" virtual="true"> + <Dimensions x="30" y="30" /> + </Texture> --> - </Controls> + </Controls> </GuiXml>