Created
February 4, 2024 03:20
-
-
Save nommiin/15ce8d63948800c52b4b51f7313fb86a to your computer and use it in GitHub Desktop.
Get calling GML function as normalized-string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #macro _GMFUNCTION_NAME_ array_first(string_split_ext(_GMFUNCTION_, ["gml_Script_", "gml_Object_", "gml_GlobalScript_", "@"], true, 2)) | |
| /* | |
| function test() { | |
| show_message(_GMFUNCTION_NAME_); // test | |
| function does_this() { | |
| show_message(_GMFUNCTION_NAME_); // does_this | |
| var a = function even_work() { | |
| show_message(_GMFUNCTION_NAME_); // even_work | |
| var b = function() { | |
| show_message(_GMFUNCTION_NAME_); // anon | |
| } | |
| b(); | |
| } | |
| a(); | |
| } | |
| does_this(); | |
| } | |
| test(); | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment