Skip to content

Commit

Permalink
Load autoload.lua in "minimal" lua states
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Sep 8, 2023
1 parent 6dbdfd6 commit a746eb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions data/libs/autoload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
-- this is the only library automatically loaded at startup
-- its the right place to extend core Lua tables

require 'SpaceStation'

string.trim = function(s)
return string.gsub(s or "", "^%s*(.-)%s*$", "%1")
end
Expand Down
4 changes: 3 additions & 1 deletion src/lua/Lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ namespace Lua {
LuaColor::Register(manager->GetLuaState());

LuaEngine::Register();

pi_lua_dofile(manager->GetLuaState(), "libs/autoload.lua");
}

void InitModules()
Expand Down Expand Up @@ -122,7 +124,7 @@ namespace Lua {
SceneGraph::Lua::Init();

// XXX load everything. for now, just modules
pi_lua_dofile(l, "libs/autoload.lua");
// pi_lua_dofile(l, "libs/autoload.lua");
lua_pop(l, 1);

pi_lua_import(l, "pigui", true);
Expand Down

0 comments on commit a746eb7

Please sign in to comment.