You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifnot (spec.curSecondaryAscendClassandhoverNode.ascendancyName==spec.curSecondaryAscendClass.id) then
337
+
isDifferentAscendancy=true
338
+
end
339
+
end
340
+
341
+
ifisDifferentAscendancythen
342
+
-- First, check if it's in the current class (same-class switching)
343
+
forascendClassId, ascendClassinpairs(spec.curClass.classes) do
344
+
ifascendClass.id==hoverNode.ascendancyNamethen
345
+
targetAscendClassId=ascendClassId
346
+
break
347
+
end
348
+
end
349
+
350
+
iftargetAscendClassIdthen
351
+
-- Same-class switching - always allowed
352
+
spec:SelectAscendClass(targetAscendClassId)
353
+
spec:AddUndoState()
354
+
spec:SetWindowTitleWithBuildClass()
355
+
build.buildFlag=true
356
+
else
357
+
-- Cross-class switching - search all classes
358
+
forclassId, classDatainpairs(spec.tree.classes) do
359
+
forascendClassId, ascendClassinpairs(classData.classes) do
360
+
ifascendClass.id==hoverNode.ascendancyNamethen
361
+
targetBaseClassId=classId
362
+
targetBaseClass=classData
363
+
targetAscendClassId=ascendClassId
364
+
break
365
+
end
366
+
end
367
+
iftargetBaseClassIdthenbreakend
368
+
end
369
+
370
+
iftargetBaseClassIdthen
371
+
localused=spec:CountAllocNodes()
372
+
localclickedAscendNodeId=hoverNodeandhoverNode.id
373
+
localfunctionallocateClickedAscendancy()
374
+
ifnotclickedAscendNodeIdthen
375
+
return
376
+
end
377
+
localtargetNode=spec.nodes[clickedAscendNodeId]
378
+
iftargetNodeandnottargetNode.allocthen
379
+
spec:AllocNode(targetNode)
380
+
end
381
+
end
382
+
383
+
-- Allow cross-class switching if: no regular points allocated OR tree is connected to target class
384
+
ifused==0orspec:IsClassConnected(targetBaseClassId) then
385
+
spec:SelectClass(targetBaseClassId)
386
+
spec:SelectAscendClass(targetAscendClassId)
387
+
allocateClickedAscendancy()
388
+
spec:AddUndoState()
389
+
spec:SetWindowTitleWithBuildClass()
390
+
build.buildFlag=true
391
+
else
392
+
-- Tree has points but isn't connected to target class
393
+
main:OpenConfirmPopup("Class Change", "Changing class to "..targetBaseClass.name.." will reset your passive tree.\nThis can be avoided by connecting one of the "..targetBaseClass.name.." starting nodes to your tree.", "Continue", function()
394
+
spec:SelectClass(targetBaseClassId)
395
+
spec:SelectAscendClass(targetAscendClassId)
396
+
allocateClickedAscendancy()
397
+
spec:AddUndoState()
398
+
spec:SetWindowTitleWithBuildClass()
399
+
build.buildFlag=true
400
+
end, "Connect Path", function()
401
+
ifspec:ConnectToClass(targetBaseClassId) then
402
+
spec:SelectClass(targetBaseClassId)
403
+
spec:SelectAscendClass(targetAscendClassId)
404
+
allocateClickedAscendancy()
405
+
spec:AddUndoState()
406
+
spec:SetWindowTitleWithBuildClass()
407
+
build.buildFlag=true
408
+
end
409
+
end)
410
+
return
411
+
end
412
+
end
413
+
end
414
+
end
415
+
end
416
+
ifhoverNode.pathandnotshouldBlockGlobalNodeAllocation(hoverNode) then
417
+
-- Handle allocation of unallocated nodes
418
+
ifhoverNode.isAttributeandnothotkeyPressedthen
419
+
build.treeTab:ModifyAttributePopup(hoverNode)
420
+
else
421
+
-- the odd conditional here is so the popup only calls AllocNode inside and to avoid duplicating some code
422
+
-- same flow for hotkey attribute and non attribute nodes
0 commit comments