asdasdasdasdasd
This commit is contained in:
@@ -17,11 +17,18 @@ class PluginLoader(Window):
|
||||
start_open=True
|
||||
)
|
||||
|
||||
self.lua_runtime = lua51.LuaRuntime()
|
||||
|
||||
@work
|
||||
async def find_plugins(self):
|
||||
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...[/]")
|
||||
|
||||
# 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.math = self.lua_runtime.globals().math
|
||||
sandbox.string = self.lua_runtime.globals().string
|
||||
sandbox.berry = lua_runtime_stuff
|
||||
|
||||
setfenv(0, sandbox)
|
||||
executed_code = self.lua_runtime.execute(code)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
local plugin = {}
|
||||
|
||||
function plugin.init()
|
||||
berry.ui.notify("hiiii")
|
||||
end
|
||||
|
||||
function plugin.main()
|
||||
|
||||
Reference in New Issue
Block a user