fix possible lua errors
This commit is contained in:
parent
a4ee590b47
commit
0f3bac595e
|
@ -56,8 +56,8 @@ function EnterGame.create()
|
|||
local account = Settings.get('account')
|
||||
local password = Settings.get('password')
|
||||
local host = Settings.get('host')
|
||||
local port = tonumber(Settings.get('port'))
|
||||
local autologin = toboolean(Settings.get('autologin'))
|
||||
local port = Settings.getNumber('port')
|
||||
local autologin = Settings.getBoolean('autologin')
|
||||
|
||||
enterGame:getChildById('accountNameLineEdit'):setText(account)
|
||||
enterGame:getChildById('accountPasswordLineEdit'):setText(password)
|
||||
|
@ -90,7 +90,7 @@ function EnterGame.doLogin()
|
|||
EnterGame.account = enterGame:getChildById('accountNameLineEdit'):getText()
|
||||
EnterGame.password = enterGame:getChildById('accountPasswordLineEdit'):getText()
|
||||
EnterGame.host = enterGame:getChildById('serverHostLineEdit'):getText()
|
||||
EnterGame.port = enterGame:getChildById('serverPortLineEdit'):getText()
|
||||
EnterGame.port = tonumber(enterGame:getChildById('serverPortLineEdit'):getText())
|
||||
EnterGame.hide()
|
||||
|
||||
Settings.set('host', EnterGame.host)
|
||||
|
|
|
@ -24,9 +24,14 @@ function Options.changeOption(key, status)
|
|||
if key == 'vsync' then
|
||||
g_window.setVerticalSync(status)
|
||||
elseif key == 'showfps' then
|
||||
addEvent(function() rootWidget:recursiveGetChildById('frameCounter'):setVisible(status) end)
|
||||
addEvent(function()
|
||||
local frameCounter = rootWidget:recursiveGetChildById('frameCounter')
|
||||
if frameCounter then frameCounter:setVisible(status) end
|
||||
end)
|
||||
elseif key == 'fullscreen' then
|
||||
addEvent(function() g_window.setFullscreen(status) end)
|
||||
addEvent(function()
|
||||
g_window.setFullscreen(status)
|
||||
end)
|
||||
end
|
||||
Settings.set(key, status)
|
||||
Options[key] = status
|
||||
|
|
Loading…
Reference in New Issue