A bid on a listed player can be taken back
transfer.submit {action: withdrawBid, listingId} removes the manager's bid
before the seller decides. The orders list of the transfer market does it
with its delete button.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ec8295c84
commit
83bd96c1ff
9 files changed
+77
-4
No files matched your search
@@ -469,6 +469,17 @@ bool App::engine_transfer_action(const std::string &action,
|
||||
close_transfer();
|
||||
return true;
|
||||
}
|
||||
if (action == "transfer-order-delete" && target) {
|
||||
// an order of the list is the manager's bid on a listed player: it can be taken back
|
||||
const int index = target->GetAttribute<int>("data-index", -1);
|
||||
const auto &orders = engine_transfer_value_.at("orders");
|
||||
if (index < 0 || size_t(index) >= orders.size()) return true;
|
||||
const Json draft = {{"kind", "withdrawBid"}, {"player", orders[size_t(index)].at("player")}, {"listing", orders[size_t(index)].at("listing")}};
|
||||
transfer_dialog_.clear(); // the question lies under the list otherwise
|
||||
confirmation("Das Gebot für " + orders[size_t(index)].at("name").get<std::string>() + " zurückziehen?", [send, draft] { send(draft); });
|
||||
popup_accept_ = "Zurückziehen";
|
||||
return true;
|
||||
}
|
||||
if (action == "transfer-orders") {
|
||||
transfer_dialog_ = "orders";
|
||||
transfer_return_focus_ = target->GetId();
|
||||
|
||||
Reference in new issue
Block a user