Copy and pasted a method similar to red_to_green, called blue_to_white.
This commit is contained in:
parent
0009ddbd63
commit
beb7fde5e9
3 changed files with 23 additions and 0 deletions
|
@ -37,6 +37,8 @@
|
|||
flag_rgb=flag_green
|
||||
red_green_scale="e60000,ff0000,ff4000,ff8000,ffc000,ffff00,c0ff00,80ff00,40ff00,00ff00,00e600"
|
||||
red_green_scale_text="c80000,dd0000,dd3700,dd6e00,dda500,dddd00,a5dd00,6edd00,37dd00,00dd00,00c800"
|
||||
blue_white_scale="00A0E1,FFFFFF,96FFFF,00CDCD,FF00E1,A91EFF,8B00ED,AA00FF"
|
||||
blue_white_scale_text="8B00ED,AA00FF,A91EFF,E11EFF,00A0FF,00CDCD,96FFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF"
|
||||
|
||||
footprint_prefix="footsteps/foot-normal,footsteps/foot-medium,footsteps/foot-slow"
|
||||
footprint_teleport_enter="footsteps/teleport-in.png"
|
||||
|
|
|
@ -103,6 +103,9 @@ namespace game_config
|
|||
std::vector<Uint32> red_green_scale;
|
||||
std::vector<Uint32> red_green_scale_text;
|
||||
|
||||
std::vector<Uint32> blue_white_scale;
|
||||
std::vector<Uint32> blue_white_scale_text;
|
||||
|
||||
double hp_bar_scaling = 0.666;
|
||||
double xp_bar_scaling = 0.5;
|
||||
|
||||
|
@ -234,6 +237,15 @@ namespace game_config
|
|||
red_green_scale_text.push_back(0x00FFFF00);
|
||||
}
|
||||
|
||||
blue_white_scale = string2rgb(v["blue_white_scale"]);
|
||||
if (blue_white_scale.empty()) {
|
||||
blue_white_scale.push_back(0x00FFFFFF);
|
||||
}
|
||||
blue_white_scale_text = string2rgb(v["blue_white_scale_text"]);
|
||||
if (blue_white_scale_text.empty()) {
|
||||
blue_white_scale_text.push_back(0x00FFFFFF);
|
||||
}
|
||||
|
||||
server_list.clear();
|
||||
foreach (const config &server, v.child_range("server"))
|
||||
{
|
||||
|
@ -330,4 +342,12 @@ namespace game_config
|
|||
return color_scale[lvl];
|
||||
}
|
||||
|
||||
Uint32 blue_to_white(int val, bool for_text){
|
||||
const std::vector<Uint32>& color_scale =
|
||||
for_text ? blue_white_scale_text : blue_white_scale;
|
||||
val = std::max<int>(0, std::min<int>(val, 100));
|
||||
int lvl = (color_scale.size()-1) * val / 100;
|
||||
return color_scale[lvl];
|
||||
}
|
||||
|
||||
} // game_config
|
||||
|
|
|
@ -153,6 +153,7 @@ namespace game_config
|
|||
*/
|
||||
|
||||
Uint32 red_to_green(int val, bool for_text = true);
|
||||
Uint32 blue_to_white(int val, bool for_text = true);
|
||||
|
||||
extern const version_info wesnoth_version;
|
||||
extern const version_info min_savegame_version;
|
||||
|
|
Loading…
Add table
Reference in a new issue