Skip to content

Commit

Permalink
Furniture UI rework
Browse files Browse the repository at this point in the history
Fixed a bug with enchanting furniture recipes not showing material requirements
Changed the UI of the recipe list. First, it now uses a scroll list, instead of a tree, like the base game. As such, there is basically no longer any lag at all. Second, there is now a *second* scroll list, which has buttons for the different categories. By default, the list will now show all of the recipes. (under food/drink/furniture) Once you click a category (e.g. delicacies or suite) then only that category will be shown. You can show multiple categories at once. Did not clean out old code yet
DolgubonSetCrafter.addFurnitureByLink now also takes in a quantity param. Default is 1 if not provided
Favourites work for furniture
Added a bypass check if user tries to port to a crafting house on PTS
  • Loading branch information
Dolgubon committed Feb 15, 2024
1 parent f0a7d8d commit 6b7d1e0
Show file tree
Hide file tree
Showing 8 changed files with 408 additions and 298 deletions.
13 changes: 8 additions & 5 deletions Crafter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function DolgubonSetCrafter.recompileMatRequirements()
for station, stationQueue in pairs( LazyCrafter.personalQueue) do

for queuePosition, request in pairs(stationQueue) do
if (request.smithingQuantity == 0) or not (station == CRAFTING_TYPE_ENCHANTING ) then
if (request.smithingQuantity == 0) or not (station == CRAFTING_TYPE_ENCHANTING ) or (request.recipeListIndex) then
addRequirements(request, true)
end
end
Expand Down Expand Up @@ -750,14 +750,16 @@ function DolgubonSetCrafter.addFurniture()
requestTableCopy["Quality"] = DolgubonSetCrafter.quality[GetItemLinkQuality(DolgubonSetCrafter.selectedFurnitureLink)]
requestTableCopy["Name"] = {GetItemLinkName(DolgubonSetCrafter.selectedFurnitureLink), GetItemLinkName(DolgubonSetCrafter.selectedFurnitureLink)}
requestTableCopy["Station"] = {station, GetCraftingSkillName(station)}
requestTableCopy["isRecipe"] = true
requestTableCopy.typeId = 2
queue[#queue+1] = requestTableCopy
else
out("No item to craft was selected!")
end
end

function DolgubonSetCrafter.addFurnitureByLink(itemLink)
function DolgubonSetCrafter.addFurnitureByLink(itemLink, quantity)
quantity = quantity or 1
requestTableCopy = {}
requestTableCopy["Reference"] = DolgubonSetCrafter.savedvars.counter
DolgubonSetCrafter.savedvars.counter = DolgubonSetCrafter.savedvars.counter + 1
Expand All @@ -771,13 +773,14 @@ function DolgubonSetCrafter.addFurnitureByLink(itemLink)
if returnedTable then
addRequirements(returnedTable, true)
end
local _, recipeListIndex, recipeList = GetRecipeInfoFromItemId(GetItemLinkItemId(link))
local _,_,_,_,_,_, station = GetRecipeInfo(recipeListIndex, recipeList)
local station, recipeListIndex, recipeList = GetRecipeInfoFromItemId(GetItemLinkItemId(itemLink))
-- local _,_,_,_,_,_, station = GetRecipeInfo(recipeListIndex, recipeList)

requestTableCopy["Quantity"] = {1, "1x"}
requestTableCopy["Quantity"] = {quantity, quantity.."x"}
requestTableCopy["Quality"] = DolgubonSetCrafter.quality[GetItemLinkQuality(itemLink)]
requestTableCopy["Name"] = {GetItemLinkName(itemLink), GetItemLinkName(itemLink)}
requestTableCopy["Station"] = {station, GetCraftingSkillName(station)}
requestTableCopy["isRecipe"] = true
requestTableCopy.typeId = 2
queue[#queue+1] = requestTableCopy
DolgubonSetCrafter.updateList()
Expand Down
4 changes: 2 additions & 2 deletions DolgubonsLazySetCrafter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
; States and/or other countries. All rights reserved.
; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms

## Title: Dolgubon's Lazy Set Crafter v3.0.1
## Title: Dolgubon's Lazy Set Crafter v3.0.2
## APIVersion: 101040
## Author: Dolgubon
## Version: 3.0.1
## Version: 3.0.2
## SavedVariables: dolgubonslazysetcraftersavedvars
## DependsOn: LibLazyCrafting>=4000 LibAddonMenu-2.0 LibStub
## OptionalDependsOn: pChat LibFeedback LibCustomMenu LibPrice
Expand Down
90 changes: 50 additions & 40 deletions Favourites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ local function loadSelectionFavourite(selectedFavourite)
DolgubonSetCrafter.armourTypes[selectedFavourite.weight.id]:toggleOn()
end

local function loadRecipeQueueItem(queueInfo)
d(queueInfo)
DolgubonSetCrafter.addFurnitureByLink(queueInfo.Link, queueInfo.Quantity[1])
end

local function loadQueueFavourite(selectedFavourite, useCurrentLevel, useCurrentQuality, useCurrentSet, useCurrentStyle)
if useCurrentLevel then
d("LOADING Set Crafter selection: '"..selectedFavourite.name.."' with currently selected level")
Expand All @@ -151,50 +156,55 @@ local function loadQueueFavourite(selectedFavourite, useCurrentLevel, useCurrent
end

for k, v in pairs(selectedFavourite.queue) do
local copy = ZO_DeepTableCopy(v)
copy["CraftRequestTable"][11] = DolgubonSetCrafter.savedvars.counter
copy["Reference"] = DolgubonSetCrafter.savedvars.counter
local returnedTable
if useCurrentLevel then
local level, isCP = DolgubonSetCrafter:GetLevel()
local levelString = level
if isCP then
levelString = "CP "..levelString
d(v)
if v.isRecipe then
loadRecipeQueueItem(v)
else
local copy = ZO_DeepTableCopy(v)
copy["CraftRequestTable"][11] = DolgubonSetCrafter.savedvars.counter
copy["Reference"] = DolgubonSetCrafter.savedvars.counter
local returnedTable
if useCurrentLevel then
local level, isCP = DolgubonSetCrafter:GetLevel()
local levelString = level
if isCP then
levelString = "CP "..levelString
end
-- re-generate level stuff
copy["Level"] = {
level, levelString, isCP
}
copy["CraftRequestTable"][2] = isCP
copy["CraftRequestTable"][3] = level
local r = copy["CraftRequestTable"]

returnedTable = DolgubonSetCrafter.LazyCrafter:CraftSmithingItemByLevel(r[1], r[2], r[3],r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], nil, nil, nil, r[15])

copy["Link"] = DolgubonSetCrafter.LazyCrafter.getItemLinkFromParticulars( returnedTable.setIndex,returnedTable.trait ,returnedTable.pattern ,returnedTable.station ,level,
isCP,returnedTable.quality,returnedTable.style, returnedTable.potencyItemId , returnedTable.essenceItemId, returnedTable.aspectItemId)

if r[12] and r[13] and r[14] then -- If these are nil then there's no glyph
local enchantLevel = LibLazyCrafting.closestGlyphLevel(isCP, level)
enchantRequestTable = DolgubonSetCrafter.LazyCrafter:CraftEnchantingGlyphByAttributes(isCP, enchantLevel,
copy["Enchant"][1], copy["EnchantQuality"] ,
DolgubonSetCrafter:GetAutocraft(), returnedTable["Reference"], returnedTable)
r[12] = enchantRequestTable.potencyItemID
r[13] = enchantRequestTable.essenceItemID
r[14] = enchantRequestTable.aspectItemID
end

else
local r = copy["CraftRequestTable"]
returnedTable = DolgubonSetCrafter.LazyCrafter:CraftSmithingItemByLevel(r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15])
-- returnedTable = DolgubonSetCrafter.LazyCrafter:CraftSmithingItemByLevel(unpack(copy["CraftRequestTable"]))
end
-- re-generate level stuff
copy["Level"] = {
level, levelString, isCP
}
copy["CraftRequestTable"][2] = isCP
copy["CraftRequestTable"][3] = level
local r = copy["CraftRequestTable"]

returnedTable = DolgubonSetCrafter.LazyCrafter:CraftSmithingItemByLevel(r[1], r[2], r[3],r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], nil, nil, nil, r[15])

