-
-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a more correct atlas list #4776
Conversation
See the PR description for details
I would prefer if we can automate this in the same way we used to automate the model list update. If I understood you correctly, we can simplify the algorithm and do:
I'll take a look at whether we can automate this with wago.tools in the new year. |
As explained at #3966 this export is generated with wow.export to get db2 files, into dbc2csv, into csv2lua, basically same as you did but not using cascexplorer Can you include the atlascsv2lua.lua script with your changes? |
I used C#. If necessary I will attach the entire project. The above algorithm fits in just one line //Method syntax
List<string> preResult = filteredTableL.Join(tableA, itemF => itemF.FileDataID, itemA => itemA.FileDataID, (itemF, itemA) => itemA)
.Join(tableM, prev => prev.ID, itemM => itemM.UiTextureAtlasID, (prev, itemM) => itemM)
.Join(tableE, prec => prec.UiTextureAtlasElementID, itemE => itemE.ID, (prec, itemE) => itemE.Name)
.Distinct(StringComparer.Ordinal)
.OrderBy(x => x, StringComparer.Ordinal)
.ToList(); where
|
The same but in query syntax with one note //Since there is no equivalent to Distinct() in queries
//Use group A by B into C
// select C.First()
//Query syntax
var query = from itemF in filteredTableL
join itemA in tableA on itemF.FileDataID equals itemA.FileDataID
join itemM in tableM on itemA.ID equals itemM.UiTextureAtlasID
join itemE in tableE on itemM.UiTextureAtlasElementID equals itemE.ID
orderby itemE.Name ascending
group itemE by itemE.Name into newForm
select newForm.First().Name;
List<string> preResult = query.ToList(); |
I'm not quite sure what your main point is. Would you like to automate or/and use Github Actions for this task? Ok. There are no problems with this at all, except for data extraction. More precisely, getting one type of data. I duplicate one thought from the above text wall. The list generated using the tables may contain empty textures (Why? Blizzard knows it). How to get rid of them? I don't know. You can suggest your option. I used listfile for the current build (NOT community listfile, it's important). The problem is getting this file. At the moment I don’t know any other tools for this except CASCExplorer and Local WoW.tools |
Code heavly based on code/ideas provided by Nightwarden24 in WeakAuras#4776 Just ported to lua for hopefully easier maintability Fixes: WeakAuras#4776
Thank you for all the work you did on this. I've merged the lua implementation of you algorighm. If you can get the CascLib to work, I can look into integrating that too. |
Description
Your way of generating a texture atlas list is wrong. As a result:
2x
in the search field. You will see a bunch of empty textures among the results. Let's take the first one:!ui-frame-diamondmetal-edgeleft-2x
./dump C_Texture.GetAtlasInfo("!ui-frame-diamondmetal-edgeleft-2x")
retuns nil/dump C_Texture.GetAtlasInfo("Unit_Druid_AstralPower_Fill")
retuns a non-empty result.The whole point is that the required data is not in CommitedName column of the UiTextureAtlasMember table but in Name column of the UiTextureAtlasElement table. However, you can't just list the values of this column. That would also be a mistake. To get the correct result, you will have to use data from all three tables (UiTextureAtlas, UiTextureAtlasMember, UiTextureAtlasElement) by correlating their elements based on matching keys. Basically, it's an inner join operation in relational databases.
The algorithm might be something like this:
But that's not all. When generating the list in this way, it was found that:
CGuy_
.C_Texture.GetAtlasInfo
returns info for them, but they are displayed as a green square on the screen (check it out using the texture picker). I can assume by the file name (Interface/CameraGuy/CameraGuyAsset
) that they are intended for the commentator mode, which is not available to playersSo I decided to further filter the result by checking whether a texture atlas file (FileDataID column of the UiTextureAtlas table) exists in the game client. I used listfile of the current build for this purpose.
I've also used the following tools:
Note: Personally, I didn't use compiled binaries of CASCExplorer and DBC2CSV, but built them myself as they may have become outdated since the last release.
Notes: I can't say that the list in the commit below is complete, because there is no sample/benchmark to compare with. In theory, the list doesn't contain empty textures.
Data are extracted from the following builds:
Type of change