浏览代码

gui stuff for bank

Laserlicht 1 年之前
父节点
当前提交
a15cd05da3
共有 2 个文件被更改,包括 13 次插入2 次删除
  1. 3 0
      Mods/vcmi/config/vcmi/english.json
  2. 10 2
      client/windows/CCastleInterface.cpp

+ 3 - 0
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:",

+ 10 - 2
client/windows/CCastleInterface.cpp

@@ -1061,8 +1061,16 @@ void CCastleBuildings::enterAnyThievesGuild()
 void CCastleBuildings::enterBank()
 {
 	std::vector<std::shared_ptr<CComponent>> components;
-	components.push_back(std::make_shared<CComponent>(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<CComponent>(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<CComponent>(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()