diff --git a/sys/apis/gps.lua b/sys/apis/gps.lua index c7f24e7..1b3e223 100644 --- a/sys/apis/gps.lua +++ b/sys/apis/gps.lua @@ -2,7 +2,6 @@ local GPS = { } local device = _G.device local gps = _G.gps -local turtle = _G.turtle function GPS.locate(timeout, debug) local pt = { } @@ -34,60 +33,6 @@ function GPS.getPoint(timeout, debug) return pt end -function GPS.getHeading(timeout, destructive) - if not turtle then - return - end - - local apt = GPS.locate(timeout) - if not apt then - return false, 'GPS not available' - end - - local heading = turtle.point.heading - - while true do - if not turtle.inspect() and turtle.forward() then - break - end - turtle.turnRight() - if turtle.getHeading() == heading then - if destructive then - turtle.dig() - if turtle.forward() then - break - end - end - return false, 'GPS.getPoint: Unable to move forward' - end - end - - local bpt = GPS.locate() - if not bpt then - return false, 'GPS not available' - end - - if apt.x < bpt.x then - return 0 - elseif apt.z < bpt.z then - return 1 - elseif apt.x > bpt.x then - return 2 - end - return 3 -end - -function GPS.getPointAndHeading(timeout, destructive) - local heading = GPS.getHeading(timeout, destructive) - if heading then - local pt = GPS.getPoint() - if pt then - pt.heading = heading - end - return pt - end -end - -- from stock gps API local function trilaterate(A, B, C) local a2b = B.position - A.position diff --git a/sys/apis/ui/components/Checkbox.lua b/sys/apis/ui/components/Checkbox.lua index a780c42..9f0b272 100644 --- a/sys/apis/ui/components/Checkbox.lua +++ b/sys/apis/ui/components/Checkbox.lua @@ -45,6 +45,10 @@ function UI.Checkbox:focus() self:draw() end +function UI.Checkbox:setValue(v) + self.value = v +end + function UI.Checkbox:reset() self.value = false end diff --git a/sys/apps/Network.lua b/sys/apps/Network.lua index f209aa1..517c98f 100644 --- a/sys/apps/Network.lua +++ b/sys/apps/Network.lua @@ -23,6 +23,8 @@ local config = Config.load('network', { }) if UI.term.width >= 30 then table.insert(gridColumns, { heading = 'Fuel', key = 'fuel', width = 5 }) +end +if UI.term.width >= 40 then table.insert(gridColumns, { heading = 'Uptime', key = 'uptime' }) end diff --git a/sys/extensions/6.tl3.lua b/sys/extensions/6.tl3.lua index abba19f..3a32a08 100644 --- a/sys/extensions/6.tl3.lua +++ b/sys/extensions/6.tl3.lua @@ -3,7 +3,6 @@ if not _G.turtle then end local Pathing = require('pathfind') -local GPS = require('gps') local Point = require('point') local synchronized = require('sync').sync local Util = require('util') @@ -1241,15 +1240,6 @@ function turtle.inspectDownAt(pt) return _actionDownAt(actionsAt.inspect, function turtle.inspectForwardAt(pt) return _actionForwardAt(actionsAt.inspect, pt) end function turtle.inspectUpAt(pt) return _actionUpAt(actionsAt.inspect, pt) end --- [[ GPS ]] -- -function turtle.enableGPS(timeout, destructive) - local pt = GPS.getPointAndHeading(timeout, destructive) - if pt then - turtle.setPoint(pt, true) - return turtle.point - end -end - -- deprecate function turtle.addFeatures(...) for _,feature in pairs({ ... }) do