mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-04-02 18:25:30 +02:00
Changed lua monitoring calls. Support for threading.
This commit is contained in:
29
RetroFE/Source/Lua/LuaCollection.cpp
Normal file
29
RetroFE/Source/Lua/LuaCollection.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "LuaCollection.h"
|
||||
#include "../Collection/CollectionInfo.h"
|
||||
#include <string>
|
||||
#include "../Collection/Item.h"
|
||||
|
||||
Configuration *config;
|
||||
CollectionInfoBuilder *cib;
|
||||
LuaEvent *events;
|
||||
void LuaCollection::initialize(Configuration *c, CollectionInfoBuilder *b, LuaEvent *e)
|
||||
{
|
||||
config = c;
|
||||
cib = b;
|
||||
events = e;
|
||||
}
|
||||
|
||||
int LuaCollection::load(lua_State *l)
|
||||
{
|
||||
std::string collection = luaL_checkstring(l, 1);
|
||||
cib->buildCollection(collection, loadCallback, (void *)l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LuaCollection::loadCallback(void *context)
|
||||
{
|
||||
lua_State *l = (lua_State *)context;
|
||||
events->trigger(l, "onCollectionLoaded");
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user