mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
rework on UILineEdit
* allow multiline text editing * rename UILineEdit to UITextEdit
This commit is contained in:
@@ -10,9 +10,9 @@ local enterGameButton
|
||||
|
||||
-- private functions
|
||||
local function clearAccountFields()
|
||||
enterGame:getChildById('accountNameLineEdit'):clearText()
|
||||
enterGame:getChildById('accountPasswordLineEdit'):clearText()
|
||||
enterGame:getChildById('accountNameLineEdit'):focus()
|
||||
enterGame:getChildById('accountNameTextEdit'):clearText()
|
||||
enterGame:getChildById('accountPasswordTextEdit'):clearText()
|
||||
enterGame:getChildById('accountNameTextEdit'):focus()
|
||||
Settings.remove('account')
|
||||
Settings.remove('password')
|
||||
end
|
||||
@@ -71,13 +71,13 @@ function EnterGame.init()
|
||||
local port = Settings.get('port')
|
||||
local autologin = Settings.getBoolean('autologin')
|
||||
|
||||
enterGame:getChildById('accountNameLineEdit'):setText(account)
|
||||
enterGame:getChildById('accountPasswordLineEdit'):setText(password)
|
||||
enterGame:getChildById('serverHostLineEdit'):setText(host)
|
||||
enterGame:getChildById('serverPortLineEdit'):setText(port)
|
||||
enterGame:getChildById('accountNameTextEdit'):setText(account)
|
||||
enterGame:getChildById('accountPasswordTextEdit'):setText(password)
|
||||
enterGame:getChildById('serverHostTextEdit'):setText(host)
|
||||
enterGame:getChildById('serverPortTextEdit'):setText(port)
|
||||
enterGame:getChildById('autoLoginBox'):setChecked(autologin)
|
||||
enterGame:getChildById('rememberPasswordBox'):setChecked(#account > 0)
|
||||
enterGame:getChildById('accountNameLineEdit'):focus()
|
||||
enterGame:getChildById('accountNameTextEdit'):focus()
|
||||
|
||||
-- only open entergame when app starts
|
||||
enterGame:hide()
|
||||
@@ -120,10 +120,10 @@ function EnterGame.openWindow()
|
||||
end
|
||||
|
||||
function EnterGame.doLogin()
|
||||
EnterGame.account = enterGame:getChildById('accountNameLineEdit'):getText()
|
||||
EnterGame.password = enterGame:getChildById('accountPasswordLineEdit'):getText()
|
||||
EnterGame.host = enterGame:getChildById('serverHostLineEdit'):getText()
|
||||
EnterGame.port = tonumber(enterGame:getChildById('serverPortLineEdit'):getText())
|
||||
EnterGame.account = enterGame:getChildById('accountNameTextEdit'):getText()
|
||||
EnterGame.password = enterGame:getChildById('accountPasswordTextEdit'):getText()
|
||||
EnterGame.host = enterGame:getChildById('serverHostTextEdit'):getText()
|
||||
EnterGame.port = tonumber(enterGame:getChildById('serverPortTextEdit'):getText())
|
||||
EnterGame.hide()
|
||||
|
||||
Settings.set('host', EnterGame.host)
|
||||
|
@@ -10,8 +10,8 @@ MainWindow
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
|
||||
LineEdit
|
||||
id: accountNameLineEdit
|
||||
TextEdit
|
||||
id: accountNameTextEdit
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
@@ -23,8 +23,8 @@ MainWindow
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 8
|
||||
|
||||
PasswordLineEdit
|
||||
id: accountPasswordLineEdit
|
||||
PasswordTextEdit
|
||||
id: accountPasswordTextEdit
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: prev.bottom
|
||||
@@ -38,8 +38,8 @@ MainWindow
|
||||
anchors.top: prev.bottom
|
||||
margin-top: 8
|
||||
|
||||
LineEdit
|
||||
id: serverHostLineEdit
|
||||
TextEdit
|
||||
id: serverHostTextEdit
|
||||
tooltip: |-
|
||||
Make sure that your client uses
|
||||
the correct game protocol version
|
||||
@@ -56,8 +56,8 @@ MainWindow
|
||||
anchors.top: serverLabel.top
|
||||
margin-left: 10
|
||||
|
||||
LineEdit
|
||||
id: serverPortLineEdit
|
||||
TextEdit
|
||||
id: serverPortTextEdit
|
||||
text: 7171
|
||||
anchors.left: portLabel.left
|
||||
anchors.right: portLabel.right
|
||||
|
Reference in New Issue
Block a user