Regarding functions with optional/default arguments:
When I specify a function as having one or more default arguments, and then call it using less than the maximum number of arguments, I get a warning that it expected a different number of arguments from what it got.
In my example, drawWindowFrame() has 8 parameters, of which one of them, drawBG, is optional, defaulting to true. I call the function, omitting drawBg, which runs as expected, but the warning still shows.
View attachment 33696
I am aware that you can suppress the warning by adding the line:
GML:
if (0) {return argument[0];}
But that seems like a rather crude way of doing it, basically having to trick the editor into ignoring the number of arguments. Also, unless you explicitly include the jsdoc @param lines, it will cause the help text to just say drawWindowFrame(...) and not show any arguments. Is there a more elegant way of handling this? If not, can you please add one?