Tavern also in infobox & haptics
This commit is contained in:
1 parent
5a84e7cd7f
commit
b89cdda718
2 files changed
+14
No files matched your search
@@ -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<CCastleBuildings>(town)->enterToTheQuickRecruitmentWindow();
|
||||
}
|
||||
});
|
||||
fastTavern = std::make_shared<LRClickableArea>(Rect(3, 2, 58, 64), [townId]()
|
||||
{
|
||||
std::vector<const CGTownInstance*> 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<LRClickableArea>(Rect(143, 31, 30, 34), []()
|
||||
{
|
||||
std::vector<const CGTownInstance*> towns = LOCPLINT->cb->getTownsInfo(true);
|
||||
|
||||
Reference in new issue
Block a user