Add a new key "flag_rgb" in [faction]
(same use as for [unit_type] except that if missing, magenta is assumed)
This commit is contained in:
parent
68bb9dd937
commit
543d0afcf5
2 changed files with 11 additions and 2 deletions
|
@ -586,7 +586,11 @@ void connect::side::update_faction_combo()
|
|||
const std::string& name = (**faction)["name"];
|
||||
const std::string& icon = (**faction)["image"];
|
||||
if (!icon.empty()) {
|
||||
factions.push_back(IMAGE_PREFIX + icon + "~RC(magenta>" + lexical_cast<std::string>(colour_+1) + ")" + COLUMN_SEPARATOR + name);
|
||||
std::string rgb = (**faction)["flag_rgb"];
|
||||
if (rgb.empty())
|
||||
rgb = "magenta";
|
||||
|
||||
factions.push_back(IMAGE_PREFIX + icon + "~RC(" + rgb + ">" + lexical_cast<std::string>(colour_+1) + ")" + COLUMN_SEPARATOR + name);
|
||||
} else {
|
||||
factions.push_back(name);
|
||||
}
|
||||
|
|
|
@ -286,8 +286,13 @@ void wait::join_game(bool observe)
|
|||
{
|
||||
const std::string& name = (**side)["name"];
|
||||
const std::string& icon = (**side)["image"];
|
||||
|
||||
if (!icon.empty()) {
|
||||
choices.push_back(IMAGE_PREFIX + icon + "~RC(magenta>" +
|
||||
std::string rgb = (**side)["flag_rgb"];
|
||||
if (rgb.empty())
|
||||
rgb = "magenta";
|
||||
|
||||
choices.push_back(IMAGE_PREFIX + icon + "~RC(" + rgb + ">" +
|
||||
lexical_cast<std::string>(color+1) + ")" + COLUMN_SEPARATOR + name);
|
||||
} else {
|
||||
choices.push_back(name);
|
||||
|
|
Loading…
Add table
Reference in a new issue