Table range calculator closes with the right button; no frame in the panorama
- The Von/Bis calculator of the league table is left with the right mouse button (as the Toto calculator), restoring the backdrop. - The stadium panorama draws no hover frame (the original draws none); the yellow frames stay on the main page (seat blocks, investments). Refs #64, #66. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
81ae6ad236
commit
f12857414e
3 files changed
+14
-7
No files matched your search
@@ -287,7 +287,12 @@ bool LeagueTableRangeDialog::activate_cell(int index) {
|
||||
|
||||
bool LeagueTableRangeDialog::pointer_down(int px, int py, bool right) {
|
||||
if (outcome_delivered_) return false;
|
||||
if (right) return true; // modal consumes RMB but does not infer Source event 8
|
||||
if (right) {
|
||||
// The right button leaves the calculator as event 8 does (as the Toto calculator); the exit
|
||||
// still waits for its final Present. The modal consumes the press either way.
|
||||
(void)cancel_from_source_event();
|
||||
return true;
|
||||
}
|
||||
if (dragging_) {
|
||||
pointer_x_ = px;
|
||||
pointer_y_ = py;
|
||||
|
||||
@@ -858,12 +858,6 @@ void StadiumScreen::render_panorama(Image& out) const {
|
||||
}
|
||||
if (periphery_hover_ < 0) return;
|
||||
const size_t object = size_t(periphery_hover_);
|
||||
{
|
||||
// the hit rectangle of the object under the pointer, framed in yellow as on the advertising page
|
||||
const size_t at = ::bmh::layout::Stadium_PeripheryObjectContains_ExecutableField + object * 8;
|
||||
const int left = exe_.u16(at), top = exe_.u16(at + 2), right = exe_.u16(at + 4), bottom = exe_.u16(at + 6);
|
||||
outline(out, left, top, right - left + 1, bottom - top + 1, 0x27);
|
||||
}
|
||||
copy_crop(out, periphery_overlay_, 8, 7, 26, 32, 180, 27);
|
||||
const bool busy = state_.days[object] != 0;
|
||||
const std::string title = texts_[text_id(::bmh::layout::Stadium_RenderPanorama_TextPointer + unsigned(object) * 4)] +
|
||||
|
||||
@@ -186,6 +186,14 @@ void test_toto_source_calculator(const std::filesystem::path& data) {
|
||||
check(cancelled_result && cancelled_result->result == TableRangeDialogResult::cancel,
|
||||
"Toto calculator cancel has no accepted payment value");
|
||||
|
||||
LeagueTableRangeDialog by_mouse(data, backdrop, TotoStakeDialogProfile{TableRangeTextMode::flat});
|
||||
(void)by_mouse.render(); (void)by_mouse.after_present();
|
||||
check(by_mouse.pointer_down(10, 10, true), "the right button is consumed by the calculator");
|
||||
check(by_mouse.render().pixels == backdrop.pixels, "the right button restores the owned backdrop");
|
||||
const auto by_mouse_result = by_mouse.after_present();
|
||||
check(by_mouse_result && by_mouse_result->result == TableRangeDialogResult::cancel,
|
||||
"the right button closes the calculator as a cancel");
|
||||
|
||||
TableRangeDialogProfile table_profile;
|
||||
table_profile.text_mode = TableRangeTextMode::flat;
|
||||
LeagueTableRangeDialog table(data, backdrop, table_profile);
|
||||
|
||||
Reference in new issue
Block a user