So right now i'm trying to understand how the lua script files for the menus work. Here's what I've got so far.
Binder.cpp binds the ModuleManager functions RunField,RunMenu,RunBattle to lua. In lua to call these you would use module:run_field(116) for example. Communication runs through the boost thread g_ModuleManager.
That part seems nice and clear.
Now I'm trying to look at what happens when RunMenu gets called.
ModuleManager makes a new MenuModule and passes in the menu_id. It then goes and spits out "MenuModule created."
Some how the OnStart function gets run (i'm thinking that's an ogre thing?) and then it goes through and creates a new MenuScriptManager
That MenuScriptManager is used to MenuScriptManager.LoadFile("data/menu/simple.lua")
The Load then opens and runs the script.
The Script then runs and becuause after the script is loaded the state is set to MODULE_RUN nothing shows up. If you make it so that after the script loads the state is changed to MODULE_FINISH you can make a module:run_field(116) call and it then shows and works.
I think i just needed to type that out, and I don't know if i have an actual question, but pointers in any which direction would be helpful i think.
*edit yet again*
So it seems like binder.cpp is missing a bind for setting the state of module so you can actually get out of the script. I haven't for the life of me been able to get the script to exit and continue on execution of the game. Maybe I just don't understand the logic in the construction of how it works or how to actually get it to exit, definately toss some advice myway if you've got it.
*edit-- man this is like a stream of consciousness*
I just found the scripts for the functions and maps and i'm going to go through those and hopefully they'll solve my questions.
md1_1.xml has an error. For encounters it should be 28.125 no 28,125.