mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-04-02 18:25:30 +02:00
Collection loading and deletion support (in a thread).
This commit is contained in:
@@ -16,14 +16,24 @@ void LuaCollection::initialize(Configuration *c, CollectionInfoBuilder *b, LuaE
|
||||
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)
|
||||
int LuaCollection::destroy(lua_State *l)
|
||||
{
|
||||
CollectionInfo *i = (CollectionInfo *)luaL_checkinteger(l, 1);
|
||||
cib->destroyCollection(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void LuaCollection::loadCallback(void *context, CollectionInfo *info)
|
||||
{
|
||||
lua_State *l = (lua_State *)context;
|
||||
events->trigger(l, "onCollectionLoaded");
|
||||
events->trigger(l, "onCollectionLoaded", (void *)info);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user