-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPanzersFace.cpp
188 lines (185 loc) · 10.3 KB
/
PanzersFace.cpp
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
#include "PanzersFace.h"
PanzersFace::PanzersFace(int dynamicStart, int dynamicFinish, int pastCoord) :
_dynamicStart{ dynamicStart },
_dynamicFinish{ dynamicFinish },
_pastCoord{ pastCoord },
_tempCoord{ 0,0 }
{}
void PanzersFace::drawStartMenu() {
_draw.text("ÏÎËÈÃÎÍ", { 153,428 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÏÎËÈÃÎÍ", { 150,430 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÑÎÇÄÀÒÜ ÒÀÍÊ", { 73,518 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÑÎÇÄÀÒÜ ÒÀÍÊ", { 70,520 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÓÄÀËÈÒÜ ÒÀÍÊ", { 73,608 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÓÄÀËÈÒÜ ÒÀÍÊ", { 70,610 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÂÛÕÎÄ", { 643,608 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÂÛÕÎÄ", { 640,610 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL);
}
void PanzersFace::drawPanzerCreaterMenu() {
_draw.text("ÍÀÇÂÀÍÈÅ ÒÀÍÊÀ", { 523, 18 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÍÀÇÂÀÍÈÅ ÒÀÍÊÀ", { 520, 20 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÌÎÄÅËÜ ÒÀÍÊÀ", { 533, 288 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÌÎÄÅËÜ ÒÀÍÊÀ", { 530, 290 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÕÀÐÀÊÒÅÐÈÑÒÈÊÈ", { 523, 468 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÕÀÐÀÊÒÅÐÈÑÒÈÊÈ", { 520, 470 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL);
}
void PanzersFace::drawPanzerCharacteristicsMenu(Player& panzer) {
_draw.text("Î×ÊÈ ÀÏÃÐÅÉÄÀ:", { 513, 18 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("Î×ÊÈ ÀÏÃÐÅÉÄÀ:", { 510, 20 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÇÄÎÐÎÂÜÅ:", { 543, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÇÄÎÐÎÂÜÅ:", { 540, 110 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("/100", { 803, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("/100", { 800, 110 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÁÐÎÍß:", { 543, 198 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÁÐÎÍß:", { 540, 200 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("/100", { 803, 198 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("/100", { 800, 200 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÑÊÎÐÎÑÒÜ:", { 543, 288 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÑÊÎÐÎÑÒÜ:", { 540, 290 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("/22", { 803, 288 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("/22", { 800, 290 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÑÈËÀ:", { 543, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÑÈËÀ:", { 540, 380 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("/5:", { 803, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("/5:", { 800, 380 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("ÑÎÁÐÀÒÜ ÒÀÍÊ", { 553, 468 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÑÎÁÐÀÒÜ ÒÀÍÊ", { 550, 470 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("<<", { 503, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("<<", { 500, 110 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("<<", { 503, 198 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("<<", { 500, 200 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("<<", { 503, 288 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("<<", { 500, 290 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text("<<", { 503, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("<<", { 500, 380 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text(">>", { 873, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(">>", { 870, 110 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text(">>", { 873, 198 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(">>", { 870, 200 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text(">>", { 873, 288 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(">>", { 870, 290 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text(">>", { 873, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(">>", { 870, 380 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text(to_string(panzer.getCommandPoints()), { 843, 18 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getCommandPoints()), { 840, 20 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL)
.text(to_string(panzer.getHealth()), { 753, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getHealth()), { 750, 110 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL)
.text(to_string(panzer.getArmor()), { 753, 198 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getArmor()), { 750, 200 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL)
.text(to_string(panzer.getSpeed()), { 753, 288 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getSpeed()), { 750, 290 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL)
.text(to_string(panzer.getShotPower()), { 753, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getShotPower()), { 750, 380 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL);
}
void PanzersFace::drawMainPage(const COORD& coord) {
_draw.image({ 0,0 }, _pic.deskPoligonMenu);
border(coord);
_draw.textTransparence(true);
drawStartMenu();
_draw.textTransparence(false)
.showPicture();
}
void PanzersFace::drawNewPanzerName(const COORD& coord, string& writing, bool busy) {
_draw.image({ 0,0 }, _pic.deskPanzerNameModel);
border(coord);
_draw.textTransparence(true);
drawPanzerCreaterMenu();
_draw.text(writing, { 523, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(writing, { 520, 110 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL);
if (busy) _draw.rectangle({ 500, 190 }, { 900, 270 }, RGB(60, 50, 50))
.text("èìÿ íåäîñòóïíî", { 523, 198 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("èìÿ íåäîñòóïíî", { 520, 200 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL);
drawStartMenu();
_draw.textTransparence(false)
.showPicture();
}
void PanzersFace::drawNewPanzerModel(const COORD& coord, Player& panzer, bool pushLeft, bool pushRight) {
_draw.image({ 0,0 }, _pic.deskPanzerNameModel);
border(coord);
_draw.textTransparence(true);
drawPanzerCreaterMenu();
COLORREF colorLeft = (pushLeft) ? RGB(255, 0, 0) : RGB(255, 255, 255);
COLORREF colorRight = (pushRight) ? RGB(255, 0, 0) : RGB(255, 255, 255);
Sleep(50);
_draw.text(panzer.getName(), { 523, 108 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(panzer.getName(), { 520, 110 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL)
.text(to_string(panzer.getModel()), { 688, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getModel()), { 685, 380 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL)
.text("<<<", { 513, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("<<<", { 510, 380 }, 60, 15, "Palatino Linotype", colorLeft, NULL)
.text(">>>", { 843, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(">>>", { 840, 380 }, 60, 15, "Palatino Linotype", colorRight, NULL)
.text(to_string(panzer.getModel()), { 688, 378 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(to_string(panzer.getModel()), { 685, 380 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL)
.image({ 220, 180 }, showModel(&panzer));
drawStartMenu();
_draw.textTransparence(false)
.showPicture();
}
void PanzersFace::drawNewPanzerCharacteristics(const COORD& coord, Player& panzer, bool pushLeft, bool pushRight) {
_draw.image({ 0,0 }, _pic.deskPanzerCharacteristics);
border(coord);
_draw.textTransparence(true);
drawPanzerCharacteristicsMenu(panzer);
COLORREF colorLeft = (pushLeft) ? RGB(255, 0, 0) : RGB(255, 255, 255);
COLORREF colorRight = (pushRight) ? RGB(255, 0, 0) : RGB(255, 255, 255);
Sleep(50);
if (coord.Y < 450)
_draw.text("<<", { 503, coord.Y + 8 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("<<", { 500, coord.Y + 10 }, 60, 15, "Palatino Linotype", colorLeft, NULL)
.text(">>", { 873, coord.Y + 8 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(">>", { 870, coord.Y + 10 }, 60, 15, "Palatino Linotype", colorRight, NULL);
_draw.image({ 220, 180 }, showModel(&panzer));
drawStartMenu();
_draw.textTransparence(false)
.showPicture();
}
void PanzersFace::drawPanzers(vector<Player>& panzer, COORD& coord, int size, bool loop) {
if (loop) {
_tempCoord = { 520, 100 };
if (coord.Y - _pastCoord > 100) _dynamicStart -= 2;
if (_pastCoord - coord.Y > 100) _dynamicStart += 2;
if (_pastCoord > coord.Y) --_dynamicStart;
if (_pastCoord < coord.Y) ++_dynamicStart;
if (_dynamicStart > size) _dynamicStart = 0;
if (_dynamicStart < 0)_dynamicStart = size;
_pastCoord = coord.Y;
if (_dynamicStart > 5) { coord.Y = 460; }
border({ coord.X, coord.Y });
_dynamicFinish = (size < 5) ? size : (_dynamicStart > 5) ? _dynamicStart : 5;
for (int i = (_dynamicStart <= 5) ? 0 : _dynamicStart - 5; i < _dynamicFinish; i++) {
_draw.text(panzer[i].getName(), { 523, _tempCoord.Y - 2 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(panzer[i].getName(), { 520, _tempCoord.Y }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL);
if (_tempCoord.Y < 460) _tempCoord.Y += 90;
}
coord.Y = _pastCoord;
if(coord.Y > 50)_draw.image({ 220, 180 }, showModel(&panzer[_dynamicStart - 1]));
}
else {
_pastCoord = 10;
_dynamicStart = 0;
_dynamicFinish = 0;
}
}
void PanzersFace::drawSearchPanzer(const COORD& coord, const string& writing) {
_draw.image({ 0,0 }, _pic.deskPanzerCharacteristics)
.textTransparence(true);
drawStartMenu();
border({ coord.X, coord.Y });
_draw.text(writing, { 523, 18 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text(writing, { 520, 20 }, 60, 15, "Palatino Linotype", RGB(255, 0, 0), NULL);
_draw.textTransparence(false)
.showPicture();
}
void PanzersFace::drawAllPanzers(vector<Player>& panzer, COORD& coord, int size, bool loop) {
_draw.image({ 0,0 }, _pic.deskPanzerCharacteristics)
.textTransparence(true);
drawStartMenu();
_draw.text("ÏÎÈÑÊ", { 523, 8 }, 60, 15, "Palatino Linotype", NULL, NULL)
.text("ÏÎÈÑÊ", { 520, 10 }, 60, 15, "Palatino Linotype", RGB(255, 255, 255), NULL);
drawPanzers(panzer, coord, size, loop);
_draw.textTransparence(false)
.showPicture();
}
PanzersFace::~PanzersFace()
{}