Hooked up Lua menu actions in Qt Tas Editor.
This commit is contained in:
parent
fa748b0a41
commit
4b3ae8fead
|
@ -183,6 +183,12 @@ void FCEUD_MovieRecordTo(void);
|
||||||
void FCEUD_MovieReplayFrom(void);
|
void FCEUD_MovieReplayFrom(void);
|
||||||
void FCEUD_LuaRunFrom(void);
|
void FCEUD_LuaRunFrom(void);
|
||||||
|
|
||||||
|
#ifdef _S9XLUA_H
|
||||||
|
// lua engine
|
||||||
|
void TaseditorAutoFunction(void);
|
||||||
|
void TaseditorManualFunction(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
int32 FCEUI_GetDesiredFPS(void);
|
int32 FCEUI_GetDesiredFPS(void);
|
||||||
void FCEUI_SaveSnapshot(void);
|
void FCEUI_SaveSnapshot(void);
|
||||||
void FCEUI_SaveSnapshotAs(void);
|
void FCEUI_SaveSnapshotAs(void);
|
||||||
|
|
|
@ -846,7 +846,7 @@ QMenuBar *TasEditorWindow::buildMenuBar(void)
|
||||||
//act->setShortcut(QKeySequence(tr("Ctrl+N")));
|
//act->setShortcut(QKeySequence(tr("Ctrl+N")));
|
||||||
act->setStatusTip(tr("Run Function"));
|
act->setStatusTip(tr("Run Function"));
|
||||||
//act->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
|
//act->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
|
||||||
//connect(act, SIGNAL(triggered()), this, SLOT(createNewProject(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(manLuaRun(void)) );
|
||||||
|
|
||||||
luaMenu->addAction(act);
|
luaMenu->addAction(act);
|
||||||
|
|
||||||
|
@ -858,7 +858,7 @@ QMenuBar *TasEditorWindow::buildMenuBar(void)
|
||||||
//act->setShortcut(QKeySequence(tr("Ctrl+N")));
|
//act->setShortcut(QKeySequence(tr("Ctrl+N")));
|
||||||
act->setStatusTip(tr("Auto Function"));
|
act->setStatusTip(tr("Auto Function"));
|
||||||
//act->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
|
//act->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
|
||||||
//connect(act, SIGNAL(triggered()), this, SLOT(createNewProject(void)) );
|
connect(act, SIGNAL(triggered(bool)), this, SLOT(autoLuaRunChanged(bool)) );
|
||||||
|
|
||||||
luaMenu->addAction(act);
|
luaMenu->addAction(act);
|
||||||
|
|
||||||
|
@ -1364,7 +1364,7 @@ int TasEditorWindow::initModules(void)
|
||||||
// create initial snapshot in history
|
// create initial snapshot in history
|
||||||
history.reset();
|
history.reset();
|
||||||
// reset Taseditor variables
|
// reset Taseditor variables
|
||||||
//mustCallManualLuaFunction = false;
|
mustCallManualLuaFunction = false;
|
||||||
|
|
||||||
//SetFocus(history.hwndHistoryList); // set focus only once, to show blue selection cursor
|
//SetFocus(history.hwndHistoryList); // set focus only once, to show blue selection cursor
|
||||||
//SetFocus(pianoRoll.hwndList);
|
//SetFocus(pianoRoll.hwndList);
|
||||||
|
@ -1392,16 +1392,19 @@ void TasEditorWindow::frameUpdate(void)
|
||||||
splicer.update();
|
splicer.update();
|
||||||
history.update();
|
history.update();
|
||||||
project.update();
|
project.update();
|
||||||
|
|
||||||
|
#ifdef _S9XLUA_H
|
||||||
// run Lua functions if needed
|
// run Lua functions if needed
|
||||||
if (taseditorConfig.enableLuaAutoFunction)
|
if (taseditorConfig.enableLuaAutoFunction)
|
||||||
{
|
{
|
||||||
//TaseditorAutoFunction();
|
TaseditorAutoFunction();
|
||||||
}
|
}
|
||||||
//if (mustCallManualLuaFunction)
|
if (mustCallManualLuaFunction)
|
||||||
//{
|
{
|
||||||
// TaseditorManualFunction();
|
TaseditorManualFunction();
|
||||||
// mustCallManualLuaFunction = false;
|
mustCallManualLuaFunction = false;
|
||||||
//}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
pianoRoll->update();
|
pianoRoll->update();
|
||||||
|
|
||||||
|
@ -2356,6 +2359,16 @@ void TasEditorWindow::pauseAtEndActChanged(bool val)
|
||||||
taseditorConfig.autopauseAtTheEndOfMovie = val;
|
taseditorConfig.autopauseAtTheEndOfMovie = val;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
void TasEditorWindow::manLuaRun(void)
|
||||||
|
{
|
||||||
|
mustCallManualLuaFunction = true;
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void TasEditorWindow::autoLuaRunChanged(bool val)
|
||||||
|
{
|
||||||
|
taseditorConfig.enableLuaAutoFunction = val;
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
void TasEditorWindow::showToolTipsActChanged(bool val)
|
void TasEditorWindow::showToolTipsActChanged(bool val)
|
||||||
{
|
{
|
||||||
taseditorConfig.tooltipsEnabled = val;
|
taseditorConfig.tooltipsEnabled = val;
|
||||||
|
|
|
@ -295,6 +295,8 @@ class TasEditorWindow : public QDialog
|
||||||
|
|
||||||
std::vector<std::string> patternsNames;
|
std::vector<std::string> patternsNames;
|
||||||
std::vector<std::vector<uint8_t>> patterns;
|
std::vector<std::vector<uint8_t>> patterns;
|
||||||
|
|
||||||
|
bool mustCallManualLuaFunction;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int initModules(void);
|
int initModules(void);
|
||||||
|
@ -373,6 +375,8 @@ class TasEditorWindow : public QDialog
|
||||||
void setMaxUndoCapacity(void);
|
void setMaxUndoCapacity(void);
|
||||||
void setCurrentPattern(int);
|
void setCurrentPattern(int);
|
||||||
void tabViewChanged(int);
|
void tabViewChanged(int);
|
||||||
|
void autoLuaRunChanged(bool);
|
||||||
|
void manLuaRun(void);
|
||||||
|
|
||||||
friend class RECORDER;
|
friend class RECORDER;
|
||||||
friend class SPLICER;
|
friend class SPLICER;
|
||||||
|
|
Loading…
Reference in New Issue