fix problems with refresh with messages (and probably other weird cases too)

This commit is contained in:
Jérémy Rosen 2006-03-03 12:35:23 +00:00
parent e669c579fa
commit 6d08bfdf1f
4 changed files with 8 additions and 2 deletions

View file

@ -109,6 +109,8 @@ SVN trunk (1.1.1+svn):
* Added ignore list on MP
* MP server only accepts nicks made from alphanumeric and underscore
characters
* force a refresh after calls to ONSCREEN scrolls, to avoid refresh
problems.
Version 1.1.1:
* campaigns

View file

@ -607,6 +607,7 @@ void unit_speak(const config& message_info, display& disp, const unit_map& units
{
for(unit_map::const_iterator i = units.begin(); i != units.end(); ++i) {
if(i->second.matches_filter(message_info)) {
disp.scroll_to_tile(i->first.x,i->first.y);
const surface surface(image::get_image(i->second.type().image_profile(),image::UNSCALED));
gui::show_dialog(disp,surface,i->second.underlying_description(),message_info["message"],gui::MESSAGE);

View file

@ -562,8 +562,11 @@ void display::scroll_to_tile(int x, int y, SCROLL_TYPE scroll_type, bool check_f
const int xpos = get_location_x(loc);
const int ypos = get_location_y(loc);
if ((scroll_type == ONSCREEN) && !outside_area(map_area(),xpos,ypos))
if ((scroll_type == ONSCREEN) && !outside_area(map_area(),xpos,ypos)) {
invalidate_all();
draw();
return;
}
const int speed = preferences::scroll_speed()*2;

View file

@ -107,7 +107,7 @@ public:
//it will also try to make it such that x2,y2 is on-screen but this
//is not guaranteed.
void scroll_to_tiles(int x1, int y1, int x2, int y2,
SCROLL_TYPE scroll_type=SCROLL, bool check_fogged=true);
SCROLL_TYPE scroll_type=ONSCREEN, bool check_fogged=true);
//scrolls to the leader of a certain side. This will normally be the playing team.
void scroll_to_leader(unit_map& units, int side);