File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1919 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020 * SOFTWARE.
2121 */
22- #include " ../utils/convert_godot_lua .hpp"
22+ #include " ../utils/custom_sol .hpp"
2323
2424#include < godot_cpp/classes/engine.hpp>
25- #include < sol/sol.hpp>
2625
2726using namespace godot ;
28- using namespace luagdextension ;
2927
3028extern " C" int luaopen_godot_singleton_access (lua_State *L) {
29+ sol::state_view state (L);
3130 Engine *engine = Engine::get_singleton ();
3231 for (auto && singleton_name : engine->get_singleton_list ()) {
33- lua_push (L, engine->get_singleton (singleton_name));
34- lua_setglobal (L, singleton_name.ascii ().get_data ());
32+ state.set (singleton_name.ascii ().get_data (), engine->get_singleton (singleton_name));
3533 }
36-
3734 return 0 ;
3835}
You can’t perform that action at this time.
0 commit comments