-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPromotionDialog.qml
179 lines (171 loc) · 6.04 KB
/
PromotionDialog.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
import QtQuick 2.9
import QtQuick.Controls 2.5
import QtQuick.Window 2.3
import QtQuick.Dialogs 1.2
//promotion dialog
Dialog {
id: promotion
title: persian.checked ? "ارتقا" : "Promotion"
width: parent.height * 0.35
height: parent.height * 0.35
onRejected: {
bknd.promote(4)
mystack.replace("GamePage.qml")
}
contentItem: Rectangle {
id: promotionRec
border.color: "#7c6d43"
border.width: 2
anchors.centerIn: parent
//background
Image {
id: name
source: "qrc:/Assets/Images/Wood2.jpg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Text {
id: promotionText
text: persian.checked ? "به کدام یک میخواهید ارتقا پیدا کنید؟" : "Which one do you want promote to?"
color: "white"
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 5
font.pixelSize: 18
width: parent.width * 0.9
height: parent.height * 0.3
anchors.horizontalCenter: parent.horizontalCenter
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
//promotion Grid
Grid {
id: promotionGrid
height: parent.height * 0.7
width: parent.width * 0.9
anchors.top: promotionText.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: parent.height * 0.1
rows: 2
columns: 2
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
columnSpacing: this.width * 0.1
rowSpacing: this.height * 0.1
//promote To Queen
Rectangle {
id: queenRec
color: "#00000000"
border.color: "#7c6d43"
width: parent.width * 0.45
height: parent.height * 0.45
Image {
source: "qrc:/Assets/Images/wood1.jpeg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Button {
id: promoteToQueen
flat: true
icon.source: "qrc:/Assets/Icons/WQueen.png"
icon.width: this.width * 0.9
icon.height: this.height * 0.9
icon.color: "#9c843c"
width: parent.width - 2
height: parent.height - 2
onClicked: {
bknd.promote(4)
mystack.replace("GamePage.qml")
}
}
}
//promote To Rook
Rectangle {
id: rookRec
color: "#00000000"
border.color: "#7c6d43"
width: parent.width * 0.45
height: parent.height * 0.45
Image {
source: "qrc:/Assets/Images/wood1.jpeg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Button {
id: promoteToRook
flat: true
icon.source: "qrc:/Assets/Icons/WRook.png"
icon.width: this.width * 0.9
icon.height: this.height * 0.9
icon.color: "#9c843c"
width: parent.width - 2
height: parent.height - 2
onClicked: {
bknd.promote(3)
mystack.replace("GamePage.qml")
}
}
}
//promote To Bishop
Rectangle {
id: bihopRec
color: "#00000000"
border.color: "#9c843c"
width: parent.width * 0.45
height: parent.height * 0.45
Image {
source: "qrc:/Assets/Images/wood1.jpeg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Button {
id: promoteToBishop
flat: true
icon.source: "qrc:/Assets/Icons/WBishop.png"
icon.width: this.width * 0.9
icon.height: this.height * 0.9
icon.color: "#9c843c"
width: parent.width - 2
height: parent.height - 2
onClicked: {
bknd.promote(1)
mystack.replace("GamePage.qml")
}
}
}
//promote To Knight
Rectangle {
id: knightRec
color: "#00000000"
border.color: "#7c6d43"
width: parent.width * 0.45
height: parent.height * 0.45
Image {
source: "qrc:/Assets/Images/wood1.jpeg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Button {
id: promoteToKnight
flat: true
icon.source: "qrc:/Assets/Icons/WKnight.png"
icon.width: this.width * 0.9
icon.height: this.height * 0.9
icon.color: "#9c843c"
width: parent.width - 2
height: parent.height - 2
onClicked: {
bknd.promote(2)
mystack.replace("GamePage.qml")
}
}
}
}
}
}