1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-24 06:03:28 +00:00

Add fileextension for Paint (#260)

* Add fileextension for Paint

* Change extension to .nfp

* Add setting
This commit is contained in:
Wilma456 2017-05-29 15:05:19 +02:00 committed by Daniel Ratcliffe
parent 99b5534099
commit 07ae332c24
3 changed files with 11 additions and 0 deletions

View File

@ -819,6 +819,7 @@ settings.set( "shell.allow_disk_startup", (commands == nil) )
settings.set( "shell.autocomplete", true )
settings.set( "edit.autocomplete", true )
settings.set( "edit.default_extension", "lua" )
settings.set( "paint.default_extension", "nfp" )
settings.set( "lua.autocomplete", true )
settings.set( "list.show_hidden", false )
if term.isColour() then

View File

@ -12,6 +12,7 @@ shell.autocomplete - enables auto-completion in the Shell.
lua.autocomplete - enables auto-completion in the Lua program.
edit.autocomplete - enables auto-completion in the Edit program.
edit.default_extension - sets the default file extension for files created with the Edit program
paint.default_extension - sets the default file extension for files created with the Paint program
bios.use_multishell - enables Multishell on Advanced Computers, Turtles, Pocket Computers and Command Computers.
shell.allow_disk_startup - if a Disk Drive with a Disk inside that has a 'startup' script is attached to a computer, this setting allows to automatically run that script when the computer starts.
shell.allow_startup - if there is a 'startup' script in a computer's root, this setting allow to automatically run that script when the computer runs.

View File

@ -44,6 +44,15 @@ if fs.exists(sPath) and fs.isDir(sPath) then
return
end
-- Create .nfp files by default
if not fs.exists( sPath ) and not string.find( sPath, "%." ) then
local sExtension = settings.get("paint.default_extension", "" )
if sExtension ~= "" then
sPath = sPath .. "." .. sExtension
end
end
---------------
-- Functions --
---------------