04-02-21, 05:58 AM | #1 |
How to build UI in order to present a table?
Hello,
It is possible I am asking about Mixins but I am a total beginner regarding UI and frames in WoW. I have a small addon, which I use to gather some information about my runs in mythc+ dungeons. It's structured in a table and I simply use default chat to list everything if I am looking for something. I want to present all this information in a frame. I looked at a few add-ons as well as a couple of frames by Blizzard. For instance, SaveInstances has a list of details about payers saved for dungeons/raids or current state on currencies etc.; it is presented in a frame/table whose background alternates from row to row as well as highlights a row on mouseover. Another example is Blizzard's Guilds and Communities, and particularly a list of members; it looks clean because each name is on the same background repeated per line. I was wondering if I can do that for my addon. When I searched Google, I came across Mixins, which I am not familiar with but seems to be what I am looking for. If I am correct, it is a way of "presenting" tables. Is it possible to use one of Blizzard's templates for myself? Also, if I know what I want to use, how can I find a particular Mixin? Thanks |
|
04-02-21, 06:55 AM | #2 |
Since you already use the default chat to display, You can just use the SimpleHTML widget, I use it to show details of the table/frames like :
The green text are links, you can click you can move it to show tips. It's simple to concat string than create fontstring arrays. |
|
04-02-21, 08:11 AM | #3 |
Thanks. I have also considered SimpleHTML. I even made a function converting the said table > HTML but somehow it doesn't render HTML but shows the full HTML code in it. Would you mind sharing your code? That frame would be a good start but, eventually, I would like to make something with a custom frame Just for the sake of learning. i am not very good at UI and would like to learn it, as well.
|
|
04-02-21, 09:15 AM | #4 |
The html used by the SimpleHtml has many limits. If you get the whole html, it means the widget reject to render it.
You should check the Well-formed HTML in the https://wowwiki-archive.fandom.com/w...ECT_SimpleHTML. Also concat string directly is a real pain. Create custom UI is a big topic to be discussed here. You may discuss it in the WoWUIDev@discord. And for the code to create such a frame, if you don't mind using other libs: simplehtmltest.jpg Lua Code:
It'd could be more longer to create this without a lib. So this is an ADs The Scorpio is a power addon dev platform, you can find my post at https://www.wowinterface.com/forums/...splay.php?f=41. I don't really like blz's mixin system, but you still can find me in the discord. |
|
04-02-21, 10:59 AM | #5 |
Very often, displaying information in table form generally means creating a frame/button for each row where each row is broken up into sections (columns), and then positioning each row one below the next so they form a table. Then you loop through the rows and update the columns.
It's very common to do this with a scrollframe too, which allows your table to be scrollable. The code that follows adds a /showme slash command to summon a scrollable table of random data. (You can repeat /showme to generate new random data.) When the number of rows has the potential to far exceed the displayable area, it's common to use a HybridScrollFrameTemplate or FauxScrollFrameTemplate. Then you only have as many rows that can be displayed and you update the content based on the scrollbar offset. In the example below I've doing a basic scrollframe where every row is defined so you don't need to worry about offsets. (This is not suggested for long lists, but probably easier to pick apart.) Lua Code:
Last edited by Gello : 04-02-21 at 11:02 AM. |
|
04-03-21, 03:57 AM | #6 |
Thank you for the example codes and the idea of adding buttons as cells. I think I can follow from here and start trying something Thanks
|
|
WoWInterface » Developer Discussions » Lua/XML Help » How to build UI in order to present a table? |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|