|
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 |
ZO_CRAFTING_RESULT_TYPE ={ ITEM = 1, CURRENCY = 2, KNOWLEDGE = 3,}local CONTEXTUAL_ANIMATION_NAME_BY_CONTEXT ={ [CRAFTING_PROCESS_CONTEXT_CONSUME_ATTUNABLE_STATIONS] = "CraftingResultsConsumeStation_Animation",}local g_forceCenterResultsText = false local pulseTexture = CreateControlFromVirtual("$(parent)PulseTexture", control, "ZO_CraftingResultPulseTexture") control.pulseAnimation = ANIMATION_MANAGER:CreateTimelineFromVirtual("CraftingResultPulse", pulseTexture) end endend control:RegisterForEvent(EVENT_CRAFT_STARTED, function(eventCode, ...) self:OnCraftStarted(...) end) control:AddFilterForEvent(EVENT_CRAFT_STARTED, REGISTER_FILTER_IS_IN_GAMEPAD_PREFERRED_MODE, showInGamepadPreferredModeOnly) control:RegisterForEvent(EVENT_CRAFT_COMPLETED, function(eventCode, ...) self:OnCraftCompleted(...) end) control:AddFilterForEvent(EVENT_CRAFT_COMPLETED, REGISTER_FILTER_IS_IN_GAMEPAD_PREFERRED_MODE, showInGamepadPreferredModeOnly) control:RegisterForEvent(EVENT_RETRAIT_STARTED, function(eventCode, ...) self:OnRetraitStarted(...) end) control:AddFilterForEvent(EVENT_RETRAIT_STARTED, REGISTER_FILTER_IS_IN_GAMEPAD_PREFERRED_MODE, showInGamepadPreferredModeOnly) control:RegisterForEvent(EVENT_RETRAIT_RESPONSE, function(eventCode, ...) self:OnRetraitCompleted(...) end) control:AddFilterForEvent(EVENT_RETRAIT_RESPONSE, REGISTER_FILTER_IS_IN_GAMEPAD_PREFERRED_MODE, showInGamepadPreferredModeOnly) control:RegisterForEvent(EVENT_RECONSTRUCT_STARTED, function(eventCode, ...) self:OnReconstructStarted(...) end) control:AddFilterForEvent(EVENT_RECONSTRUCT_STARTED, REGISTER_FILTER_IS_IN_GAMEPAD_PREFERRED_MODE, showInGamepadPreferredModeOnly) control:RegisterForEvent(EVENT_RECONSTRUCT_RESPONSE, function(eventCode, ...) self:OnReconstructCompleted(...) end) control:AddFilterForEvent(EVENT_RECONSTRUCT_RESPONSE, REGISTER_FILTER_IS_IN_GAMEPAD_PREFERRED_MODE, showInGamepadPreferredModeOnly) self.enchantSoundPlayer:SetFinishedAllSoundsCallback(function() self:OnAllEnchantSoundsFinished() end) -- Create a pool of CraftingResultTooltipAnimation_Base to be applied to controls that are -- not the "primary" crafting tooltip (self.tooltipControl), but are being displayed alongside of it -- This allows us to have additional controls animate in-sync with the crafting tooltipend end end if not tooltipControl then endend if CONTEXTUAL_ANIMATION_NAME_BY_CONTEXT[context] ~= nil then end end endendfunction ZO_CraftingResults_Base:SetTooltipAnimationSounds(tooltipAnimationSuccessSound, tooltipAnimationFailureSound)end endend self.resultTooltipAnimation = ANIMATION_MANAGER:CreateTimelineFromVirtual("CraftingResultTooltipAnimation") end self.resultTooltipAnimation:GetAnimationTimeline(1):GetAnimation(1):SetAnimatedControl(tooltipBurst1) self.resultTooltipAnimation:GetAnimationTimeline(1):GetAnimation(2):SetAnimatedControl(tooltipBurst2) if tooltipBurst1 then end if tooltipBurst2 then end end endend --Check to see if we have created an animation for this context yet local animationName = CONTEXTUAL_ANIMATION_NAME_BY_CONTEXT[context] if animationName then else return end end end endend end end endend-- Add a control that we want to have animate alongside the main crafting tooltip (self.tooltipControl)-- These will not play the full set of animations, but will have the same alpha animations endendend if craftingType == CRAFTING_TYPE_PROVISIONING then return false elseif craftingType == CRAFTING_TYPE_ENCHANTING then elseif craftingType == CRAFTING_TYPE_ALCHEMY then if activeSmithing then else return true end endend --The contextual and tooltip animations are mutually exclusive else end --The result of DoesCraftingTypeHaveSlotAnimations for smithing depends on having an active smithing object. There is no such object if the smithing UI --is closed. This means that the result of the function can change between OnCraftStarted and OnCraftEnded if the smithing UI is closed during a crafting --operation. So store the results off here and don't call it later on. -- Suppress item count-related messaging for Smithing Tradeskills' Improvement and Research actions. self.craftingProcessProducesItems = not (mode == SMITHING_MODE_IMPROVEMENT or mode == SMITHING_MODE_RESEARCH or mode == SMITHING_MODE_CONSOLIDATED_SET_SELECTION or mode == SMITHING_MODE_ROOT) elseif SCENE_MANAGER:GetCurrentSceneName() == "gamepad_smithing_research_confirm" then -- Separate case due to ancillary confirmation Scene else end self.craftingProcessProducesItems = self.craftingProcessProducesItems and context ~= CRAFTING_PROCESS_CONTEXT_CONSUME_ATTUNABLE_STATIONS local potencySound, potencyLength, essenceSound, essenceLength, aspectSound, aspectLength = ZO_Enchanting_GetVisibleEnchanting():GetLastRunestoneSoundParams() end endendend local PLAY_STOP_TOOLTIP_ANIMATION = trueend local PLAY_STOP_TOOLTIP_ANIMATION = trueend local edgeTexture = "EsoUI/Art/Crafting/crafting_toolTip_glow_edge_blue64.dds" local burstTexture = "EsoUI/Art/Crafting/burst_blue.dds" if isFailure then edgeTexture = "EsoUI/Art/Crafting/crafting_toolTip_glow_edge_red64.dds" -- no burst texture for failue since we hide the bursts elseif isExceptionalResult then edgeTexture = "EsoUI/Art/Crafting/crafting_toolTip_glow_edge_gold64.dds" burstTexture = "EsoUI/Art/Crafting/burst_gold.dds" end if isFailure then else end end end end end end else endend if self.contextualAnimationControls[context] and not self.contextualAnimationControls[context]:IsHidden() then else endendfunction ZO_CraftingResults_Base:CompleteCraftProcess(craftFailed, isExceptionalResult, craftingType) self.processCompletedArguments = {craftFailed = craftFailed, isExceptionalResult = isExceptionalResult, craftingType = craftingType} else else end end endend local craftFailed = numItemsGained == 0 local NOT_EXCEPTIONAL_RESULT = falseend local craftFailed = result ~= RETRAIT_RESPONSE_SUCCESS local EXCEPTIONAL_RESULT = trueend local craftFailed = result ~= RECONSTRUCT_RESPONSE_SUCCESS local EXCEPTIONAL_RESULT = trueend self:CompleteCraftProcess(arguments.craftFailed, arguments.isExceptionalResult, arguments.craftingType) else end endend endend endend if craftingType == CRAFTING_TYPE_BLACKSMITHING then return SOUNDS.BLACKSMITH_EXTRACTED_BOOSTER elseif craftingType == CRAFTING_TYPE_CLOTHIER then return SOUNDS.CLOTHIER_EXTRACTED_BOOSTER elseif craftingType == CRAFTING_TYPE_WOODWORKING then return SOUNDS.WOODWORKER_EXTRACTED_BOOSTER elseif craftingType == CRAFTING_TYPE_JEWELRYCRAFTING then return SOUNDS.JEWELRYCRAFTER_EXTRACTED_BOOSTER endendlocal SMITHING_TYPE_TO_FAILED_EXTRACTION_SOUND ={ [CRAFTING_TYPE_BLACKSMITHING] = SOUNDS.BLACKSMITH_FAILED_EXTRACTION, [CRAFTING_TYPE_CLOTHIER] = SOUNDS.CLOTHIER_FAILED_EXTRACTION, [CRAFTING_TYPE_WOODWORKING] = SOUNDS.WOODWORKER_FAILED_EXTRACTION, [CRAFTING_TYPE_JEWELRYCRAFTING] = SOUNDS.JEWELRYCRAFTER_FAILED_EXTRACTION,} local failedExtractionSound = internalassert(SMITHING_TYPE_TO_FAILED_EXTRACTION_SOUND[craftingType]) return SI_SMITHING_EXTRACTION_FAILED, failedExtractionSoundend for i = 1, numItemsGained do local name, icon, stack, sellPrice, meetsUsageRequirement, equipType, itemType = GetLastCraftingResultItemInfo(i) if itemType == boosterItemType then return true end end end return falseend g_forceCenterResultsText = forceCenterResultsTextendendenddo local CRAFTING_RESULT_SORT_ORDER = { displayQuality = { tiebreaker = "quality", isNumeric = true, tieBreakerSortOrder = ZO_SORT_ORDER_DOWN }, -- quality is deprecated, included here for addon backwards compatibility quality = { tiebreaker = "stack", isNumeric = true, tieBreakerSortOrder = ZO_SORT_ORDER_DOWN }, stack = { tiebreaker = "resultIndex", isNumeric = true, tieBreakerSortOrder = ZO_SORT_ORDER_UP }, resultIndex = { isNumeric = true }, } return ZO_TableOrderingFunction(left, right, "displayQuality", CRAFTING_RESULT_SORT_ORDER, ZO_SORT_ORDER_DOWN) end end if playerSkillProgressionData then local messageParams = CENTER_SCREEN_ANNOUNCE:CreateMessageParams(CSA_CATEGORY_LARGE_TEXT, SOUNDS.SCRIBING_SCRIBE_COMPLETE_ANNOUNCE) local bodyText = zo_strformat(SI_CRAFTED_ABILITY_NAME_AND_SKILL_LINE_FORMATTER, GetAbilityName(abilityId), skillTypeData:GetName(), skillLineData:GetName()) end if penaltyApplied then end if numItemsGained == 0 and numResultCurrencies == 0 then if craftingType == CRAFTING_TYPE_ALCHEMY then -- Crafted inert potion elseif craftingType == CRAFTING_TYPE_ENCHANTING then -- No extraction results -- Only display extraction-related messaging for operations that produce items. -- No results from gear deconstruction local failedExtractionStringId, failedExtractionSoundName = GetFailedSmithingExtractionResultInfo(craftingType) if penaltyApplied then ZO_AlertNoSuppression(UI_ALERT_CATEGORY_ALERT, failedExtractionSoundName, SI_SMITHING_DECONSTRUCTION_LEVEL_PENALTY) else end end end else local finalItemSoundCategory = ITEM_SOUND_CATEGORY_NONE local resultIndex = 0 local resultItems = {} for i = 1, numItemsGained do local name, icon, stack, sellPrice, meetsUsageRequirement, equipType, itemType, itemStyle, displayQuality, itemSoundCategory, itemInstanceId = GetLastCraftingResultItemInfo(i) -- Don't save messages if we can't display them immediately if shouldDisplayMessages then resultIndex = resultIndex + 1 { resultType = ZO_CRAFTING_RESULT_TYPE.ITEM, resultIndex = resultIndex, stack = stack, sellPrice = sellPrice, meetsUsageRequirement = meetsUsageRequirement, equipType = equipType, itemType = itemType, itemStyle = itemStyle, displayQuality = displayQuality, -- quality is deprecated, included here for addon backwards compatibility quality = displayQuality, itemSoundCategory = itemSoundCategory, itemInstanceId = itemInstanceId, }) end if finalItemSoundCategory == ITEM_SOUND_CATEGORY_NONE then finalItemSoundCategory = itemSoundCategory end end end if numResultCurrencies ~= 0 and shouldDisplayMessages then -- Append any resulting currencies after any resulting items. for currencyIndex = 1, numResultCurrencies do resultIndex = resultIndex + 1 local IS_SINGULAR = true local IS_NOT_UPPERCASE = false local resultData = { resultType = ZO_CRAFTING_RESULT_TYPE.CURRENCY, resultIndex = resultIndex, currencyType = currencyType, stack = currencyAmount, } end end if gainedBooster then else end if penaltyApplied then end end if totalInspiration > 0 then end end end endend endend return self.craftingProcessCompleted == false or self.tooltipAnimationCompleted == false or self.contextualAnimationCompleted == falseend return falseend local resultType = left.resultType if resultType ~= right.resultType then return false end if resultType == ZO_CRAFTING_RESULT_TYPE.ITEM then return left.itemInstanceId == right.itemInstanceId elseif resultType == ZO_CRAFTING_RESULT_TYPE.CURRENCY then return left.currencyType == right.currencyType elseif resultType == ZO_CRAFTING_RESULT_TYPE.KNOWLEDGE then --Knowledge will never be the same, as you can only learn a trait or translation once return false else return false endend |