Add virtual touch buttons for Monopoly game and centralize configuration in ModalButtonHelper

This commit is contained in:
Adolfo Reyna
2026-02-06 22:11:24 -05:00
parent eb86c3fc0e
commit e2817262b0
11 changed files with 194 additions and 8 deletions

View File

@@ -7,6 +7,7 @@
#include "monopoly_board.h"
#include "player.h"
#include "MonopolyBoardRenderer.h"
#include "ModalButtonHelper.h"
class BoardModalGame : public Game {
bool dismissed;
@@ -18,7 +19,10 @@ public:
BoardModalGame(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager, Player* p, int count, int current_idx)
: Game(width, height, renderer, gui, input_manager), dismissed(false), players(p), players_count(count), observer_idx(current_idx) {}
void init() override { dismissed = false; }
void init() override {
dismissed = false;
ModalButtonHelper::set_monopoly_regions(input_manager, width, height);
}
Type get_type() const override { return Type::MONOPOLY_BOARD; }
bool update(const InputEvent& event) override {
@@ -119,6 +123,8 @@ public:
}
renderer->draw_string_scaled(ix + (iw - 12 * 6) / 2, iy + ih - 15, "PRESS BUTTON", 1);
ModalButtonHelper::draw_virtual_buttons(renderer, input_manager);
}
public: