11420
|
1 |
import QtQuick 2.0
|
11423
|
2 |
import Hedgewars.Engine 1.0
|
11420
|
3 |
|
|
4 |
Rectangle {
|
11423
|
5 |
ListView {
|
|
6 |
id: roomsList
|
|
7 |
x: 20
|
|
8 |
y: 0
|
|
9 |
width: parent.width
|
|
10 |
height: parent.height - x
|
|
11 |
focus: true
|
|
12 |
clip: true
|
|
13 |
|
|
14 |
model: ListModel {
|
|
15 |
id: roomsListModel
|
|
16 |
}
|
|
17 |
|
|
18 |
delegate: Rectangle {
|
|
19 |
id: roomDelegate
|
|
20 |
height: 24
|
|
21 |
width: parent.width
|
|
22 |
color: "transparent"
|
|
23 |
|
|
24 |
Row {
|
|
25 |
spacing: 8;
|
|
26 |
Text {
|
|
27 |
text: name
|
|
28 |
}
|
|
29 |
Text {
|
|
30 |
text: players + " / " + teams
|
|
31 |
}
|
|
32 |
Text {
|
|
33 |
text: host
|
|
34 |
}
|
|
35 |
Text {
|
|
36 |
text: map
|
|
37 |
}
|
|
38 |
Text {
|
|
39 |
text: script
|
|
40 |
}
|
|
41 |
Text {
|
|
42 |
text: scheme
|
|
43 |
}
|
|
44 |
Text {
|
|
45 |
text: weapons
|
|
46 |
}
|
|
47 |
}
|
|
48 |
|
|
49 |
MouseArea {
|
|
50 |
z: 1
|
|
51 |
anchors.fill: parent
|
|
52 |
onClicked: ;
|
|
53 |
}
|
|
54 |
}
|
|
55 |
|
|
56 |
Connections {
|
|
57 |
target: HWEngine
|
|
58 |
onRoomAdded: roomsListModel.append({
|
|
59 |
"name" : name
|
|
60 |
, "players": players
|
|
61 |
, "teams": teams
|
|
62 |
, "host": host
|
|
63 |
, "map": map
|
|
64 |
, "script": script
|
|
65 |
, "scheme": scheme
|
|
66 |
, "weapons": weapons
|
|
67 |
})
|
11424
|
68 |
onRoomRemoved: {
|
|
69 |
var i = roomsListModel.count - 1;
|
|
70 |
while ((i >= 0) && (roomsListModel.get(i).name !== name)) --i
|
|
71 |
|
|
72 |
if(i >= 0) roomsListModel.remove(i, 1)
|
|
73 |
}
|
11423
|
74 |
}
|
|
75 |
}
|
11420
|
76 |
|
|
77 |
Chat {
|
11423
|
78 |
id: lobbyChat;
|
11420
|
79 |
x: 0;
|
|
80 |
y: 100;
|
|
81 |
width: parent.width;
|
|
82 |
height: parent.height - y;
|
|
83 |
}
|
|
84 |
}
|
|
85 |
|
|
86 |
|