-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiplayer.qml
56 lines (45 loc) · 1.38 KB
/
Multiplayer.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import QtQuick 2.0
import "qml_ui"
Item {
property var title: "Single Player Menu"
signal requestStackChange(var stack, var properties)
id: singlePlayerMenuContainer
ListView {
id: singlePlayerMenuListView
anchors.centerIn: parent
width: { return parent.width * 0.8 }
height: { return parent.height * 0.3 }
model: singlePlayerMenuModel
delegate: MainMenuButton {
text: model.text
width: { return singlePlayerMenuListView.width }
height: { return singlePlayerMenuListView.height / singlePlayerMenuModel.count }
onMenuButtonClicked: {
singlePlayerMenuContainer.requestStackChange(model.stack, {});
}
}
}
ListModel {
id: singlePlayerMenuModel
ListElement {
text: "Random Game"
stack: "qml_multiplayer/RandomGame.qml"
}
ListElement {
text: "Normal Game"
stack: "qml_singleplayer/NormalGame.qml"
}
ListElement {
text: "Challenge a friend"
stack: "qml_multiplayer/ChallengeGame.qml"
}
// ListElement {
// text: "Practice Game"
// stack: "qml_singleplayer/PracticeGame.qml"
// }
// ListElement {
// text: "Custom Game"
// stack: "qml_singleplayer/CustomGame.qml"
// }
}
}