AlterEgo

AlterEgo

39k Downloads

Custom sorting

DennisRas opened this issue ยท 6 comments

commented

Someone has requested the ability to sort the characters in a custom order.

commented

@DennisRas Sorry about the long delay here, I went out of town for quite a while haha. Thank you so much for the breakdown of your previous attempts and ideas, I legitimately facepalmed when I saw your elegant demo of having a button to move a column a certain direction, as my drag-and-drop idea was far more complicated.

At the moment, since my initial implementation won't work (in it's current state) moving forward, I think it would probably be best to close my PR just to tidy up your repo!

If you ever do open the project up for branching again, please let me know! Or if you have a task tracker page for tasks that you would like implemented (even if it's something like working on the project's documentation, git branching strategy, etc), please direct me there and I'd love to continue to contribute!

commented

@TylerJBrown192 No worries. First I had a friend from work passing away and then I got really sick for a couple of days and went to the hospital, so it's all good. I haven't had the time to keep up with the coding for quite a while, but I'm back again :-)

Your implementation was nice.
I kinda dropped the idea of using the buttons, because I can't hide/show them on hover (hovering above multiple frames is not a thing in WoW). I would have to implement cursor position detection, but that's just too complex.

Another solution would to still use the left/right buttons as shown in the video above and have their visibility toggled with a "Save" button somewhere to hide them again. This is fine, but the issue is how do you instruct the user to toggle the edit mode again since currently the Custom Order option is a Dropdown item.

My next idea would be to add a submenu to the "Custom Sort" option of the Sorting Dropdown with each character and up/down arrows next to them. The default Blizz Dropdown API doesn't support buttons next to each dropdown item since each item is basically a button itself. Could possibly extend the Dropdown XML and add 2 extra buttons next to the item button. The addon BtwQuests does something similar for deleting a character in the dropdown.

commented

At the moment, since my initial implementation won't work (in it's current state) moving forward, I think it would probably be best to close my PR just to tidy up your repo!

I appreciate it and love what you did with your PR. Let's figure it out :)

If you ever do open the project up for branching again, please let me know! Or if you have a task tracker page for tasks that you would like implemented (even if it's something like working on the project's documentation, git branching strategy, etc), please direct me there and I'd love to continue to contribute!

Please see this discussion :)

commented

Hey @DennisRas , I've tried to establish the ground work for this functionality in a PR from my forked repo here!

As I noted in this comment block, the remaining work for this feature would be the actual drag-and-drop functionality itself. I was going to make an OnClick event on the Character name Frame pop up a tooltip in which one could set the custom order numerically via an Input element, but looking at the main branch it seems you're already working on a feature that involves an OnClick event for that same Character name Frame, so I leaned towards the (admittedly much harder) implementation you see in the PR.

Unfortunately since this is my first crack at Lua / WoW addon code, I've reached limitation of my knowledge around the WoW API and the Ace addon library. If you think that this is a good path forward, and can point me towards a library or functionality that assist with drag-and-drop as outlined, I would be happy to carry this work over the finish line!

p.s. Thank you very much for this addon, it is one of the most helpful and best designed / UX experience I've seen in an addon yet. Cheers!

commented

@TylerJBrown192 I am honored of your contribution. You're my first contributor in years, so this is pretty exciting to me ๐Ÿ˜ƒ Thank you for showing interest.

I did actually work on a custom order feature some time ago, but I ran into some complications with the UX part of it so put it on hold. The issue is that layered WoW frames don't have their event handlers triggered. Only one frame can trigger "OnEnter" and "OnLeave" and I wanted to create these Left/Right buttons (video shows a plus texture for now) next to the character names if Custom Order was selected, but there's no way I can show the arrows only when hovering the character name row. Another solution would be to "toggle" the state of editing your custom order and then saving your order in order to show/hide the arrows.

I've looked at your code and it seems like a good attempt. I have thought about the dragging solution too, but I was worried it would require too much custom coding for placeholder columns and what not, so I didn't consider it too much.

In my version I put the order of the characters on the character tables themselves, which would be recalculated once in a while when characters get added/removed from the data.

Oh and yeah, I must admit I didn't expect the addon to gain attraction let alone contributions, so both the addon code and the repo is in a bit of a mess right now in terms of branches, pipeline etc. It's all just developed in the main branch right now ๐Ÿ˜› I'll try and clean it up and set up a branch for the custom sorting.

Here's a video of what it looked like in December before I realized the issue with scripts on layered frames:

Wow_L5TrLau6W7.mp4
commented

Oh and to move forward with the conversation; I'm gonna be finishing up and working on some of the other issues first, since they're already in the main branch, and then I'll open up for branching again, so custom order and other features can be worked on as well. I need to clean up the current situation of the addon hehe.

Lua is also new to me (and quite lackluster compared to other programming languages), so I understand the logic coming from JS and other languages. It'll be a challenge, but a fun challenge ๐Ÿ˜„

And thanks for the last comment. Appreciate it.