Ask whether to take a listed player off the market when selling him

VERKAUFEN on a player who stands on the transfer list only showed a message
when no offer had arrived yet. The original first asks whether the player
should be taken off the transfer market: yes frees the list slot (the player
stays in the squad), no continues to the offers. Controller and UI tests cover
both answers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-11-08 12:57:27 +01:00
1 parent adcaa9b569
commit 6aa7c4f4a2
8 files changed
+66 -10

No files matched your search

+30
View File
@@ -516,6 +516,36 @@ void check_transfer_market_controller(const std::filesystem::path& data) {
for (int e = 0; e < 40; ++e) listed_again |= (game.squad_slots.at(0xb70 + size_t(e)) & 0xfff) ==
(game.squad_slots.at(squad_range(before.runtime_club).first + size_t(row2)) & 0xfff);
check(listed_again, "the declined player stands on the transfer list again");
// VERKAUFEN on a listed player asks "Wollen Sie ... vom Transfermarkt holen?"; no keeps the listing, yes takes him off
const auto player_id = game.squad_slots.at(squad_range(before.runtime_club).first + size_t(row2)) & 0xfff;
const auto on_list = [&] {
for (int e = 0; e < 40; ++e) if ((game.squad_slots.at(0xb70 + size_t(e)) & 0xfff) == player_id) return true;
return false;
};
std::string asked;
bool answer = false;
relist_hooks.confirm = [&](const GameState&, int, const std::string& text) { asked = text; return answer; };
for (const bool yes : {false, true}) {
answer = yes; asked.clear();
auto selected = FlowResult{};
auto sell_again = flow.click(200, 207); // after a "no" the player is still selected
if (sell_again.request != FlowRequest::submenu_action) {
selected = flow.click(20, y2);
if (selected.request == FlowRequest::submenu_action) check(serve_relist(selected).empty(), "the listed player's preview is served");
sell_again = flow.click(200, 207);
}
check(sell_again.request == FlowRequest::submenu_action && std::holds_alternative<TransferMarketRequest>(sell_again.submenu_action) &&
std::get<TransferMarketRequest>(sell_again.submenu_action).kind == TransferMarketRequestKind::review_offers &&
std::get<TransferMarketRequest>(sell_again.submenu_action).ask_withdraw,
"selling a listed player starts the withdraw question even without offers");
const app::TransferOfferPresenter no_bid = [](const GameState&, const TransferOfferListView&) { return -1; };
check(app::serve_flow_request(flow, sell_again, session, data, data, 0x1789abcd, revision, playback, audio_session, false,
{}, no_bid, {}, {}, {}, {}, {}, {}, {}, app::PendingOfferEntryPolicy::legacy_unpresented, relist_hooks,
app::HumanBuyerMarketEntryPolicy::normal_interactive).empty(), "the withdraw question is served");
check(!asked.empty(), "the question 'vom Transfermarkt holen' was asked");
check(on_list() == !yes, yes ? "answering yes takes the player off the transfer list" : "answering no keeps the player on the list");
}
}
{ // the search dialog behind the buttons Suchen and Vorschlag (Source sub_19409)