Skip to content

Commit

Permalink
Sort effects alphabetically in help dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
blabber authored and jwrober committed Nov 5, 2024
1 parent 3c0a00a commit ae5cc22
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions common/helpdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,9 @@ void boot_help_texts(const nation_set *nations_to_show,
}
multipliers_iterate_end;
break;
case HELP_EFFECT:
case HELP_EFFECT: {
std::list<help_item *> effect_help;

for (int i = 0; i < EFT_COUNT; ++i) {
auto effects = get_effects(static_cast<effect_type>(i));
if (effect_list_size(effects) > 0) {
Expand Down Expand Up @@ -1034,10 +1036,16 @@ void boot_help_texts(const nation_set *nations_to_show,
effect_list_iterate_end;

pitem->text = qstrdup(qUtf8Printable(all_text));
help_nodes->append(pitem);
effect_help.push_back(pitem);
}
}

effect_help.sort(help_item_compar);
for (auto pitem : effect_help) {
help_nodes->append(pitem);
}
break;
}
default:
qCritical("Bad current_type: %d.", current_type);
break;
Expand Down

0 comments on commit ae5cc22

Please sign in to comment.