Merge pull request #109 from floydinator-git/main

add assets.exists
This commit is contained in:
Kae 2024-09-07 14:35:17 +10:00 committed by GitHub
commit 06b865fb84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,6 +124,7 @@ Assets::Assets(Settings settings, StringList assetSources) {
LuaCallbacks callbacks;
callbacks.registerCallbackWithSignature<StringSet, String>("byExtension", bind(&Assets::scanExtension, this, _1));
callbacks.registerCallbackWithSignature<Json, String>("json", bind(&Assets::json, this, _1));
callbacks.registerCallbackWithSignature<bool, String>("exists", bind(&Assets::assetExists, this, _1));
callbacks.registerCallback("bytes", [this](String const& path) -> String {
auto assetBytes = bytes(path);