Skip to content

Commit 3178108

Browse files
committed
Modified placement order of buttons so that the board is added first,
and thus all board clicks are handled first. Still need to do something more permanent to fix the issue with button overlap.
1 parent 6d9d1b8 commit 3178108

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/GameController.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
GameController::GameController(GameBoard& model, GameView& view) : model(model), view(view) {
1818
using namespace std::placeholders;
1919

20+
view.addElement(makeViewButton(std::bind(&GameController::handleBoardEvent, this, _1), {{0, 0}, {1, 1}}));
2021

2122
view.addElement(makeViewButtonColor(std::bind(&GameController::nextTurn, this, _1), {{0, 0.2}, {0.1, 0.3}}, std::make_tuple(0.f, 0.f, 1.f)));
2223
view.addElement(makeViewButtonColor(std::bind(&GameController::handleRoadButtonEvent, this, _1), {{0, 0}, {0.1, 0.1}}, std::make_tuple(1.f, 0.f, 0.f)));
2324
view.addElement(makeViewButtonColor(std::bind(&GameController::handleSettlementButtonEvent, this, _1), {{0, 0.1}, {0.1, 0.2}}, std::make_tuple(0.f, 1.0f, 0.f)));
2425

25-
view.addElement(makeViewButton(std::bind(&GameController::handleBoardEvent, this, _1), {{0, 0}, {1, 1}}));
26-
2726
auto font = "resources/TypeWritersSubstitute-Black.ttf";
2827
auto fontSize = 50;
2928

@@ -158,7 +157,6 @@ bool GameController::handleBoardEvent(ScreenCoordinate screenCoord) {
158157

159158
switch (getState()){
160159
case BUILDROAD:
161-
std::cout << "BUILDROAD\n";
162160
if(!hasClickHistory()) {
163161
storeClick(coord);
164162
} else {

0 commit comments

Comments
 (0)