From befbcc6f769dc9ac588a5dd14890c923b48ad947 Mon Sep 17 00:00:00 2001 From: Tobias Rehbein Date: Tue, 5 Nov 2024 18:18:17 +0100 Subject: [PATCH 1/2] Sort effects alphabetically in help dialog --- common/helpdata.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/helpdata.cpp b/common/helpdata.cpp index d5652b2ac5..c1a272a390 100644 --- a/common/helpdata.cpp +++ b/common/helpdata.cpp @@ -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 effect_help; + for (int i = 0; i < EFT_COUNT; ++i) { auto effects = get_effects(static_cast(i)); if (effect_list_size(effects) > 0) { @@ -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; From 844807a98f7ecbaf30ab2c9040bfc46c702f7190 Mon Sep 17 00:00:00 2001 From: Tobias Rehbein Date: Tue, 5 Nov 2024 18:19:09 +0100 Subject: [PATCH 2/2] Display correct values for Output_Waste_by_Distance The `Output_Waste_by_Distance' values shown in the help dialog were 100 times too high. Closes #2434. --- common/effects.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/effects.cpp b/common/effects.cpp index bb54a9f954..c43c174742 100644 --- a/common/effects.cpp +++ b/common/effects.cpp @@ -1167,8 +1167,10 @@ QString effect_type_unit_text(effect_type type, int value) float factor = 1.0f + value / 1000.0f; return QString(PL_("**%1", "**%1", factor)).arg(factor); } - case EFT_OUTPUT_WASTE_BY_DISTANCE: - return QString(PL_("%1%/tile", "%1%/tile", value)).arg(value); + case EFT_OUTPUT_WASTE_BY_DISTANCE: { + float waste = value / 100.0f; + return QString(PL_("%1%/tile", "%1%/tile", waste)).arg(waste); + } case EFT_CITY_BUILD_SLOTS: return QString(PL_("%1 slot", "%1 slots", value)).arg(value); case EFT_MAX_TRADE_ROUTES: