mirror of
https://github.com/kepler155c/opus
synced 2025-08-04 13:03:46 +00:00
turtle.unequip + justified headings bug
This commit is contained in:
parent
0b326589c2
commit
8cfeaad061
@ -1490,6 +1490,7 @@ end
|
|||||||
|
|
||||||
function UI.Grid:drawHeadings()
|
function UI.Grid:drawHeadings()
|
||||||
local x = 1
|
local x = 1
|
||||||
|
local sb = UI.StringBuffer(self.width)
|
||||||
for _,col in ipairs(self.columns) do
|
for _,col in ipairs(self.columns) do
|
||||||
local ind = ' '
|
local ind = ' '
|
||||||
if col.key == self.sortColumn then
|
if col.key == self.sortColumn then
|
||||||
@ -1499,13 +1500,17 @@ function UI.Grid:drawHeadings()
|
|||||||
ind = self.sortIndicator
|
ind = self.sortIndicator
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
sb:insert(ind .. col.heading, col.cw + 1)
|
||||||
|
--[[
|
||||||
self:write(x,
|
self:write(x,
|
||||||
1,
|
1,
|
||||||
Util.widthify(ind .. col.heading, col.cw + 1),
|
Util.widthify(ind .. col.heading, col.cw + 1),
|
||||||
self.headerBackgroundColor,
|
self.headerBackgroundColor,
|
||||||
col.key == self.sortColumn and self.headerSortColor or self.headerTextColor)
|
col.key == self.sortColumn and self.headerSortColor or self.headerTextColor)
|
||||||
x = x + col.cw + 1
|
x = x + col.cw + 1
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
self:write(1, 1, sb:get(), self.headerBackgroundColor, self.headerTextColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UI.Grid:sortCompare(a, b)
|
function UI.Grid:sortCompare(a, b)
|
||||||
|
@ -935,6 +935,13 @@ function turtle.isEquipped(item)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function turtle.unequip(side)
|
||||||
|
if not turtle.selectSlotWithQuantity(0) then
|
||||||
|
return false, 'No slots available'
|
||||||
|
end
|
||||||
|
return turtle.equip(side)
|
||||||
|
end
|
||||||
|
|
||||||
-- [[ ]] --
|
-- [[ ]] --
|
||||||
function turtle.run(fn, ...)
|
function turtle.run(fn, ...)
|
||||||
local args = { ... }
|
local args = { ... }
|
||||||
@ -980,6 +987,12 @@ function turtle.addWorldBlock(pt)
|
|||||||
Pathing.addBlock(pt)
|
Pathing.addBlock(pt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function turtle.addWorldBlocks(pts)
|
||||||
|
Util.each(pts, function(pt)
|
||||||
|
Pathing.addBlock(pt)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
local movementStrategy = turtle.pathfind
|
local movementStrategy = turtle.pathfind
|
||||||
|
|
||||||
function turtle.setMovementStrategy(strategy)
|
function turtle.setMovementStrategy(strategy)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user