CommunityDragon / CDTB

A library containing everything to extract files from client files.
GNU Lesser General Public License v3.0
119 stars 33 forks source link

Fix shader guessing consistently failing to find all shader files #58

Closed Morilli closed 2 years ago

Morilli commented 2 years ago
benoitryder commented 2 years ago

Might wanna consider combining all the hardcoded paths into a for() expression at this point.

I agree, that would be cleaner. Also maybe improve the detection of "shared extension" using a regexp for instance.

Morilli commented 2 years ago

Which "shared extension detection" do you mean here? This part?

shader_paths = [path for path in self.known.values() if any(extension in path for extension in shader_extensions)]
benoitryder commented 2 years ago

Yes. shader_extensions and the any(...) could be replaced by using a regexp.

Morilli commented 2 years ago

Okay, have refactored a fair bit, and it works much better now imo.