From 926bf718144d70957fb0e92d4b2a36d5bd678cf2 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:02:40 +0200 Subject: [PATCH] make townhall clickable --- client/windows/CCastleInterface.cpp | 4 ++++ client/windows/CCastleInterface.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 20f0aef08..7c6e945a7 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -1286,6 +1286,10 @@ void CCastleInterface::recreateIcons() hall = std::make_shared(80, 413, town, true); fort = std::make_shared(122, 413, town, false); + fastTownHall = std::make_shared(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(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); diff --git a/client/windows/CCastleInterface.h b/client/windows/CCastleInterface.h index 353d96542..9ed063668 100644 --- a/client/windows/CCastleInterface.h +++ b/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 exit; std::shared_ptr split; + std::shared_ptr fastTownHall; std::shared_ptr fastArmyPurchase; std::vector> creainfo;//small icons of creatures (bottom-left corner);