Add core library and element classes for Basalt framework

This commit is contained in:
Robert Jelic
2025-02-09 13:40:17 +01:00
parent acc5949085
commit 1d31fb8d0c
16 changed files with 1329 additions and 0 deletions

25
src/init.lua Normal file
View File

@@ -0,0 +1,25 @@
local args = {...}
local basaltPath = args[1] or "basalt"
local defaultPath = package.path
local format = "path;/path/?.lua;/path/?/init.lua;"
local main = format:gsub("path", basaltPath)
package.path = main.."rom/?"
local function errorHandler(err)
local errorManager = require("errorManager")
errorManager.header = "Basalt Loading Error"
errorManager.error(err)
end
-- Use xpcall with error handler
local ok, result = pcall(require, "main")
if not ok then
errorHandler(result)
else
return result
end