[Wotlk] Party Pets
XyzKangUI opened this issue ยท 24 comments
When party pets are enabled in wrath it will not sort because the GetUnits() function apparently does not account for partypet..i or raidpet..i units. So the amount of units will be less than the frames displayed and return on the LayoutRaid() function.
So I edited the GetUnits function to include pet units and it messes up the sorting creating a gap when you sort 'player' to be on the bottom:
What I've noticed are these issues:
- When 'displayPets' is disabled (after editing GetUnits) it will detect 1 more unit than frames -> aborting the sorting. I didnt add a check for the raidOptionDisplayPets cvar here :/
- When 'displayPets' is enabled (after the edit again) it will sort, but when you sort yourself on the 'bottom' it creates a gap as seen in the picture below (1a)
- When 'displayPets' is enabled (idem) you cant sort yourself to the 'middle'. The funny thing is that when you do enable 'middle' it will sort you on the bottom and the pet frame will be attached to you, resulting in the correct behaviour for 'bottom' option. See picture below (1b)
Ah right, I've totally missed party pets as they aren't working in retail at all (so people are using addons/weak auras).
I'll start working on fixing this.
Yep as I suspected the frame name is partypet1
where my GetPets() function is returning party1pet
even though both are valid unit tokens. Just thinking about how to fix this atm.
Ok cool, so I think there is just 1 bug left I need to fix to get the pets sorted as well then.
Ok cool, so I think there is just 1 bug left I need to fix to get the pets sorted as well then.
why do you want to sort the pets, they are always attached to the bottom frame. Seems to be the correct behaviour
I was thinking for example if the sorted party is:
party2
party3
party1
player
Then the pets should be:
partypet2
partypet3
partypet1
playerpet
I like the commitment, but I dont think that the average player cares about pets position. It are mostly the PvP'ers who like to sort their frames by unit because of their macro's.
Yeah true, I think I'm so close to having it working so might as well try it anyway.
I like the commitment, but I dont think that the average player cares about pets position. It are mostly the PvP'ers who like to sort their frames by unit because of their macro's.
I believe that the unit names are just the default game units. From the lock PoV his pet will be "pet" and from the priest PoV the lock's pet will be "partypet1". When you convert the party to a raid it will be "raidpet1" for both the lock and priest, but macro's that use "pet" or "partypet1" still remain intact.
Although I guess that it answers your question if I tell you that its partypet..index and raidpet..index, unless you are in a party your own pet ("player") will be "pet" and for others it will be "partypetX"
Yeah I'm guessing this last bug is because i'm doing framesByUnit[partypet1]
but actually the frame unit is framesByUnit[party1pet]
or something like that. Just trying to think of someway to fix this cleanly at the moment.
The error is caused by the pet unit, although you seem to have fixed top/middle/bottom sorting when there is a pet frame showing.
You can use the SecureButton_GetUnit API to get an unit from a raidframe, e.g. SecureButton_GetUnit(CompactRaidFrame7) will return the unit id attached to it.
I've just pushed a potential fix if you wouldn't mind doing another check? Thanks so much for your help with this, I'm not sure how I could test this on Wotlk other than asking for randoms to join group.
I made like 4 accounts for wrath PTR servers so that I can do tests on. Pretty solid.
The API mentioned above will gsub and change raid1pet to raidpet1 and so forth, pretty solid. Wouldn't require you to also iterate over units. Could directly convert all frames to their respective unit ids and store that. Anyway it seems to work: when player is top it will set his pet at the top and vice versa when hes bottom sorted his pet will be on the bottom as well.
Oh ok, that sounds like a better approach, I will update to use SecureButton_GetUnit.
Alright I think I've got it working well enough for a release.
There might be some more refactoring I can do there which I'll investigate later as it seems I can't quite get away from needing the aliases for pets at the moment.
I am curious if one day you will expand this addon's features to change spacing levels between frames. I am aware you are storing the X and Y values but if it could be used to add an own value on top , e.g. +5 it would be amazing.
I was actually thinking of adding in that feature! It would be pretty easy to add in some +-offsets.
I will work on adding this over the next few days.
If you have any other ideas/suggestions in the future as well feel free to let me know :)