@@ -304,10 +304,8 @@ void LuaFile::load()
304
304
305
305
lua[" require" ] = [&](const std::string &filename) -> sol::object
306
306
{
307
- storage::Path lib (filename);
308
-
309
307
// Load the file
310
- sol::load_result chunk = lua.load_file (this ->lua_storage .convertPath (lib ).str ());
308
+ sol::load_result chunk = lua.load_file (this ->lua_storage .convertPath (filename ).str ());
311
309
if (!chunk.valid ())
312
310
{
313
311
sol::error err = chunk;
@@ -318,16 +316,6 @@ void LuaFile::load()
318
316
return chunk ();
319
317
};
320
318
321
- lua[" saveTable" ] = [&](const std::string &filename, const sol::table &table)
322
- {
323
- save_lua_table (lua, lua_storage.convertPath (filename).str (), table);
324
- };
325
-
326
- lua[" loadTable" ] = [&](const std::string &filename)
327
- {
328
- return load_lua_table (lua, lua_storage.convertPath (filename).str ());
329
- };
330
-
331
319
if (perms.acces_hardware ) // si hardware est autorisé
332
320
{
333
321
lua.new_usertype <LuaHardware>(" hardware" ,
@@ -381,6 +369,16 @@ void LuaFile::load()
381
369
382
370
lua[" Json" ] = json_ud;
383
371
372
+ lua[" saveTable" ] = [&](const std::string &filename, const sol::table &table)
373
+ {
374
+ save_lua_table (lua, lua_storage.convertPath (filename).str (), table);
375
+ };
376
+
377
+ lua[" loadTable" ] = [&](const std::string &filename)
378
+ {
379
+ return load_lua_table (lua, lua_storage.convertPath (filename).str ());
380
+ };
381
+
384
382
lua[" storage" ] = &lua_storage;
385
383
}
386
384
@@ -732,6 +730,8 @@ void LuaFile::load()
732
730
733
731
app.set_function (" launch" , sol::overload ([&](std::string name, std::vector<std::string> arg)
734
732
{
733
+ std::cout << " launch: " << name << std::endl;
734
+ std::cout << " arg: " << arg[0 ] << std::endl;
735
735
try {
736
736
AppManager::get (name)->run (arg);
737
737
}
@@ -745,6 +745,7 @@ void LuaFile::load()
745
745
return true ; },
746
746
[&](std::string name)
747
747
{
748
+ std::cout << " launch: " << name << std::endl;
748
749
try
749
750
{
750
751
AppManager::get (name)->run ({});
@@ -810,7 +811,7 @@ void LuaFile::load()
810
811
systemSettings.set_function (" getBackgroundColor" , &libsystem::paxoConfig::getBackgroundColor);
811
812
systemSettings.set_function (" getTextColor" , &libsystem::paxoConfig::getTextColor);
812
813
systemSettings.set_function (" getBorderColor" , &libsystem::paxoConfig::getBorderColor);
813
- systemSettings.set_function (" setBackgroundColor" , & libsystem::paxoConfig::setBackgroundColor);
814
+ systemSettings.set_function (" setBackgroundColor" , []( int color) { libsystem::paxoConfig::setBackgroundColor ( color_t (color), true ); } );
814
815
systemSettings.set_function (" setTextColor" , &libsystem::paxoConfig::setTextColor);
815
816
systemSettings.set_function (" setBorderColor" , &libsystem::paxoConfig::setBorderColor);
816
817
}
0 commit comments