06-28-19, 05:01 PM | #21 |
Yes, I wish they'd still put game manuals with the WoW expansions, now it's just a leaflet with download code
Most of the newer API had been undocumented ever since patch 8.0.1 I've started updating the api docs like 3 months ago and feel like almost nobody else really cares to contribute https://wow.gamepedia.com/index.php?...action=history |
|
06-28-19, 11:04 PM | #22 |
Is FauxScrollFrame capable of, say, a 3-4 column sheet (ie: Listing players, their class, their dkp etc) that is sortable by each column? Or would that have to be Hybrid? If anyone had an example it would be great but if not, I'll figure it out eventually
|
|
06-28-19, 11:35 PM | #23 | |
|
||
06-29-19, 02:08 AM | #24 | |
Either way, I have some free time the coming weeks, and my projects are up to date, so I'll see if I can add some documentation. I can try my hand at a HybridScrollFrames guide and fill in some missing documentation on stuff like the Cooldown widget. |
||
06-29-19, 06:36 AM | #25 | |
|
||
06-29-19, 09:39 AM | #26 | |
Here is the template blizz uses for the AH sort tabs, here is an example of how that template is used in xml, and here is the sorting being done in lua. For your case you would need to store some state like the direction of the sort, but that would be pretty simple. You could use table.sort to reorder the source of the FSF, with the sort func being tied to the column and direction. After that you just run your Update function to repopulate the FSF with the newly ordered data. Lua Code:
|
||
06-29-19, 10:55 AM | #27 |
And to package the table into a really ugly (but hopefully visual concept wise) no xml (on your part) scroll list for display (use sorting from fusionpit to add sort buttons):
Lua Code:
You could make each row a single button with 3 FontStrings or ...
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. Last edited by Fizzlemizz : 06-29-19 at 02:41 PM. |
|
06-29-19, 02:03 PM | #28 |
Tremendously appreciated guys.
|
|
06-29-19, 05:25 PM | #29 |
I went ahead and made each row a single button with 3 embedded fontstrings so you could get the highlight effect on mouseover for the entire row. But when it scrolls, it simply overwrites the previous fontstring (you end up with a dozen or more strings stacked on top of each other in each row). I've tried clearing the fontstring prior to setting it, but that doesn't seem to work. And I don't feel like clearing and rebuilding the entire table on scroll would be efficient.
Lua Code:
Last edited by Aeriez : 06-29-19 at 06:14 PM. |
|
06-29-19, 06:20 PM | #30 |
MyFrame_Update is creating new FontStrings each scroll on top of the ones before.
Create the Fontstrings in CreateRow() so they only get created once Code:
f.DKPInfo[i].Text1 = f.DKPInfo[i]:CreateFontString(nil, "OVERLAY"); ... f.DKPInfo[i].Text2 = f.DKPInfo[i]:CreateFontString(nil, "OVERLAY"); ... f.DKPInfo[i].Text3 = f.DKPInfo[i]:CreateFontString(nil, "OVERLAY"); Code:
row.DKPInfo[1].Text1:SetText(...) row.DKPInfo[1].Text2:SetText(...) row.DKPInfo[1].Text3:SetText(...) Code:
function CreateRow(parent, id) -- Create 3 buttons for each row in the list local f = CreateFrame("Button", "$parentLine"..id, parent) f.Strings = {} f:SetSize(core.TableWidth, core.TableHeight) f:SetHighlightTexture("Interface\\BUTTONS\\UI-Listbox-Highlight2.blp"); f:SetScript("OnClick", OnClick) for i=1, 3 do f.Strings[i] = f:CreateFontString(nil, "OVERLAY"); f.Strings[i]:SetFontObject("GameFontHighlight"); f.Strings[i]:SetTextColor(1, 1, 1, 1); end f.Strings[1]:SetPoint("LEFT") f.Strings[2]:SetPoint("CENTER") f.Strings[3]:SetPoint("RIGHT", -30, 0) return f end function MyFrame_Update(self) local numOptions = #TableData local index, row local offset = FauxScrollFrame_GetOffset(self) for i=1, core.TableNumrows do row = self.Rows[i] index = offset + i if (index == SelectedData) then row:SetNormalTexture("Interface\\BUTTONS\\UI-Listbox-Highlight2.blp") else row:SetNormalTexture(nil) end if TableData[index] then row.Strings[1]:SetText("Player"..TableData[index].player) row.Strings[2]:SetText(classes[TableData[index].class]) row.Strings[3]:SetText(TableData[index].dkp) else row:Hide() end end FauxScrollFrame_Update(self, numOptions, numrows, height) end
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. Last edited by Fizzlemizz : 06-29-19 at 11:03 PM. |
|
06-29-19, 07:05 PM | #31 |
If you're going to sort on classes, you'll probably want to create the classes table in alphabetical order because TableData is storing the classes key (1, 2, 3 etc.) not the actual class name.
Code:
local classes = { "DH", "DK", "Druid", "Hunter", "Mage", "Monk", "Paladin", "Priest", "Rogue", "Shaman", "Warlock", "Warrior" } -- Sorted to use keys[i] insted of full class name in the table
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. |
|
06-30-19, 03:41 PM | #32 |
So I've been making a lot of progress on the look and feel of the whole thing. However, I tried making a filter for the list (checkboxes for each class). On click, it runs the update function omitting any classes unchecked. It works perfectly... Until the list gets smaller than the rows displayed... Then the whole frame disappears as if it was hidden. Any insight on what may cause that?
I have SetText("") to simply clear out the text of any rows that go beyond the number of entries (27 rows total, if there's only 25 entries in the WorkingTable then it should blank out the last 2 lines... or so I thought). Lua Code:
EDIT: I have tried reactively adjusting core.TableNumrows (number of rows to draw) based on numOptions (number of entries in the table).. But that doesn't seem to effect anything Last edited by Aeriez : 06-30-19 at 05:27 PM. |
|
06-30-19, 06:29 PM | #33 |
Probably easier to use a filtered "display" table to store information from the main table.
Lua Code:
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. Last edited by Fizzlemizz : 06-30-19 at 11:54 PM. |
|
06-30-19, 11:18 PM | #34 |
Thanks a ton! I ended up doing something similar to that actually. Much appreciated!
|
|
WoWInterface » Developer Discussions » Lua/XML Help » Trying to Learn |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|