-
Notifications
You must be signed in to change notification settings - Fork 476
Adding new lua functions to the source
RhythmLunatic edited this page Oct 11, 2017
·
3 revisions
This is for adding functions to the source code, not functions for your themes! If you want that, go to the Theming Help section!
And before you go polluting the source with needless functions, you should check if it can be done in lua first.
On the screen you want to add to, scroll all the way down to where it says "Luna" and then the screen name.
Define your function, such as
static int ExampleFunction( T* p, lua_State *L )
{
COMMON_RETURN_SELF;
}(Lots of information here)
Then in the constructor, add your new function like this
ADD_METHOD(ExampleFunction);Finally, add your new function to the StepMania lua documentation. Go to Docs/Luadoc.xml and Docs/LuaDocumentation.xml and add them in the correct places.
In LuaDocumentation.xml
<Function name='ExampleFunction' return='void' arguments=''>
A cool example function.
</Function>And LuaDoc.xml
<Function name='ExampleFunction' />