Jorixon / JASM

Just Another Skin Manager
GNU General Public License v3.0
61 stars 7 forks source link

Better way of detecting what skin a mod is for #155

Open Jorixon opened 3 months ago

Jorixon commented 3 months ago

Currently, the method for determining which character skin a mod belongs to involves examining the filenames within the mod and comparing them with existing ModFilesName for that characterskin. Filtered to these filenames based on specific extensions (".buf", ".dds", ".ib"). Then if any match is found assume that the mod is for that characterskin

However, this approach was implemented hastily and I'm no modder myself.

I believe that .ini files may contain character hashes that could be integrated into characters.json file to more accurately determine which character skin each mod corresponds to.

I'm currently looking into this and would appreciate feedback and ideas.

The current source code for this can be found here: JASM\src\GIMI-ModManager.Core\Services\ModCrawlerService.cs

farsdewibs0n commented 1 month ago

I believe that .ini files may contain character hashes that could be integrated into characters.json file to more accurately determine which character skin each mod corresponds to.

This doesn't really work if the models are new (no hashes yet), or outdated mods.

Modders usually put the target mod (idk how to explain it) in the .ini (even the .ini filename is the target mod most of the time).

Pyrageis commented 1 week ago

rather than hashes that would need more added when a new update changes some hashes, most ini files will have the name of the character as part of a section name in overrides, for example

6sN49Yh 1

IfZbzAw 1

only reason they wouldn't is if the inis were made manually rather than with the export script, in the occasional case it doesn't you could keep the old method to use as a fallback if it can't find one in an ini

an upside to doing it via hashes if chosen to do that way you could have it let the user know if its an old hash and the mod needs the version update fix to be done, as it usually keeps the old hash in the file but as a comment you would just have to exclude the lines with hashes that start with ;