asdasdasdasdasd
This commit is contained in:
@@ -17,11 +17,18 @@ class PluginLoader(Window):
|
|||||||
start_open=True
|
start_open=True
|
||||||
)
|
)
|
||||||
|
|
||||||
self.lua_runtime = lua51.LuaRuntime()
|
|
||||||
|
|
||||||
@work
|
@work
|
||||||
async def find_plugins(self):
|
async def find_plugins(self):
|
||||||
log = self.query_one(RichLog)
|
log = self.query_one(RichLog)
|
||||||
|
|
||||||
|
log.write("[b]Setting up LUA runtime..[/]")
|
||||||
|
self.lua_runtime = lua51.LuaRuntime()
|
||||||
|
lua_runtime_stuff = {
|
||||||
|
"ui": {
|
||||||
|
"notify": self.notify
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.write("[b]Finding plugins...[/]")
|
log.write("[b]Finding plugins...[/]")
|
||||||
|
|
||||||
# Find all plugins (they're just in the plugins folder for now)
|
# Find all plugins (they're just in the plugins folder for now)
|
||||||
@@ -83,6 +90,7 @@ class PluginLoader(Window):
|
|||||||
sandbox.print = self.log #self.lua_runtime.globals().print
|
sandbox.print = self.log #self.lua_runtime.globals().print
|
||||||
sandbox.math = self.lua_runtime.globals().math
|
sandbox.math = self.lua_runtime.globals().math
|
||||||
sandbox.string = self.lua_runtime.globals().string
|
sandbox.string = self.lua_runtime.globals().string
|
||||||
|
sandbox.berry = lua_runtime_stuff
|
||||||
|
|
||||||
setfenv(0, sandbox)
|
setfenv(0, sandbox)
|
||||||
executed_code = self.lua_runtime.execute(code)
|
executed_code = self.lua_runtime.execute(code)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
local plugin = {}
|
local plugin = {}
|
||||||
|
|
||||||
function plugin.init()
|
function plugin.init()
|
||||||
|
berry.ui.notify("hiiii")
|
||||||
end
|
end
|
||||||
|
|
||||||
function plugin.main()
|
function plugin.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user