소스 검색

make townhall clickable

Laserlicht 2 년 전
부모
커밋
926bf71814
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      client/windows/CCastleInterface.cpp
  2. 2 1
      client/windows/CCastleInterface.h

+ 4 - 0
client/windows/CCastleInterface.cpp

@@ -1286,6 +1286,10 @@ void CCastleInterface::recreateIcons()
 	hall = std::make_shared<CTownInfo>(80, 413, town, true);
 	fort = std::make_shared<CTownInfo>(122, 413, town, false);
 
+	fastTownHall = std::make_shared<CButton>(Point(80, 413), AnimationPath::builtin("ITMTL.def"), CButton::tooltip(), [&](){ builds->enterTownHall(); });
+	fastTownHall->setImageOrder(town->hallLevel() - 1, town->hallLevel() - 1, town->hallLevel() - 1, town->hallLevel() - 1);
+	fastTownHall->setAnimateLonelyFrame(true);
+
 	fastArmyPurchase = std::make_shared<CButton>(Point(122, 413), AnimationPath::builtin("itmcl.def"), CButton::tooltip(), [&](){ builds->enterToTheQuickRecruitmentWindow(); });
 	fastArmyPurchase->setImageOrder(town->fortLevel() - 1, town->fortLevel() - 1, town->fortLevel() - 1, town->fortLevel() - 1);
 	fastArmyPurchase->setAnimateLonelyFrame(true);

+ 2 - 1
client/windows/CCastleInterface.h

@@ -154,7 +154,6 @@ class CCastleBuildings : public CIntObject
 	void enterCastleGate();
 	void enterFountain(const BuildingID & building, BuildingSubID::EBuildingSubID subID, BuildingID upgrades);//Rampart's fountains
 	void enterMagesGuild();
-	void enterTownHall();
 
 	void openMagesGuild();
 	void openTownHall();
@@ -167,6 +166,7 @@ public:
 	~CCastleBuildings();
 
 	void enterDwelling(int level);
+	void enterTownHall();
 	void enterToTheQuickRecruitmentWindow();
 
 	void buildingClicked(BuildingID building, BuildingSubID::EBuildingSubID subID = BuildingSubID::NONE, BuildingID upgrades = BuildingID::NONE);
@@ -226,6 +226,7 @@ class CCastleInterface : public CStatusbarWindow, public IGarrisonHolder
 
 	std::shared_ptr<CButton> exit;
 	std::shared_ptr<CButton> split;
+	std::shared_ptr<CButton> fastTownHall;
 	std::shared_ptr<CButton> fastArmyPurchase;
 
 	std::vector<std::shared_ptr<CCreaInfo>> creainfo;//small icons of creatures (bottom-left corner);