More buttons without a lasting state look pressed while held

Advertising offers and notices, the player card, the training camp booking and
notice, the file dialog (page button, overwrite question) and the bank notices
and credit fee question now draw the pressed look from the mouse press until
the release. Manager notices share source_dialog_button_at for their OK/Ja/Nein.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-11-08 18:36:48 +01:00
1 parent b6bc17a381
commit 551d564efb
14 files changed
+145 -48

No files matched your search

+6 -2
View File
@@ -575,7 +575,8 @@ Image ContractsScreen::render() const {
notice.body=utf8_to_original(state_.feedback);
notice.source_manager_flags=0x80;
draw_source_dialog(out,{widgets_,faces_,&badge_atlas_,font_,large_font_,
exe_,sprite_font_,texts_},notice,state_.gradient_text);
exe_,sprite_font_,texts_},notice,state_.gradient_text,
pressed_button_==3?std::optional<GameEndTaxDialog::Button>(GameEndTaxDialog::Button::acknowledge):std::nullopt);
}
return out;
}
@@ -589,7 +590,10 @@ Image ContractsScreen::render() const {
// release. Returns true when the picture changed.
bool ContractsScreen::press(int x, int y) {
int id = -1;
if (page_ == Page::player_offer || page_ == Page::team_premiums) {
if (page_ == Page::result) {
// OK of the manager's answer (id 3)
if (source_dialog_button_at(TaxDialogKind::acknowledgement, false, x, y) == GameEndTaxDialog::Button::acknowledge) id = 3;
} else if (page_ == Page::player_offer || page_ == Page::team_premiums) {
const bool team = page_ == Page::team_premiums && team_premium_mode_;
const auto selected = std::find_if(state_.players.begin(), state_.players.end(), [&](const auto& p) { return p.row == state_.selected_row; });
const int top = team || selected == state_.players.end() || selected->row >= 13 ? 22 : 130;