From 45c05ac5610416e75a123995af649681d43adf7f Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 18 Oct 2021 23:20:28 +0800 Subject: * lua error handle --- Editor/EditorMain.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Editor/EditorMain.cpp') diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp index 67ddc38..f8ee4ef 100644 --- a/Editor/EditorMain.cpp +++ b/Editor/EditorMain.cpp @@ -35,6 +35,11 @@ static int MainLoop() return (INT)msg.wParam; } +void ErrorHandle(cc8* msg) +{ + log_error(std::string("[Lua] ") + msg); +} + void InitLuaState() { LuaBind::VM vm; @@ -45,7 +50,7 @@ void InitLuaState() log_error("Can't setup scripting."); } LuaBind::State state = vm.GetMainState(); - state.DoFile("./Scripts/EditorApplication.lua"); + state.DoFile("./Scripts/EditorApplication.lua", ErrorHandle); } #ifdef GAMELAB_DEBUG -- cgit v1.1-26-g67d0