|
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 |
local TRIBUTE_CARD_ATLAS_FILE_DIMENSIONS = 512-- TODO Tribute: Work with art to bake this into the suit atlaslocal TRIBUTE_SUIT_TAB_TEXTURE_COORD_WIDTH = 135local TRIBUTE_SUIT_TAB_TEXTURE_COORD_HEIGHT = 400ZO_TRIBUTE_SUIT_TAB_ICON_WIDTH = 85ZO_TRIBUTE_SUIT_TAB_ICON_HEIGHT = 240ZO_TRIBUTE_SUIT_TAB_ICON_TOP_COORD = (TRIBUTE_CARD_ATLAS_FILE_DIMENSIONS - TRIBUTE_SUIT_TAB_TEXTURE_COORD_HEIGHT) / TRIBUTE_CARD_ATLAS_FILE_DIMENSIONSZO_TRIBUTE_SUIT_TAB_ICON_BOTTOM_COORD = 1ZO_TRIBUTE_SUIT_TAB_ICON_LEFT_COORD = (TRIBUTE_CARD_ATLAS_FILE_DIMENSIONS - TRIBUTE_SUIT_TAB_TEXTURE_COORD_WIDTH) / TRIBUTE_CARD_ATLAS_FILE_DIMENSIONSZO_TRIBUTE_SUIT_TAB_ICON_RIGHT_COORD = 1-- Patroin Requirement Container --enddo internalassert(TRIBUTE_PATRON_REQUIREMENT_ITERATION_END == 3, "A new Tribute Patron requirement has been added. Does the REQUIREMENT_PARAM_MODIFIERS need special modifiers for this requirement?") local REQUIREMENT_PARAM_MODIFIERS = { -- Add quantity overrides for TRIBUTE_PATRON_REQUIREMENTs here. Supports displayParam, displayFunction, indexing by param1 } local ANCHOR_OFFSETS = { { X = 67, Y = -72, }, -- TOP { X = 42, Y = 0, }, -- MIDDLE { X = 67, Y = 72, }, -- BOTTOM } self.requirementType, self.quantity, self.param1, self.param2 = stallObject:GetRequirementInfo(favorState, requirementIndex) if paramModifiers then local paramQuantityDisplayOverride = paramModifiers.quantityDisplayOverride if paramQuantityDisplayOverride then if paramQuantityDisplayOverride.displayParam == 1 then elseif paramQuantityDisplayOverride.displayParam == 2 then else end end end self.typeIconTexture:SetTexture(GetTributePatronRequirementIconPath(self.requirementType, self.param1, self.param2)) local quantityDisplayText = quantityDisplayValue == 0 and GetString(SI_TRIBUTE_MECHANIC_ANY_QUANTITY_SYMBOL) or quantityDisplayValue local isDoubleDigitContainer = quantityDisplayValue >= 10 local styleTemplate = isDoubleDigitContainer and "ZO_TributePatronStall_Requirement_DoubleDigit_Style" or "ZO_TributePatronStall_Requirement_SingleDigit_Style" -- Singular is MIDDLE, otherwise, TOP, MIDDLE, BOTTOM local anchorOffsets = (self.numSiblings == 1) and ANCHOR_OFFSETS[2] or ANCHOR_OFFSETS[requirementIndex] endendend-- Patron Stall -- return objectend self.tabFadeTimeline = ANIMATION_MANAGER:CreateTimelineFromVirtual("ZO_TributePatronStall_TabFadeTimeline", control) -- SetSkipAnimationsBehindPlayheadOnInitialPlay is needed because the animations have delays. -- Without this, when playing the animation directly to start, it won't set the state right because the position is technically beyond the playhead self.requirementsFadeTimeline = ANIMATION_MANAGER:CreateTimelineFromVirtual("ZO_TributePatronStall_RequirementsFadeTimeline", self.requirementsControl)end end) end) end)endendend return screenX, screenYendend self.control:AddFilterForEvent(EVENT_TRIBUTE_PATRON_DRAFTED, REGISTER_FILTER_PATRON_DRAFT_ID, patronDraftId) self.control:AddFilterForEvent(EVENT_TRIBUTE_PATRON_STATE_FLAGS_CHANGED, REGISTER_FILTER_PATRON_DRAFT_ID, patronDraftId) self.control:AddFilterForEvent(EVENT_TRIBUTE_PATRON_FAVOR_STATE_CHANGED, REGISTER_FILTER_PATRON_DRAFT_ID, patronDraftId)endend endend if not patronData then return end screenX, screenY = screenX + ZO_TRIBUTE_PATRON_TOOLTIP_OFFSET_X, screenY + ZO_TRIBUTE_PATRON_TOOLTIP_OFFSET_Y local highlightActivePatronState = currentGameFlowState == TRIBUTE_GAME_FLOW_STATE_PLAYING local SUPPRESS_NOT_COLLECTIBLE_WARNING = true if currentGameFlowState == TRIBUTE_GAME_FLOW_STATE_PATRON_DRAFT and not ZO_TRIBUTE_PATRON_SELECTION_MANAGER:ShouldShowGamepadTooltips() then return end local optionalArgs = { highlightActivePatronState = highlightActivePatronState, suppressNotCollectibleWarning = SUPPRESS_NOT_COLLECTIBLE_WARNING, } ZO_TributePatronTooltip_Gamepad_Show(patronData, optionalArgs, RIGHT, GuiRoot, TOPLEFT, screenX, screenY) else ItemTooltip:SetTributePatron(patronData:GetId(), highlightActivePatronState, SUPPRESS_NOT_COLLECTIBLE_WARNING) end endendend local renderPositionX, renderPositionY, renderPositionZ, rotationXRadians, rotationYRadians, rotationZRadians = GetTributePatronTabIconTransformInfo(self.patronDraftId)end if isHighlighted then else endend else -- Which card type doesn't matter because they both use the same tab icon in their atlas end local IGNORE_CALLBACKS = trueend if not changedFlags then return end endend if stateFlag == TRIBUTE_PATRON_STATE_FLAGS_HIGHLIGHTED then return end -- TODO Tribute: Handle other Patron state flags if necessary.end -- We'll show the requirements after the tab fade has finished coming in return end local crossfadeRequirements = false if numOldRequirements ~= numNewRequirements then crossfadeRequirements = true else for requirementIndex = 1, numNewRequirements do local oldRequirementType, oldQuantity, oldParam1, oldParam2 = self:GetRequirementInfo(oldFavorState, requirementIndex) local newRequirementType, newQuantity, newParam1, newParam2 = self:GetRequirementInfo(newFavorState, requirementIndex) if oldRequirementType ~= newRequirementType or oldQuantity ~= newQuantity or oldParam1 ~= newParam1 or oldParam2 ~= newParam2 then crossfadeRequirements = true break end end end if crossfadeRequirements then -- Fade out the current requirements, then replace them and fade back in else -- Skip the crossfade animation and immediately update the requirements. endend if completedPlaying then -- Tab fade in from draft is complete, time to bring in the requirements endend -- Fading out old requirements is complete, clear them, create new requirements, and fade them in endend local requirementContainer = requirementContainerPool:AcquireObject(self, self.favorState, requirementIndex) endend endend local IGNORE_CALLBACKS = true -- Allow cleanup of big texture to gain back some memoryendendend |