From a15cd05da35aff0bac22cb46a9f6997331146023 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 4 Aug 2024 18:25:21 +0200 Subject: [PATCH] gui stuff for bank --- Mods/vcmi/config/vcmi/english.json | 3 +++ client/windows/CCastleInterface.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Mods/vcmi/config/vcmi/english.json b/Mods/vcmi/config/vcmi/english.json index 6eea25ce7..1ce59c60d 100644 --- a/Mods/vcmi/config/vcmi/english.json +++ b/Mods/vcmi/config/vcmi/english.json @@ -304,6 +304,9 @@ "vcmi.townHall.greetingCustomUntil" : " until next battle.", "vcmi.townHall.greetingInTownMagicWell" : "%s has restored your spell points to maximum.", + "vcmi.townStructure.bank.borrow" : "You enter the bank. A banker sees you and says: \"We have made a special offer for you. You can take a loan of 2500 gold from us for 5 days. You will have to repay 500 gold every day.\"", + "vcmi.townStructure.bank.payBack" : "You enter the bank. A banker sees you and says: \"You have already got your loan. Pay it back before taking a new one.\"", + "vcmi.logicalExpressions.anyOf" : "Any of the following:", "vcmi.logicalExpressions.allOf" : "All of the following:", "vcmi.logicalExpressions.noneOf" : "None of the following:", diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 4b95d91a8..8e620b614 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -1061,8 +1061,16 @@ void CCastleBuildings::enterAnyThievesGuild() void CCastleBuildings::enterBank() { std::vector> components; - components.push_back(std::make_shared(ComponentType::RESOURCE, GameResID::GOLD, 2500)); - LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"), [this](){ LOCPLINT->cb->triggerTownSpecialBuildingAction(town, BuildingSubID::BANK); }, nullptr, components); + if(town->bonusValue.second > 0) + { + components.push_back(std::make_shared(ComponentType::RESOURCE, GameResID(GameResID::GOLD), "-500/" + CGI->generaltexth->translate("core.genrltxt.64"))); + LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.payBack"), components); + } + else{ + + components.push_back(std::make_shared(ComponentType::RESOURCE, GameResID(GameResID::GOLD), 2500)); + LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this](){ LOCPLINT->cb->triggerTownSpecialBuildingAction(town, BuildingSubID::BANK); }, nullptr, components); + } } void CCastleBuildings::enterAnyMarket()