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 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 |
ZO_TRADE_BOP_ICON = "EsoUI/Art/Inventory/inventory_Tradable_icon.dds"
end
end
if itemCombinationResult == ITEM_COMBINATION_RESULT_SUCCESS then
-- Combinations play an animation on success, hide UI so the player can see it
end
end
end )
self . bagCache = { }
self . questCache = { }
{
-- with the addition of Craft Bags the bank bag could be modified by the automatic transfer
-- of bank contents to the Craft Bag on joining a region
for bag = BAG_HOUSE_BANK_ONE , BAG_HOUSE_BANK_TEN do
end
end ,
end ,
} )
{
end ,
} )
{
end ,
end ,
} )
end
local function OnInventorySlotUpdated ( eventCode , bagId , slotIndex , isNewItem , itemSoundCategory , updateReason )
if updateReason == INVENTORY_UPDATE_REASON_DURABILITY_CHANGE then
if newCondition == 100 then
end
end
self . refresh : RefreshSingle ( "inventory" , bagId , slotIndex , isNewItem , itemSoundCategory , updateReason )
if bagId == BAG_BACKPACK or bagId == BAG_VIRTUAL then
if isNewItem and GetCraftingInteractionType ( ) == CRAFTING_TYPE_INVALID and not SYSTEMS : IsShowing ( "crownCrate" ) then
end
end
if bagId == BAG_WORN and eventCode == EVENT_INVENTORY_SINGLE_SLOT_UPDATE then
if updateReason == INVENTORY_UPDATE_REASON_DEFAULT then
if slotHasItem then
else
end
end
if updateReason == INVENTORY_UPDATE_REASON_DURABILITY_CHANGE then
if effectivenessReduced then
end
end
end
end
end
end
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_INVENTORY_SINGLE_SLOT_UPDATE , OnInventorySlotUpdated )
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_GUILD_SELF_JOINED_GUILD , RefreshInventoryOnGuildChange )
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_GUILD_SELF_LEFT_GUILD , RefreshInventoryOnGuildChange )
local function OnGuildBankInventorySlotUpdated ( eventCode , slotIndex , updatedByLocalPlayer , itemSoundCategory )
end
end
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_GUILD_BANK_ITEM_ADDED , OnGuildBankInventorySlotUpdated )
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_GUILD_BANK_ITEM_REMOVED , OnGuildBankInventorySlotUpdated )
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_GUILD_BANK_UPDATED_QUANTITY , OnGuildBankInventorySlotUpdated )
end
end
end
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_QUEST_CONDITION_COUNTER_CHANGED , OnSingleQuestUpdated )
local wasInitialize = reason == CURRENCY_CHANGE_REASON_PLAYER_INIT
local wasItemPurchased = reason == CURRENCY_CHANGE_REASON_VENDOR and newMoney < oldMoney
if not ( wasItemPurchased or wasInitialize ) then
end
end
local isExcludedReason = changeReason == CURRENCY_CHANGE_REASON_PLAYER_INIT or
changeReason == CURRENCY_CHANGE_REASON_LOOT or
changeReason == CURRENCY_CHANGE_REASON_PVP_KILL_TRANSFER or
changeReason == CURRENCY_CHANGE_REASON_DEATH or
changeReason == CURRENCY_CHANGE_REASON_BANK_FEE or
( changeReason == CURRENCY_CHANGE_REASON_VENDOR and newTelvarStones < oldTelvarStones )
if not isExcludedReason then
end
end
end
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_SMITHING_TRAIT_RESEARCH_CANCELED , OnSmithingTraitResearch )
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_SMITHING_TRAIT_RESEARCH_STARTED , OnSmithingTraitResearch )
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_NON_COMBAT_BONUS_CHANGED , function ( event , nonCombatBonusType )
if nonCombatBonusType == NON_COMBAT_BONUS_MERCHANT_HAGGLING then
end
end )
local inventoryFilterTargetDescriptor =
{
[ BACKGROUND_LIST_FILTER_TARGET_BAG_SLOT ] =
{
searchFilterList =
{
BACKGROUND_LIST_FILTER_TYPE_NAME ,
} ,
{
BAG_WORN ,
BAG_BACKPACK ,
BAG_VIRTUAL ,
}
} ,
[ BACKGROUND_LIST_FILTER_TARGET_QUEST_ITEM_ID ] =
{
searchFilterList =
{
BACKGROUND_LIST_FILTER_TYPE_NAME ,
} ,
} ,
}
TEXT_SEARCH_MANAGER : SetupContextTextSearch ( "playerInventoryTextSearch" , inventoryFilterTargetDescriptor )
end
end
end
if onUseType == ITEM_USE_TYPE_COMBINATION then
if baseCollectibleId ~= 0 then
ZO_CombinationPromptManager_ShowEvolutionPrompt ( baseCollectibleId , unlockedCollectibleId , AcceptEvolutionCallback , DeclineEvolutionCallback )
return
end
end
-- right now only items that evolve collectibles need confirmation
-- so if it's not one of those, automatically accept using the item
end
end
EVENT_MANAGER : RegisterForEvent ( namespace , EVENT_CANCEL_REQUEST_CONFIRM_USE_ITEM , OnCancelConfirmUseItem )
end
end
end
function ZO_SharedInventoryManager : RefreshSingleSlot ( bagId , slotIndex , isNewItem , itemSoundCategory , updateReason )
end
end
-- where ... are bag ids to combined into a single data table
local filteredItems = { }
filteredItems [ # filteredItems + 1 ] = itemData
end
end
end
return filteredItems
end
if bagCache [ slotIndex ] then
return bagCache [ slotIndex ]
end
end
for i = 1 , numBagIds do
return false
end
end
end
return true
end
--Quest Items
end
end
if singleQuestCache then
return singleQuestCache
end
end
for questIndex = 1 , MAX_JOURNAL_QUESTS do
end
return self . questCache
end
-- Trait Information Update
-- Refresh all bags where weapons and armor can reside
end
local existingData = bagCache [ slotIndex ]
if existingData then
if existingData . traitInformation ~= newItemTraitInformation or existingData . sellInformation ~= newItemSellInformation then
existingData . traitInformation = newItemTraitInformation
existingData . traitInformationSortOrder = ZO_GetItemTraitInformation_SortOrder ( existingData . traitInformation )
existingData . sellInformation = newItemSellInformation
existingData . sellInformationSortOrder = ZO_GetItemSellInformationCustomSortOrder ( existingData . sellInformation )
end
end
end
end
end
-- Helper functions for new items
return true
end
end
end
return false
end
if slotData then
slotData . age = 0
end
end
if slotData then
end
return false
end
if slotData then
return slotData . uniqueId
end
end
local nickname
if collectibleId ~= 0 then
if collectibleData then
end
end
return interactName , nickname
end
--[[ Shared Guild Bank functions ]] --
local validId
for i = 1 , numGuilds do
if ( lastSuccessfulGuildBankId == guildId ) then
return
elseif ( validId == nil ) then
validId = guildId
end
end
if validId then
elseif numGuilds > 0 then
end
end
--[[ Private API ]] --
if not self . bagCache [ bagId ] then
self . bagCache [ bagId ] = { }
end
return self . bagCache [ bagId ]
end
return self . bagCache [ bagId ] ~= nil
end
return self . bagCache [ bagId ]
end
end
end
local SHARED_INVENTORY_SLOT_RESULT_REMOVED = 1
local SHARED_INVENTORY_SLOT_RESULT_ADDED = 2
local SHARED_INVENTORY_SLOT_RESULT_UPDATED = 3
local SHARED_INVENTORY_SLOT_RESULT_NO_CHANGE = 4
local SHARED_INVENTORY_SLOT_RESULT_REMOVE_AND_ADD = 5
function ZO_SharedInventoryManager : HandleSlotCreationOrUpdate ( bagCache , bagId , slotIndex , isNewItem )
local existingSlotData = bagCache [ slotIndex ]
bagCache [ slotIndex ] = slotData
if result == SHARED_INVENTORY_SLOT_RESULT_REMOVED then
elseif result == SHARED_INVENTORY_SLOT_RESULT_ADDED then
elseif result == SHARED_INVENTORY_SLOT_RESULT_UPDATED then
elseif result == SHARED_INVENTORY_SLOT_RESULT_REMOVE_AND_ADD then
end
end
local currentBitValue = 1
end
currentBitValue = currentBitValue * 2
end
end
slotData . statusSortOrder = self : ComputeDynamicStatusMask ( slotData . isPlayerLocked , slotData . isGemmable , slotData . stolen , slotData . isBoPTradeable , slotData . brandNew , slotData . bagId == BAG_WORN )
end
function ZO_SharedInventoryManager : CreateOrUpdateSlotData ( existingSlotData , bagId , slotIndex , isNewItem )
local icon , stackCount , sellPrice , meetsUsageRequirement , locked , equipType , _ , functionalQuality , displayQuality = GetItemInfo ( bagId , slotIndex )
local hadItemInSlotBefore = false
local wasSameItemInSlotBefore = false
local hasItemInSlotNow = stackCount > 0
local slot = existingSlotData
if not slot then
if hasItemInSlotNow then
slot = { }
end
else
hadItemInSlotBefore = slot . stackCount > 0
wasSameItemInSlotBefore = hadItemInSlotBefore and hasItemInSlotNow and slot . itemInstanceId == newItemInstanceId
end
if not hasItemInSlotNow then
if hadItemInSlotBefore then
return nil , SHARED_INVENTORY_SLOT_RESULT_REMOVED
end
return nil , SHARED_INVENTORY_SLOT_RESULT_NO_CHANGE
end
local rawNameBefore = slot . rawName
if rawNameBefore ~= slot . rawName then
end
if not wasSameItemInSlotBefore then
end
slot . iconFile = icon
slot . stackCount = stackCount
slot . sellPrice = sellPrice
slot . launderPrice = launderPrice
slot . stackSellPrice = stackCount * sellPrice
slot . stackLaunderPrice = stackCount * launderPrice
slot . bagId = bagId
slot . slotIndex = slotIndex
-- Items flagged equipped unique can only have one equipped, which means once they are
-- equipped they are no longer equippable, but we don't want to color these items red
-- in GamepadInventory once they are equipped, because that doesn't make any sense.
slot . meetsUsageRequirement = meetsUsageRequirement or ( bagId == BAG_WORN )
slot . locked = locked
slot . functionalQuality = functionalQuality
slot . displayQuality = displayQuality
-- slot.quality is deprecated, included here for addon backwards compatibility
slot . quality = displayQuality
slot . equipType = equipType
slot . itemInstanceId = newItemInstanceId
slot . isGemmable = false
slot . requiredPerGemConversion = nil
slot . gemsAwardedPerConversion = nil
if isFromCrownCrate then
local requiredPerGemConversion , gemsAwardedPerConversion = GetNumCrownGemsFromItemManualGemification ( bagId , slotIndex )
if requiredPerGemConversion > 0 and gemsAwardedPerConversion > 0 then
slot . requiredPerGemConversion = requiredPerGemConversion
slot . gemsAwardedPerConversion = gemsAwardedPerConversion
slot . isGemmable = true
end
end
if wasSameItemInSlotBefore and slot . age ~= 0 then
-- don't modify the age, keep it the same relative sort - for now?
elseif isNewItem then
else
slot . age = 0
end
if hadItemInSlotBefore then
if isNewItem then
return slot , SHARED_INVENTORY_SLOT_RESULT_REMOVE_AND_ADD
else
return slot , SHARED_INVENTORY_SLOT_RESULT_UPDATED
end
end
return slot , SHARED_INVENTORY_SLOT_RESULT_ADDED
end
--Quest Items Private API--
if not self . questCache [ questIndex ] then
end
return self . questCache [ questIndex ]
end
for questIndex = 1 , MAX_JOURNAL_QUESTS do
end
end
self . questCache [ questIndex ] = nil
-- First update all the tools for the quest...
self : CreateQuestData ( icon , stack , questIndex , toolIndex , QUEST_MAIN_STEP_INDEX , nil , name , questItemId )
end
-- Then update all the collectable items...
end
end
end
end
function ZO_SharedInventoryManager : CreateQuestData ( iconFile , stackCount , questIndex , toolIndex , stepIndex , conditionIndex , name , questItemId )
if ( stackCount > 0 ) then
local questCache = self . questCache
--store all tools and items in a subtable under the questIndex for faster access
if ( not questCache [ questIndex ] ) then
questCache [ questIndex ] = { }
end
local questItems = questCache [ questIndex ]
local questItem =
{
iconFile = iconFile ,
stackCount = stackCount ,
questIndex = questIndex ,
toolIndex = toolIndex ,
stepIndex = stepIndex ,
conditionIndex = conditionIndex ,
sellPrice = 0 ,
stackSellPrice = 0 ,
filterData = { ITEMFILTERTYPE_QUEST } ,
questItemId = questItemId ,
age = 0 , -- 0 for now, probably need to come up with a way to make these appear new when appropriate. maybe diffing what was there before with what's being added?
}
end
questItems [ questItemId ] = questItem
end
end
do
local SHOW_ALL = true
local HAS_ENOUGH = false
function ZO_SharedInventory_ConnectPlayerCurrencyLabel ( label , currencyType , currencyLocation , currencyOptions , showCap )
local dirty = true
local displayOptions = { }
end
label : RegisterForEvent ( EVENT_CURRENCY_UPDATE , function ( eventId , eventCurrencyType , eventCurrencyLocation , newAmount , oldAmount , reason )
if eventCurrencyType == currencyType and eventCurrencyLocation == currencyLocation then
dirty = true
else
dirty = false
ZO_CurrencyControl_SetSimpleCurrency ( label , currencyType , newAmount , currencyOptions , SHOW_ALL , HAS_ENOUGH , displayOptions )
end
end
end )
if dirty then
dirty = false
ZO_CurrencyControl_SetSimpleCurrency ( label , currencyType , GetCurrencyAmount ( currencyType , currencyLocation ) , currencyOptions , SHOW_ALL , HAS_ENOUGH , displayOptions )
end
end
end
end
end
-- Internal Use Only
if bagCache then
local previousSlotData = bagCache [ slotIndex ]
--Since the inventory can update the existing slot table to a new item we need to make a copy of the old data
if previousSlotData then
end
return previousSlotData
end
end
-- Globals --
ZO_INVENTORY_STAT_GROUPS =
{
{
STAT_MAGICKA_MAX ,
STAT_MAGICKA_REGEN_COMBAT ,
STAT_HEALTH_MAX ,
STAT_HEALTH_REGEN_COMBAT ,
STAT_STAMINA_MAX ,
STAT_STAMINA_REGEN_COMBAT ,
} ,
{
STAT_SPELL_POWER ,
STAT_SPELL_CRITICAL ,
STAT_SPELL_PENETRATION ,
STAT_POWER ,
STAT_CRITICAL_STRIKE ,
STAT_PHYSICAL_PENETRATION ,
} ,
{
STAT_SPELL_RESIST ,
STAT_PHYSICAL_RESIST ,
STAT_CRITICAL_RESISTANCE ,
} ,
}
--Used to take the variable returns from CompareBagItemToCurrentlyEquipped or CompareItemLinkToCurrentlyEquipped
-- and put them in a hash table for more covenient lookups
local statDeltaLookup = { }
statDeltaLookup [ changedStat ] = changeAmount
end
return statDeltaLookup
end
local EQUIP_SLOTS =
{
EQUIP_SLOT_HEAD ,
EQUIP_SLOT_NECK ,
EQUIP_SLOT_CHEST ,
EQUIP_SLOT_SHOULDERS ,
EQUIP_SLOT_MAIN_HAND ,
EQUIP_SLOT_OFF_HAND ,
EQUIP_SLOT_WAIST ,
EQUIP_SLOT_LEGS ,
EQUIP_SLOT_FEET ,
EQUIP_SLOT_COSTUME ,
EQUIP_SLOT_RING1 ,
EQUIP_SLOT_RING2 ,
EQUIP_SLOT_HAND ,
EQUIP_SLOT_BACKUP_MAIN ,
EQUIP_SLOT_BACKUP_OFF ,
}
if ( result ~= nil ) then
return result
end
end
end
if backpackSlots then
local hadGemmableMaterial = false
hadGemmableMaterial = true
break
end
end
if hadGemmableMaterial then
else
end
end
end
do
-- if this triggers, need to add new trait information to this arbitrary sort order
local ITEM_TRAIT_INFORMATION_SORT_ORDER =
{
[ ITEM_TRAIT_INFORMATION_INTRICATE ] = 0 ,
[ ITEM_TRAIT_INFORMATION_NONE ] = 1 ,
[ ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED ] = 2 ,
[ ITEM_TRAIT_INFORMATION_RETRAITED ] = 3 ,
[ ITEM_TRAIT_INFORMATION_RECONSTRUCTED ] = 4 ,
[ ITEM_TRAIT_INFORMATION_ORNATE ] = 5 ,
}
return ITEM_TRAIT_INFORMATION_SORT_ORDER [ traitInfo ]
end
end
do
-- if this triggers, need to add new sell information to this arbitrary sort order
local ITEM_SELL_INFORMATION_SORT_ORDER =
{
[ ITEM_SELL_INFORMATION_PRIORITY_SELL ] = 0 ,
[ ITEM_SELL_INFORMATION_NONE ] = 1 ,
[ ITEM_SELL_INFORMATION_CAN_BE_RESEARCHED ] = 2 ,
[ ITEM_SELL_INFORMATION_INTRICATE ] = 3 ,
[ ITEM_SELL_INFORMATION_RECONSTRUCTED ] = 4 ,
[ ITEM_SELL_INFORMATION_CANNOT_SELL ] = 5 ,
}
return ITEM_SELL_INFORMATION_SORT_ORDER [ sellInformation ]
end
end |