Added logic for the lua output display console.
This commit is contained in:
parent
122473b575
commit
4e9601a241
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
static bool luaScriptRunning = false;
|
static bool luaScriptRunning = false;
|
||||||
|
|
||||||
|
static std::string luaOutputText;
|
||||||
static std::list <LuaControlDialog_t*> winList;
|
static std::list <LuaControlDialog_t*> winList;
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
LuaControlDialog_t::LuaControlDialog_t(QWidget *parent)
|
LuaControlDialog_t::LuaControlDialog_t(QWidget *parent)
|
||||||
|
@ -141,7 +142,7 @@ void LuaControlDialog_t::openLuaScriptFile(void)
|
||||||
|
|
||||||
//getDirFromFile( last.c_str(), dir );
|
//getDirFromFile( last.c_str(), dir );
|
||||||
|
|
||||||
//dialog.setDirectory( tr(dir) );
|
dialog.setDirectory( tr("/usr/share/fceux/luaScripts") );
|
||||||
|
|
||||||
// Check config option to use native file dialog or not
|
// Check config option to use native file dialog or not
|
||||||
g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
|
g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
|
||||||
|
@ -178,6 +179,7 @@ void LuaControlDialog_t::openLuaScriptFile(void)
|
||||||
void LuaControlDialog_t::startLuaScript(void)
|
void LuaControlDialog_t::startLuaScript(void)
|
||||||
{
|
{
|
||||||
#ifdef _S9XLUA_H
|
#ifdef _S9XLUA_H
|
||||||
|
luaOutputText.clear();
|
||||||
fceuWrapperLock();
|
fceuWrapperLock();
|
||||||
if ( 0 == FCEU_LoadLuaCode( scriptPath->text().toStdString().c_str(), scriptArgs->text().toStdString().c_str() ) )
|
if ( 0 == FCEU_LoadLuaCode( scriptPath->text().toStdString().c_str(), scriptArgs->text().toStdString().c_str() ) )
|
||||||
{
|
{
|
||||||
|
@ -208,6 +210,7 @@ void LuaControlDialog_t::refreshState(void)
|
||||||
stopButton->setEnabled( false );
|
stopButton->setEnabled( false );
|
||||||
startButton->setText( tr("Start") );
|
startButton->setText( tr("Start") );
|
||||||
}
|
}
|
||||||
|
luaOutput->setText( luaOutputText.c_str() );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void updateLuaWindows( void )
|
void updateLuaWindows( void )
|
||||||
|
@ -224,7 +227,7 @@ void WinLuaOnStart(intptr_t hDlgAsInt)
|
||||||
{
|
{
|
||||||
luaScriptRunning = true;
|
luaScriptRunning = true;
|
||||||
|
|
||||||
printf("Lua Script Running: %i \n", luaScriptRunning );
|
//printf("Lua Script Running: %i \n", luaScriptRunning );
|
||||||
|
|
||||||
updateLuaWindows();
|
updateLuaWindows();
|
||||||
}
|
}
|
||||||
|
@ -233,14 +236,17 @@ void WinLuaOnStop(intptr_t hDlgAsInt)
|
||||||
{
|
{
|
||||||
luaScriptRunning = false;
|
luaScriptRunning = false;
|
||||||
|
|
||||||
printf("Lua Script Running: %i \n", luaScriptRunning );
|
//printf("Lua Script Running: %i \n", luaScriptRunning );
|
||||||
|
|
||||||
updateLuaWindows();
|
updateLuaWindows();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void PrintToWindowConsole(intptr_t hDlgAsInt, const char* str)
|
void PrintToWindowConsole(intptr_t hDlgAsInt, const char* str)
|
||||||
{
|
{
|
||||||
printf("%s\n", str );
|
//printf("%s\n", str );
|
||||||
|
|
||||||
|
luaOutputText.append( str );
|
||||||
|
|
||||||
|
updateLuaWindows();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue