I would like to request a way to get the "tab container" (the flow that contains the actual tab buttons) of a tabbed pane, and modify it as any other LuaGuiElement (except for deleting it altogether, which would be disallowed). My usecase is so that I can add a drag handle and close button to the top-right of this GUI, similar to the new character GUI.
Thanks in advance!
I tried implementing this myself first, but it turned out be be too complex for my skill level and knowledge of C++...
Retrieve and modify the tab container of tabbed panes
Retrieve and modify the tab container of tabbed panes
Don't forget, you're here forever.
Re: Retrieve and modify the tab container of tabbed panes
That's... kind of not possible. The character GUI isn't even finished and the way it currently does that logic mods would never be able to do through the Lua API. You could try to do it yourself and see all the issues you'll run into.
If you want to get ahold of me I'm almost always on Discord.
Re: Retrieve and modify the tab container of tabbed panes
Yeah, I actually tried doing this myself first, but ran into issues almost immediately that I didn't know how to solve. That's why I put it on here.
I have discovered a partial workaround: I found out recently that you can actually add elements to buttons and tabs, just like any other element. So I created a tab and put stuff in it:
However, as you can see, there are a few issues. First, only the active tab can draw "over" the pane. Second, the close button's shadow isn't drawn, or is probably hidden behind the tab itself.
Additionally, using horizontally_stretchable on the tab doesn't appear to work, so I had to hardcode the width.
If a method to force the tab to "draw over" even when inactive were implemented, and if the shadow layering could be fixed, then this could work!
I have discovered a partial workaround: I found out recently that you can actually add elements to buttons and tabs, just like any other element. So I created a tab and put stuff in it:
However, as you can see, there are a few issues. First, only the active tab can draw "over" the pane. Second, the close button's shadow isn't drawn, or is probably hidden behind the tab itself.
Additionally, using horizontally_stretchable on the tab doesn't appear to work, so I had to hardcode the width.
If a method to force the tab to "draw over" even when inactive were implemented, and if the shadow layering could be fixed, then this could work!
Don't forget, you're here forever.
Re: Retrieve and modify the tab container of tabbed panes
Well, after doing some really janky crap, I managed to make it work. And it actually doesn't look half bad!
What I did was remove the top border on the content pane so it seamlessly transitions into the top. Then I modified the inactive tab styles to draw the top of the frame as their glow, so it looks almost like it's an actual feature of the engine...
I still have to hardcode the width of the drag handle and the frame itself, because the tab doesn't expand when you use horizontally_stretchable on it. I'll probably make a PR to fix that.
This can be moved to "won't implement" now.
What I did was remove the top border on the content pane so it seamlessly transitions into the top. Then I modified the inactive tab styles to draw the top of the frame as their glow, so it looks almost like it's an actual feature of the engine...
I still have to hardcode the width of the drag handle and the frame itself, because the tab doesn't expand when you use horizontally_stretchable on it. I'll probably make a PR to fix that.
This can be moved to "won't implement" now.
Don't forget, you're here forever.