diff --git a/Alchemy.lua b/Alchemy.lua index 34ed4fc..aa68fbc 100644 --- a/Alchemy.lua +++ b/Alchemy.lua @@ -130,9 +130,9 @@ local function LLC_AlchemyCraftInteraction(station, earliest, addon , position) currentCraftAttempt.prevSlots = LibLazyCrafting.backpackInventory() end -local function LLC_AlchemyCraftingComplete(event, station, lastCheck) +local function LLC_AlchemyCraftingComplete(station, lastCheck) dbug("EVENT:CraftComplete") - LibLazyCrafting.stackableCraftingComplete(event, station, lastCheck, CRAFTING_TYPE_ALCHEMY, currentCraftAttempt) + LibLazyCrafting.stackableCraftingComplete(station, lastCheck, CRAFTING_TYPE_ALCHEMY, currentCraftAttempt) end diff --git a/Enchanting.lua b/Enchanting.lua index be4fa62..5bbffe0 100644 --- a/Enchanting.lua +++ b/Enchanting.lua @@ -365,7 +365,8 @@ local function LLC_EnchantingCraftinteraction(station, earliest, addon, position select(2,findItemLocationById(earliest["aspectItemID"])), earliest["quantity"] } - local maxCraftable = math.min(earliest["quantity"] or 1, GetMaxIterationsPossibleForEnchantingItem(unpack(locations))) + local max = GetMaxIterationsPossibleForEnchantingItem(unpack(locations)) + local maxCraftable = math.min(earliest["quantity"] or 1, max ) locations[7] = maxCraftable if locations[1] and locations[3] and locations[5] and maxCraftable>0 then dbug("CALL:ZOEnchantCraft") @@ -464,7 +465,7 @@ local function wasItemMade(bag, slot) return GetItemLinkName(GetItemLink(BAG_BACKPACK, slot,0)) == GetItemLinkName(currentCraftAttempt.link) and GetItemLinkQuality(GetItemLink(BAG_BACKPACK, slot,0)) == GetItemLinkQuality(currentCraftAttempt.link) end -local function handleEnchantComplete(event, station, slot) +local function handleEnchantComplete(station, slot) -- We found it! dbug("ACTION:RemoveQueueItem") local removedTable = craftingQueue[currentCraftAttempt.Requester][CRAFTING_TYPE_ENCHANTING][currentCraftAttempt.position] @@ -479,7 +480,6 @@ local function handleEnchantComplete(event, station, slot) removedTable.quantity = removedTable.quantity - 1 currentCraftAttempt.quantity = currentCraftAttempt.quantity - 1 end - -- d(removedTable) if removedTable.dualEnchantingSmithing then removedTable.glyphInfo= removedTable.glyphInfo or {} table.insert(removedTable.glyphInfo, @@ -509,7 +509,7 @@ local function handleEnchantComplete(event, station, slot) return removedTable end -local function LLC_EnchantingCraftingComplete(event, station, lastCheck) +local function LLC_EnchantingCraftingComplete(station, lastCheck) if currentCraftAttempt.allRunesKnown==false then -- User didn't know all the glyphs, so we get the item link *now* since now they know them -- Hopefully they have more than one currentCraftAttempt.link = GetEnchantingResultingItemLink(unpack(currentCraftAttempt.locations)) @@ -520,7 +520,7 @@ local function LLC_EnchantingCraftingComplete(event, station, lastCheck) local found = false local removedTable while slot ~= nil do - removedTable = handleEnchantComplete(event, station, slot) + removedTable = handleEnchantComplete(station, slot) bag, slot = LibLazyCrafting.findNextSlotIndex(wasItemMade, slot+1) found = true end diff --git a/LibLazyCrafting.lua b/LibLazyCrafting.lua index 7f9fc6b..07a0f95 100644 --- a/LibLazyCrafting.lua +++ b/LibLazyCrafting.lua @@ -17,7 +17,7 @@ end -- Initialize libraries local libLoaded -local LIB_NAME, VERSION = "LibLazyCrafting", 3.07 +local LIB_NAME, VERSION = "LibLazyCrafting", 3.074 local LibLazyCrafting, oldminor if LibStub then LibLazyCrafting, oldminor = LibStub:NewLibrary(LIB_NAME, VERSION) @@ -180,8 +180,9 @@ LibLazyCrafting.craftResultFunctions = craftResultFunctions --- GENERAL HELPER FUNCTIONS function LibLazyCrafting.AddHomeMarker(setId, station) + -- d("Add " .. tostring(setId) .." : " .. station) if HomeStationMarker then - if setIndex == INDEX_NO_SET then + if setId == LibLazyCrafting.INDEX_NO_SET then HomeStationMarker.AddMarker(nil, station) else HomeStationMarker.AddMarker(setId, station) @@ -190,8 +191,9 @@ function LibLazyCrafting.AddHomeMarker(setId, station) end function LibLazyCrafting.DeleteHomeMarker(setId, station) + -- d("Delete " .. tostring(setId) .." : " .. station) if HomeStationMarker then - if setIndex == INDEX_NO_SET then + if setId == LibLazyCrafting.INDEX_NO_SET then HomeStationMarker.DeleteMarker(nil, station) else HomeStationMarker.DeleteMarker(setId, station) @@ -294,7 +296,7 @@ local function tableClear(t) end -- Common code called by Alchemy and Provisioning crafting complete handlers. -function LibLazyCrafting.stackableCraftingComplete(event, station, lastCheck, craftingType, currentCraftAttempt) +function LibLazyCrafting.stackableCraftingComplete(station, lastCheck, craftingType, currentCraftAttempt) dbug("EVENT:CraftComplete") if not (currentCraftAttempt and currentCraftAttempt.addon) then return end local currSlots = LibLazyCrafting.backpackInventory() @@ -322,7 +324,7 @@ function LibLazyCrafting.stackableCraftingComplete(event, station, lastCheck, cr local earliest = craftingQueue[currentCraftAttempt.addon][craftingType][currentCraftAttempt.position] earliest.timesToMake = earliest.timesToMake - 1 currentCraftAttempt.timesToMake = earliest.timesToMake - if GetCraftingInteractionType()==0 then zo_callLater(function() LibLazyCrafting.stackableCraftingComplete(event, station, true, craftingType, currentCraftAttempt) end,100) end + if GetCraftingInteractionType()==0 then zo_callLater(function() LibLazyCrafting.stackableCraftingComplete( station, true, craftingType, currentCraftAttempt) end,100) end end elseif lastCheck then -- give up on finding it. @@ -330,7 +332,7 @@ function LibLazyCrafting.stackableCraftingComplete(event, station, lastCheck, cr else -- further search -- search again later - if GetCraftingInteractionType()==0 then zo_callLater(function() LibLazyCrafting.stackableCraftingComplete(event, station, true, craftingType, currentCraftAttempt) end,100) end + if GetCraftingInteractionType()==0 then zo_callLater(function() LibLazyCrafting.stackableCraftingComplete( station, true, craftingType, currentCraftAttempt) end,100) end end end diff --git a/LibLazyCrafting.txt b/LibLazyCrafting.txt index bfbc7c6..f5f3fdc 100644 --- a/LibLazyCrafting.txt +++ b/LibLazyCrafting.txt @@ -6,8 +6,8 @@ ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms ## APIVersion: 100035 -## Title: LibLazyCrafting v3.07 -## Version: 3.07 +## Title: LibLazyCrafting v3.074 +## Version: 3.074 ## Author: Dolgubon ## Contributors: ziggr ## OptionalDependsOn: pChat LibStub HomeStationMarker diff --git a/Provisioning.lua b/Provisioning.lua index d443c74..a8daf86 100644 --- a/Provisioning.lua +++ b/Provisioning.lua @@ -117,8 +117,8 @@ local function LLC_ProvisioningCraftInteraction(station, earliest, addon , posit currentCraftAttempt.prevSlots = LibLazyCrafting.backpackInventory() end -local function LLC_ProvisioningCraftingComplete(event, station, lastCheck) - LibLazyCrafting.stackableCraftingComplete(event, station, lastCheck, CRAFTING_TYPE_PROVISIONING, currentCraftAttempt) +local function LLC_ProvisioningCraftingComplete(station, lastCheck) + LibLazyCrafting.stackableCraftingComplete(station, lastCheck, CRAFTING_TYPE_PROVISIONING, currentCraftAttempt) end local function LLC_ProvisioningIsItemCraftable(self, station, request) diff --git a/Smithing.lua b/Smithing.lua index 809e9df..b7cf853 100644 --- a/Smithing.lua +++ b/Smithing.lua @@ -985,7 +985,7 @@ local function smithingCompleteNewItemHandler(station, bag, slot) currentCraftAttempt.smithingQuantity = currentCraftAttempt.smithingQuantity - 1 end if currentCraftAttempt.quality>1 then - --d("Improving #".. tostring(currentCraftAttempt.reference)) + -- d("Improving #".. tostring(currentCraftAttempt.reference)) if removedRequest.dualEnchantingSmithing then table.insert(removedRequest.equipInfo, @@ -1009,6 +1009,8 @@ local function smithingCompleteNewItemHandler(station, bag, slot) local copiedTable = LibLazyCrafting.tableShallowCopy(removedRequest) copiedTable.slot = slot copiedTable.smithingQuantity = 1 + LibLazyCrafting.DeleteHomeMarker(removedRequest.setIndex, station) + LibLazyCrafting.AddHomeMarker(INDEX_NO_SET, station) LibLazyCrafting.SendCraftEvent(LLC_INITIAL_CRAFT_SUCCESS, station, currentCraftAttempt.Requester, copiedTable) else removedRequest.bag = BAG_BACKPACK @@ -1205,7 +1207,10 @@ local setInfo = {{168747 , 168767, [6] = 168754, [7] =168782 },9,isSwapped=true}, -- 541 Aetherial Ascension {{168373 , 168393, [6] = 168380, [7] =168408 },6,isSwapped=true}, -- 540 Legacy of Karth {{167999 , 168019, [6] = 168006, [7] =168034 },3,isSwapped=true}, -- 539 Red Eagle's Fury - + {{172455 , 172475, [6] = 172462, [7] =172490 },3,isSwapped=true}, -- 582 Hist Whisperer's Song + {{172829 , 172849, [6] = 172836, [7] =172864 },7,isSwapped=true}, -- 583 Heartland Conquerer + {{173203 , 173223, [6] = 173210, [7] =173238 },5,isSwapped=true}, -- 584 Diamond's Victory + } SetIndexes = {} @@ -1497,7 +1502,7 @@ local function internalScrapeSetItemItemIds() local estimatedTime = math.floor((20000*apiVersionDifference+200000)/300*25/1000)+3 zo_callLater(function() CHAT_SYSTEM:AddMessage("LibLazyCrafting: Beginning scrape of set items. Estimated time: "..estimatedTime.."s") - CHAT_SYSTEM:AddMessage("This is a once per major game update scan. Please wait until it it is complete.")end + CHAT_SYSTEM:AddMessage("This is a (usually) once per major game update scan. Please wait until it it is complete.")end , 25) local craftedItemIds = LibLazyCraftingSavedVars.SetIds or {} @@ -1879,9 +1884,9 @@ local function initializeSetInfo() end local vars = LibLazyCraftingSavedVars -- Last condition is bc I forgot to actually add them before the patch increase :( - if not vars.SetIds or not vars.lastScrapedAPIVersion or vars.lastScrapedAPIVersion