cleanup + example start

This commit is contained in:
kepler155c@gmail.com
2019-11-17 18:21:48 -07:00
parent 64ec8c82d3
commit 922c391bf2
16 changed files with 95 additions and 49 deletions

View File

@@ -1,5 +1,3 @@
_G.requireInjector(_ENV)
local Ansi = require('opus.ansi')
local Event = require('opus.event')
local UI = require('opus.ui')
@@ -27,7 +25,7 @@ local peripheralsPage = UI.Page {
},
}
function peripheralsPage.grid:draw()
function peripheralsPage.grid:enable()
local sides = peripheral.getNames()
Util.clear(self.values)
@@ -39,7 +37,7 @@ function peripheralsPage.grid:draw()
end
self:update()
self:adjustWidth()
UI.Grid.draw(self)
UI.Grid.enable(self)
end
function peripheralsPage:updatePeripherals()
@@ -84,7 +82,6 @@ local methodsPage = UI.Page {
}
function methodsPage:enable(p)
self.peripheral = p or self.peripheral
p = peripheral.wrap(self.peripheral.side)
@@ -136,7 +133,6 @@ function methodsPage:eventHandler(event)
end
function methodsPage:getDocumentation()
local method = self.grid:getSelected()
if method.noext then -- computercraft docs