Share the drawing of the wide push button between the dialogs

Transfer market, pitch, lineup, bank, offer editor, advertising, manager, player card,
player detail, club info, league pairings, other games, top scorers, stadium,
training, game end and the contract tabs drew the same button frame with their own
copies. They now call draw_wide_button_frame (ui/button_frame.hpp), which a test
compares pixel for pixel with the former drawing. Buttons whose drawing differs by a
pixel (statistics rankings, team statistics, opportunities, analytics) are left alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-11-08 19:04:28 +01:00
1 parent 23201fa637
commit 5b845fbab3
16 files changed
+156 -150

No files matched your search

+3 -7
View File
@@ -4,6 +4,7 @@
// views and converts button and row clicks into ClubInfoRequest values. It does not change the game itself.
#include "formats/executable_layout.hpp"
#include "ui/club_info.hpp"
#include "ui/button_frame.hpp"
#include <algorithm>
#include <array>
@@ -317,13 +318,8 @@ Image ClubInfoScreen::render() const {
const bool active = (x == 1 && pressed_button_ == (projection_.has_squad ? ClubInfoButton::view : ClubInfoButton::category)) ||
(x == 60 && pressed_button_ == ClubInfoButton::statistics) ||
(x == 120 && pressed_button_ == ClubInfoButton::category);
if (active) { const uint8_t base = out.at(x, 225); rect(out, x, 215, width + 1, 2, base); rect(out, x, 215, 2, height + 1, base); x += 2; }
else { rect(out, x + 2, 225, width, 2, 0x40); rect(out, x + width, 217, 2, height, 0x40); }
const int sy = active ? 44 : 74;
copy(out, widgets_, 24, sy, x, 215 + (active ? 2 : 0), 31, 10);
int at = 31, remain = width - 31;
while (remain > 20) { const int n = std::min(8, remain - 20); copy(out, widgets_, 24, sy + 10, x + at, 215 + (active ? 2 : 0), n, 10); at += n; remain -= n; }
copy(out, widgets_, 45 - remain, sy + 20, x + at, 215 + (active ? 2 : 0), remain, 10);
(void)height;
x += draw_wide_button_frame(out, widgets_, x, 215, width, active); // button_frame.hpp
if (!label.empty()) {
const int mode = exe_.u8(::bmh::layout::Advertising_Button_RuntimeField + int(active));
const int label_baseline = active ? 224 : 222;