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

Added an "All" filter for Packs and Types #191

Closed elmodor closed 1 year ago

elmodor commented 1 year ago

Fixes/Solves Fixes #141

I thought about adding an "All" type to the AssetDB - but since this is an "UI" element only I don't think this belongs into the AssetDB.

The idea is that there is an "All" pack that displays all packs. This is available in all PreviewFilter instances and selected by default.

I also added an "All" filter for types. This is beneficial if you use the search function to filter. Or to see all assets in one go. Also selected by default. There is an additional condition for types: the "All" filter will only be created if there is more than 1 type. So for instances like table, skybox etc there won't be an "All" type filter.

elmodor commented 1 year ago

I've made the "All" strings translate-able. The metadata type is changed from "ALL" to "ALL_TYPES/PACKS_DISPLAY" to be more robust, just in case someone adds an actual pack named "All".

elmodor commented 1 year ago

I can prepend an @ - but I guess you are talking about Windows here? On Linux, you can create a folder with any character. But I doubt someone names their pack "@ALL_PACKS_DISPLAY". Or we can prepend an @ for all other asset packs: _pack_button.set_item_metadata(_pack_button.get_item_count() - 1, "@" + pack)

I will do the first option for now since I doubt anyone names their pack like this

drwhut commented 1 year ago

Ah, looks like one of the PRs created a merge conflict.

elmodor commented 1 year ago

Resolved merge conflict