author | unc0rr |
Mon, 20 Oct 2014 22:55:12 +0400 | |
branch | qmlfrontend |
changeset 10442 | c58db813240b |
parent 10436 | 084e046f6bd5 |
child 10444 | 47a6231f1fc1 |
permissions | -rw-r--r-- |
10422 | 1 |
import QtQuick 2.0 |
2 |
import Hedgewars.Engine 1.0 |
|
3 |
||
10442 | 4 |
|
10422 | 5 |
Rectangle { |
6 |
HWButton { |
|
7 |
id: btnPreview |
|
8 |
x: 50 |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
9 |
y: 16 |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
10 |
width: 256 |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
11 |
height: 128 |
10422 | 12 |
|
10432 | 13 |
onClicked: HWEngine.getPreview() |
10422 | 14 |
|
15 |
Connections { |
|
16 |
target: HWEngine |
|
10424
4be6cd55f1cf
- Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents:
10422
diff
changeset
|
17 |
onPreviewImageChanged: previewImage.source = "image://preview/" + HWEngine.currentSeed() |
10422 | 18 |
} |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
19 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
20 |
Image { |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
21 |
id: previewImage |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
22 |
x: 0 |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
23 |
y: 0 |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
24 |
width: 256 |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
25 |
height: 128 |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
26 |
cache: false |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
27 |
} |
10422 | 28 |
} |
29 |
||
10436 | 30 |
Rectangle { |
31 |
x: 320 |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
32 |
y: 16 |
10436 | 33 |
width: 100 |
34 |
height: 256 |
|
35 |
color: "#15193a" |
|
36 |
radius: 8 |
|
37 |
border.width: 4 |
|
38 |
border.color: "#eaea00" |
|
39 |
Image { |
|
40 |
id: themeImage |
|
41 |
x: 0 |
|
42 |
y: 0 |
|
43 |
width: 64 |
|
44 |
height: 64 |
|
45 |
fillMode: Image.Pad |
|
46 |
} |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
47 |
|
10436 | 48 |
ListView { |
49 |
id: themesList |
|
50 |
x: 0 |
|
51 |
y: 64 |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
52 |
width: 100 |
10436 | 53 |
height: 192 |
54 |
highlight: Rectangle { color: "#eaea00"; radius: 4 } |
|
55 |
focus: true |
|
56 |
||
57 |
model: themesModel |
|
58 |
delegate: Rectangle { |
|
59 |
height: 25 |
|
60 |
width: 100 |
|
61 |
color: "transparent" |
|
62 |
Text {id: themeName; text: modelData } |
|
63 |
MouseArea { |
|
64 |
z: 1 |
|
65 |
anchors.fill: parent |
|
66 |
onClicked: { |
|
67 |
themeImage.source = "image://theme/" + themeName.text |
|
68 |
themesList.currentIndex = index |
|
69 |
} |
|
70 |
} |
|
71 |
} |
|
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
10432
diff
changeset
|
72 |
} |
10422 | 73 |
} |
10442 | 74 |
|
75 |
ListView { |
|
76 |
id: playingTeamsList |
|
77 |
x: 440 |
|
78 |
y: 16 |
|
79 |
width: 100 |
|
80 |
height: 192 |
|
81 |
highlight: Rectangle { color: "#eaea00"; radius: 4 } |
|
82 |
focus: true |
|
83 |
clip: true |
|
84 |
||
85 |
model: ListModel { |
|
86 |
id: localTeamsModel |
|
87 |
} |
|
88 |
||
89 |
delegate: Rectangle { |
|
90 |
id: teamDelegate |
|
91 |
height: 24 |
|
92 |
width: parent.width |
|
93 |
radius: 8 |
|
94 |
border.width: 2 |
|
95 |
border.color: "#eaea00" |
|
96 |
||
97 |
Row { |
|
98 |
Text { text: name } |
|
99 |
} |
|
100 |
} |
|
101 |
||
102 |
Connections { |
|
103 |
target: HWEngine |
|
104 |
onLocalTeamAdded: localTeamsModel.append({"aiLevel": aiLevel, "name": teamName}) |
|
105 |
} |
|
106 |
} |
|
107 |
||
108 |
Component.onCompleted: { |
|
109 |
HWEngine.getTeamsList() |
|
110 |
HWEngine.getPreview() |
|
111 |
} |
|
10422 | 112 |
} |