Skip to content

Commit

Permalink
New Class "LuaBundle"
Browse files Browse the repository at this point in the history
Refactored code to make use of new LuaBundle class, this is to bring the implementation closer inline with how EmuThread is implemented, and should now be compatible with multiple emuInstances, if needed. also should make adding support for multiple lua scripts a bit easier as well.
  • Loading branch information
NPO-197 committed Sep 27, 2024
1 parent 2f19ab8 commit 8d0de89
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 170 deletions.
11 changes: 8 additions & 3 deletions src/frontend/qt_sdl/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,15 @@ void EmuThread::run()

handleMessages();


LuaConsoleDialog* dialog = emuInstance->getMainWindow()->getLuaDialog();
//Lua Script Stuff (-for now happens at the end of each frame regardless of emuStatus)
LuaScript::createLuaState();//Create LuaState if needed
LuaScript::luaUpdate(); //"_Update()" gets called in current lua script

if(dialog!=nullptr)
{
LuaBundle* lua = dialog->getLuaBundle();
lua->createLuaState();//Create LuaState if needed
lua->luaUpdate(); //"_Update()" gets called in current lua script
}
}

file = Platform::OpenLocalFile("rtc.bin", Platform::FileMode::Write);
Expand Down
Loading

0 comments on commit 8d0de89

Please sign in to comment.