瀏覽代碼

Fixed #260, improvement for #250.

Michał W. Urbańczyk 14 年之前
父節點
當前提交
df062614d7
共有 3 個文件被更改,包括 15 次插入7 次删除
  1. 3 4
      client/CAdvmapInterface.cpp
  2. 7 3
      client/CMessage.cpp
  3. 5 0
      client/GUIClasses.cpp

+ 3 - 4
client/CAdvmapInterface.cpp

@@ -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);

+ 7 - 3
client/CMessage.cpp

@@ -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;
 

+ 5 - 0
client/GUIClasses.cpp

@@ -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())