Add virtual touch buttons for Monopoly game and centralize configuration in ModalButtonHelper
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "player.h"
|
||||
#include "MonopolyBoardRenderer.h"
|
||||
#include "sprites.h"
|
||||
#include "ModalButtonHelper.h"
|
||||
|
||||
class CommunityChestModalGame : public Game {
|
||||
const CommunityCard* card;
|
||||
@@ -20,7 +21,10 @@ public:
|
||||
CommunityChestModalGame(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager, const CommunityCard* c, Player* p_list = nullptr, int p_count = 0, int p_pos = -1)
|
||||
: Game(width, height, renderer, gui, input_manager), card(c), dismissed(false), players(p_list), players_count(p_count), player_pos(p_pos) {}
|
||||
|
||||
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_COMMUNITY_CHEST; }
|
||||
|
||||
bool update(const InputEvent& event) override {
|
||||
@@ -86,6 +90,8 @@ public:
|
||||
|
||||
// Prompt
|
||||
renderer->draw_string_scaled(ix + (iw - 12 * 12) / 2, iy + ih - 20, "Press BUTTON", 2);
|
||||
|
||||
ModalButtonHelper::draw_virtual_buttons(renderer, input_manager);
|
||||
}
|
||||
|
||||
bool is_dismissed() const { return dismissed; }
|
||||
|
||||
Reference in New Issue
Block a user