Open KormexGit opened 6 months ago
Definitely! With the addition of YoYoGames/GameMaker-Bugs#2964 (asset_get_ids()
), this would eliminate the need for functions like object_get_name()
, sprite_get_name()
, script_get_name()
, etc, in many cases.
I agree, it would probably be nicer to deprecate all the specific asset type name fetchy functions and just have one that works for all asset types instead.
yes please depecrate all the other and just make this one the default
I agree with everyone here.
At the moment, there is also a problem with getting the asset type - Asset.GMTextureGroup
There is no constant in the collection of constants for the texture group when trying to find out the asset type:
/* Default is Asset.GMTextureGroup */
show_message(asset_get_type("Default") == asset_unknown); // true
Its currently very cumbersome to go from asset_index -> asset name.
You need to check if the asset exist, then what type of asset it is via asset_get_type, then call the appropriate *_get_name function.
This should all be rolled up into a native asset_get_name function.
We definitely need this.
Is your feature request related to a problem?
I saw a comment on YoYoGames/GameMaker-Bugs#2808 that mentioned GM not having a asset_get_name() function, and realized I don't think there's a request for that yet, so figured I'd file one. This function wouldn't have been possible before, but with the ref changes, it should be possible now. Combined with the existing asset_get_type, this would streamline things like save systems.
Describe the solution you'd like
Add a new function, asset_get_name. This would function similar to existing functions like object_get_name, sprite_get_name, etc. but it would take any asset type. It would essentially be the true opposite to asset_get_index.
Describe alternatives you've considered
No response
Additional context
No response