misc_gui.c
changeset 1336 69391734ce23
parent 1329 6988419aa6f0
child 1341 f52b476be477
equal deleted inserted replaced
1335:a5f223b9f549 1336:69391734ce23
   629 	}
   629 	}
   630 }
   630 }
   631 
   631 
   632 void GuiShowTooltips(StringID string_id)
   632 void GuiShowTooltips(StringID string_id)
   633 {
   633 {
       
   634 	char buffer[512];
   634 	Window *w;
   635 	Window *w;
   635 	int right,bottom;
   636 	int right,bottom;
   636 	int x,y;
   637 	int x,y;
   637 
   638 
   638 	if (string_id == 0)
   639 	if (string_id == 0)
   643 		if (WP(w,tooltips_d).string_id == string_id)
   644 		if (WP(w,tooltips_d).string_id == string_id)
   644 			return;
   645 			return;
   645 		DeleteWindow(w);
   646 		DeleteWindow(w);
   646 	}
   647 	}
   647 
   648 
   648 	GetString(str_buffr, string_id);
   649 	GetString(buffer, string_id);
   649 	assert(strlen(str_buffr) < sizeof(str_buffr) - 1);
   650 
   650 
   651 	right = GetStringWidth(buffer) + 4;
   651 	right = GetStringWidth(str_buffr) + 4;
       
   652 
   652 
   653 	bottom = 14;
   653 	bottom = 14;
   654 	if (right > 200) {
   654 	if (right > 200) {
   655 		bottom += ((right - 4) / 176) * 10;
   655 		bottom += ((right - 4) / 176) * 10;
   656 		right = 200;
   656 		right = 200;