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
Add ascendancy click switching with connect-path option (#9292)
* Add click-to-switch functionality for ascendancies and bloodlines
- Click any ascendancy node to automatically switch to that ascendancy
- Same-class switching (e.g., Juggernaut → Berserker): always allowed
- Cross-class switching: allowed if no regular points allocated or tree is connected to target class
- Bloodline switching: always allowed (independent of base class and tree)
- Show warning when trying to cross-class switch with points but no connection
* Optimizations and auto pathing
-Optimizations
-Connect path option when trying to swap to unconnected class.
* fix: keep existing allocations when auto-connecting classes
* Fix pathing + Title update
The pathing code didn't check to make sure it was linked to a node that was connected to the start
Also changing Ascendancies was not updating the window title with the new ascendancy
---------
Co-authored-by: LocalIdentity <localidentity2@gmail.com>
ifnot (spec.curSecondaryAscendClassandhoverNode.ascendancyName==spec.curSecondaryAscendClass.id) then
309
+
isDifferentAscendancy=true
310
+
end
311
+
end
312
+
313
+
ifisDifferentAscendancythen
314
+
-- First, check if it's in the current class (same-class switching)
315
+
forascendClassId, ascendClassinpairs(spec.curClass.classes) do
316
+
ifascendClass.id==hoverNode.ascendancyNamethen
317
+
targetAscendClassId=ascendClassId
318
+
break
319
+
end
320
+
end
321
+
322
+
iftargetAscendClassIdthen
323
+
-- Same-class switching - always allowed
324
+
spec:SelectAscendClass(targetAscendClassId)
325
+
spec:AddUndoState()
326
+
spec:SetWindowTitleWithBuildClass()
327
+
build.buildFlag=true
328
+
else
329
+
-- Cross-class switching - search all classes
330
+
forclassId, classDatainpairs(spec.tree.classes) do
331
+
forascendClassId, ascendClassinpairs(classData.classes) do
332
+
ifascendClass.id==hoverNode.ascendancyNamethen
333
+
targetBaseClassId=classId
334
+
targetBaseClass=classData
335
+
targetAscendClassId=ascendClassId
336
+
break
337
+
end
338
+
end
339
+
iftargetBaseClassIdthenbreakend
340
+
end
341
+
342
+
iftargetBaseClassIdthen
343
+
localused=spec:CountAllocNodes()
344
+
localclickedAscendNodeId=hoverNodeandhoverNode.id
345
+
localfunctionallocateClickedAscendancy()
346
+
ifnotclickedAscendNodeIdthen
347
+
return
348
+
end
349
+
localtargetNode=spec.nodes[clickedAscendNodeId]
350
+
iftargetNodeandnottargetNode.allocthen
351
+
spec:AllocNode(targetNode)
352
+
end
353
+
end
354
+
355
+
-- Allow cross-class switching if: no regular points allocated OR tree is connected to target class
356
+
ifused==0orspec:IsClassConnected(targetBaseClassId) then
357
+
spec:SelectClass(targetBaseClassId)
358
+
spec:SelectAscendClass(targetAscendClassId)
359
+
allocateClickedAscendancy()
360
+
spec:AddUndoState()
361
+
spec:SetWindowTitleWithBuildClass()
362
+
build.buildFlag=true
363
+
else
364
+
-- Tree has points but isn't connected to target class
365
+
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()
366
+
spec:SelectClass(targetBaseClassId)
367
+
spec:SelectAscendClass(targetAscendClassId)
368
+
allocateClickedAscendancy()
369
+
spec:AddUndoState()
370
+
spec:SetWindowTitleWithBuildClass()
371
+
build.buildFlag=true
372
+
end, "Connect Path", function()
373
+
ifspec:ConnectToClass(targetBaseClassId) then
374
+
spec:SelectClass(targetBaseClassId)
375
+
spec:SelectAscendClass(targetAscendClassId)
376
+
allocateClickedAscendancy()
377
+
spec:AddUndoState()
378
+
spec:SetWindowTitleWithBuildClass()
379
+
build.buildFlag=true
380
+
end
381
+
end)
382
+
return
383
+
end
384
+
end
385
+
end
386
+
end
387
+
end
388
+
end
389
+
390
+
-- Normal node allocation (non-ascendancy or same ascendancy)
0 commit comments