Ui enhancements 2.0 (#29)

* canvas overhaul

* editor 2.0

* more tweaks

* more editor work

* completions + refactor

* cleanup + editor additions

* cleanup + undo overhaul

* editor recent/peripherals/redo + cleanup

* editor path issues

* cleanup

* changes for deprecated ui methods - recolor milo - make turtle scripts run again - mob rancher improvements

* can now use named colors
This commit was merged in pull request #29.
This commit is contained in:
kepler155c
2020-04-21 22:40:47 -06:00
committed by GitHub
parent 47e0a90116
commit 4576969739
65 changed files with 1842 additions and 1310 deletions

View File

@@ -1,5 +1,5 @@
_G.requireInjector(_ENV)
local config = require('config').load('gps')
local config = require('opus.config').load('gps')
if config.home then
if turtle.enableGPS() then
return turtle.pathfind(config.home)

View File

@@ -1,29 +0,0 @@
turtle.run(function()
_G.requireInjector(_ENV)
local GPS = require('gps')
local Socket = require('socket')
local id = {COMPUTER_ID}
if not turtle.enableGPS() then
error('turtle: No GPS found')
end
local socket = Socket.connect(id, 161)
if not socket then
error('turtle: Unable to connect to ' .. id)
end
socket:write({ type = 'gps' })
local pt = socket:read(3)
if not pt then
error('turtle: No GPS response')
end
if not turtle.pathfind(pt) then
error('Unable to go to location')
end
end)

View File

@@ -0,0 +1,17 @@
local turtle = _G.turtle
turtle.run(function()
_G.requireInjector(_ENV)
local GPS = require('opus.gps')
if not turtle.enableGPS() then
error('turtle: No GPS found')
end
local pt = {GPS}
if not turtle.pathfind(pt) then
error('Unable to go to location')
end
end)

View File

@@ -1,5 +1,5 @@
_G.requireInjector(_ENV)
local Config = require('config')
local Config = require('opus.config')
local pt = turtle.enableGPS()
if pt then
local config = Config.load('gps', { })

View File

@@ -2,9 +2,9 @@ local function summon(id)
_G.requireInjector(_ENV)
local GPS = require('gps')
local Point = require('point')
local Socket = require('socket')
local GPS = require('opus.gps')
local Point = require('opus.point')
local Socket = require('opus.socket')
turtle.setStatus('GPSing')
turtle.setPoint({ x = 0, y = 0, z = 0, heading = 0 })