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:
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user