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:
parent
d91150ca14
commit
6323b321c1
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue