organize TODO file

This commit is contained in:
Eduardo Bart
2012-01-06 07:35:48 -02:00
parent 7206f7aad9
commit d25228fc1c
5 changed files with 65 additions and 56 deletions

View File

@@ -1,10 +1,8 @@
Client = {}
-- TODO: load and save configurations
function Client.init()
-- set default settings
local function setupWindow()
g_window.show()
g_window.setMinimumSize({ width = 550, height = 450 })
g_window.setMinimumSize({ width = 600, height = 480 })
-- initialize in fullscreen mode on mobile devices
if g_window.getPlatformType() == "X11-EGL" then
@@ -29,9 +27,13 @@ function Client.init()
g_window.setTitle('OTClient')
g_window.setIcon(resolvepath('clienticon.png'))
end
function Client.init()
setupWindow()
if not g_sprites.isLoaded() or not g_thingsType.isLoaded() then
fatal("spr and dat files are not loaded, did you loaded them?")
fatal("spr and dat files are not loaded, are them missing?")
end
end

View File

@@ -47,7 +47,7 @@ local function tryLogin(charInfo, tries)
end
-- save last used character
g_configs.set('lastUsedCharacter', charInfo.characterName)
Settings.set('lastUsedCharacter', charInfo.characterName)
end
-- public functions
@@ -74,7 +74,7 @@ function CharacterList.create(characters, premDays)
label.worldHost = worldHost
label.worldPort = worldIp
if i == 1 or g_configs.get('lastUsedCharacter') == characterName then
if i == 1 or Settings.get('lastUsedCharacter') == characterName then
focusLabel = label
end
end

View File

@@ -11,8 +11,8 @@ local function clearAccountFields()
enterGame:getChildById('accountNameLineEdit'):clearText()
enterGame:getChildById('accountPasswordLineEdit'):clearText()
enterGame:getChildById('accountNameLineEdit'):focus()
g_configs.set('account', nil)
g_configs.set('password', nil)
Settings.remove('account')
Settings.remove('password')
end
local function onError(protocol, error)
@@ -30,9 +30,9 @@ end
local function onCharacterList(protocol, characters, premDays)
if enterGame:getChildById('rememberPasswordBox'):isChecked() then
g_configs.set('account', EnterGame.account)
g_configs.set('password', EnterGame.password)
g_configs.set('autologin', tostring(enterGame:getChildById('autoLoginBox'):isChecked()))
Settings.set('account', EnterGame.account)
Settings.set('password', EnterGame.password)
Settings.set('autologin', enterGame:getChildById('autoLoginBox'):isChecked())
else
clearAccountFields()
end
@@ -40,9 +40,9 @@ local function onCharacterList(protocol, characters, premDays)
loadBox:destroy()
CharacterList.create(characters, premDays)
local lastMotdNumber = tonumber(g_configs.get("motd"))
local lastMotdNumber = Settings.getNumber("motd")
if motdNumber and motdNumber ~= lastMotdNumber then
g_configs.set("motd", motdNumber)
Settings.set("motd", motdNumber)
local motdBox = displayInfoBox("Message of the day", motdMessage)
motdBox.onOk = CharacterList.show
CharacterList.hide()
@@ -53,11 +53,11 @@ end
function EnterGame.create()
enterGame = displayUI('entergame.otui')
local account = g_configs.get('account')
local password = g_configs.get('password')
local host = g_configs.get('host')
local port = tonumber(g_configs.get('port'))
local autologin = toboolean(g_configs.get('autologin'))
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'))
enterGame:getChildById('accountNameLineEdit'):setText(account)
enterGame:getChildById('accountPasswordLineEdit'):setText(password)
@@ -93,8 +93,8 @@ function EnterGame.doLogin()
EnterGame.port = enterGame:getChildById('serverPortLineEdit'):getText()
EnterGame.hide()
g_configs.set('host', EnterGame.host)
g_configs.set('port', EnterGame.port)
Settings.set('host', EnterGame.host)
Settings.set('port', EnterGame.port)
local protocolLogin = ProtocolLogin.create()
protocolLogin.onError = onError