-
Notifications
You must be signed in to change notification settings - Fork 0
/
EndScreen.qml
234 lines (195 loc) · 6.57 KB
/
EndScreen.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
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()
property int alreadysaved: 0
property string highestname: ""
property string highestscore: ""
property int mode: 0
Image {
id:backing
anchors.centerIn: parent
width:if(orient == 2) {parent.height / 1.5} else {parent.height / 1.7}
height:parent.height * 0.96
source:"qrc:/Img/Border1.png"
//fillMode: Image.PreserveAspectFit
visible: false
}
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
}
Glow {
samples: 17
radius: 8
source:backing
anchors.fill: backing
opacity: 0.6
}
DropShadow {
anchors.fill: backing
horizontalOffset: 10
verticalOffset: 10
radius: 8.0
samples: 17
color: "#80000000"
source: backing
opacity:0.6
}
Text {
id:title
anchors.horizontalCenter: backing.horizontalCenter
anchors.top:backing.top
anchors.topMargin: backing.height * 0.1
font.family: pixeltext.name
// width:backing.width
text:if(mode == 1) {"access granted"} else {"high scores"}
color:"Yellow"
font.pixelSize: if(mode == 1) {backing.height * 0.045} else {backing.height * 0.06}
}
Text {
id:players
text:if(mode == 1) {name.toLowerCase()} else {highestname.toLowerCase()}
//visible: if(mode == 1) {true} else {false}
anchors.left:backing.left
anchors.leftMargin: backing.height * 0.05
anchors.top:title.bottom
anchors.topMargin: backing.height * 0.05
font.family: pixeltext.name
color:"Yellow"
font.pixelSize: backing.height * 0.06
Image {
width:parent.height /2
height:parent.height /2
anchors.bottom:parent.bottom
anchors.bottomMargin: -parent.height * 0.1
anchors.left:parent.right
anchors.leftMargin:parent.height * 0.02
source:"qrc:/Img/edit.svg"
visible: if(mode == 1) {true} else {false}
}
TextInput {
width:parent.width
height:parent.height
anchors.left:parent.left
maximumLength: 3
font.pixelSize: backing.height * 0.06
color:"Yellow"
text:name.toLowerCase()
font.family: pixeltext.name
font.capitalization: Font.AllLowercase
onTextChanged: name = text
visible: if(mode == 1) {true} else {false}
}
}
Text {
//visible: if(mode == 1) {true} else {false}
anchors.right: backing.right
anchors.rightMargin: backing.height * 0.05
anchors.top:title.bottom
anchors.topMargin: backing.height * 0.05
text:if(mode == 1) {gameBoard1.score} else {highestscore}
font.family: pixeltext.name
color:"Yellow"
font.pixelSize: backing.height * 0.06
}
Rectangle {
visible: if(mode == 1) {true} else {false}
anchors.top:players.bottom
anchors.topMargin: backing.height * 0.01
anchors.right: backing.right
anchors.rightMargin: backing.height * 0.04
width:backing.height * 0.1
height:backing.height * 0.05
border.color:"Yellow"
border.width:parent.height * 0.001
color:"#0FFFFFFF"
radius:5
Text {
anchors.centerIn: parent
font.family: pixeltext.name
color:if(alreadysaved == 0) {"Yellow"} else {
"Gray"
}
font.pixelSize: parent.height * 0.5
text: "save"
}
MouseArea {
anchors.fill:parent
onClicked: if(alreadysaved == 0) {Scripts.scoreboardSave(name,gameBoard1.score),alreadysaved =1} else { }
}
}
Rectangle {
width:backing.width * 0.9
height:backing.height * 0.55
anchors.bottom:backing.bottom
border.color:"Yellow"
border.width:parent.height * 0.001
color:"#0FFFFFFF"
anchors.bottomMargin: backing.height * 0.1
anchors.horizontalCenter: backing.horizontalCenter
clip:true
ListView {
anchors.top:parent.top
anchors.left:parent.left
width:parent.width
height:parent.height
model:scores
delegate: Item {
width:parent.width
height:window_container.height * 0.05
Row {
width:parent.width
height:parent.height
// spacing:parent.width / 3
Text {
text:thename
width:parent.width / 3
font.family: pixeltext.name
color:"Yellow"
font.pixelSize: parent.height * 0.5
}
Text {
text:thedate
width:parent.width / 3
font.family: pixeltext.name
color:"Yellow"
font.pixelSize: parent.height * 0.5
}
Text {
text:thescore
width:parent.width / 3
horizontalAlignment: Text.AlignRight
font.family: pixeltext.name
color:"Yellow"
font.pixelSize: parent.height * 0.5
}
}
}
}
}
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: {if(mode == 1) {Scripts.cleargame()} else {}
endScreen.mode = 0; endScreen.visible = false,mainMenu.visible = true }
}
}
ListModel {
id:scores
}
}