-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton.cpp
574 lines (478 loc) · 19.5 KB
/
button.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
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
#include "core.h"
extern int display_width;
extern int display_height;
extern std::ofstream log_file;
extern ALLEGRO_BITMAP** image_list;
extern ALLEGRO_FONT* font15;
extern game_session* session;
boost::shared_ptr<std::vector<boost::shared_ptr<button>>> button::button_list;
void button::draw_button(int button_number)
{
al_draw_filled_rectangle(button_number*BUTTON_SIZE + 5, display_height - BUTTON_SIZE + 5, (button_number + 1)*BUTTON_SIZE -5 , display_height - 5, BLACK_COLOR); //draws black rectangle
al_draw_bitmap_region(action_image, 0, 0, 64, 64, button_number*BUTTON_SIZE + 8, display_height - BUTTON_SIZE + 8, 0); //draws button image
if(button_number == 9) //draws number of action
al_draw_textf(font15, WRITING_COLOR, button_number*BUTTON_SIZE + 72, display_height - 23, ALLEGRO_ALIGN_RIGHT, "%i", 0);
else if(button_number < 9)
al_draw_textf(font15, WRITING_COLOR, button_number*BUTTON_SIZE + 72, display_height - 23, ALLEGRO_ALIGN_RIGHT, "%i", button_number + 1);
}
button::button(ALLEGRO_BITMAP* image, button_type type, bool multiple_selection)
: action_image(image), type(type), multiple_selection(multiple_selection)
{ }
int button::general_update_tiles_with_action(bool mouse_button_down, int tile_x, int tile_y, int button_down_tile_x, int button_down_tile_y)
{
LOG("updating tiles tile_x: " << tile_x << " tile_y: " << tile_y << " button_x: " << button_down_tile_x << " button_y " << button_down_tile_y);
reset_tiles_with_action();
tile_x = std::min(game_info::map_width - 1, std::max(0, tile_x)); //tile_x should be valid tile coordinate
tile_y = std::min(game_info::map_height - 1, std::max(0, tile_y));
button_down_tile_x = std::min(game_info::map_width - 1, std::max(0, button_down_tile_x));
button_down_tile_y = std::min(game_info::map_height - 1, std::max(0, button_down_tile_y));
if((multiple_selection) && (mouse_button_down))
{
int start_x = std::min(button_down_tile_x, tile_x); //choose right tiles and give them action
int start_y = std::min(button_down_tile_y, tile_y);
int end_x = std::max(button_down_tile_x, tile_x);
int end_y = std::max(button_down_tile_y, tile_y);
for(int i=start_x; i<end_x; i++)
tiles_with_action.push_back(session->tile_list[button_down_tile_y][i].get());
for(int i=start_y; i<=end_y; i++)
tiles_with_action.push_back(session->tile_list[i][tile_x].get());
}
else //only one tile with action
tiles_with_action.push_back(session->tile_list[tile_y][tile_x].get());
return 0;
}
void button::reset_tiles_with_action()
{
for(size_t i=0; i<tiles_with_action.size(); ++i)
{
tiles_with_action[i]->action_on_tile.reset();
}
tiles_with_action.clear();
}
void button::set_basic_button_list(bool restart_unlocks)
{
static boost::shared_ptr<std::vector<boost::shared_ptr<button>>> basic_button_list = init_buttons();
static boost::shared_ptr<std::vector<boost::shared_ptr<button>>> starting_button_list(new std::vector<boost::shared_ptr<button>>(1, boost::shared_ptr<button>(new button_build(WAREHOUSE))));
if(restart_unlocks)
{
basic_button_list = init_buttons();
starting_button_list = boost::shared_ptr<std::vector<boost::shared_ptr<button>>>(new std::vector<boost::shared_ptr<button>>(1, boost::shared_ptr<button>(new button_build(WAREHOUSE))));
}
if((session != NULL) && (session->game_started))
{
button::button_list = basic_button_list;
}
else
button::button_list = starting_button_list;
}
boost::shared_ptr<std::vector<boost::shared_ptr<button>>> button::init_buttons()
{
int max_number_of_buttons = (display_width - 3*BUTTON_SIZE) / BUTTON_SIZE;
if(max_number_of_buttons < 3)
{
LOG("display is too small");
throw std::exception();
}
std::vector<building_type> food{HUNTER, FISHERMAN, APPLE_FARM, DAIRY_FARM, WHEAT_FARM, WINDMILL};
std::vector<building_type> economy{HOUSE, MARKET, GREAT_HALL, CHURCH, STORE, WAREHOUSE};
std::vector<building_type> industry{QUARRY, WOODCUTTER, CLAY_PIT, POTTERY_WORKSHOP, BRICKMAKER, MARBLE_QUARRY, GOLD_MINE, COAL_MINE, IRON_MINE};
std::vector<building_type> military{BARRACKS, PALISADE, WALL, LEFT_GATE, NORTHWEST_TOWER, NORTHWEST_STAIRS, SMITH, ARMOURER, FLETCHER};
std::vector<std::vector<building_type>> buttons_init_list{food, economy, industry, military};
boost::shared_ptr<std::vector<boost::shared_ptr<button>>> basic(new std::vector<boost::shared_ptr<button>>());
basic->push_back(boost::shared_ptr<button>(new navigation_button(FOOD, "Food production")));
basic->push_back(boost::shared_ptr<button>(new navigation_button(ECONOMY, "Economy buildings")));
basic->push_back(boost::shared_ptr<button>(new navigation_button(INDUSTRY, "Industry buildings")));
basic->push_back(boost::shared_ptr<button>(new navigation_button(MILITARY, "Military buildings")));
basic->push_back(boost::shared_ptr<button>(new button_path(true)));
basic->push_back(boost::shared_ptr<button>(new button_path(false)));
for(size_t i=0; i<buttons_init_list.size(); ++i)
{
size_t button_index = 0;
boost::shared_ptr<std::vector<boost::shared_ptr<button>>> back_button_list = basic;
boost::shared_ptr<std::vector<boost::shared_ptr<button>>> button_list(new std::vector<boost::shared_ptr<button>>);
(boost::dynamic_pointer_cast<navigation_button>((*basic)[i]))->set_buttons_after_use(button_list);
while(button_index < buttons_init_list[i].size())
{
bool some_buttons_left = true;
button_list->push_back(boost::shared_ptr<button>(new navigation_button(BACK, "Previous selection")));
(boost::dynamic_pointer_cast<navigation_button>((*button_list)[0]))->set_buttons_after_use(back_button_list);
for(int j=1; j < max_number_of_buttons; ++j)
{
if(button_index < buttons_init_list[i].size()) //can add button to the current list
{
button_list->push_back(boost::shared_ptr<button>(new button_build(buttons_init_list[i][button_index])));
++button_index;
}
else
{
some_buttons_left = false;
break;
}
}
if(some_buttons_left)
{
button_list->pop_back();
--button_index;
button_list->push_back(boost::shared_ptr<button>(new navigation_button(FORWARD, "Next selection")));
boost::shared_ptr<std::vector<boost::shared_ptr<button>>> new_button_list(new std::vector<boost::shared_ptr<button>>);
(boost::dynamic_pointer_cast<navigation_button>(button_list->back()))->set_buttons_after_use(new_button_list);
back_button_list = button_list;
button_list = new_button_list;
}
}
}
return basic;
}
void button::draw_button_info(const std::string& name, const std::string& text, const std::vector<int>& prices, int honour_price, int needed_workers, int real_x)
{
int window_height = 200; //these variables should be used to change window proportions
int window_width = 280;
int x = real_x;
int y = display_height - window_height - 2*BUTTON_SIZE;
al_draw_filled_rectangle(x, y, x + window_width, display_height - BUTTON_SIZE, BACKGROUND_COLOR);
al_draw_text(font15, WRITING_COLOR, x + 10, y + 10, ALLEGRO_ALIGN_LEFT, name.c_str());
int pictures_drawn = 0;
for(int i=0; i<NUMBER_OF_RESOURCES; i++)
{
if(prices[i] > 0)
{
al_draw_bitmap_region(image_list[RESOURCES_IMAGE], 30*i, 0, 30, 30, x + 5 + 60*pictures_drawn, y + 45, 0);
al_draw_textf(font15, WRITING_COLOR, x + 5 + 40 + 60*pictures_drawn, y + 50, 0, "%i", prices[i]);
pictures_drawn++;
}
}
if(honour_price > 0)
{
al_draw_bitmap(image_list[HONOUR_IMAGE], x + 5 + 60*pictures_drawn, y + 45, 0);
al_draw_textf(font15, WRITING_COLOR, x + 5 + 40 + 60*pictures_drawn, y + 50, 0, "%i", honour_price);
pictures_drawn++;
}
if(needed_workers > 0)
{
al_draw_textf(font15, WRITING_COLOR, x + 10, y + 80, 0, "Workers: %i", needed_workers);
}
int length_of_line = 30; //how many characters per line
int heigth_of_line = 25;
int start_y = 80;
if(needed_workers > 0)
start_y += 30;
int current_line_length = 0;
int line_start = 0;
int line_number = 0;
for(size_t i=0; i<text.size(); ++i)
{
if((current_line_length > length_of_line) && (text[i] == ' '))
{
al_draw_text(font15, WRITING_COLOR, x + 10, y + start_y + line_number*heigth_of_line, ALLEGRO_ALIGN_LEFT,
text.substr(line_start, current_line_length).c_str());
current_line_length = 0;
line_start = i + 1;
line_number++;
}
if(i == text.size() - 1)
{
al_draw_text(font15, WRITING_COLOR, x + 10, y + start_y + line_number*heigth_of_line, ALLEGRO_ALIGN_LEFT,
text.substr(line_start).c_str());
}
current_line_length++;
}
}
void button::draw_progress_bar(int start_x, int start_y, int percentage, int bar_lenght, int bar_height)
{
al_draw_filled_rectangle(start_x, start_y, start_x + (percentage*bar_lenght)/100, start_y + bar_height, LIGHT_GREEN_COLOR);
al_draw_rectangle(start_x, start_y, start_x + bar_lenght, start_y + bar_height, GREY_COLOR, 1);
}
/*Initialize button. Creates imaginary building which will be drawn if player will be chosing locations of his new building.*/
button_build::button_build(building_type type_of_building) : button(image_list[building_info::show_building_info(type_of_building).image], BUTTON_BUILD, false),
type_of_building(type_of_building), number_of_floors(building_info::show_building_info(type_of_building).number_of_floors)
{
buildings_to_draw.push_back(building::create_building(type_of_building, 0, 0, 0, BLUE_PLAYER, false));
if((type_of_building == WALL) || (type_of_building == PALISADE))
multiple_selection = true;
}
/* Is called if there is action on tile. (Player is chosing location of his new building.)*/
game_object* button_build::draw(int tile_x, int tile_y, int surface_height, int number_of_tile)
{
buildings_to_draw[number_of_tile]->game_object::update(tile_x, tile_y, surface_height);
building* return_value = buildings_to_draw[number_of_tile].get();
if(return_value == nullptr)
throw std::exception();
return return_value;
}
bool button_build::panel_click()
{
if(session->unlocked_buildings[type_of_building])
return true;
int price = building_info::show_building_info(type_of_building).honour_price;
if(session->honour >= price)
{
session->unlocked_buildings[type_of_building] = true;
if((type_of_building == LEFT_GATE) || (type_of_building == RIGHT_GATE))
{
session->unlocked_buildings[RIGHT_GATE] = true;
session->unlocked_buildings[LEFT_GATE] = true;
}
else if((type_of_building == NORTHWEST_STAIRS) || (type_of_building == NORTHEAST_STAIRS)
|| (type_of_building == SOUTHEAST_STAIRS) || (type_of_building == SOUTHWEST_STAIRS))
{
session->unlocked_buildings[NORTHWEST_STAIRS] = true;
session->unlocked_buildings[NORTHEAST_STAIRS] = true;
session->unlocked_buildings[SOUTHEAST_STAIRS] = true;
session->unlocked_buildings[SOUTHWEST_STAIRS] = true;
}
else if((type_of_building == NORTHWEST_TOWER) || (type_of_building == NORTHEAST_TOWER)
|| (type_of_building == SOUTHEAST_TOWER) || (type_of_building == SOUTHWEST_TOWER))
{
session->unlocked_buildings[NORTHWEST_TOWER] = true;
session->unlocked_buildings[NORTHEAST_TOWER] = true;
session->unlocked_buildings[SOUTHEAST_TOWER] = true;
session->unlocked_buildings[SOUTHWEST_TOWER] = true;
}
session->honour -= price;
}
return false;
}
/*Builds building on tile, if building can be build there.*/
void button_build::map_click()
{
for(size_t i=0; i<tiles_with_action.size(); ++i)
{
int tile_x = tiles_with_action[i]->show_tile_x();
int tile_y = tiles_with_action[i]->show_tile_y();
can_build_output output = building::can_build_here(session->tile_list[tile_y][tile_x].get(), buildings_to_draw[0]->show_type());
if(output == can_build_output::CAN_BUILD)
session->tile_list[tile_y][tile_x]->build(type_of_building, BLUE_PLAYER);
else
{
std::tuple<can_build_output, std::string> t = find<hint_database, 0>(output);
std::string message = std::get<1>(t);
session->hints.add_hint(compute_game_x(tile_x, tile_y), compute_game_y(tile_x, tile_y), message, LIGHT_RED_COLOR);
}
}
}
/*Draws imaginary building or sets action_on_tile so that imaginary building will be drawn by draw_map() function.*/
void button_build::draw_action(int screen_position_x, int screen_position_y)
{
for(size_t i=0; i<tiles_with_action.size(); ++i) //if !multiple_selection, then tiles_with_action.size() should be 1 or 0.
{
int tile_x = tiles_with_action[i]->show_tile_x();
int tile_y = tiles_with_action[i]->show_tile_y();
if(building::can_build_here(session->tile_list[tile_y][tile_x].get(), buildings_to_draw[i]->show_type()) == can_build_output::CAN_BUILD)
buildings_to_draw[i]->draw_green = true;
else
buildings_to_draw[i]->draw_green = false;
session->tile_list[tile_y][tile_x]->action_on_tile = shared_from_this();
session->tile_list[tile_y][tile_x]->number_of_tile_with_action = i;
}
}
/*Called if mouse wheel moves. Rotates gate.*/
int button_build::scroll()
{
switch(type_of_building)
{
case(LEFT_GATE):
{
type_of_building = RIGHT_GATE;
buildings_to_draw[0]->type = RIGHT_GATE;
buildings_to_draw[0]->size = RIGHT_GATE_BUILDING;
}
break;
case(RIGHT_GATE):
{
type_of_building = LEFT_GATE;
buildings_to_draw[0]->type = LEFT_GATE;
buildings_to_draw[0]->size = LEFT_GATE_BUILDING;
}
break;
case(NORTHWEST_STAIRS):
{
type_of_building = NORTHEAST_STAIRS;
buildings_to_draw[0]->type = NORTHEAST_STAIRS;
}
break;
case(NORTHEAST_STAIRS):
{
type_of_building = SOUTHEAST_STAIRS;
buildings_to_draw[0]->type = SOUTHEAST_STAIRS;
}
break;
case(SOUTHEAST_STAIRS):
{
type_of_building = SOUTHWEST_STAIRS;
buildings_to_draw[0]->type = SOUTHWEST_STAIRS;
}
break;
case(SOUTHWEST_STAIRS):
{
type_of_building = NORTHWEST_STAIRS;
buildings_to_draw[0]->type = NORTHWEST_STAIRS;
}
break;
case(NORTHWEST_TOWER):
{
type_of_building = NORTHEAST_TOWER;
buildings_to_draw[0]->type = NORTHEAST_TOWER;
}
break;
case(NORTHEAST_TOWER):
{
type_of_building = SOUTHEAST_TOWER;
buildings_to_draw[0]->type = SOUTHEAST_TOWER;
}
break;
case(SOUTHEAST_TOWER):
{
type_of_building = SOUTHWEST_TOWER;
buildings_to_draw[0]->type = SOUTHWEST_TOWER;
}
break;
case(SOUTHWEST_TOWER):
{
type_of_building = NORTHWEST_TOWER;
buildings_to_draw[0]->type = NORTHWEST_TOWER;
}
break;
default: {}
}
return 0;
}
/*Draws information about building which is build by this button.*/
void button_build::draw_info(int button_number)
{
bool unlocked = session->unlocked_buildings[type_of_building];
building_info info = building_info::show_building_info(type_of_building);
if(unlocked)
{
std::vector<int> building_price = info.building_price;
if(!session->game_started)
{
building_price = std::vector<int>(NUMBER_OF_RESOURCES, 0);
}
draw_button_info(info.name, info.text, building_price, 0, info.number_of_workers, button_number*BUTTON_SIZE);
}
else
{
draw_button_info("Unlock " + info.name, info.text, std::vector<int>(NUMBER_OF_RESOURCES, 0), info.honour_price, 0, button_number*BUTTON_SIZE);
}
}
void button_build::draw_button(int button_number)
{
bool unlocked = session->unlocked_buildings[type_of_building];
al_draw_filled_rectangle(button_number*BUTTON_SIZE + 5, display_height - BUTTON_SIZE + 5, (button_number + 1)*BUTTON_SIZE -5 , display_height - 5, BLACK_COLOR); //draws black rectangle
if(unlocked)
{
al_draw_bitmap_region(action_image, 0, 0, 64, 64, button_number*BUTTON_SIZE + 8, display_height - BUTTON_SIZE + 8, 0); //draws button image
}
else
{
al_draw_bitmap_region(image_list[LOCK_IMAGE], 0, 0, 64, 64, button_number*BUTTON_SIZE + 8, display_height - BUTTON_SIZE + 8, 0);
}
if(button_number == 9) //draws number of action
al_draw_textf(font15, WRITING_COLOR, button_number*BUTTON_SIZE + 72, display_height - 23, ALLEGRO_ALIGN_RIGHT, "%i", 0);
else if(button_number < 9)
al_draw_textf(font15, WRITING_COLOR, button_number*BUTTON_SIZE + 72, display_height - 23, ALLEGRO_ALIGN_RIGHT, "%i", button_number + 1);
}
int button_build::update_tiles_with_action(bool mouse_button_down, int tile_x, int tile_y, int button_down_tile_x, int button_down_tile_y)
{
general_update_tiles_with_action(mouse_button_down, tile_x, tile_y, button_down_tile_x, button_down_tile_y);
if((buildings_to_draw.size() < tiles_with_action.size()) && (multiple_selection))
{
for(size_t i=buildings_to_draw.size(); i<tiles_with_action.size(); ++i)
{
if((type_of_building == WALL) || (type_of_building == PALISADE))
{
buildings_to_draw.push_back(building::create_building(type_of_building, 0, 0, 0, BLUE_PLAYER, false));
}
}
}
return 0;
}
void button_build::reset_tiles_with_action()
{
button::reset_tiles_with_action();
}
button_path::button_path(bool add) : button(image_list[PATHS_IMAGE], BUTTON_PATH, true)
{
this->add = add;
}
game_object* button_path::draw(int tile_x, int tile_y, int surface_height, int number_of_tile)
{
return NULL;
}
void button_path::map_click()
{
LOG("button path::map_click(), first x: " << tiles_with_action[0]->show_tile_x() << " first y: " << tiles_with_action[0]->show_tile_y());
for(size_t i=0; i<tiles_with_action.size(); ++i)
{
if(add)
tiles_with_action[i]->add_path(true);
else if(!add)
{
if(tiles_with_action[i]->building_on_tile.expired()) //neccessary to prevent removing path under gate
tiles_with_action[i]->remove_path(true);
}
}
}
void button_path::draw_action(int screen_position_x, int screen_position_y)
{
for(size_t i=0; i<tiles_with_action.size(); ++i)
{
tiles_with_action[i]->action_on_tile = shared_from_this();
tiles_with_action[i]->number_of_tile_with_action = i;
tiles_with_action[i]->add_path(false);
}
}
void button_path::draw_info(int button_number)
{
std::string name;
std::string text;
std::vector<int> prices(NUMBER_OF_RESOURCES, 0);
prices[STONE] = 0;
prices[WOOD] = 0;
if(add)
{
name.append("BUILD PATH");
text.append("Your buildings should be connected by paths to allow transport of resources.");
}
else
{
name.append("DELETE PATH");
text.append("Remove path to allow buildings on tile.");
}
draw_button_info(name, text, prices, 0, 0, button_number*BUTTON_SIZE);
}
void button_path::draw_button(int button_number)
{
al_draw_filled_rectangle(button_number*BUTTON_SIZE + 5, display_height - BUTTON_SIZE + 5, (button_number + 1)*BUTTON_SIZE -5 , display_height - 5, BLACK_COLOR); //draws black rectangle
if(add)
al_draw_bitmap_region(action_image, 0, 0, 64, 64, button_number*BUTTON_SIZE + 8, display_height - BUTTON_SIZE + 8, 0); //draws button image
else
al_draw_bitmap_region(action_image, 0, 64, 64, 64, button_number*BUTTON_SIZE + 8, display_height - BUTTON_SIZE + 8, 0); //draws button image
if(button_number == 9) //draws number of action
al_draw_textf(font15, WRITING_COLOR, button_number*BUTTON_SIZE + 72, display_height - 23, ALLEGRO_ALIGN_RIGHT, "%i", 0);
else if(button_number < 9)
al_draw_textf(font15, WRITING_COLOR, button_number*BUTTON_SIZE + 72, display_height - 23, ALLEGRO_ALIGN_RIGHT, "%i", button_number + 1);
}
void button_path::reset_tiles_with_action()
{
for(size_t i=0; i<tiles_with_action.size(); ++i)
{
if(tiles_with_action[i]->unreal_path_on_tile())
{
tiles_with_action[i]->remove_path(false);
}
}
button::reset_tiles_with_action();
}
navigation_button::navigation_button(navigation_button_type navigation_type, const std::string& button_name)
: button(image_list[NAVIGATION_BUTTONS_IMAGE], NAVIGATION_BUTTON, false), navigation_type(navigation_type), name(button_name)
{
}
void navigation_button::draw_button(int button_number)
{
al_draw_bitmap_region(image_list[NAVIGATION_BUTTONS_IMAGE], ((int)navigation_type)*70, 0, 70, 70, button_number*BUTTON_SIZE + 5, display_height - BUTTON_SIZE + 5, 0);
}
void navigation_button::draw_info(int button_number)
{
button::draw_button_info(name, "", std::vector<int>(NUMBER_OF_RESOURCES, 0), 0, 0, BUTTON_SIZE * button_number);
}