The stadium has a name of its own, and the name can be sold
A manager renames his stadium on the stadium page. On the advertising page three sponsors offer to buy the name for one to five years; the sponsor pays with every month change, the stadium is called after him, and until the contract ends it can be neither renamed nor sold again. The match sheet shows the name. Engine: naming_rights.hpp; read stadium (name, nameEditable, namingRights, namingOffers), commands stadium.rename and stadium.namingRights, live read stadiumName; saved in state/modern.json. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
83bd96c1ff
commit
2639f37def
26 files changed
+507
-9
No files matched your search
@@ -481,6 +481,27 @@ void App::engine_event(Rml::Event &event) {
|
||||
const auto action = node->GetAttribute<Rml::String>("data-action", ""), id = node->GetAttribute<Rml::String>("data-id", "");
|
||||
if (!popup_.empty()) {
|
||||
if(action=="balance-discard"){engine_balance_action(action,node);return;}
|
||||
if (action == "naming-accept") {
|
||||
const std::string offer = id;
|
||||
std::string name, terms;
|
||||
try {
|
||||
for (const auto &row : engine_data_.at("stadium").at("data").at("namingOffers"))
|
||||
if (row.value("id", std::string()) == offer) {
|
||||
name = row.value("name", std::string());
|
||||
terms = engine_price(row.at("monthly")) + " im Monat für " + std::to_string(row.value("months", 0) / 12) + (row.value("months", 0) == 12 ? " Jahr" : " Jahre");
|
||||
}
|
||||
} catch (const std::exception &) {}
|
||||
popup_.clear(); reset_popup(); confirm_ = {}; dirty_ = true;
|
||||
if (name.empty()) return;
|
||||
confirmation("Den Stadionnamen wirklich verkaufen? Das Stadion heißt dann " + name + " (" + terms + "). Bis zum Vertragsende lässt sich der Name nicht mehr ändern.", [this, offer] {
|
||||
try {
|
||||
engine_finance_submit(engine_naming_rights_command(engine_data_, offer, editor::new_id("request:ui-")));
|
||||
} catch (const std::exception &e) { message(e.what()); }
|
||||
});
|
||||
popup_title_ = "Namensrecht verkaufen";
|
||||
popup_accept_ = "Verkaufen";
|
||||
return;
|
||||
}
|
||||
if (action == "engine-offer-accept") {
|
||||
const auto player = engine_offer_player_;
|
||||
const int index = node->GetAttribute<int>("data-id", -1);
|
||||
|
||||
Reference in new issue
Block a user