1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
--[[ Crafting Create Screen Base ]] --
end
end
-- To be used with the C APIs, eg. CreateTradeskillItem(tradeskillObject:GetAllCraftingParameters())
-- Lua limitation:
-- writing tradeskillObject:GetAllCraftingParameters(), numIterations would truncate the crafting
-- parameters to only the first return, so each implementation of
-- GetAllCraftingParameters should manually place that argument at the end themselves
-- return implementation defined
end
-- should return bool
end
-- override me
return 1
end
-- should return bool, errorString
end
end
end
--[[ Crafting Multi Slot Base ]] --
return craftingSlot
end
function ZO_CraftingMultiSlotBase : Initialize ( owner , control , slotType , emptyTexture , multipleItemsTexture , craftingInventory , emptySlotIconTexture )
if emptySlotIconTexture then
end
-- required
-- optional
end
if isCorrectType then
else
end
end
end
-- Use to validate a list of virtually stacked items created from EnumerateInventorySlotsAndAddToScrollData
-- validItemFilterFn is optional
local failed = false
local itemsChanged = false
local bagId , slotIndex , itemInstanceId = item . bagId , item . slotIndex , item . itemInstanceId
else
itemsChanged = true
failed = true
end
end
if itemsChanged then
end
return not failed
end
do
if item . bagId == validItem . bagId and item . slotIndex == validItem . slotIndex then
return true
end
end
return false
end
-- Use to validate a list of slotDatas created from GetIndividualInventorySlotsAndAddToScrollData
-- validItemFilterFn is optional
local failed = false
local needsValidation = { }
needsValidation [ i ] = true
end
if MatchesValidItemSlot ( item , validItems ) and ( validItemFilterFn == nil or validItemFilterFn ( item . bagId , item . slotIndex ) ) then
needsValidation [ idx ] = nil
end
end
-- There are items that were not validated, clear them out
failed = true
if needsValidation [ i ] then
end
end
end
if failed then
return false
else
return true
end
end
end
end
return true
end
return false
end
-- Crafting slots work off of virtual inventories, so this item is used to represent all items with the instance id that is slotted here, not just this slot
local item =
{
bagId = bagId ,
slotIndex = slotIndex ,
}
return true
end
return false
end
if addedItem then
end
return addedItem
end
local removedItem = false
if item . bagId == bagId and item . slotIndex == slotIndex then
removedItem = true
break
end
end
if removedItem then
end
return removedItem
end
local isEmpty = numItems == 0
local icon
local quantity
if isEmpty then
quantity = 0
elseif numItems == 1 then
else
quantity = 0 -- hide quantity label
end
local MEETS_REQUIREMENTS = nil
local LOCKED = nil
ZO_ItemSlot_SetupSlotBase ( self . control , quantity , icon , MEETS_REQUIREMENTS , LOCKED , self : ShouldBeVisible ( ) )
else
ZO_ItemSlot_SetupSlot ( self . control , quantity , icon , MEETS_REQUIREMENTS , LOCKED , self : ShouldBeVisible ( ) )
end
end
if icon == "" then
-- Empty string represents no icon, in this case we should just hide both inventory slot icon and our empty slot override
else
end
end
end
local quantity = 0
-- non virtual items will have a stack count of 0, but we know that they represent exactly one in quantity
quantity = quantity + zo_max ( 1 , self . craftingInventory : GetStackCount ( self : GetItemBagAndSlot ( index ) ) )
end
end
return quantity
end
end
end
end
end
end
end
end
end
if item then
return item . bagId , item . slotIndex
end
return nil
end
if item then
return item . itemInstanceId
end
return nil
end
if item . itemInstanceId == itemId then
return true
end
end
return false
end
if item . bagId == bagId and item . slotIndex == slotIndex then
return true
end
end
return false
end
end
end
end
end
end
end
-- To be overridden if managing the visibility of the slot
return true
end
--[[ Crafting Slot Base ]] --
-- This is a multislot that only permits single items. The multislot API can
-- be used, but the old single-slot api has been implemented on top.
-- Attempting to add multiple items using AddItem() will instead replace the
-- current item.
end
function ZO_CraftingSlotBase : Initialize ( owner , control , slotType , emptyTexture , craftingInventory , emptySlotIcon )
return ZO_CraftingMultiSlotBase . Initialize ( self , owner , control , slotType , emptyTexture , "" , craftingInventory , emptySlotIcon )
end
-- can be overriden for custom functionality, but should still call base or SetupItem
end
if oldBagId ~= bagId or oldSlotIndex ~= slotIndex then
end
end
-- instead of adding, replace existing items
end
end
end
end
end
end
self . animation = ANIMATION_MANAGER : CreateTimelineFromVirtual ( "CraftingGlowAlphaAnimation" , self : GetNamedChild ( "Glow" ) )
end
--[[ Crafting Slot Animation Base ]] --
return craftingSlotAnimationBase
end
end
end )
end
end
end
end
-- intended to be overridden
end
-- intended to be overridden
end
--[[ Global Utils ]] --
if cost > 0 then
return zo_strformat ( SI_CRAFTING_PERFORM_CRAFT , ZO_Currency_FormatKeyboard ( CURT_MONEY , cost , ZO_CURRENCY_FORMAT_AMOUNT_ICON ) )
end
return zo_strformat ( SI_CRAFTING_PERFORM_CRAFT , ZO_Currency_FormatKeyboard ( CURT_MONEY , cost , ZO_CURRENCY_FORMAT_ERROR_AMOUNT_ICON ) )
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
do
local CRAFTABLE_TRAIT_TYPES =
{
ITEM_TRAIT_TYPE_NONE ,
ITEM_TRAIT_TYPE_WEAPON_POWERED ,
ITEM_TRAIT_TYPE_WEAPON_CHARGED ,
ITEM_TRAIT_TYPE_WEAPON_PRECISE ,
ITEM_TRAIT_TYPE_WEAPON_INFUSED ,
ITEM_TRAIT_TYPE_WEAPON_DEFENDING ,
ITEM_TRAIT_TYPE_WEAPON_TRAINING ,
ITEM_TRAIT_TYPE_WEAPON_SHARPENED ,
ITEM_TRAIT_TYPE_WEAPON_DECISIVE ,
ITEM_TRAIT_TYPE_WEAPON_NIRNHONED ,
ITEM_TRAIT_TYPE_ARMOR_STURDY ,
ITEM_TRAIT_TYPE_ARMOR_IMPENETRABLE ,
ITEM_TRAIT_TYPE_ARMOR_REINFORCED ,
ITEM_TRAIT_TYPE_ARMOR_WELL_FITTED ,
ITEM_TRAIT_TYPE_ARMOR_TRAINING ,
ITEM_TRAIT_TYPE_ARMOR_INFUSED ,
ITEM_TRAIT_TYPE_ARMOR_PROSPEROUS ,
ITEM_TRAIT_TYPE_ARMOR_DIVINES ,
ITEM_TRAIT_TYPE_ARMOR_NIRNHONED ,
ITEM_TRAIT_TYPE_JEWELRY_ARCANE ,
ITEM_TRAIT_TYPE_JEWELRY_HEALTHY ,
ITEM_TRAIT_TYPE_JEWELRY_ROBUST ,
ITEM_TRAIT_TYPE_JEWELRY_TRIUNE ,
ITEM_TRAIT_TYPE_JEWELRY_INFUSED ,
ITEM_TRAIT_TYPE_JEWELRY_PROTECTIVE ,
ITEM_TRAIT_TYPE_JEWELRY_SWIFT ,
ITEM_TRAIT_TYPE_JEWELRY_HARMONY ,
ITEM_TRAIT_TYPE_JEWELRY_BLOODTHIRSTY ,
}
local traits = { }
local traitIndex = traitType + 1
local _ , name , icon , sellPrice , meetsUsageRequirement , itemStyle , quality = GetSmithingTraitItemInfo ( traitIndex )
index = traitIndex ,
icon = icon ,
sellPrice = sellPrice ,
meetsUsageRequirement = meetsUsageRequirement ,
itemStyle = itemStyle ,
quality = quality ,
} )
end
return traits
end
end
do
local ITEM_FILTER_TO_SMITHING_FILTER =
{
[ ITEMFILTERTYPE_WEAPONS ] = SMITHING_FILTER_TYPE_WEAPONS ,
[ ITEMFILTERTYPE_ARMOR ] = SMITHING_FILTER_TYPE_ARMOR ,
[ ITEMFILTERTYPE_JEWELRY ] = SMITHING_FILTER_TYPE_JEWELRY ,
}
local smithingFilter = ITEM_FILTER_TO_SMITHING_FILTER [ itemFilter ]
if smithingFilter then
return smithingFilter
end
end
return SMITHING_FILTER_TYPE_RAW_MATERIALS
end
return ITEM_FILTER_TO_SMITHING_FILTER [ itemFilter ]
end
local SMITHING_FILTER_TO_ITEM_FILTER =
{
[ SMITHING_FILTER_TYPE_WEAPONS ] = ITEMFILTERTYPE_WEAPONS ,
[ SMITHING_FILTER_TYPE_SET_WEAPONS ] = ITEMFILTERTYPE_WEAPONS ,
[ SMITHING_FILTER_TYPE_ARMOR ] = ITEMFILTERTYPE_ARMOR ,
[ SMITHING_FILTER_TYPE_SET_ARMOR ] = ITEMFILTERTYPE_ARMOR ,
[ SMITHING_FILTER_TYPE_JEWELRY ] = ITEMFILTERTYPE_JEWELRY ,
[ SMITHING_FILTER_TYPE_SET_JEWELRY ] = ITEMFILTERTYPE_JEWELRY ,
}
return SMITHING_FILTER_TO_ITEM_FILTER [ smithingFilter ]
end
local TRAIT_CATEGORY_TO_SMITHING_FILTER =
{
[ ITEM_TRAIT_TYPE_CATEGORY_WEAPON ] = SMITHING_FILTER_TYPE_WEAPONS ,
[ ITEM_TRAIT_TYPE_CATEGORY_ARMOR ] = SMITHING_FILTER_TYPE_ARMOR ,
[ ITEM_TRAIT_TYPE_CATEGORY_JEWELRY ] = SMITHING_FILTER_TYPE_JEWELRY ,
}
end
local SMITHING_FILTER_TO_BASE_FILTER =
{
[ SMITHING_FILTER_TYPE_WEAPONS ] = SMITHING_FILTER_TYPE_WEAPONS ,
[ SMITHING_FILTER_TYPE_SET_WEAPONS ] = SMITHING_FILTER_TYPE_WEAPONS ,
[ SMITHING_FILTER_TYPE_ARMOR ] = SMITHING_FILTER_TYPE_ARMOR ,
[ SMITHING_FILTER_TYPE_SET_ARMOR ] = SMITHING_FILTER_TYPE_ARMOR ,
[ SMITHING_FILTER_TYPE_JEWELRY ] = SMITHING_FILTER_TYPE_JEWELRY ,
[ SMITHING_FILTER_TYPE_SET_JEWELRY ] = SMITHING_FILTER_TYPE_JEWELRY ,
}
return SMITHING_FILTER_TO_BASE_FILTER [ smithingFilter ]
end
if SMITHING_FILTER_TO_BASE_FILTER [ smithingFilter ] == nil then
return true
end
return SMITHING_FILTER_TO_BASE_FILTER [ smithingFilter ] == smithingFilter
end
return false
end
if baseFilter == SMITHING_FILTER_TYPE_WEAPONS then
elseif baseFilter == SMITHING_FILTER_TYPE_ARMOR then
elseif baseFilter == SMITHING_FILTER_TYPE_JEWELRY then
end
end
end
do
local g_isCrafting = false
g_isCrafting = true
end )
g_isCrafting = false
end )
end
end
end
-- Crafting screens virtualize each item into stacks, but only refining items
-- can properly support deconstruction by virtual stack. In all other cases, eg.
-- enchanting, we need to send a message with each slot represented by the
-- virtual stack, which is what this function prepares for us.
function ZO_CraftingUtils_AddVirtualStackToDeconstructMessageAsRealStacks ( virtualBagId , virtualSlotIndex , quantityToAdd )
local ALL_MATCHING_ITEMS = nil
-- When there are more slots than items to add, we want to prioritize
-- backpack items over bank items. Since the loop that adds these items pops
-- from the end, we should generate our slots list so that the end of the list holds all the backpack items
local slots = PLAYER_INVENTORY : GenerateAllSlotsInVirtualStackedItem ( ALL_MATCHING_ITEMS , instanceId , INVENTORY_BANK , INVENTORY_BACKPACK )
while quantityToAdd > 0 and slots [ 1 ] do
return false
end
quantityToAdd = quantityToAdd - stackCount
end
return quantityToAdd == 0 -- did we add as many items as we requested?
end
if key ~= "topSection" then
end
end |