I got a little time to play around with this some more…
ClassTalentHelper.SwitchToLoadoutByName seems to solve the problems that C_ClassTalents.LoadConfig seems to have, namely, C_ClassTalents.LoadConfig does not properly set the state of the talent UI so is essentially unusable by addon authors.
The code I had was doing the following:
- Find the setup named “AMR Latest Setup”
- Delete that setup if it exists
- Create a new setup with that same name via
C_ClassTalents.ImportLoadout - Activate the newly created setup
The last step was the only thing not really working. And it also seems that C_ClassTalents.ImportLoadout tries to do something to the talent UI… maybe it implicitly does something similar to LoadConfig upon creation… but it is even more inconsistent.
If I call ClassTalentHelper.SwitchToLoadoutByName after C_ClassTalents.ImportLoadout to actually activate that loadout, it works… but only if I put enough of a delay. A minimum of 2 seconds seems to be required for it to function consistently. I’m not a huge fan of doing that… it is very easy for a player to interrupt that and end with their talent tree in a goofy state.
I’m going to try a couple more things to see if I can get something more consistent working.