mirror of
https://github.com/LDDestroier/CC/
synced 2025-01-07 07:50:26 +00:00
Fixed block character selector, added byte indicator
This commit is contained in:
parent
d575a3b660
commit
ab57b5b36a
15
pain.lua
15
pain.lua
@ -1901,10 +1901,12 @@ local boxCharSelector = function()
|
||||
end
|
||||
end
|
||||
local rend = function()
|
||||
term.setCursorPos(1,scr_y)
|
||||
term.setCursorPos(scr_x - 3, scr_y)
|
||||
term.setBackgroundColor(colors.lightGray)
|
||||
term.setTextColor(colors.black)
|
||||
term.setTextColor(colors.gray)
|
||||
term.clearLine()
|
||||
term.write("\\" .. string.byte(getDrawingCharacter(boxchar.topLeft, boxchar.topRight, boxchar.left, boxchar.right, boxchar.bottomLeft, boxchar.bottomRight).char) .. " ")
|
||||
term.setTextColor(colors.black)
|
||||
term.write("Press CTRL or 'N' when ready.")
|
||||
term.setCursorPos(1,scr_y-3) co(boxchar.topLeft) write("Q") co(boxchar.topRight) write("W")
|
||||
term.setCursorPos(1,scr_y-2) co(boxchar.left) write("A") co(boxchar.right) write("S")
|
||||
@ -1927,7 +1929,7 @@ local boxCharSelector = function()
|
||||
end
|
||||
elseif evt[1] == "mouse_click" or evt[1] == "mouse_drag" then
|
||||
local button, mx, my = evt[2], evt[3], evt[4]
|
||||
if my >= scr_y-2 then
|
||||
if my >= scr_y-3 then
|
||||
if mx == 1 then
|
||||
if my == scr_y - 3 then boxchar.topLeft = not boxchar.topLeft end
|
||||
if my == scr_y - 2 then boxchar.left = not boxchar.left end
|
||||
@ -1988,6 +1990,9 @@ local specialCharSelector = function()
|
||||
term.write("Press CTRL or 'N' when ready.")
|
||||
|
||||
while true do
|
||||
term.setCursorPos(scr_x - 3, scr_y)
|
||||
term.setTextColor(colors.gray)
|
||||
term.write("\\" .. string.byte(char) .. " ")
|
||||
evt, butt, x, y = os.pullEvent()
|
||||
if (evt == "mouse_click" or evt == "mouse_drag") then
|
||||
if chars[y-sy] then
|
||||
@ -1996,10 +2001,10 @@ local specialCharSelector = function()
|
||||
char = chars[y-sy][x]
|
||||
render()
|
||||
end
|
||||
else
|
||||
elseif evt == "mouse_click" then
|
||||
return char
|
||||
end
|
||||
else
|
||||
elseif evt == "mouse_click" then
|
||||
return char
|
||||
end
|
||||
elseif evt == "key" then
|
||||
|
Loading…
Reference in New Issue
Block a user