-
Notifications
You must be signed in to change notification settings - Fork 0
/
Challenges.qml
163 lines (130 loc) · 4.31 KB
/
Challenges.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import QtQuick 2.0
import QtGraphicalEffects 1.0
import "main.js" as Scripts
Item {
id:window_container
// onVisibleChanged: if(visible == true) {Scripts.scoreboardLoad()} else {Scripts.scoreboardLoad()}
// Component.onCompleted: Scripts.scoreboardLoad()
Image {
id:backing
anchors.centerIn: parent
width:if(orient ==2) {parent.height / 1.2} else {parent.height / 1.8}
height:parent.height * 0.96
source:"qrc:/Img/Border1.png"
//fillMode: Image.PreserveAspectFit
visible: true
Image {
anchors.centerIn:backing
width:backing.width * 0.98
height:backing.height * 0.93
source:"qrc:Img/Grid.png"
fillMode: Image.Tile
opacity: 0.2
}
}
Text {
id:title
text:"challenges"
font.family: pixeltext.name
font.pixelSize: if(orient ==2) {parent.height * 0.06} else {parent.height * 0.04}
color:"Yellow"
anchors.horizontalCenter:backing.horizontalCenter
anchors.top:backing.top
anchors.topMargin: parent.height * 0.03
}
ListView {
anchors.top:title.bottom
anchors.topMargin: if(orient == 2) {parent.height * 0.01} else {parent.height * 0.04}
anchors.bottom:backing.bottom
anchors.horizontalCenter: parent.horizontalCenter
width:backing.width * 0.95
// height:backing.height * 0.9
clip:true
spacing:parent.height * 0.03
// anchors.centerIn: backing
model: ListModel {
ListElement {
gamename:"standard"
themode:0
}
ListElement {
gamename:"time attack"
locked:false
themode:2
}
ListElement {
gamename:"random"
locked:false
themode:3
}
ListElement {
gamename:"vs bot"
locked:true
themode:4
}
}
delegate: Item {
width:parent.width * 0.95
height:window_container.height * 0.1
anchors.horizontalCenter: parent.horizontalCenter
Image {
id:border
source:"qrc:/Img/Border3.png"
anchors.fill:parent
}
Glow {
anchors.fill:border
source:border
radius:3
}
Text {
anchors.left:parent.left
anchors.leftMargin:parent.height * 0.08
anchors.verticalCenter: parent.verticalCenter
font.family: pixeltext.name
font.pixelSize: parent.height * 0.5
text:gamename
color:"Yellow"
}
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.right:parent.right
anchors.rightMargin: parent.height * 0.1
source:"qrc:/Img/lock.png"
width:parent.height * 0.6
height:parent.height * 0.6
opacity:0.4
visible: locked
}
MouseArea {
anchors.fill: parent
enabled:if(locked == true) {false} else {true}
onClicked: {//Scripts.cleargame();
mainMenu.visible = false;
challenges.visible = false;
//gamemode = index;
gameBoard1.mode = themode;
game.visible = true;
Scripts.startgame(index);
}
}
}
add: Transition {
NumberAnimation { properties: "x,y"; duration: 1000 }
}
}
Text {
anchors.horizontalCenter: backing.horizontalCenter
anchors.bottom:backing.bottom
anchors.bottomMargin: backing.height * 0.05
color:"Yellow"
text:"main menu"
font.family: pixeltext.name
font.pixelSize: backing.height * 0.02
MouseArea {
anchors.fill: parent
onClicked: {window_container.visible = false,
endScreen.visible = false,mainMenu.visible = true }
}
}
}