1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Replaced clickLeft with clickPressed clickReleased methods

This commit is contained in:
Ivan Savenko
2023-07-08 14:33:04 +03:00
parent fa4a0004b2
commit ca889a5c2a
65 changed files with 372 additions and 420 deletions

View File

@ -41,23 +41,17 @@ void MapViewActions::setContext(const std::shared_ptr<IMapRendererContext> & con
this->context = context;
}
void MapViewActions::clickLeft(tribool down, bool previousState)
void MapViewActions::clickPressed(const Point & cursorPosition)
{
if(indeterminate(down))
return;
if(down == false)
return;
int3 tile = model->getTileAtPoint(GH.getCursorPosition() - pos.topLeft());
int3 tile = model->getTileAtPoint(cursorPosition - pos.topLeft());
if(context->isInMap(tile))
adventureInt->onTileLeftClicked(tile);
}
void MapViewActions::showPopupWindow()
void MapViewActions::showPopupWindow(const Point & cursorPosition)
{
int3 tile = model->getTileAtPoint(GH.getCursorPosition() - pos.topLeft());
int3 tile = model->getTileAtPoint(cursorPosition - pos.topLeft());
if(context->isInMap(tile))
adventureInt->onTileRightClicked(tile);