1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fixed #260, improvement for #250.

This commit is contained in:
Michał W. Urbańczyk 2011-05-25 22:44:02 +00:00
parent 528f0363a1
commit df062614d7
3 changed files with 15 additions and 7 deletions

View File

@ -488,11 +488,10 @@ void CTerrainRect::clickRight(tribool down, bool previousState)
{
int3 mp = whichTileIsIt();
if (!CGI->mh->map->isInTheMap(mp) || down != true)
return;
adventureInt->tileRClicked(mp);
if (CGI->mh->map->isInTheMap(mp) && down)
adventureInt->tileRClicked(mp);
}
void CTerrainRect::mouseMoved (const SDL_MouseMotionEvent & sEvent)
{
int3 tHovered = whichTileIsIt(sEvent.x,sEvent.y);

View File

@ -439,11 +439,15 @@ void CMessage::drawIWindow(CInfoWindow * ret, std::string text, int player)
int curh = SIDE_MARGIN;
int xOffset = (ret->pos.w - ret->text->pos.w)/2;
ret->text->moveBy(Point(xOffset, SIDE_MARGIN));
//blitTextOnSur (txtg, fontHeight, curh, ret->bitmap);
if(!ret->buttons.size() && !ret->components.size()) //improvement for very small text only popups -> center text vertically
{
if(ret->bitmap->h > ret->text->pos.h + 2*SIDE_MARGIN)
curh = (ret->bitmap->h - ret->text->pos.h)/2;
}
ret->text->moveBy(Point(xOffset, curh));
curh += ret->text->pos.h;

View File

@ -500,6 +500,11 @@ CInfoWindow::CInfoWindow(std::string Text, int player, const TCompsInfo &comps,
}
text = new CTextBox(Text, Rect(0, 0, 250, 100), 0, FONT_MEDIUM, CENTER, zwykly);
if(!text->slider)
{
text->pos.w = text->maxW;
text->pos.h = text->maxH;
}
text->redrawParentOnScrolling = true;
if(buttons.size())