Make end turn button appear in the right place
This commit is contained in:
parent
79740d3cee
commit
67cbd43740
7
game.cpp
7
game.cpp
|
@ -151,14 +151,17 @@ void Game::render()
|
||||||
DrawUtils::draw_line(display, 150, display->h - 100, 150, display->h, 2,
|
DrawUtils::draw_line(display, 150, display->h - 100, 150, display->h, 2,
|
||||||
0x000000);
|
0x000000);
|
||||||
|
|
||||||
if (data.get_current_vertex() != NULL &&
|
|
||||||
data.get_current_vertex()->player == data.get_turn())
|
|
||||||
{
|
{
|
||||||
for (list<MenuButton*>::iterator cursor = buttons.begin();
|
for (list<MenuButton*>::iterator cursor = buttons.begin();
|
||||||
cursor != buttons.end(); cursor++)
|
cursor != buttons.end(); cursor++)
|
||||||
{
|
{
|
||||||
MenuButton* button = *cursor;
|
MenuButton* button = *cursor;
|
||||||
|
|
||||||
|
if (!(button->get_action() & BUTTON_END_TURN) &&
|
||||||
|
(data.get_current_vertex() == NULL ||
|
||||||
|
data.get_current_vertex()->player != data.get_turn()))
|
||||||
|
continue;
|
||||||
|
|
||||||
if ((button->get_action() & (BUTTON_BUILD_ATTACKER |
|
if ((button->get_action() & (BUTTON_BUILD_ATTACKER |
|
||||||
BUTTON_BUILD_DEFENDER |
|
BUTTON_BUILD_DEFENDER |
|
||||||
BUTTON_BUILD_PRODUCER)) &&
|
BUTTON_BUILD_PRODUCER)) &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user