1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* partial handling r-clicks on adv map

* minor fixes
This commit is contained in:
Michał W. Urbańczyk
2009-01-14 19:01:20 +00:00
parent b895fa35cb
commit a37ce5df9e
3 changed files with 44 additions and 2 deletions

View File

@ -435,6 +435,47 @@ endchkpt:
}
void CTerrainRect::clickRight(tribool down)
{
int3 mp = whichTileIsIt();
if ((mp.x<0)
|| (mp.y<0)
|| down != true
)
{
LOCPLINT->adventureInt->handleRightClick("",down,this);
return;
}
std::vector < const CGObjectInstance * > objs = LOCPLINT->cb->getBlockingObjs(mp);
if(!objs.size())
return;
const CGObjectInstance * obj = objs[objs.size()-1];
switch(obj->ID)
{
case 34:
{
CInfoPopup * ip = new CInfoPopup(graphics->heroWins[obj->subID],
LOCPLINT->current->motion.x-graphics->heroWins[obj->subID]->w,
LOCPLINT->current->motion.y-graphics->heroWins[obj->subID]->h,false
);
ip->activate();
break;
}
case 98:
{
CInfoPopup * ip = new CInfoPopup(graphics->townWins[obj->id],
LOCPLINT->current->motion.x-graphics->townWins[obj->id]->w,
LOCPLINT->current->motion.y-graphics->townWins[obj->id]->h,false
);
ip->activate();
break;
}
default:
{
LOCPLINT->adventureInt->handleRightClick(obj->getHoverText(),down,this);
break;
}
}
}
void CTerrainRect::mouseMoved (const SDL_MouseMotionEvent & sEvent)
{

View File

@ -10,6 +10,7 @@ ADVENTURE INTERFACE:
* smooth map scrolling on hero movement
* added water animation
* speed of scrolling map and hero movement can be adjusted in the System Options Window
* partial handling r-clicks on adventure map
TOWN INTERFACE:
* the scroll tab won't remain hanged to our mouse position if we move the mouse away from the scroll bar

View File

@ -1552,10 +1552,10 @@ CMapHandler::~CMapHandler()
delete map->defy[i];
for(int i=0; i < roadDefs.size(); i++)
delete delete roadDefs[i];
delete roadDefs[i];
for(int i=0; i < staticRiverDefs.size(); i++)
delete delete staticRiverDefs[i];
delete staticRiverDefs[i];
//TODO: delete border graphics
}