This commit is contained in:
Ale32bit 2016-11-10 18:21:11 +01:00 committed by GitHub
parent 26340b57a7
commit 10868b8abd

View file

@ -1,6 +1,6 @@
local function kernel() local function kernel()
_G.sPhone = { _G.sPhone = {
version = "Alpha 3.11", version = "Alpha 3.11.1",
user = "Guest", user = "Guest",
devMode = false, devMode = false,
mainTerm = term.current(), mainTerm = term.current(),
@ -365,17 +365,21 @@ local function kernel()
end end
end end
function sPhone.read( _sReplaceChar, _tHistory, _fnComplete, _MouseEvent ) function sPhone.read( _sReplaceChar, _tHistory, _fnComplete, _MouseEvent, _presetInput )
term.setCursorBlink( true ) term.setCursorBlink( true )
local sLine = "" local sLine = _presetInput
if type(sLine) ~= "string" then
sLine = ""
end
local nPos = #sLine
local nHistoryPos local nHistoryPos
local _MouseX local _MouseX
local _MouseY local _MouseY
local param local param
local sEvent local sEvent
local usedMouse = false local usedMouse = false
local nPos = 0
if _sReplaceChar then if _sReplaceChar then
_sReplaceChar = string.sub( _sReplaceChar, 1, 1 ) _sReplaceChar = string.sub( _sReplaceChar, 1, 1 )
end end
@ -1239,10 +1243,12 @@ end
if y == h and (x >= 23 and x <= w) then if y == h and (x >= 23 and x <= w) then
skipped = true skipped = true
config.write("/.sPhone/config/sPhone","lockEnabled",false) config.write("/.sPhone/config/sPhone","lockEnabled",false)
end
end
break break
end end
else
break
end
end
term.redirect(sPhone.mainTerm) term.redirect(sPhone.mainTerm)
if not skipped then if not skipped then
term.setBackgroundColor(sPhone.theme["lock.background"]) term.setBackgroundColor(sPhone.theme["lock.background"])