This commit is contained in:
Igor Timofeev 2017-04-25 14:34:44 +03:00
parent c4084507fe
commit 5f3a00edfe
4 changed files with 18 additions and 13 deletions

View File

@ -5,7 +5,7 @@
about="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/MineOS/About/",
type="Script",
forceDownload=true,
version=3.57,
version=3.58,
},
{
path="/MineOS/Pictures/MoonTouch.pic",
@ -198,7 +198,7 @@
path="/lib/MineOSCore.lua",
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/MineOSCore.lua",
type="Library",
version=1.59,
version=1.60,
},
{
path="/lib/advancedLua.lua",
@ -258,7 +258,7 @@
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/GUI.lua",
type="Library",
preloadFile=true,
version=1.50,
version=1.51,
},
{
path="/lib/rayEngine.lua",

View File

@ -120,12 +120,12 @@ local function checkPassword()
container.panel.onTouch = function()
local hash = require("SHA2").hash(inputTextBox.text or "")
if hash == _G.OSSettings.passwordHash then
workspace:deleteChildren(#workspace.children)
container:delete()
workspace:draw()
buffer.draw()
elseif hash == "c925be318b0530650b06d7f0f6a51d8289b5925f1b4117a43746bc99f1f81bc1" then
GUI.error(MineOSCore.localization.mineOSCreatorUsedMasterPassword)
workspace:deleteChildren(#workspace.children)
container:delete()
workspace:draw()
buffer.draw()
else
@ -146,7 +146,7 @@ local function setPassword()
container.panel.onTouch = function()
if inputTextBox1.text == inputTextBox2.text then
workspace:deleteChildren(#workspace.children)
container:delete()
_G.OSSettings.protectionMethod = "password"
_G.OSSettings.passwordHash = require("SHA2").hash(inputTextBox1.text or "")
@ -178,7 +178,7 @@ local function setProtectionMethod()
buffer.draw()
container.panel.onTouch = function()
workspace:deleteChildren(#workspace.children)
container:delete()
workspace:draw()
buffer.draw()
@ -541,7 +541,7 @@ local function createWorkspace()
buffer.draw()
container.panel.onTouch = function()
workspace:deleteChildren(#workspace.children)
container:delete()
if comboBox.currentItem == 1 then
_G.OSSettings.screensaver = nil
else
@ -573,7 +573,7 @@ local function createWorkspace()
buffer.draw()
container.panel.onTouch = function()
workspace:deleteChildren(#workspace.children)
container:delete()
workspace:draw()
buffer.draw()
end
@ -605,7 +605,7 @@ local function createWorkspace()
end
container.panel.onTouch = function()
workspace:deleteChildren(#workspace.children)
container:delete()
_G.OSSettings.resolution = {tonumber(widthTextBox.text), tonumber(heightTextBox.text)}
MineOSCore.saveOSSettings()
changeResolution()

View File

@ -234,6 +234,10 @@ local function containerGetFirstParent(object)
end
end
local function selfDelete(object)
table.remove(object.parent.children, containerObjectIndexOf(object))
end
-- Add any object as children to parent container with specified objectType
function GUI.addChildToContainer(container, object, objectType)
object.type = objectType or GUI.objectTypes.unknown
@ -244,6 +248,7 @@ function GUI.addChildToContainer(container, object, objectType)
object.moveForward = containerObjectMoveForward
object.moveBackward = containerObjectMoveBackward
object.getFirstParent = containerGetFirstParent
object.delete = selfDelete
object.localPosition = {x = object.x, y = object.y}
table.insert(container.children, object)

View File

@ -833,7 +833,7 @@ local function checkFileToExists(container, path)
container.parent:draw()
buffer.draw()
else
container.parent:deleteChildren(#container.parent.children, #container.parent.children)
container:delete()
fs.makeDirectory(fs.path(path))
return true
end
@ -909,14 +909,14 @@ function MineOSCore.applicationHelp(parentWindow, path)
buffer.draw()
container.panel.onTouch = function()
parentWindow:deleteChildren(#parentWindow.children, #parentWindow.children)
container:delete()
MineOSCore.safeLaunch(path .. "/Main.lua")
parentWindow:draw()
buffer.draw()
end
button.onTouch = function()
parentWindow:deleteChildren(#parentWindow.children, #parentWindow.children)
container:delete()
_G.OSSettings.showHelpOnApplicationStart = false
MineOSCore.saveOSSettings()