fix rent calculation
This commit is contained in:
@@ -50,8 +50,10 @@ public:
|
||||
DiceModalGame(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager, int d1, int d2, const BoardTile* from, const BoardTile* to, Player* p, int count)
|
||||
: Game(width, height, renderer, gui, input_manager), dice1(d1), dice2(d2), from_tile(from), to_tile(to), players(p), players_count(count), dismissed(false) {}
|
||||
void init() override { dismissed = false; }
|
||||
Type get_type() const override { return Type::MONOPOLY_DICE; }
|
||||
bool update(const InputEvent& event) override {
|
||||
if (event.type == INPUT_BUTTON_0 || event.type == INPUT_BUTTON_1) {
|
||||
// Only B dismisses now, so A can still be used for "change action" (even if it does nothing here)
|
||||
if (event.type == INPUT_BUTTON_1) {
|
||||
dismissed = true;
|
||||
return true;
|
||||
}
|
||||
@@ -60,7 +62,11 @@ public:
|
||||
void draw() override {
|
||||
renderer->clear_buffer();
|
||||
|
||||
MonopolyBoardRenderer::draw_board_perimeter(renderer, width, height, players, players_count);
|
||||
MonopolyBoardRenderer::draw_board_perimeter(renderer, width, height, players, players_count, (to_tile ? -1 /* or some index */ : -1)); // Keep it simple for now or pass relevant pos
|
||||
// Let's pass the destination position to highlight it during the dice roll
|
||||
int target_pos = -1;
|
||||
for(int i=0; i<40; i++) if(&MONOPOLY_BOARD[i] == to_tile) target_pos = i;
|
||||
MonopolyBoardRenderer::draw_board_perimeter(renderer, width, height, players, players_count, target_pos);
|
||||
|
||||
// --- Inner UI (Center Area) ---
|
||||
int cw = width / 7;
|
||||
@@ -106,7 +112,7 @@ public:
|
||||
int btn_y = iy + ih - 35;
|
||||
renderer->draw_filled_rectangle(btn_x, btn_y, btn_w, btn_h, true, 1);
|
||||
renderer->set_text_color(false);
|
||||
renderer->draw_string_scaled(btn_x + 5, btn_y + 5, ">A CONTINUE", 2);
|
||||
renderer->draw_string_scaled(btn_x + 5, btn_y + 5, ">B CONTINUE", 2);
|
||||
renderer->set_text_color(true);
|
||||
}
|
||||
bool is_dismissed() const { return dismissed; }
|
||||
|
||||
Reference in New Issue
Block a user