mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-27 16:39:29 +00:00
Reset defaults before starting a file (main.lua)
This commit is contained in:
parent
b4f5365e96
commit
c053997f96
1 changed files with 5 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
local gfx = require("ctr.gfx")
|
||||
local fs = require("ctr.fs")
|
||||
|
||||
-- Set up path
|
||||
|
|
@ -5,12 +6,15 @@ local ldir = fs.getDirectory().."libs/"
|
|||
package.path = package.path..";".. ldir.."?.lua;".. ldir.."?/init.lua"
|
||||
|
||||
repeat
|
||||
gfx.set3D(false)
|
||||
gfx.color.setDefault(0xFFFFFFFF)
|
||||
gfx.color.setBackground(0xFF000000)
|
||||
gfx.font.setDefault()
|
||||
local file = require("openfile")("Choose a Lua file to execute", nil, ".lua", "exist")
|
||||
if file then
|
||||
fs.setDirectory(file:match("^(.-)[^/]*$"))
|
||||
local success, err = pcall(dofile, file)
|
||||
if not success then
|
||||
local gfx = require("ctr.gfx")
|
||||
local hid = require("ctr.hid")
|
||||
gfx.set3D(false)
|
||||
gfx.color.setDefault(0xFFFFFFFF)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue