Update settings.lua
This commit is contained in:
parent
995169cb41
commit
e287a99ae3
1 changed files with 21 additions and 12 deletions
|
@ -22,21 +22,23 @@ local function clear()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function changeUsername()
|
local function changeUsername()
|
||||||
local newUsername
|
local newUsername = sPhone.user
|
||||||
term.setBackgroundColor(sPhone.theme["backgroundColor"])
|
term.setBackgroundColor(sPhone.theme["backgroundColor"])
|
||||||
term.clear()
|
term.clear()
|
||||||
term.setCursorPos(1,1)
|
term.setCursorPos(1,1)
|
||||||
sPhone.header(sPhone.user)
|
sPhone.header("New username")
|
||||||
term.setCursorPos(w,1)
|
term.setCursorPos(w,1)
|
||||||
term.setBackgroundColor(sPhone.theme["header"])
|
term.setBackgroundColor(sPhone.theme["header"])
|
||||||
term.setTextColor(sPhone.theme["headerText"])
|
term.setTextColor(sPhone.theme["headerText"])
|
||||||
write("X")
|
write("X")
|
||||||
term.setBackgroundColor(sPhone.theme["backgroundColor"])
|
term.setBackgroundColor(sPhone.theme["backgroundColor"])
|
||||||
term.setTextColor(sPhone.theme["text"])
|
term.setTextColor(sPhone.theme["text"])
|
||||||
visum.align("center"," New Username",false,3)
|
term.setCursorPos(2,7)
|
||||||
term.setCursorPos(2,5)
|
print("Change your username.")
|
||||||
write("Username: ")
|
print(" It affects chat app.")
|
||||||
while true do
|
while true do
|
||||||
|
term.setCursorPos(2,4)
|
||||||
|
term.clearLine()
|
||||||
newUsername,mouse,x,y = sPhone.read(nil,nil,nil,true,newUsername)
|
newUsername,mouse,x,y = sPhone.read(nil,nil,nil,true,newUsername)
|
||||||
if mouse then
|
if mouse then
|
||||||
if y == 1 and x == w then
|
if y == 1 and x == w then
|
||||||
|
@ -48,7 +50,7 @@ local function changeUsername()
|
||||||
end
|
end
|
||||||
sPhone.user = newUsername
|
sPhone.user = newUsername
|
||||||
config.write("/.sPhone/config/sPhone","username",newUsername)
|
config.write("/.sPhone/config/sPhone","username",newUsername)
|
||||||
sPhone.winOk("Username","Changed")
|
sPhone.winOk("Username","changed")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function changePassword()
|
local function changePassword()
|
||||||
|
@ -177,18 +179,20 @@ local function changePassword()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function changeLabel()
|
local function changeLabel()
|
||||||
local newLabel
|
local newLabel = os.getComputerLabel()
|
||||||
sPhone.header(sPhone.user)
|
sPhone.header("New Label")
|
||||||
visum.align("center", " Set Label",false,3)
|
|
||||||
term.setCursorPos(w,1)
|
term.setCursorPos(w,1)
|
||||||
term.setBackgroundColor(sPhone.theme["header"])
|
term.setBackgroundColor(sPhone.theme["header"])
|
||||||
term.setTextColor(sPhone.theme["headerText"])
|
term.setTextColor(sPhone.theme["headerText"])
|
||||||
write("X")
|
write("X")
|
||||||
term.setBackgroundColor(sPhone.theme["backgroundColor"])
|
term.setBackgroundColor(sPhone.theme["backgroundColor"])
|
||||||
term.setTextColor(sPhone.theme["text"])
|
term.setTextColor(sPhone.theme["text"])
|
||||||
term.setCursorPos(2,5)
|
term.setCursorPos(2,7)
|
||||||
|
print("Change computer label")
|
||||||
|
print(" to be identified")
|
||||||
|
print(" in your inventory.")
|
||||||
while true do
|
while true do
|
||||||
term.setCursorPos(2,5)
|
term.setCursorPos(2,4)
|
||||||
term.clearLine()
|
term.clearLine()
|
||||||
newLabel,mouse,x,y = sPhone.read(nil,nil,nil,true,newLabel)
|
newLabel,mouse,x,y = sPhone.read(nil,nil,nil,true,newLabel)
|
||||||
if mouse then
|
if mouse then
|
||||||
|
@ -205,7 +209,12 @@ local function changeLabel()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function clearLabel()
|
local function clearLabel()
|
||||||
os.setComputerLabel(nil)
|
local ok, err = pcall(function() os.setComputerLabel(nil) end)
|
||||||
|
if not ok then
|
||||||
|
os.setComputerLabel(err)
|
||||||
|
sPhone.winOk("Error")
|
||||||
|
return
|
||||||
|
end
|
||||||
sPhone.winOk("Computer Label cleared")
|
sPhone.winOk("Computer Label cleared")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue