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.26k stars 51 forks source link

Omit extensions in config.cfg #217

Open GrimPixel opened 1 year ago

GrimPixel commented 1 year ago

Is your feature request related to a problem? Please describe. In config.cfg, extensions have to be included for file names, while in stacks.cfg, they are omitted.

Describe the solution you'd like Omit extensions in config.cfg.

drwhut commented 1 year ago

A potential issue that can occur with this is if two files have the same name, but with different extensions. I admit it's not a likely senario, but if the config.cfg file used just the name without the extension, then how would it know which file to configure?

GrimPixel commented 1 year ago

In the stacks.cfg, there is the same question: if two files have the same name with different extensions, which one will it take? I haven't tried it yet. It is not supposed to have two files with the same name and different extensions in a set of asset, usually.

drwhut commented 1 year ago

You raise a fair point - currently the game will not add two assets with the same name (even if they have different extensions), so there could be two potential solutions:

GrimPixel commented 1 year ago

I prefer to keep unique names because extensions are omitted in game, so they are meant to be ignored.

drwhut commented 1 year ago

With the implementation of #124, this has potentially complicated things: theoretically, two assets with the same file name can now have two different names in-game using the name property.

Due to the way assets are indexed internally, it still makes sense to restrict in-game names to be unique (which is currently the case) - but due to the new property, I personally think it's okay to keep using extensions since the name property can be used to forcefully re-name one of the assets if need be.

I will keep this issue open, though in case people are against this idea.

EDIT: I forgot to mention, some users may also find it useful to apply specific properties to assets with a given extension.