on_o = show_debug(); is wrong.. you have to assign the function pointer!:
on_o = show_debug;The reason is that the on_ events are function* pointer callbacks which are automatically executed. If you would like to assign several function depending on the gamestate, use a wrapper function which does the selection:
Code:
function on_o_event ()
{
if (gameState == gs_mainMenu) {
switchDebugMenu();
} else {
switchDebugDefault();
}
}
on_o = on_o_event;
Or something like this..