@@ -358,25 +358,26 @@ end
358
358
--- comment
359
359
--- @param multiplier number ?
360
360
--- @param crafterUID string
361
+ --- @param excludeWarbankTemp ? boolean
361
362
--- @return boolean
362
- function CraftSim .ReagentData :HasEnough (multiplier , crafterUID )
363
+ function CraftSim .ReagentData :HasEnough (multiplier , crafterUID , excludeWarbankTemp )
363
364
multiplier = multiplier or 1
364
365
-- check required, optional and finished reagents if the player has enough times multiplier in his inventory and bank
365
366
366
367
local hasRequiredReagents = GUTIL :Every (self .requiredReagents ,
367
368
--- @param requiredReagent CraftSim.Reagent
368
369
function (requiredReagent )
369
- return requiredReagent :HasItems (multiplier , crafterUID )
370
+ return requiredReagent :HasItems (multiplier , crafterUID , excludeWarbankTemp )
370
371
end )
371
372
372
373
local hasOptionalReagents = GUTIL :Every (GUTIL :Concat ({ self .optionalReagentSlots , self .finishingReagentSlots }),
373
374
--- @param optionalReagentSlot CraftSim.OptionalReagentSlot
374
375
function (optionalReagentSlot )
375
- return optionalReagentSlot :HasItem (multiplier , crafterUID )
376
+ return optionalReagentSlot :HasItem (multiplier , crafterUID , excludeWarbankTemp )
376
377
end )
377
378
local hasSparkReagent = true
378
379
if self :HasSparkSlot () then
379
- hasSparkReagent = self .sparkReagentSlot :HasItem (multiplier , crafterUID )
380
+ hasSparkReagent = self .sparkReagentSlot :HasItem (multiplier , crafterUID , excludeWarbankTemp )
380
381
end
381
382
-- update item cache for all possible optional reagents if I am the crafter
382
383
if crafterUID == CraftSim .UTIL :GetPlayerCrafterUID () then
@@ -402,33 +403,37 @@ function CraftSim.ReagentData:HasEnough(multiplier, crafterUID)
402
403
403
404
if self .recipeData .isEnchantingRecipe then
404
405
local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID , CraftSim .CONST
405
- .ENCHANTING_VELLUM_ID )
406
+ .ENCHANTING_VELLUM_ID , true )
406
407
hasVellumIfneeded = itemCount >= multiplier
407
408
end
408
409
409
410
410
411
return hasRequiredReagents and hasOptionalReagents and hasSparkReagent and hasVellumIfneeded
411
412
end
412
413
413
- function CraftSim .ReagentData :GetCraftableAmount (crafterUID )
414
+ --- @param crafterUID CrafterUID
415
+ --- @param excludeWarbankTemp ? boolean
416
+ function CraftSim .ReagentData :GetCraftableAmount (crafterUID , excludeWarbankTemp )
414
417
local print = CraftSim .DEBUG :SetDebugPrint (CraftSim .CONST .DEBUG_IDS .CRAFTQ )
415
418
416
419
print (" getCraftable amount" , false , true )
417
420
418
421
local currentMinimumReagentFit = math.huge
419
422
for _ , requiredReagent in pairs (self .requiredReagents ) do
420
423
if not requiredReagent :IsOrderReagentIn (self .recipeData ) then
421
- if not requiredReagent :HasItems (1 , crafterUID ) then
424
+ if not requiredReagent :HasItems (1 , crafterUID , excludeWarbankTemp ) then
422
425
return 0
423
426
end
424
- currentMinimumReagentFit = math.min (requiredReagent :HasQuantityXTimes (crafterUID ), currentMinimumReagentFit )
427
+ currentMinimumReagentFit = math.min (requiredReagent :HasQuantityXTimes (crafterUID , excludeWarbankTemp ),
428
+ currentMinimumReagentFit )
425
429
end
426
430
end
427
431
428
432
if self :HasSparkSlot () then
429
433
if self .sparkReagentSlot .activeReagent then
430
434
if not self .sparkReagentSlot .activeReagent :IsOrderReagentIn (self .recipeData ) then
431
- currentMinimumReagentFit = math.min (self .sparkReagentSlot :HasQuantityXTimes (crafterUID ),
435
+ currentMinimumReagentFit = math.min (
436
+ self .sparkReagentSlot :HasQuantityXTimes (crafterUID , excludeWarbankTemp ),
432
437
currentMinimumReagentFit )
433
438
end
434
439
else
@@ -443,10 +448,11 @@ function CraftSim.ReagentData:GetCraftableAmount(crafterUID)
443
448
local optionalReagentSlots = GUTIL :Concat ({ self .optionalReagentSlots , self .finishingReagentSlots })
444
449
for _ , optionalReagentSlot in pairs (optionalReagentSlots ) do
445
450
if optionalReagentSlot .activeReagent and not optionalReagentSlot .activeReagent :IsOrderReagentIn (self .recipeData ) then
446
- if not optionalReagentSlot :HasItem (1 , crafterUID ) then
451
+ if not optionalReagentSlot :HasItem (1 , crafterUID , excludeWarbankTemp ) then
447
452
return 0
448
453
end
449
- currentMinimumReagentFitOptional = math.min (optionalReagentSlot :HasQuantityXTimes (crafterUID ),
454
+ currentMinimumReagentFitOptional = math.min (
455
+ optionalReagentSlot :HasQuantityXTimes (crafterUID , excludeWarbankTemp ),
450
456
currentMinimumReagentFitOptional )
451
457
end
452
458
end
@@ -455,7 +461,7 @@ function CraftSim.ReagentData:GetCraftableAmount(crafterUID)
455
461
local vellumMinimumFit = math.huge
456
462
if self .recipeData .isEnchantingRecipe then
457
463
local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID , CraftSim .CONST
458
- .ENCHANTING_VELLUM_ID )
464
+ .ENCHANTING_VELLUM_ID , true )
459
465
vellumMinimumFit = itemCount
460
466
print (" minimum vellum fit: " .. tostring (vellumMinimumFit ))
461
467
end
@@ -484,6 +490,10 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID)
484
490
local iconSize = 25
485
491
local text = " "
486
492
493
+ -- TODO: Remove after 11.0.5
494
+ local excludeWarbankTemp = self .recipeData .orderData and
495
+ CraftSim .DB .OPTIONS :Get (" CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK" )
496
+
487
497
for _ , requiredReagent in pairs (self .requiredReagents ) do
488
498
local reagentIcon = requiredReagent .items [1 ].item :GetItemIcon ()
489
499
local inlineIcon = GUTIL :IconToText (reagentIcon , iconSize , iconSize )
@@ -496,7 +506,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID)
496
506
if reagentItem .originalItem then
497
507
itemID = reagentItem .originalItem :GetItemID ()
498
508
end
499
- local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID , itemID )
509
+ local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID , itemID , excludeWarbankTemp )
500
510
local quantityText = f .r (tostring (requiredReagent .requiredQuantity * multiplier ) ..
501
511
" (" .. tostring (itemCount ) .. " )" )
502
512
@@ -530,7 +540,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID)
530
540
if reagentItem .originalItem then
531
541
itemID = reagentItem .originalItem :GetItemID ()
532
542
end
533
- local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID , itemID )
543
+ local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID , itemID , excludeWarbankTemp )
534
544
local quantityText = f .r (
535
545
tostring (reagentItem .quantity * multiplier ) .. " (" .. tostring (itemCount ) .. " )" )
536
546
@@ -566,7 +576,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID)
566
576
local inlineIcon = GUTIL :IconToText (reagentIcon , iconSize , iconSize )
567
577
text = text .. inlineIcon
568
578
local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID ,
569
- itemID )
579
+ itemID , excludeWarbankTemp )
570
580
local requiredQuantity = self .sparkReagentSlot .maxQuantity * multiplier
571
581
local quantityText = f .r (tostring (requiredQuantity ) .. " (" .. tostring (itemCount ) .. " )" )
572
582
if itemCount >= requiredQuantity or isOrderReagent then
@@ -597,7 +607,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID)
597
607
local inlineIcon = GUTIL :IconToText (reagentIcon , iconSize , iconSize )
598
608
text = text .. inlineIcon
599
609
local itemCount = CraftSim .CRAFTQ :GetItemCountFromCraftQueueCache (crafterUID ,
600
- optionalReagentSlot .activeReagent .item :GetItemID ())
610
+ optionalReagentSlot .activeReagent .item :GetItemID (), excludeWarbankTemp )
601
611
local quantityText = f .r (tostring (multiplier ) .. " (" .. tostring (itemCount ) .. " )" )
602
612
if itemCount >= multiplier then
603
613
quantityText = f .g (tostring (multiplier ))
0 commit comments