tweaked look of tooltips

This commit is contained in:
uid68803 2004-01-29 18:34:23 +00:00
parent 4d0e4f42a6
commit 901fdd21a6
2 changed files with 9 additions and 4 deletions

View file

@ -166,10 +166,10 @@ report generate_report(TYPE type, const gamemap& map, const unit_map& units,
tooltip << font::LARGE_TEXT << translate_string_default(tod.id,tod.name) << "\n"
<< translate_string("lawful") << " " << string_table["units"] << ": "
<< (tod.lawful_bonus > 0 ? font::LARGE_TEXT : font::NULL_MARKUP) << tod.lawful_bonus << "%\n"
<< (tod.lawful_bonus > 0 ? "+" : "") << tod.lawful_bonus << "%\n"
<< translate_string("neutral") << " " << string_table["units"] << ": " << "0%\n"
<< translate_string("chaotic") << " " << string_table["units"] << ": "
<< (tod.lawful_bonus < 0 ? font::LARGE_TEXT : font::NULL_MARKUP) << (tod.lawful_bonus*-1) << "%";
<< (tod.lawful_bonus < 0 ? "+" : "") << (tod.lawful_bonus*-1) << "%";
res.tooltip = tooltip.str();
return res;
}

View file

@ -68,17 +68,22 @@ void draw_tooltip()
if(current_background == NULL)
return;
gui::draw_solid_tinted_rectangle(current_rect.x,current_rect.y,
current_rect.w,current_rect.h,
0,0,0,0.6,screen);
/*
gui::draw_solid_tinted_rectangle(current_rect.x,current_rect.y,
current_rect.w,current_rect.h,
180,180,0,1.0,screen);
gui::draw_rectangle(current_rect.x,current_rect.y,
current_rect.w-1,current_rect.h-1,0,screen);
*/
SDL_Rect text_area = get_text_size(current_message);
text_area.x = current_rect.x + current_rect.w/2 - text_area.w/2;
text_area.y = current_rect.y + current_rect.h/2 - text_area.h/2;
font::draw_text(display_,text_area,font_size,font::BLACK_COLOUR,
font::draw_text(display_,text_area,font_size,font::NORMAL_COLOUR,
current_message,text_area.x,text_area.y);
update_rect(current_rect);