Transfer market: the search dialog behind Suchen and Vorschlag; asking fee display follows Diamond 3.7
TransferMarketScreen gets the dialog of the original (KB/69.VGA panel at 184,20, seven bar rows from the EXE table, click rules of sub_19409, confirm button, price estimate). Suchen opens it with the stored profile, Vorschlag with the suggestion the squad asks for (computed in the projection). Closing posts a store_search_profile request; the controller stores it and announces the matching listings through the notice presenter, like the original's message boxes. Right button or Esc leaves with the search switched off. Controller test drives the whole route. The market list showed the asking fee scaled by 0x30d4 (older Diamond); 3.7 rounds to 10000 (sub_3C940), now also in the projection. Four tests computed the old base and follow. Fixes #79 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
933567232e
commit
0a95dbcba6
12 files changed
+255
-17
No files matched your search
@@ -542,6 +542,34 @@ void serve_transfer_action(ui::StartupFlow& flow, CareerSession& session,
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Search dialog closed (Suchen / Vorschlag): store the profile; with apply, the listings that fit are announced one
|
||||
// by one through the notice presenter, like the original's message boxes. Only a changed profile raises the revision.
|
||||
if (request.kind == ui::TransferMarketRequestKind::store_search_profile) {
|
||||
if (entry_policy != HumanBuyerMarketEntryPolicy::normal_interactive) {
|
||||
flow.reject_preparation_action("Der Original-Suchdialog ist in diesem Einstieg nicht verfügbar.");
|
||||
return;
|
||||
}
|
||||
std::string error;
|
||||
const uint64_t before = revision;
|
||||
const bool stored = TransferActions(session).apply(revision, [&] {
|
||||
const auto result = session.dispatch_search_profile(request.manager_slot, request.search_profile,
|
||||
request.search_cancelled, request.search_apply, revision, error);
|
||||
if (!result) return false;
|
||||
if (presenters.notice)
|
||||
for (const auto& hit : result->hits)
|
||||
presenters.notice(session.state(), HumanBuyerSaleNotice{request.manager_slot, hit.entry, -1,
|
||||
::bmh::layout::Month_SearchProfileNews_TextPointer3, hit.message, 0x40});
|
||||
return true;
|
||||
});
|
||||
if (!stored) {
|
||||
flow.reject_preparation_action("Das Suchprofil konnte nicht gespeichert werden.");
|
||||
} else if (revision != before) {
|
||||
flow.acknowledge_preparation(session.preparation_projection(revision), {});
|
||||
} else {
|
||||
flow.acknowledge_unchanged_transfer_market();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// All other kinds (bid, list, review offers): run through TransferActions::market with the
|
||||
// sale hooks. The notice presenter is wrapped to remember whether a notice was shown, so the
|
||||
// callback can keep the original notice/acknowledge order.
|
||||
|
||||
Reference in new issue
Block a user