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 |
ZO_CHAMPION_CONSTELLATION_DEPTH = 1.69
ZO_CHAMPION_CLUSTER_DEPTH = 2.69
ZO_CHAMPION_CONSTELLATION_WIDTH = 600
ZO_CHAMPION_CONSTELLATION_HEIGHT = 338
ZO_CHAMPION_CLUSTER_WIDTH = 400
ZO_CHAMPION_CLUSTER_HEIGHT = 200
ZO_CHAMPION_CONSTELLATION_INNER_RADIUS = 190 -- how far is the start of the constellation from the center of the ring?
ZO_CONSTELLATION_TEXTURE_SIZE_WIDTH = 2048
ZO_CONSTELLATION_TEXTURE_SIZE_HEIGHT = 1024
ZO_CONSTELLATION_TEXTURE_INNER_WIDTH = 1776
ZO_CONSTELLATION_TEXTURE_INNER_HEIGHT = 1000
-- Each ring anchor represents a place on the global ring that each
-- constellation could be in. Each constellation will always be attached to one
-- ring anchor, but there may be inactive ring anchors elsewhere on the ring that
-- should be out of sight of the player.
self . constellationZoomedOutTexture = CreateControlFromVirtual ( "$(parent)Constellation" , canvasControl , "ZO_Constellation" , anchorIndex )
self . constellationZoomedInTexture = CreateControlFromVirtual ( "$(parent)ConstellationZoomedIn" , canvasControl , "ZO_ConstellationZoomedIn" , anchorIndex )
self . constellationSelectedTexture = CreateControlFromVirtual ( "$(parent)ConstellationMouseOver" , canvasControl , "ZO_ConstellationMouseOver" , anchorIndex )
self . rotatedNode = sceneGraph : CreateNode ( string . format ( "constellationRingRotated%d" , self . anchorIndex ) )
end
local constellationComputedWidth , constellationComputedHeight = self . rotatedNode : ComputeSizeForDepth (
ZO_CHAMPION_CONSTELLATION_WIDTH ,
ZO_CHAMPION_CONSTELLATION_HEIGHT ,
ZO_CHAMPION_CONSTELLATION_DEPTH ,
ZO_CHAMPION_REFERENCE_CAMERA_Z )
local normalizeFactorX = 1 / ZO_CONSTELLATION_TEXTURE_SIZE_WIDTH
local normalizeFactorY = 1 / ZO_CONSTELLATION_TEXTURE_SIZE_HEIGHT
local centerX = ZO_CONSTELLATION_TEXTURE_SIZE_WIDTH * 0.5
local centerY = ZO_CONSTELLATION_TEXTURE_SIZE_HEIGHT * 0.5
local halfWidth = ZO_CONSTELLATION_TEXTURE_INNER_WIDTH * 0.5
local halfHeight = ZO_CONSTELLATION_TEXTURE_INNER_HEIGHT * 0.5
local left = ( centerX - halfWidth ) * normalizeFactorX
local right = ( centerX + halfWidth ) * normalizeFactorX
local top = ( centerY - halfHeight ) * normalizeFactorY
local bottom = ( centerY + halfHeight ) * normalizeFactorY
self . constellationZoomedOutTexture : SetDimensions ( constellationComputedWidth , constellationComputedHeight )
self . rotatedNode : AddTexture ( self . constellationZoomedOutTexture , 0 , 0 , ZO_CHAMPION_CONSTELLATION_DEPTH )
self . constellationZoomedInTexture : SetDimensions ( constellationComputedWidth , constellationComputedHeight )
self . rotatedNode : AddTexture ( self . constellationZoomedInTexture , 0 , 0 , ZO_CHAMPION_CONSTELLATION_DEPTH )
self . constellationSelectedTexture : SetTexture ( disciplineData : GetBackgroundSelectedZoomedOutTexture ( ) )
self . constellationSelectedTexture : SetDimensions ( constellationComputedWidth , constellationComputedHeight )
self . rotatedNode : AddTexture ( self . constellationSelectedTexture , 0 , 0 , ZO_CHAMPION_CONSTELLATION_DEPTH )
end
end
end
self . zoomedInTextureAlphaInterpolator : SetFluxParams ( visualInfo . constellationZoomedInBackgroundAlpha )
end
end
function ZO_ChampionCluster : Initialize ( constellation , sceneGraph , championClusterData , clusterIndex )
else
--Create a node for this cluster
local clusterNode = sceneGraph : CreateNode ( string . format ( "constellation%dClusterNode%d" , constellation : GetChampionDisciplineData ( ) : GetId ( ) , clusterIndex ) )
--Acquire the control for the background
--The texture image here is cluster specific
--Calculate the dimensions for the background
local clusterComputedWidth , clusterComputedHeight = self . node : ComputeSizeForDepth ( ZO_CHAMPION_CLUSTER_WIDTH , ZO_CHAMPION_CLUSTER_HEIGHT , ZO_CHAMPION_CLUSTER_DEPTH , ZO_CHAMPION_REFERENCE_CAMERA_Z )
--Calculate the x and y coordinates of the background so that it is centered on the root star
end
self . hidden = true -- when hidden, all star controls are either hidden or released from the star control pool. it's not safe to try to reference a texture or link while hidden.
end
local CHAMPION_LINE_THICKNESS = 5
-- there are two valid reasons for linkedStar to not yet exist:
-- 1. the star still needs to be created. because links are bidirectional, we will create the link when that star is created.
-- 2. the star is not part of the current cluster. In this case not creating a link is desired and handled automatically.
linkControl . championSkillData1 = linkedSkillData
linkControl . championSkillData2 = championSkillData
self . node : AddLine ( linkControl , linkedStar : GetTexture ( ) , star : GetTexture ( ) , self : IsRootCluster ( ) and ZO_CHAMPION_CONSTELLATION_DEPTH or ZO_CHAMPION_CLUSTER_DEPTH )
end
end
end
end
end
else
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
if not hidden then
-- show the cluster
else
-- this is the root cluster, so it's likely we'll need to show
-- it again in the near future. hide it instead of releasing
-- controls
else
-- this is a sub-cluster, which will usually not be visible,
-- and when it is visible, nothing else will be. Let's release its
-- controls so they can be used by other sub-clusters
end
end
end
end
end
end
-- will automatically refresh on showing
return
end
end
end
end
end
end
do
local LINK_UNLOCKED_ALPHA = 0.9
local LINK_UNLOCKED_FOCUSED_ALPHA = 1.0
local LINK_LOCKED_ALPHA = 0.3
local LINK_LOCKED_FOCUSED_ALPHA = 0.6
local selectedStarData = nil
if selectedStar then
else
end
end
local isFocused = linkControl . championSkillData1 == selectedStarData or linkControl . championSkillData2 == selectedStarData
local lockedAlpha = isFocused and LINK_LOCKED_FOCUSED_ALPHA or LINK_LOCKED_ALPHA
local unlockedAlpha = isFocused and LINK_UNLOCKED_FOCUSED_ALPHA or LINK_UNLOCKED_ALPHA
if linkControl . championSkillData1 : WouldBeUnlockedNode ( ) or linkControl . championSkillData2 : WouldBeUnlockedNode ( ) then
else
end
end
end
end
end
return
end
end
end
end
return
end
local championSkillData
else
end
end
end
end
--For now, treat the position of the cluster as the position of the first star in the cluster
--If there are no stars in this cluster, just return 0,0 as the position
if firstStar then
else
return 0 , 0
end
end
-----------------------
--Constellation
-----------------------
--Stars
for clusterIndex , championClusterData in self . championDisciplineData : ChampionClusterDataIterator ( ) do
end
local cluster = self . clustersByClusterData [ championSkillData : GetChampionClusterData ( ) ] or self . rootCluster
end
end
end
end
end
CHAMPION_DATA_MANAGER : RegisterCallback ( "ChampionSkillPendingPointsChanged" , function ( championSkillData )
if self . selectedStar and self . selectedStar : IsSkillStar ( ) and championSkillData == self . selectedStar : GetChampionSkillData ( ) then
end
end )
end
end
end
end
end
-- visualInfo fields:
-- starAlpha: interpolator params, target is alpha value for visual skill stars
-- glowAlpha: interpolator params, target is alpha value for glow around constellation
-- constellationAlpha: interpolator params, target is constellation alpha as idle animation
-- mouseoverAlpha: interpolator params, target is alpha for entire constellation when a player mouses over it
-- interpolator params defined in ZO_LerpInterpolator:SetFluxParams()
end
local clusterLinkAlpha = linkAlpha * newClusterStarAlpha
end
end
if not active then
end
end
end
end
end
end
end
if oldCluster ~= newCluster then
local INSTANT = true
end
end
else
end
end
end
end
if oldStar ~= newStar then
if oldStar then
--Don't bother checking for non skill stars, as they aren't slottable in the first place
if slot and skillData then
end
end
end
end
if newStar then
end
--Don't bother checking for non skill stars, as they aren't slottable in the first place
if slot and skillData then
end
end
end
end
end
end
end
end
end
local otherNodeAnchorIndex = otherNode . ringAnchor . anchorIndex
else
end
end
local CHAMPION_CYCLED_TO_SOUNDS =
{
[ CHAMPION_DISCIPLINE_TYPE_WORLD ] = SOUNDS . CHAMPION_CYCLED_TO_THIEF ,
[ CHAMPION_DISCIPLINE_TYPE_COMBAT ] = SOUNDS . CHAMPION_CYCLED_TO_MAGE ,
[ CHAMPION_DISCIPLINE_TYPE_CONDITIONING ] = SOUNDS . CHAMPION_CYCLED_TO_WARRIOR ,
}
end
local CHAMPION_SELECTED_SOUNDS =
{
[ CHAMPION_DISCIPLINE_TYPE_WORLD ] = SOUNDS . CHAMPION_THIEF_MOUSEOVER ,
[ CHAMPION_DISCIPLINE_TYPE_COMBAT ] = SOUNDS . CHAMPION_MAGE_MOUSEOVER ,
[ CHAMPION_DISCIPLINE_TYPE_CONDITIONING ] = SOUNDS . CHAMPION_WARRIOR_MOUSEOVER ,
}
end |