From a746eb7d1cd42e2ed598fc25eb05d87763b49541 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Mon, 4 Sep 2023 02:41:36 -0400 Subject: [PATCH] Load autoload.lua in "minimal" lua states --- data/libs/autoload.lua | 2 -- src/lua/Lua.cpp | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/libs/autoload.lua b/data/libs/autoload.lua index 15da553eb9e..19a5a53769b 100644 --- a/data/libs/autoload.lua +++ b/data/libs/autoload.lua @@ -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 diff --git a/src/lua/Lua.cpp b/src/lua/Lua.cpp index 31210eba9c6..23c23af4cee 100644 --- a/src/lua/Lua.cpp +++ b/src/lua/Lua.cpp @@ -66,6 +66,8 @@ namespace Lua { LuaColor::Register(manager->GetLuaState()); LuaEngine::Register(); + + pi_lua_dofile(manager->GetLuaState(), "libs/autoload.lua"); } void InitModules() @@ -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);