Open CianNoonan opened 5 years ago
I very quickly tried to just draw over it with the toolbar color. This "works", except for that the elements underneath still respond (and have priority over custom buttons added). I'm pretty sure that what you're suggesting is possible, but it wouldn't have priority for me to do now, maybe you or someone else can do it!
Ha, that's one way of doing it. If I can get it to work I'll submit a PR
How did you draw over the top of the existing buttons? I feel I'm missing something here
Made an example branch, here's the commit: https://github.com/marijnz/unity-toolbar-extender/commit/c44faf216120d381fbf70eecb520e4c000276a65
And, any progress? :)
I definitely was being silly, I can see that I just needed to expand the drawable area to draw over the buttons.
So far I've managed to prevent the tooltips from showing by setting GUIUtility.hotControl to a value other than 0(i.e 1000). This leads me to believe that these buttons completely circumvent the normal interface.
I'll keep toying with it in my spare time and see if there's a better solution using reflection.
Moving the buttons would be pretty useful, Im considering inserting new stuff, but keeping whats there by default (in the same order, etc) but displaced.
@marijnz in your opinion this should be feasible?
Looking quickly at the code, I guess it would be possible to take the children from the toolbar here: https://github.com/marijnz/unity-toolbar-extender/blob/9f4c9ba013f8e6cf3c21278e89bd450a16613a08/Assets/ToolbarExtender/Scripts/Editor/ToolbarCallback.cs#L49. Then either draw them or skip them. If somebody wants to try out..
Hi there. I tried to select the m_currentToolbar scriptable object to see what's going on in there and guess what? the children list is empty! I also managed to draw a rect over play button in center of toolbar and hooked up my own buttons but the main buttons have higher priority for mouse events and i also tried to tweak GUI.depth variable and also used event system to see if mouse is inside my button rects but there is no luck. Any help would be appreciated.
FYI, this might be easier with 2021, using Visual Elements.
Thanks for chimming in! I gave this a try time ago without luck, will try again using VE, later this year after updating to U2021.
It would be great to have the ability to move/edit/remove the existing toolbar buttons for further flexibility.
Having these take up less space would be great.