diff --git a/client/widgets/MiscWidgets.cpp b/client/widgets/MiscWidgets.cpp index 0e6f7d68e..4d5eff1d5 100644 --- a/client/widgets/MiscWidgets.cpp +++ b/client/widgets/MiscWidgets.cpp @@ -19,6 +19,7 @@ #include "../CGameInfo.h" #include "../PlayerLocalState.h" #include "../gui/WindowHandler.h" +#include "../eventsSDL/InputHandler.h" #include "../windows/CTradeWindow.h" #include "../widgets/TextControls.h" #include "../widgets/CGarrisonInt.h" @@ -180,7 +181,10 @@ LRClickableAreaOpenTown::LRClickableAreaOpenTown(const Rect & Pos, const CGTownI void LRClickableArea::clickPressed(const Point & cursorPosition) { if(onClick) + { onClick(); + GH.input().hapticFeedback(); + } } void LRClickableArea::showPopupWindow(const Point & cursorPosition) @@ -447,6 +451,15 @@ void CInteractableTownTooltip::init(const CGTownInstance * town) std::make_shared(town)->enterToTheQuickRecruitmentWindow(); } }); + fastTavern = std::make_shared(Rect(3, 2, 58, 64), [townId]() + { + std::vector towns = LOCPLINT->cb->getTownsInfo(true); + for(auto & town : towns) + { + if(town->id == townId && town->builtBuildings.count(BuildingID::TAVERN)) + LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE); + } + }); fastMarket = std::make_shared(Rect(143, 31, 30, 34), []() { std::vector towns = LOCPLINT->cb->getTownsInfo(true); diff --git a/client/widgets/MiscWidgets.h b/client/widgets/MiscWidgets.h index 3e277280c..021193e9a 100644 --- a/client/widgets/MiscWidgets.h +++ b/client/widgets/MiscWidgets.h @@ -135,6 +135,7 @@ class CInteractableTownTooltip : public CIntObject std::shared_ptr res2; std::shared_ptr garrison; + std::shared_ptr fastTavern; std::shared_ptr fastMarket; std::shared_ptr fastTownHall; std::shared_ptr fastArmyPurchase;