copy["Link"] = DolgubonSetCrafter.LazyCrafter.getItemLinkFromParticulars( returnedTable.setIndex,returnedTable.trait ,returnedTable.pattern ,returnedTable.station ,level,
isCP,returnedTable.quality,returnedTable.style, returnedTable.potencyItemId , returnedTable.essenceItemId, returnedTable.aspectItemId)
DolgubonSetCrafter.savedvars.counter = DolgubonSetCrafter.savedvars.counter + 1

if r[12] and r[13] and r[14] then -- If these are nil then there's no glyph
local enchantLevel = LibLazyCrafting.closestGlyphLevel(isCP, level)
enchantRequestTable = DolgubonSetCrafter.LazyCrafter:CraftEnchantingGlyphByAttributes(isCP, enchantLevel,
copy["Enchant"][1], copy["EnchantQuality"] ,
DolgubonSetCrafter:GetAutocraft(), returnedTable["Reference"], returnedTable)
r[12] = enchantRequestTable.potencyItemID
r[13] = enchantRequestTable.essenceItemID
r[14] = enchantRequestTable.aspectItemID
end
DolgubonSetCrafter.addRequirements(returnedTable, true)

else
local r = copy["CraftRequestTable"]
returnedTable = DolgubonSetCrafter.LazyCrafter:CraftSmithingItemByLevel(r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15])
-- returnedTable = DolgubonSetCrafter.LazyCrafter:CraftSmithingItemByLevel(unpack(copy["CraftRequestTable"]))
if pcall(function()DolgubonSetCrafter.applyValidityFunctions(v)end) then else d("Request could not be displayed. However, you should still be able to craft it.") end
table.insert(DolgubonSetCrafter.savedvars.queue, copy)
end
DolgubonSetCrafter.savedvars.counter = DolgubonSetCrafter.savedvars.counter + 1

DolgubonSetCrafter.addRequirements(returnedTable, true)

if pcall(function()DolgubonSetCrafter.applyValidityFunctions(v)end) then else d("Request could not be displayed. However, you should still be able to craft it.") end
table.insert(DolgubonSetCrafter.savedvars.queue, copy)
end
DolgubonSetCrafter.LazyCrafter:SetAllAutoCraft(DolgubonSetCrafter.savedvars.autoCraft)
DolgubonSetCrafter.updateList()
Expand Down
Loading

0 comments on commit 6b7d1e0

Please sign in to comment.