Show key descriptions with Polish letters

The game's key file has its descriptions stripped of them. Where a
description is the bundled one without the letters, the bundled one is
shown; the file itself is left as it is.
This commit is contained in:
maj00r
2026-10-04 19:41:47 +02:00
parent 4da5991c13
commit dcbd6078b9
3 changed files with 68 additions and 2 deletions

View File

@@ -886,7 +886,7 @@ public partial class Settings : UserControl, ISettingsCapture
private static bool MatchesFilter(KeyBinding b, string filter) =>
TextMatch.Contains(b.Command, filter) ||
TextMatch.Contains(b.Description, filter);
TextMatch.Contains(KeyboardConfig.Instance.DescriptionOf(b), filter);
private Control BuildBindingRow(KeyBinding b, HashSet<string> conflicts)
{
@@ -1384,7 +1384,7 @@ public partial class Settings : UserControl, ISettingsCapture
}
private static string CommandLabel(KeyBinding b) =>
string.IsNullOrEmpty(b.Description) ? b.Command : Capitalize(b.Description);
KeyboardConfig.Instance.DescriptionOf(b) is { Length: > 0 } description ? Capitalize(description) : b.Command;
private static string Capitalize(string s) =>
string.IsNullOrEmpty(s) ? s : char.ToUpperInvariant(s[0]) + s.Substring(1);