Campaign Difficulty: consolidated both lines into a single label

This commit is contained in:
Charles Dang 2018-05-29 20:55:34 +11:00
parent 90fc8cf9b6
commit 803d206cd2
2 changed files with 18 additions and 46 deletions

View file

@ -171,44 +171,13 @@
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[grid]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "label"
definition = "default_large"
[/label]
[/column]
[/row]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "description"
definition = "default"
[/label]
[/column]
[/row]
[/grid]
[label]
id = "label"
definition = "default_large"
[/label]
[/column]

View file

@ -135,17 +135,20 @@ void campaign_difficulty::pre_show(window& window)
item["use_markup"] = "true";
item["label"] = d["label"];
std::ostringstream ss;
ss << d["label"] << "\n<small>";
if(d["old_markup"].to_bool() || d["description"].empty()) {
ss << d["description"];
} else {
ss << font::span_color(font::GRAY_COLOR) << "(" << d["description"].str() << ")</span>";
}
ss << "</small>";
item["label"] = ss.str();
data.emplace("label", item);
const std::string descrip_text = d["old_markup"].to_bool() || d["description"].empty()
? d["description"]
: (formatter() <<
font::span_color(font::GRAY_COLOR) << "(" << d["description"].str() << ")</span>").str();
item["label"] = descrip_text;
data.emplace("description", item);
grid& grid = list.add_row(data);
if(d["default"].to_bool(false)) {