1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-26 08:56:54 +00:00

Implements suggested changes.

This commit is contained in:
Wojbie 2017-06-17 22:14:04 +02:00
parent efb351e1b0
commit 01a0ce3dd0
3 changed files with 9 additions and 5 deletions

View File

@ -12,8 +12,8 @@ end
local tColourLookup = {}
for n=1,16 do
tColourLookup[ string.sub( "0123456789abcdef",n,n ) ] = 2^(n-1)
tColourLookup[ 2^(n-1) ] = string.sub( "0123456789abcdef",n,n )
tColourLookup[ string.byte( "0123456789abcdef",n,n ) ] = 2^(n-1)
tColourLookup[ 2^(n-1) ] = string.byte( "0123456789abcdef",n,n )
end
function loadImage( sPath )
@ -26,7 +26,7 @@ function loadImage( sPath )
for sLine in io.lines(sPath) do
local tLine = {}
for x=1,#sLine do
tLine[x] = tColourLookup[ string.sub(sLine,x,x) ] or 0
tLine[x] = tColourLookup[ string.byte(sLine,x,x) ] or 0
end
table.insert( tImage, tLine )
end

View File

@ -1,4 +1,6 @@
edit is a text editor for creating or modifying programs or text files. After creating a program with edit, type its filename in the shell to run it. You can open any of the builtin programs with edit to learn how to program.
ex:
"edit hello" opens a file called "hello" for editing.
"edit hello" opens a file called "hello" for editing.
By changing setting "edit.advanced_functionality" to true you can unlock ability to jump to specific line in longer files.

View File

@ -59,7 +59,9 @@ end
if peripheral.find( "printer" ) then
table.insert( tMenuItems, "Print" )
end
table.insert( tMenuItems, "Jump" )
if settings.get( "edit.advanced_functionality" ) then
table.insert( tMenuItems, "Jump" )
end
table.insert( tMenuItems, "Exit" )
local sStatus = "Press Ctrl to access menu"