5 - Dual spec profile and current getting swapped during initialization
What steps will reproduce the problem?
1. While in an addons OnInitialize, create two new profiles, lets call them A and B
2. Set profile A to be current profile
3. SetDualSpecEnabled to true and SetDualSpecProfile to profile B
4. output state to chat frame for sanity check: print("current profile is:", self.db:GetCurrentProfile() " alt profile is:", self.db:GetDualSpecProfile())
5. log in, go into options and check what current and alternate profiles are set to
What is the expected output? What do you see instead?
The expected result is for profile A to be the current profile and for profile B to be set as the alternative spec. The chat frame output confirms that at the time the print statement ran, that was the case. When you look at the profile options ui (or trigger the print statement again) you see that the two have swapped with the current profile listed as being B and the alternate profile set as A.
Please provide any additional information below.
The problem only happens when SetDualSpecProfile is called. Of course, if don't then both are set to profile A which isn't much better.
If I wait for the game to load and then from the chatline trigger the SetDualSpecProfile call then the when I load up the profile options UI things are correct.
I've taken over maintenance of addon with a very poor implementation of profile support including a half-baked attempt at doing their own version of supporting dual specs. I want to roll out an update that fixes all of this and will migrate existing users settings seamlessly over into the new layout. So, during addon initialization I'm grabbing all of the settings and constructing two new profiles and changing the current profile to be the new one for the active spec. Ideally at the same time I want to set the second spec up with libdualspec.
Doing this right means that users need not even know we made any changes, while opening up the full power of profiles for those that want to use it or were frustrated by the bugs in the old implementation.
This seems to me a bug in libdualspec with regards to it thinking it needs to do a swap. A fix or information about how to work around the problem (if there's a known timing issue) would be appreciated.
| User | When | Change |
|---|---|---|
| stencil | Jan 12, 2012 at 21:26 UTC | Create |
- 1 comment
- 1 comment
- Reply
- #1
Adirelle Jan 13, 2012 at 09:18 UTC - 0 likesThis is clearly a timing issue: LibDualSpec (LDS) has to wait until talent information are available, which generally happens after OnInitialize and OnEnable. However, I am not sure why it considers it should swap the current spec and the new one. Does this reproduce *every* time ?