1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge pull request #2310 from IvanSavenko/left_click_refactor

Left click input refactor
This commit is contained in:
Ivan Savenko
2023-07-13 13:03:06 +03:00
committed by GitHub
65 changed files with 384 additions and 425 deletions

View File

@@ -255,19 +255,16 @@ void CComponent::setSurface(std::string defName, int imgPos)
image = std::make_shared<CAnimImage>(defName, imgPos);
}
void CComponent::showPopupWindow()
void CComponent::showPopupWindow(const Point & cursorPosition)
{
if(!getDescription().empty())
CRClickPopup::createAndPush(getDescription());
}
void CSelectableComponent::clickLeft(tribool down, bool previousState)
void CSelectableComponent::clickPressed(const Point & cursorPosition)
{
if (down)
{
if(onSelect)
onSelect();
}
if(onSelect)
onSelect();
}
void CSelectableComponent::init()