Brighter version for the colors of the def% in the movement hint.

The previous one was really too dark.  Now 50% is pure yellow
(255,255,0) and each 10% difference remove 50 from red or green
depending the direction
This commit is contained in:
Ali El Gariani 2007-06-04 19:34:07 +00:00
parent d91150ca14
commit 6323b321c1

View file

@ -1783,10 +1783,13 @@ void display::draw_movement_info(const gamemap::location& loc)
#ifndef USE_TINY_GUI
const unit_map::const_iterator un = units_.find(route_.steps.front());
if(un != units_.end()) {
int def = 100 - un->second.defense_modifier(map_.get_terrain(loc));
const int def = 100 - un->second.defense_modifier(map_.get_terrain(loc));
std::stringstream def_text;
def_text << def << "%";
SDL_Color color = {255 - def, 105 + def, 0, 0};
int red = 255 - maximum<int>(def-50, 0)*5;
int green = 255 - maximum<int>(50-def, 0)*5;
int blue = 0;
SDL_Color color = {red, green, blue, 0};
draw_text_in_hex(loc, def_text.str(), font::SIZE_LARGE, color, 0.5, 0.5);
}