drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.3k stars 57 forks source link

Automatically extract asset packs inside ZIP files. #309

Open drwhut opened 1 year ago

drwhut commented 1 year ago

Is your feature request related to a problem? Please describe. Since there is currently no central repository for downloading asset packs, players need to manually download them and place them in the correct folder in their Documents - because of this, most asset packs are distributed via ZIP files, the contents of which need to be extracted in order for the game to be able to read them.

Describe the solution you'd like It would be nice if the extraction step could be skipped when installing new asset packs, and have the game do this step for us.

In terms of the functionality, the game would need to start with the ZIP file in the player's Documents folder, and end up with a folder structure somewhere on the file system for it to scan like all other asset packs. Where the extraction takes place is where the implementation can change, but here's a few ideas:

Describe alternatives you've considered None.

Additional context Godot 4.x has a ZIPReader class that is perfect for this issue - however, an equivalent does not exist in Godot 3.x by default (which is what Tabletop Club v0.2.0 is going to use). Luckily, '20kdc' from the community Matrix server has developed a stand-alone script that replicates the ZIPReader API for 3.x, which makes this issue solvable for v0.2.0!