Cut the comments from the refactored code

Three survive: why AppServices is hand-wired, the cp1250 registration trap, and
the IsDieselEngine note carried over from Physics.cs.
This commit is contained in:
maj00r
2026-09-04 22:24:54 +02:00
parent 7849ef9729
commit df21ec104f
60 changed files with 3 additions and 875 deletions

View File

@@ -3,13 +3,6 @@ using Avalonia.Controls;
namespace StarterNG.Controls;
/// <summary>
/// One line of the settings panel: label on the left, the control itself in the
/// middle, a value read-out on the right, and underneath the eu07.ini key this
/// row writes plus an optional description.
/// Replaces the hand-rolled StackPanel/DockPanel pattern that used to be repeated
/// for every setting.
/// </summary>
public class SettingRow : ContentControl
{
public static readonly StyledProperty<string?> LabelProperty =
@@ -18,12 +11,6 @@ public class SettingRow : ContentControl
public static readonly StyledProperty<string?> DescriptionProperty =
AvaloniaProperty.Register<SettingRow, string?>(nameof(Description));
/// <summary>
/// The eu07.ini key this row reads and writes, shown verbatim so a user can
/// match what they see here against the file, the wiki or a forum post. Rows
/// that are starter-only preferences carry their "starter.*" key just the
/// same; rows that write no key at all leave this empty.
/// </summary>
public static readonly StyledProperty<string?> ConfigKeyProperty =
AvaloniaProperty.Register<SettingRow, string?>(nameof(ConfigKey));
@@ -71,19 +58,12 @@ public class SettingRow : ContentControl
UpdatePseudoClasses();
}
/// <summary>
/// Drives the template: an empty label lets the control span the label column,
/// an empty description or value collapses that part of the row entirely.
/// </summary>
private void UpdatePseudoClasses()
{
PseudoClasses.Set(":no-label", string.IsNullOrEmpty(Label));
PseudoClasses.Set(":no-description", string.IsNullOrEmpty(Description));
PseudoClasses.Set(":no-key", string.IsNullOrEmpty(ConfigKey));
PseudoClasses.Set(":no-value", string.IsNullOrEmpty(ValueText));
// A read-only row is a label and a reading with no widget between them. The
// reading then takes the middle column too, so a long path ellipsises instead
// of demanding its full width from an Auto column and getting cut off.
PseudoClasses.Set(":no-content", Content is null);
}
}