Add capabilities to write out documentation of all Lua functions on startup

This commit is contained in:
Alexander Bock
2014-11-29 14:03:49 +01:00
parent 4de8071efe
commit b05c4cf30f
6 changed files with 90 additions and 6 deletions

View File

@@ -344,6 +344,22 @@ bool OpenSpaceEngine::initialize() {
// TODO: Maybe move all scenegraph and renderengine stuff to initializeGL
scriptEngine().initialize();
// If a LuaDocumentationFile was specified, generate it now
using constants::configurationmanager::keyLuaDocumentationType;
using constants::configurationmanager::keyLuaDocumentationFile;
const bool hasType = configurationManager().hasKey(keyLuaDocumentationType);
const bool hasFile = configurationManager().hasKey(keyLuaDocumentationFile);
if (hasType && hasFile) {
std::string luaDocumentationType;
configurationManager().getValue(keyLuaDocumentationType, luaDocumentationType);
std::string luaDocumentationFile;
configurationManager().getValue(keyLuaDocumentationFile, luaDocumentationFile);
luaDocumentationFile = absPath(luaDocumentationFile);
_scriptEngine.writeDocumentation(luaDocumentationFile, luaDocumentationType);
}
// Load scenegraph
SceneGraph* sceneGraph = new SceneGraph;
_renderEngine.setSceneGraph(sceneGraph);