Map now has a color theme rather than random colors.
This commit is contained in:
parent
379060b8c7
commit
973495b687
4 changed files with 48 additions and 35 deletions
|
@ -217,20 +217,17 @@ void load_config(MapConfig& config, bool is_centered, std::string path, std::fun
|
|||
fmt::format("duplicate color for display={} key={}",
|
||||
(int)display, (std::string)key));
|
||||
|
||||
if(data.contains("foreground")) {
|
||||
auto fg = palette::get(data["foreground"]);
|
||||
config.colors.insert_or_assign(display, fg);
|
||||
} else {
|
||||
config.colors.insert_or_assign(display, DEFAULT_COLOR);
|
||||
}
|
||||
dbc::check(data.contains("foreground"),
|
||||
fmt::format("{} has no foreground", std::string(key)));
|
||||
|
||||
if(data.contains("background")) {
|
||||
auto bg = palette::get(data["background"]);
|
||||
config.backgrounds.insert_or_assign(display, bg);
|
||||
} else {
|
||||
sf::Color bg{0, 0, 0, 0};
|
||||
config.backgrounds.insert_or_assign(display, bg);
|
||||
}
|
||||
auto fg = palette::get(data["foreground"]);
|
||||
config.colors.insert_or_assign(display, fg);
|
||||
|
||||
dbc::check(data.contains("background"),
|
||||
fmt::format("{} has no background", std::string(key)));
|
||||
|
||||
auto bg = palette::get(data["background"]);
|
||||
config.backgrounds.insert_or_assign(display, bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue