mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
a02410c282
* splash screen when app is loading * doRaceRequest * prepare to add fkparse feature * player mark operation * dont call lua in regular room * dont call lua in lobby * clean up * idle_room in Cpp's class Server * fix many small bugs * Security enhancement (#27) * use RSA encryption when sending password * update fkp's url so other can clone it * add salt to password * save password * fix default config bug * fix room reuse bug * disable empty usr name * how to compile (#28) * add some doc * how to compile * update readme * Actions (#29) * judge(not tested) * logic of chat * sendlog at most scenario * adjust ui, add shortcuts * ui, z axis of cardArea * create server cli, improve logging * basic shell using * use gnu readline instead * use static QRegularExp * fix android build * fix automoc problem * MD5 check * md5 check bugfix * cardEffectEvent (#30) * cardEffectEvent * add TODOs * thinking Co-authored-by: Ho-spair <62695577+Ho-spair@users.noreply.github.com>
93 lines
2.3 KiB
QML
93 lines
2.3 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
Item {
|
|
id: root
|
|
scale: 2
|
|
|
|
Frame {
|
|
id: join_server
|
|
anchors.centerIn: parent
|
|
background: Rectangle {
|
|
color: "#88888888"
|
|
radius: 2
|
|
}
|
|
|
|
Column {
|
|
spacing: 8
|
|
ComboBox {
|
|
id: server_addr
|
|
model: []
|
|
editable: true
|
|
|
|
onEditTextChanged: {
|
|
if (model.indexOf(editText) === -1) {
|
|
passwordEdit.text = "";
|
|
} else {
|
|
let data = config.savedPassword[editText];
|
|
screenNameEdit.text = data.username;
|
|
passwordEdit.text = data.shorten_password;
|
|
}
|
|
}
|
|
}
|
|
TextField {
|
|
id: screenNameEdit
|
|
text: "player"
|
|
onTextChanged: {
|
|
passwordEdit.text = "";
|
|
let data = config.savedPassword[server_addr.editText];
|
|
if (data) {
|
|
if (text === data.username) {
|
|
passwordEdit.text = data.shorten_password;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*TextField {
|
|
id: avatarEdit
|
|
text: "liubei"
|
|
}*/
|
|
TextField {
|
|
id: passwordEdit
|
|
text: ""
|
|
echoMode: TextInput.Password
|
|
passwordCharacter: "*"
|
|
}
|
|
Button {
|
|
text: "Join Server"
|
|
enabled: passwordEdit.text !== ""
|
|
onClicked: {
|
|
config.serverAddr = server_addr.editText;
|
|
config.screenName = screenNameEdit.text;
|
|
config.password = passwordEdit.text;
|
|
mainWindow.busy = true;
|
|
Backend.joinServer(server_addr.editText);
|
|
}
|
|
}
|
|
Button {
|
|
text: "Console start"
|
|
enabled: passwordEdit.text !== ""
|
|
onClicked: {
|
|
config.serverAddr = "127.0.0.1";
|
|
config.screenName = screenNameEdit.text;
|
|
config.password = passwordEdit.text;
|
|
mainWindow.busy = true;
|
|
Backend.startServer(9527);
|
|
Backend.joinServer("127.0.0.1");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
config.loadConf();
|
|
server_addr.model = Object.keys(config.savedPassword);
|
|
server_addr.onModelChanged();
|
|
server_addr.currentIndex = server_addr.model.indexOf(config.lastLoginServer);
|
|
|
|
let data = config.savedPassword[config.lastLoginServer];
|
|
screenNameEdit.text = data.username;
|
|
passwordEdit.text = data.shorten_password;
|
|
}
|
|
}
|