mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-12-01 09:27:05 +01:00
Merge pull request #65 from MaSzyna-EU07/feat/settings-basic-advanced
Settings for new exe
This commit is contained in:
@@ -174,6 +174,50 @@ public class ConfigFileTests
|
||||
Assert.Equal(new[] { "// width 800", "endconfig", "// width 1920", "// height 600", "" }, Lines(config));
|
||||
}
|
||||
|
||||
private static readonly string[] Repeatable = { "network.server", "python.viewport" };
|
||||
|
||||
[Fact]
|
||||
public void A_key_set_twice_keeps_only_the_line_the_simulator_reads()
|
||||
{
|
||||
var config = ConfigFile.Parse("width 800\nheight 600\nWIDTH 1024\t// mine\nwidth 1920\nfullscreen yes\n");
|
||||
|
||||
var removed = config.RemoveDuplicates(Repeatable);
|
||||
|
||||
Assert.Equal(new[] { "height 600", "width 1920", "fullscreen yes", "" }, Lines(config));
|
||||
Assert.Equal("1920", config.GetRaw("width"));
|
||||
Assert.Equal(new[] { "width", "WIDTH" }, removed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Keys_the_simulator_takes_many_of_stay_every_one()
|
||||
{
|
||||
const string text = "network.server zmq tcp://a\nnetwork.server zmq tcp://b\npython.viewport a\npython.viewport b\n";
|
||||
var config = ConfigFile.Parse(text);
|
||||
|
||||
Assert.Empty(config.RemoveDuplicates(Repeatable));
|
||||
Assert.Equal(ConfigFile.Parse(text).ToText(), config.ToText());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Past_endconfig_and_in_comments_nothing_is_removed()
|
||||
{
|
||||
const string text = "width 800\nendconfig\nwidth 1920\nheight 1\nheight 2\n";
|
||||
var config = ConfigFile.Parse("// width 640\n/* width 700\nwidth 720 */\n" + text);
|
||||
|
||||
Assert.Empty(config.RemoveDuplicates(Repeatable));
|
||||
Assert.Equal("800", config.GetRaw("width"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_line_of_numbers_carrying_on_a_value_is_no_key_of_its_own()
|
||||
{
|
||||
const string text = "uarttune\n0 0 0\n0 0 0\nwidth 800\n";
|
||||
var config = ConfigFile.Parse(text);
|
||||
|
||||
Assert.Empty(config.RemoveDuplicates(Repeatable));
|
||||
Assert.Equal(ConfigFile.Parse(text).ToText(), config.ToText());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Without_endconfig_a_new_key_goes_at_the_end_as_it_did()
|
||||
{
|
||||
|
||||
@@ -71,17 +71,17 @@ public class ExternalIniTests
|
||||
[Fact]
|
||||
public void A_renderer_written_in_by_hand_while_the_starter_runs_survives_its_save()
|
||||
{
|
||||
// Notepad: "gfxrenderer vulkan", a word the starter does not offer.
|
||||
// Notepad: "gfxrenderer null", a word the starter does not offer.
|
||||
var installation = WithIni("gfxrenderer default\nfieldofview 45\n");
|
||||
Edited(installation, "gfxrenderer vulkan\nfieldofview 45\n");
|
||||
Edited(installation, "gfxrenderer null\nfieldofview 45\n");
|
||||
|
||||
installation.SettingsStore.Settings.FieldOfView = 60;
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
Assert.Contains("gfxrenderer vulkan", saved);
|
||||
Assert.Contains("gfxrenderer null", saved);
|
||||
Assert.Contains("fieldofview 60", saved);
|
||||
Assert.Equal("vulkan", installation.SettingsStore.Settings.RendererWord);
|
||||
Assert.Equal("null", installation.SettingsStore.Settings.RendererWord);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -188,8 +188,9 @@ public class ExternalIniTests
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
Assert.Contains("maxcabtexturesize 4096", saved);
|
||||
Assert.Contains("shadowtune 4096 250 400 300", saved);
|
||||
Assert.Contains("gfx.framebuffer.width 1920", saved);
|
||||
Assert.Contains("gfx.framebuffer.height 1080", saved);
|
||||
// The render scale is the simulator's own key now, at the whole window.
|
||||
Assert.Contains("gfx.buffer.percent 1", saved);
|
||||
Assert.DoesNotContain("\ngfx.framebuffer.width", "\n" + saved);
|
||||
Assert.Contains("fieldofview 50", saved);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,98 +13,199 @@ public class GraphicsPresetTests
|
||||
return installation.SettingsStore.Settings;
|
||||
}
|
||||
|
||||
private static SimulatorSettings AtHigh()
|
||||
private static SimulatorSettings At(GraphicsPreset preset)
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
GraphicsPreset.High.ApplyTo(settings);
|
||||
preset.ApplyTo(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
private static SimulatorSettings AtHigh() => At(GraphicsPreset.High);
|
||||
|
||||
/// <summary>The keys two renderings give different values, a key one leaves out at its default.</summary>
|
||||
private static IEnumerable<string> Differing(IReadOnlyDictionary<string, string> one, IReadOnlyDictionary<string, string> other)
|
||||
{
|
||||
string? Value(IReadOnlyDictionary<string, string> keys, string key) =>
|
||||
keys.TryGetValue(key, out string? value) ? value : SimulatorKeys.All.FirstOrDefault(k => k.Key == key)?.Default;
|
||||
return one.Keys.Union(other.Keys).Where(key => Value(one, key) != Value(other, key));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_keys_named_are_the_keys_a_level_sets()
|
||||
public void A_level_sets_no_key_but_those_it_names()
|
||||
{
|
||||
var store = new TestInstallation().SettingsStore;
|
||||
var low = Defaults().Copy();
|
||||
var top = Defaults().Copy();
|
||||
(GraphicsPreset.Minimal with { Extras = null }).ApplyTo(low);
|
||||
(GraphicsPreset.Ultra with { Extras = null, Top = null }).ApplyTo(top);
|
||||
var own = store.Render(Defaults());
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
Assert.Empty(Differing(own, store.Render(At(preset))).Except(GraphicsPreset.AllKeys));
|
||||
}
|
||||
|
||||
var lowKeys = store.Render(low);
|
||||
var topKeys = store.Render(top);
|
||||
var differing = lowKeys.Keys.Union(topKeys.Keys)
|
||||
.Where(key => lowKeys.GetValueOrDefault(key) != topKeys.GetValueOrDefault(key));
|
||||
[Fact]
|
||||
public void Every_key_of_a_level_belongs_to_one_part_or_to_the_anti_aliasing()
|
||||
{
|
||||
var inGroups = GraphicsGroup.All.SelectMany(group => group.Keys).ToList();
|
||||
|
||||
Assert.Equal(GraphicsPreset.Keys.OrderBy(k => k), differing.OrderBy(k => k));
|
||||
Assert.Equal(inGroups.Distinct(), inGroups);
|
||||
Assert.Empty(GraphicsPreset.All.SelectMany(preset => preset.Keys.Keys).Except(inGroups));
|
||||
}
|
||||
|
||||
// ── The scale ────────────────────────────────────────────────────────────
|
||||
|
||||
private static void Climbs(Func<GraphicsPreset, double> value, int repeatsAllowed)
|
||||
private static void Climbs(Func<GraphicsPreset, double> value)
|
||||
{
|
||||
var values = GraphicsPreset.All.Select(value).ToList();
|
||||
|
||||
Assert.Equal(values.OrderBy(v => v), values);
|
||||
Assert.True(values.Count - values.Distinct().Count() <= repeatsAllowed, string.Join(", ", values));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_slider_moves_from_level_to_level_as_far_as_it_has_steps_for_six()
|
||||
public void Every_part_of_the_picture_gets_better_or_stays_from_level_to_level()
|
||||
{
|
||||
// Sizes and filtering run out of steps above High.
|
||||
Climbs(p => p.TextureSize, 1);
|
||||
Climbs(p => p.CabTextureSize, 2);
|
||||
Climbs(p => p.Anisotropy, 1);
|
||||
Climbs(p => p.TextureSize);
|
||||
Climbs(p => p.CabTextureSize);
|
||||
Climbs(p => p.Anisotropy);
|
||||
Climbs(p => p.ShadowMap);
|
||||
Climbs(p => p.ShadowRange);
|
||||
Climbs(p => p.ShadowRank);
|
||||
Climbs(p => p.ReflectionsFidelity);
|
||||
Climbs(p => p.ReflectionsRate);
|
||||
Climbs(p => p.SplineFidelity);
|
||||
Climbs(p => p.DrawRangeFactor);
|
||||
Climbs(p => p.SmokeFidelity);
|
||||
|
||||
// Four steps or three for six levels.
|
||||
Climbs(p => (int)p.AntiAliasing, 2);
|
||||
Climbs(p => p.SmokeFidelity, 2);
|
||||
Climbs(p => p.SplineFidelity, 2);
|
||||
Climbs(p => p.ReflectionsFidelity, 3);
|
||||
Climbs(p => p.ShadowRank, 3);
|
||||
|
||||
// The simulator takes no more than its own 7 lights.
|
||||
Climbs(p => p.DynamicLights, 2);
|
||||
Climbs(p => p.DrawRangeFactor, 3);
|
||||
Climbs(p => p.CabShadowsRange, 1);
|
||||
|
||||
Climbs(p => p.ShadowMap, 2);
|
||||
Climbs(p => p.ShadowRange, 1);
|
||||
// The old starter's steps begin at once a second: the lower levels share it.
|
||||
Climbs(p => p.ReflectionsRate, 2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void No_step_up_a_scale_is_more_than_a_few_steps_of_its_slider()
|
||||
{
|
||||
// In steps of what the screen offers, so Ultra does not jump to the top from far below.
|
||||
var rates = GraphicsPreset.All.Select(p => Steps.IndexOf(SliderRanges.ReflectionUpdates, p.ReflectionsRate)).ToList();
|
||||
Assert.All(rates.Zip(rates.Skip(1)), step => Assert.InRange(step.Second - step.First, 0, 2));
|
||||
|
||||
foreach (Func<GraphicsPreset, int> fidelity in new Func<GraphicsPreset, int>[] { p => p.SmokeFidelity, p => p.SplineFidelity })
|
||||
foreach (string name in GraphicsPreset.Low.Keys.Keys)
|
||||
{
|
||||
var levels = GraphicsPreset.All.Select(fidelity).ToList();
|
||||
Assert.All(levels.Zip(levels.Skip(1)), step => Assert.InRange(step.Second - step.First, 0, 1));
|
||||
var key = SimulatorKeys.Named(name);
|
||||
Climbs(p => key.Kind switch
|
||||
{
|
||||
SimulatorKeyKind.Choice => key.ChoiceIndex(p.Keys[name]),
|
||||
SimulatorKeyKind.Toggle => SimulatorKey.ParseToggle(p.Keys[name]) ? 1 : 0,
|
||||
_ => key.ParseNumber(p.Keys[name])
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void High_is_the_simulators_own_but_where_that_is_the_bottom_of_a_scale()
|
||||
public void Every_level_sets_the_same_keys()
|
||||
{
|
||||
var store = new TestInstallation().SettingsStore;
|
||||
var own = store.Render(Defaults());
|
||||
var high = store.Render(AtHigh());
|
||||
|
||||
var differing = own.Keys.Union(high.Keys)
|
||||
.Where(key => own.GetValueOrDefault(key) != high.GetValueOrDefault(key));
|
||||
|
||||
Assert.Equal(new[] { "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.shadows.cab.range",
|
||||
"gfx.smoke.fidelity", "splinefidelity" }, differing.OrderBy(k => k));
|
||||
Assert.Equal(1, Defaults().SmokeFidelity);
|
||||
Assert.Equal(1, Defaults().SplineFidelity);
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
Assert.Equal(GraphicsPreset.High.Keys.Keys.OrderBy(k => k), preset.Keys.Keys.OrderBy(k => k));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_player_with_no_settings_of_their_own_starts_at_high()
|
||||
public void Every_value_of_a_level_is_one_its_row_offers()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
foreach (var (name, value) in preset.Keys)
|
||||
{
|
||||
var key = SimulatorKeys.Named(name);
|
||||
switch (key.Kind)
|
||||
{
|
||||
case SimulatorKeyKind.Choice:
|
||||
Assert.True(key.ChoiceIndex(value) >= 0, $"{preset.NameKey} {name} {value}");
|
||||
break;
|
||||
case SimulatorKeyKind.Number:
|
||||
Assert.InRange(key.ParseNumber(value), key.Minimum, key.Maximum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void High_is_the_simulators_own_but_for_the_smoke_and_the_track_curves()
|
||||
{
|
||||
var store = new TestInstallation().SettingsStore;
|
||||
|
||||
var differing = Differing(store.Render(Defaults()), store.Render(AtHigh()));
|
||||
|
||||
Assert.Equal(new[] { "gfx.smoke.fidelity", "splinefidelity" }, differing.OrderBy(k => k, StringComparer.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Very_high_is_not_everything_at_its_top()
|
||||
{
|
||||
var top = GraphicsPreset.VeryHigh;
|
||||
|
||||
Assert.True(top.AntiAliasing <= AntiAliasingMode.Msaa4);
|
||||
Assert.True(top.ShadowMap <= 4096);
|
||||
Assert.False(top.Keys.ContainsKey("gfx.raytracing"));
|
||||
Assert.NotEqual("ultra", top.Keys["gfx.clouds"]);
|
||||
Assert.NotEqual("ultra", top.Keys["gfx.fog.quality"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Low_draws_no_screen_space_effects()
|
||||
{
|
||||
Assert.Equal(AntiAliasingMode.Off, GraphicsPreset.Low.AntiAliasing);
|
||||
Assert.Equal("no", GraphicsPreset.Low.Keys["gfx.ssr"]);
|
||||
Assert.Equal("no", GraphicsPreset.Low.Keys["gfx.postfx.ao"]);
|
||||
Assert.Equal("no", GraphicsPreset.Low.Keys["gfx.contactshadows"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_level_sits_on_the_steps_the_screen_offers()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
Assert.True(Steps.IndexOf(Steps.Anisotropy, preset.Anisotropy) >= 0, preset.NameKey);
|
||||
Assert.True(Steps.IndexOf(SliderRanges.ReflectionUpdates, preset.ReflectionsRate) >= 0, preset.NameKey);
|
||||
Assert.True(Steps.IndexOf(SliderRanges.DrawRangeFactors, preset.DrawRangeFactor) >= 0, preset.NameKey);
|
||||
foreach (int size in new[] { preset.TextureSize, preset.CabTextureSize, preset.ShadowMap })
|
||||
Assert.True(size is >= 512 and <= 8192 && (size & (size - 1)) == 0, preset.NameKey);
|
||||
Assert.True(preset.CabTextureSize <= GraphicsRules.MaxCabTextureSize, preset.NameKey);
|
||||
Assert.True(preset.ShadowRange >= SimulatorSettings.ShadowRangeFloor(preset.ShadowMap), preset.NameKey);
|
||||
Assert.True(preset.ShadowRange <= GraphicsRules.MaxShadowRange, preset.NameKey);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_leaves_the_screen_and_the_matters_of_taste_as_they_are()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
settings.ChromaticAberration = false;
|
||||
settings.Smoke = false;
|
||||
settings.PythonScreens = false;
|
||||
settings.FieldOfView = 60;
|
||||
settings.BufferScalePercent = 75;
|
||||
settings.Backend = GraphicsBackend.OpenGL;
|
||||
|
||||
GraphicsPreset.VeryHigh.ApplyTo(settings);
|
||||
|
||||
Assert.False(settings.MotionBlur);
|
||||
Assert.False(settings.ChromaticAberration);
|
||||
Assert.False(settings.Smoke);
|
||||
Assert.False(settings.PythonScreens);
|
||||
Assert.Equal(60, settings.FieldOfView);
|
||||
Assert.Equal(75, settings.BufferScalePercent);
|
||||
Assert.Equal(GraphicsBackend.OpenGL, settings.Backend);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_applied_is_recognised_until_one_value_moves()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
var settings = At(preset);
|
||||
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
||||
|
||||
settings.Extra["gfx.ssr"] = preset.Keys["gfx.ssr"] == "high" ? "low" : "high";
|
||||
Assert.Null(GraphicsPreset.Matching(settings));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_is_recognised_with_its_words_written_as_numbers()
|
||||
{
|
||||
var settings = AtHigh();
|
||||
settings.Extra["gfx.ssr"] = "2";
|
||||
settings.Extra["gfx.lights.shadows"] = "2";
|
||||
|
||||
Assert.Same(GraphicsPreset.High, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
// ── The first start ──────────────────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void A_player_with_no_settings_of_their_own_starts_at_high_on_vulkan()
|
||||
{
|
||||
var installation = new TestInstallation();
|
||||
var store = installation.SettingsStore;
|
||||
@@ -118,8 +219,10 @@ public class GraphicsPresetTests
|
||||
var again = new TestInstallation(installation.Files).SettingsStore;
|
||||
again.Load();
|
||||
Assert.Same(GraphicsPreset.High, GraphicsPreset.Matching(again.Settings));
|
||||
// Nothing of an older starter to bring into the standard mode.
|
||||
Assert.Equal(GraphicsBackend.Vulkan, again.Settings.Backend);
|
||||
// Nothing of an older starter to bring into the standard mode, nor of an older layout.
|
||||
Assert.True(again.Settings.MovedToStandard);
|
||||
Assert.Equal(SimulatorSettings.CurrentRevision, again.Settings.Revision);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -159,369 +262,62 @@ public class GraphicsPresetTests
|
||||
Assert.Equal(first, installation.Files.ReadAllText(copy));
|
||||
}
|
||||
|
||||
// ── Ray tracing ──────────────────────────────────────────────────────────
|
||||
|
||||
[Theory]
|
||||
[InlineData("no", "500", RayTracing.Off)]
|
||||
[InlineData("no", "123", RayTracing.Off)]
|
||||
[InlineData("yes", "250", 0)]
|
||||
[InlineData("yes", "500", 1)]
|
||||
[InlineData("yes", "1000", 2)]
|
||||
[InlineData("yes", "2000", 3)]
|
||||
public void Ray_tracing_is_off_or_at_the_level_of_its_reach(string enabled, string range, int level) =>
|
||||
Assert.Equal(level, RayTracing.LevelOf(enabled, range));
|
||||
|
||||
[Fact]
|
||||
public void Ultra_is_the_top_of_what_the_old_starter_offered()
|
||||
public void Ray_tracing_at_a_reach_no_level_has_is_at_none()
|
||||
{
|
||||
var ultra = GraphicsPreset.Ultra;
|
||||
|
||||
Assert.Equal(8192, ultra.TextureSize);
|
||||
Assert.Equal(GraphicsRules.MaxCabTextureSize, ultra.CabTextureSize);
|
||||
Assert.Equal(8192, ultra.ShadowMap);
|
||||
Assert.Equal(GraphicsRules.MaxShadowRange, ultra.ShadowRange);
|
||||
Assert.Equal(Steps.Anisotropy.Max(), ultra.Anisotropy);
|
||||
Assert.Equal(AntiAliasingMode.Msaa8, ultra.AntiAliasing);
|
||||
Assert.Equal(SliderRanges.ReflectionUpdates.Max(), ultra.ReflectionsRate);
|
||||
Assert.Equal(4, ultra.SmokeFidelity);
|
||||
Assert.Equal(4, ultra.SplineFidelity);
|
||||
Assert.Equal(SliderRanges.DrawRangeFactors.Max(), ultra.DrawRangeFactor);
|
||||
Assert.Equal(100, ultra.CabShadowsRange);
|
||||
|
||||
var extras = ultra.Extras!;
|
||||
Assert.Equal(200, extras.PythonUpdateMs);
|
||||
Assert.True(extras.MotionBlur && extras.ChromaticAberration && extras.Smoke);
|
||||
|
||||
Assert.True(ultra.Top!.Screens);
|
||||
Assert.Null(RayTracing.LevelOf("yes", "750"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void No_level_goes_past_what_the_old_starter_gave()
|
||||
public void Ray_tracing_is_off_by_default_and_its_levels_reach_further_one_by_one()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
Assert.True(preset.ShadowRange <= GraphicsRules.MaxShadowRange, preset.NameKey);
|
||||
Assert.True(preset.CabTextureSize <= GraphicsRules.MaxCabTextureSize, preset.NameKey);
|
||||
}
|
||||
Assert.Equal(RayTracing.Off, RayTracing.LevelOf(Defaults()));
|
||||
var ranges = RayTracing.Levels.Select(level => level.Range).ToList();
|
||||
Assert.Equal(ranges.OrderBy(r => r).Distinct(), ranges);
|
||||
var key = SimulatorKeys.Named(RayTracing.RangeKey);
|
||||
Assert.All(ranges, range => Assert.InRange(range, key.Minimum, key.Maximum));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void No_level_sets_what_only_the_advanced_mode_shows()
|
||||
public void Turned_off_ray_tracing_keeps_its_reach_for_the_next_time()
|
||||
{
|
||||
var set = GraphicsPreset.Keys.Concat(GraphicsExtras.Keys).Concat(GraphicsTop.Keys).ToList();
|
||||
var settings = Defaults().Copy();
|
||||
RayTracing.Apply(settings, 3);
|
||||
RayTracing.Apply(settings, RayTracing.Off);
|
||||
|
||||
// The rows of keys by name, the buffer and the resources are all the advanced mode's.
|
||||
Assert.Empty(set.Intersect(SimulatorKeys.All.Select(key => key.Key)));
|
||||
Assert.Empty(set.Intersect(new[] { "starter.bufferscale", "gfx.framebuffer.width", "gfx.framebuffer.height",
|
||||
"compresstex", "python.mipmaps", "gfx.skippipeline" }));
|
||||
Assert.Equal("no", settings.Extra[RayTracing.Key]);
|
||||
Assert.Equal("2000", settings.Extra[RayTracing.RangeKey]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_leaves_what_only_the_advanced_mode_shows_as_it_is()
|
||||
public void No_level_of_detail_turns_ray_tracing_on_or_off()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.BufferScalePercent = 80;
|
||||
settings.CompressTextures = false;
|
||||
settings.ScreenMipmaps = false;
|
||||
settings.Extra["basedrawrange"] = "3000";
|
||||
settings.Extra["targetfps"] = "60";
|
||||
|
||||
RayTracing.Apply(settings, 2);
|
||||
preset.ApplyTo(settings);
|
||||
|
||||
Assert.Equal(80, settings.BufferScalePercent);
|
||||
Assert.False(settings.CompressTextures);
|
||||
Assert.False(settings.ScreenMipmaps);
|
||||
Assert.Equal("3000", settings.Extra["basedrawrange"]);
|
||||
Assert.Equal("60", settings.Extra["targetfps"]);
|
||||
Assert.Equal(2, RayTracing.LevelOf(settings));
|
||||
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void At_ultra_the_shadows_are_longest()
|
||||
{
|
||||
// The bottom of that scale.
|
||||
Assert.Equal(0.2, GraphicsPreset.Ultra.Top!.ShadowAngleLimit);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ultra_undoes_what_was_moved_earlier()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.ShadowAngleLimit = 0.8;
|
||||
settings.IgnoreIrrelevantTrains = true;
|
||||
settings.PythonScreens = false;
|
||||
|
||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||
|
||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||
Assert.Equal(0.2, settings.ShadowAngleLimit);
|
||||
Assert.True(settings.PythonScreens);
|
||||
Assert.True(settings.IgnoreIrrelevantTrains);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ultra_leaves_the_screens_in_their_own_windows_to_the_player()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.Extra["python.displaywindows"] = "yes";
|
||||
|
||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||
|
||||
Assert.Equal("yes", settings.Extra["python.displaywindows"]);
|
||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_other_levels_leave_what_only_ultra_sets()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All.Where(preset => preset != GraphicsPreset.Ultra))
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.IgnoreIrrelevantTrains = true;
|
||||
settings.ShadowAngleLimit = 0.8;
|
||||
|
||||
preset.ApplyTo(settings);
|
||||
|
||||
Assert.True(settings.IgnoreIrrelevantTrains, preset.NameKey);
|
||||
Assert.Equal(0.8, settings.ShadowAngleLimit);
|
||||
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ultra_is_not_recognised_with_one_of_its_values_moved()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||
|
||||
settings.ReflectionsFramerate = 25;
|
||||
|
||||
Assert.Null(GraphicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Shadows_reach_further_with_every_level_that_has_them()
|
||||
{
|
||||
static double Reach(GraphicsPreset preset) =>
|
||||
SimulatorSettings.ShadowReach(preset.ShadowRange, preset.ShadowMap, legacyRenderer: false);
|
||||
|
||||
var reaches = GraphicsPreset.All.Where(preset => preset.Shadows).Select(Reach).ToList();
|
||||
|
||||
Assert.Equal(reaches.Distinct().OrderBy(reach => reach), reaches);
|
||||
Assert.Equal(250, Reach(GraphicsPreset.High));
|
||||
Assert.Equal(800, Reach(GraphicsPreset.VeryHigh));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Without_extras_the_settings_are_what_the_simulator_goes_by()
|
||||
{
|
||||
Assert.Equal(GraphicsExtras.None, GraphicsExtras.Of(Defaults()));
|
||||
Assert.Equal(GraphicsTop.None, GraphicsTop.Of(Defaults()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_leaves_what_only_the_lowest_one_sets()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
|
||||
GraphicsPreset.Low.ApplyTo(settings);
|
||||
|
||||
Assert.False(settings.MotionBlur);
|
||||
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_level_is_within_what_the_sliders_offer()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
Assert.True(preset.TextureSize >= SliderRanges.MinTextureSize, preset.NameKey);
|
||||
Assert.True(preset.ShadowMap >= SliderRanges.MinShadowMap, preset.NameKey);
|
||||
Assert.True(preset.DynamicLights >= SliderRanges.MinDynamicLights, preset.NameKey);
|
||||
Assert.Contains(preset.ReflectionsRate, SliderRanges.ReflectionUpdates);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_lowest_level_is_not_recognised_with_one_of_its_extras_undone()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
GraphicsPreset.Minimal.ApplyTo(settings);
|
||||
|
||||
settings.Smoke = true;
|
||||
|
||||
Assert.Null(GraphicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_extras_sit_on_the_steps_the_screen_offers()
|
||||
{
|
||||
foreach (var extras in new[] { GraphicsPreset.Minimal.Extras!, GraphicsPreset.Ultra.Extras! })
|
||||
Assert.Contains(extras.PythonUpdateMs, new[] { 200, 400, 800, 1600 });
|
||||
}
|
||||
|
||||
// ── Leaving an end of the scale ──────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void A_level_between_the_ends_chooses_only_its_own_keys()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
settings.ShadowAngleLimit = 0.8;
|
||||
|
||||
var applied = new GraphicsPresetMemory().Apply(GraphicsPreset.Medium, settings);
|
||||
|
||||
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
||||
Assert.False(settings.MotionBlur);
|
||||
Assert.Equal(0.8, settings.ShadowAngleLimit);
|
||||
Assert.Equal(GraphicsPreset.Keys, applied.ChosenKeys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Leaving_the_lowest_level_brings_back_what_was_there_before_it()
|
||||
{
|
||||
var memory = new GraphicsPresetMemory();
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
var before = GraphicsExtras.Of(settings);
|
||||
|
||||
var entering = memory.Apply(GraphicsPreset.Minimal, settings);
|
||||
Assert.Equal(GraphicsPreset.Minimal.Extras, GraphicsExtras.Of(settings));
|
||||
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys), entering.ChosenKeys);
|
||||
|
||||
var leaving = memory.Apply(GraphicsPreset.Medium, settings);
|
||||
|
||||
Assert.Equal(before, GraphicsExtras.Of(settings));
|
||||
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
||||
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys), leaving.ChosenKeys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Leaving_ultra_brings_back_what_was_there_before_it()
|
||||
{
|
||||
var memory = new GraphicsPresetMemory();
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
settings.ShadowAngleLimit = 0.8;
|
||||
var extras = GraphicsExtras.Of(settings);
|
||||
var top = GraphicsTop.Of(settings);
|
||||
|
||||
memory.Apply(GraphicsPreset.Ultra, settings);
|
||||
var applied = memory.Apply(GraphicsPreset.VeryHigh, settings);
|
||||
|
||||
Assert.Equal(extras, GraphicsExtras.Of(settings));
|
||||
Assert.Equal(top, GraphicsTop.Of(settings));
|
||||
Assert.Same(GraphicsPreset.VeryHigh, GraphicsPreset.Matching(settings));
|
||||
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys).Concat(GraphicsTop.Keys), applied.ChosenKeys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Leaving_an_end_chosen_before_this_run_gives_the_simulators_own_values()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||
|
||||
new GraphicsPresetMemory().Apply(GraphicsPreset.Low, settings);
|
||||
|
||||
Assert.Equal(GraphicsExtras.None, GraphicsExtras.Of(settings));
|
||||
Assert.Equal(GraphicsTop.None, GraphicsTop.Of(settings));
|
||||
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void One_end_to_the_other_keeps_what_was_there_before_either()
|
||||
{
|
||||
var memory = new GraphicsPresetMemory();
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
settings.ShadowAngleLimit = 0.8;
|
||||
var extras = GraphicsExtras.Of(settings);
|
||||
var top = GraphicsTop.Of(settings);
|
||||
|
||||
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||
memory.Apply(GraphicsPreset.Ultra, settings);
|
||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||
|
||||
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||
Assert.Same(GraphicsPreset.Minimal, GraphicsPreset.Matching(settings));
|
||||
// Ultra's own values go, Minimal has no say over them.
|
||||
Assert.Equal(top, GraphicsTop.Of(settings));
|
||||
|
||||
memory.Apply(GraphicsPreset.Medium, settings);
|
||||
Assert.Equal(extras, GraphicsExtras.Of(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void What_was_remembered_comes_back_only_once()
|
||||
{
|
||||
var memory = new GraphicsPresetMemory();
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
|
||||
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||
memory.Apply(GraphicsPreset.Medium, settings);
|
||||
Assert.False(settings.MotionBlur);
|
||||
|
||||
// Moved since, and no end left behind this time: it stays as moved.
|
||||
settings.MotionBlur = true;
|
||||
var applied = memory.Apply(GraphicsPreset.High, settings);
|
||||
|
||||
Assert.True(settings.MotionBlur);
|
||||
Assert.Equal(GraphicsPreset.Keys, applied.ChosenKeys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_applied_twice_at_an_end_remembers_what_came_before_the_first()
|
||||
{
|
||||
var memory = new GraphicsPresetMemory();
|
||||
var settings = Defaults().Copy();
|
||||
settings.MotionBlur = false;
|
||||
var before = GraphicsExtras.Of(settings);
|
||||
|
||||
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||
memory.Apply(GraphicsPreset.Low, settings);
|
||||
|
||||
Assert.Equal(before, GraphicsExtras.Of(settings));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_applied_is_recognised_until_one_value_moves()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
preset.ApplyTo(settings);
|
||||
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
||||
|
||||
settings.DynamicLights = 6;
|
||||
Assert.Null(GraphicsPreset.Matching(settings));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_level_sits_on_the_steps_the_screen_offers()
|
||||
{
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
{
|
||||
Assert.True(Steps.IndexOf(Steps.Anisotropy, preset.Anisotropy) >= 0, preset.NameKey);
|
||||
Assert.True(Steps.IndexOf(SliderRanges.ReflectionUpdates, preset.ReflectionsRate) >= 0, preset.NameKey);
|
||||
Assert.True(Steps.IndexOf(SliderRanges.DrawRangeFactors, preset.DrawRangeFactor) >= 0, preset.NameKey);
|
||||
foreach (int size in new[] { preset.TextureSize, preset.CabTextureSize, preset.ShadowMap })
|
||||
Assert.True(size is >= 512 and <= 8192 && (size & (size - 1)) == 0, preset.NameKey);
|
||||
Assert.True(preset.ShadowRange >= SimulatorSettings.ShadowRangeFloor(preset.ShadowMap), preset.NameKey);
|
||||
Assert.True(Steps.IndexOf(SliderRanges.CabShadowRanges, preset.CabShadowsRange) >= 0, preset.NameKey);
|
||||
}
|
||||
}
|
||||
|
||||
// ── A level for one part ─────────────────────────────────────────────────
|
||||
|
||||
private static GraphicsGroupLevels Groups() => new(new TestInstallation().SettingsStore);
|
||||
|
||||
[Fact]
|
||||
public void Every_key_a_level_sets_but_those_of_the_whole_belongs_to_one_part()
|
||||
{
|
||||
var inGroups = GraphicsGroup.All.SelectMany(group => group.Keys).ToList();
|
||||
|
||||
Assert.Equal(inGroups.Distinct(), inGroups);
|
||||
Assert.Empty(inGroups.Except(GraphicsPreset.Keys).Except(GraphicsExtras.Keys).Except(GraphicsTop.Keys));
|
||||
Assert.Equal(new[] { "dynamiclights", "gfx.extraeffects", "gfx.smoke.fidelity", "multisampling" },
|
||||
GraphicsPreset.Keys.Except(inGroups).OrderBy(key => key, StringComparer.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void One_part_moves_alone()
|
||||
{
|
||||
@@ -533,9 +329,10 @@ public class GraphicsPresetTests
|
||||
Assert.Equal(GraphicsPreset.Low.ShadowMap, moved.ShadowMapResolution);
|
||||
Assert.Equal(GraphicsPreset.Low.ShadowRange, moved.ShadowProjectionRange);
|
||||
Assert.Equal(GraphicsPreset.Low.ShadowRank, moved.ShadowRankCutoff);
|
||||
Assert.Equal("low", moved.Extra["gfx.lights.shadows"]);
|
||||
Assert.Equal(settings.MaxTextureSize, moved.MaxTextureSize);
|
||||
Assert.Equal(settings.DynamicLights, moved.DynamicLights);
|
||||
Assert.Equal(settings.BufferScalePercent, moved.BufferScalePercent);
|
||||
Assert.Equal(settings.Extra["gfx.ssr"], moved.Extra["gfx.ssr"]);
|
||||
Assert.Equal(settings.AntiAliasing, moved.AntiAliasing);
|
||||
|
||||
var levels = groups.LevelsOf(moved);
|
||||
Assert.Same(GraphicsPreset.Low, levels[GraphicsGroup.Shadows]);
|
||||
@@ -544,12 +341,10 @@ public class GraphicsPresetTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_part_shows_ultra_when_the_whole_is_at_ultra()
|
||||
public void Every_part_shows_the_level_the_whole_is_at()
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||
|
||||
Assert.All(Groups().LevelsOf(settings).Values, level => Assert.Same(GraphicsPreset.Ultra, level));
|
||||
foreach (var preset in GraphicsPreset.All)
|
||||
Assert.All(Groups().LevelsOf(At(preset)).Values, level => Assert.Same(preset, level));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -565,17 +360,15 @@ public class GraphicsPresetTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_part_at_a_level_and_the_rest_with_it_is_that_level()
|
||||
public void Every_part_at_a_level_and_the_anti_aliasing_with_it_is_that_level()
|
||||
{
|
||||
var groups = Groups();
|
||||
foreach (var level in GraphicsPreset.All.Where(level => level.Extras is null))
|
||||
foreach (var level in GraphicsPreset.All)
|
||||
{
|
||||
var settings = Defaults().Copy();
|
||||
foreach (var group in GraphicsGroup.All)
|
||||
settings = groups.Apply(group, level, settings);
|
||||
settings.AntiAliasing = level.AntiAliasing;
|
||||
settings.DynamicLights = level.DynamicLights;
|
||||
settings.SmokeFidelity = level.SmokeFidelity;
|
||||
|
||||
Assert.Same(level, GraphicsPreset.Matching(settings));
|
||||
}
|
||||
@@ -589,34 +382,4 @@ public class GraphicsPresetTests
|
||||
foreach (var level in GraphicsPreset.All)
|
||||
Assert.Same(level, groups.LevelsOf(groups.Apply(group, level, Defaults()))[group]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Leaving_an_end_in_a_part_gives_the_simulators_own_for_what_only_the_end_sets()
|
||||
{
|
||||
var groups = Groups();
|
||||
var settings = AtHigh();
|
||||
settings.ShadowAngleLimit = 0.8;
|
||||
|
||||
var ultra = groups.Apply(GraphicsGroup.Shadows, GraphicsPreset.Ultra, settings);
|
||||
Assert.Equal(0.2, ultra.ShadowAngleLimit);
|
||||
Assert.Same(GraphicsPreset.Ultra, groups.LevelsOf(ultra)[GraphicsGroup.Shadows]);
|
||||
|
||||
var back = groups.Apply(GraphicsGroup.Shadows, GraphicsPreset.High, ultra);
|
||||
Assert.Equal(GraphicsTop.None.ShadowAngleLimit, back.ShadowAngleLimit);
|
||||
Assert.Same(GraphicsPreset.High, groups.LevelsOf(back)[GraphicsGroup.Shadows]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_in_a_part_between_the_ends_leaves_what_only_an_end_sets()
|
||||
{
|
||||
var settings = AtHigh();
|
||||
settings.MotionBlur = false;
|
||||
|
||||
settings.Smoke = false;
|
||||
|
||||
var shadows = Groups().Apply(GraphicsGroup.Shadows, GraphicsPreset.VeryHigh, settings);
|
||||
Assert.False(shadows.Smoke);
|
||||
Assert.False(shadows.MotionBlur);
|
||||
Assert.Equal(GraphicsPreset.VeryHigh.ShadowMap, shadows.ShadowMapResolution);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,88 +37,95 @@ public class GraphicsSettingsTests
|
||||
private static string? Line(string text, string key) =>
|
||||
Lines(text).FirstOrDefault(l => l == key || l.StartsWith(key + " ", StringComparison.Ordinal));
|
||||
|
||||
// As application.cpp on master has them; a word the starter does not know is the file's own, written back as it is.
|
||||
// As utilities/Globals.cpp has them; a word the simulator does not know is the file's own, written back as it is.
|
||||
[Theory]
|
||||
[InlineData("default", "default")]
|
||||
[InlineData("full", "full")]
|
||||
[InlineData("gl46", "gl46")]
|
||||
[InlineData("vulkan", "vulkan")]
|
||||
[InlineData("vulkan14", "vulkan14")]
|
||||
[InlineData("legacy", "legacy")]
|
||||
[InlineData("simpleshader", "legacy")]
|
||||
[InlineData("off", "legacy")]
|
||||
[InlineData("simple", "simple")]
|
||||
[InlineData("experimental", "experimental")]
|
||||
public void A_renderer_is_written_by_the_name_master_knows(string read, string written)
|
||||
[InlineData("VULKAN14", "vulkan")]
|
||||
[InlineData("default", "default")]
|
||||
[InlineData("full", "default")]
|
||||
[InlineData("gl46", "default")]
|
||||
[InlineData("opengl", "default")]
|
||||
[InlineData("legacy", "default")]
|
||||
[InlineData("simple", "default")]
|
||||
[InlineData("experimental", "default")]
|
||||
[InlineData("null", "null")]
|
||||
public void A_renderer_is_written_by_the_name_the_simulator_reads_it_as(string read, string written)
|
||||
{
|
||||
Assert.Equal($"gfxrenderer {written}", Line(Write(Read($"gfxrenderer {read}\n")), "gfxrenderer"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Without_a_renderer_in_the_file_the_full_one_is_chosen()
|
||||
public void Without_a_renderer_in_the_file_vulkan_is_chosen_and_written()
|
||||
{
|
||||
Assert.Equal(0, Read("").RenderEngine);
|
||||
Assert.Equal("gfxrenderer default", Line(Write(Read("")), "gfxrenderer"));
|
||||
// The simulator's own is OpenGL: the starter writes Vulkan whatever the file had.
|
||||
Assert.Equal(GraphicsBackend.Vulkan, Read("").Backend);
|
||||
Assert.Equal("gfxrenderer vulkan", Line(Write(Read("")), "gfxrenderer"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void An_older_renderer_stays_chosen_and_can_be_chosen_again()
|
||||
public void Opengl_stays_chosen_and_vulkan_can_be_chosen_again()
|
||||
{
|
||||
var installation = WithIni("gfxrenderer legacy\n");
|
||||
var installation = WithIni("gfxrenderer default\n");
|
||||
var store = installation.SettingsStore;
|
||||
Assert.Equal(GraphicsBackend.OpenGL, store.Settings.Backend);
|
||||
|
||||
store.Settings.FieldOfView = 50;
|
||||
store.Save();
|
||||
Assert.Contains("gfxrenderer legacy", installation.Files.ReadAllText(UserIni));
|
||||
Assert.Contains("gfxrenderer default", installation.Files.ReadAllText(UserIni));
|
||||
|
||||
store.Settings.RenderEngine = SimulatorSettings.RenderEngineOf("simple");
|
||||
store.Settings.Backend = GraphicsBackend.Vulkan;
|
||||
store.Save();
|
||||
Assert.Contains("gfxrenderer simple", installation.Files.ReadAllText(UserIni));
|
||||
Assert.Equal("gfxrenderer vulkan", Line(installation.Files.ReadAllText(UserIni), "gfxrenderer"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Keys_only_the_legacy_renderer_or_windows_read_stay_in_the_file()
|
||||
public void Keys_the_simulator_no_longer_goes_by_are_taken_out_on_a_save()
|
||||
{
|
||||
string[] old =
|
||||
{
|
||||
"usevbo no", "gfx.angleplatform vulkan", "gfx.usegles yes", "gfx.shadows.cab.range 20"
|
||||
"usevbo no", "gfx.angleplatform vulkan", "gfx.usegles yes", "gfx.shadows.cab.range 20", "shadows yes",
|
||||
"skyenabled yes", "smoothtraction yes", "gfx.framebuffer.width 1280", "gfx.framebuffer.height 720",
|
||||
"starter.bufferscale 100"
|
||||
};
|
||||
var installation = WithIni(string.Join("\n", old) + "\n");
|
||||
installation.SettingsStore.Settings.FieldOfView = 50;
|
||||
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
Assert.All(old, line => Assert.Contains(line, saved));
|
||||
Assert.All(old, line => Assert.Null(Line(saved, line.Split(' ')[0])));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Keys_of_the_vulkan_renderer_master_does_not_have_stay_on_a_save()
|
||||
public void Keys_of_the_new_renderers_are_kept_as_the_file_has_them()
|
||||
{
|
||||
string[] vulkan =
|
||||
{
|
||||
"gfx.antialiasing dlss", "gfx.dlss.preset k", "gfx.framegeneration x2", "gfx.reflex on",
|
||||
"gfx.raytracing yes", "gfx.ssr high", "gfx.postfx.ao gtao", "gfx.clouds ultra", "gfx.grass yes",
|
||||
"gfx.buffer.percent 0.67", "gfx.vulkan.device RTX", "gfx.fog yes", "gfx.cabprobe medium"
|
||||
"gfx.buffer.percent 0.67", "gfx.vulkan.device RTX", "gfx.fog yes", "gfx.cabprobe medium", "gfx.gpucull no"
|
||||
};
|
||||
var installation = WithIni("calibratein 0 0 0 0\n" + string.Join("\n", vulkan) + "\n");
|
||||
var installation = WithIni("calibratein 0 0 0 0\nmultisampling 0\n" + string.Join("\n", vulkan) + "\n");
|
||||
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
Assert.Contains("calibratein 0 0 0 0", saved);
|
||||
// Written in by hand for a build that has that renderer: the starter does not know them, and leaves them.
|
||||
Assert.All(vulkan, line => Assert.Equal(line, Line(saved, line.Split(' ')[0])));
|
||||
Assert.Equal(AntiAliasingMode.Dlss, installation.SettingsStore.Settings.AntiAliasing);
|
||||
Assert.Equal(67, installation.SettingsStore.Settings.BufferScalePercent);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Levels_leave_the_switches_only_an_older_simulator_reads()
|
||||
public void The_faster_choices_the_simulator_does_not_make_itself_are_written()
|
||||
{
|
||||
var s = new SimulatorSettings { UseVbo = false, UseGLES = true, RenderAngleVulkan = true };
|
||||
var installation = WithIni("width 1280\n");
|
||||
|
||||
GraphicsPreset.Ultra.ApplyTo(s);
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
Assert.Equal((false, true, true), (s.UseVbo, s.UseGLES, s.RenderAngleVulkan));
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
foreach (var key in SimulatorKeys.All.Where(key => key.Writes))
|
||||
Assert.Equal($"{key.Key} {key.Default}", Line(saved, key.Key));
|
||||
Assert.Equal("gfx.gpucull yes", Line(saved, "gfx.gpucull"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -127,20 +134,40 @@ public class GraphicsSettingsTests
|
||||
[InlineData("multisampling 2\n", AntiAliasingMode.Msaa4)]
|
||||
[InlineData("multisampling 3\n", AntiAliasingMode.Msaa8)]
|
||||
[InlineData("", AntiAliasingMode.Msaa4)]
|
||||
public void Multisampling_is_read_as_master_reads_it(string text, AntiAliasingMode expected)
|
||||
[InlineData("gfx.antialiasing taa\n", AntiAliasingMode.Taa)]
|
||||
[InlineData("multisampling 3\ngfx.antialiasing taa\n", AntiAliasingMode.Taa)]
|
||||
[InlineData("gfx.antialiasing taa\nmultisampling 3\n", AntiAliasingMode.Msaa8)]
|
||||
[InlineData("multisampling 2\ngfx.antialiasing dlaa\n", AntiAliasingMode.Dlaa)]
|
||||
[InlineData("multisampling 1\ngfx.antialiasing off\n", AntiAliasingMode.Off)]
|
||||
public void The_anti_aliasing_is_read_from_the_key_further_down(string text, AntiAliasingMode expected)
|
||||
{
|
||||
Assert.Equal(expected, Read(text).AntiAliasing);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Multisampling_is_written_to_its_own_key_only()
|
||||
[Theory]
|
||||
[InlineData(AntiAliasingMode.Msaa2, "1", "msaax2")]
|
||||
[InlineData(AntiAliasingMode.Taa, "0", "taa")]
|
||||
[InlineData(AntiAliasingMode.Dlss, "0", "dlss")]
|
||||
[InlineData(AntiAliasingMode.Off, "0", "off")]
|
||||
public void The_anti_aliasing_is_written_to_both_keys(AntiAliasingMode mode, string multisampling, string word)
|
||||
{
|
||||
var s = Read("multisampling 1\n");
|
||||
string text = Write(new SimulatorSettings { AntiAliasing = mode });
|
||||
|
||||
string text = Write(s);
|
||||
Assert.Equal($"multisampling {multisampling}", Line(text, "multisampling"));
|
||||
Assert.Equal($"gfx.antialiasing {word}", Line(text, "gfx.antialiasing"));
|
||||
}
|
||||
|
||||
Assert.Equal("multisampling 1", Line(text, "multisampling"));
|
||||
Assert.Null(Line(text, "gfx.antialiasing"));
|
||||
[Fact]
|
||||
public void A_save_puts_the_newer_anti_aliasing_key_below_the_older()
|
||||
{
|
||||
var installation = WithIni("gfx.antialiasing msaax4\nwidth 1280\nmultisampling 2\n");
|
||||
installation.SettingsStore.Settings.AntiAliasing = AntiAliasingMode.Taa;
|
||||
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
var lines = Lines(installation.Files.ReadAllText(UserIni)).ToList();
|
||||
Assert.True(lines.IndexOf("gfx.antialiasing taa") > lines.IndexOf("multisampling 0"));
|
||||
Assert.Equal(AntiAliasingMode.Taa, Read(installation.Files.ReadAllText(UserIni)).AntiAliasing);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -154,113 +181,37 @@ public class GraphicsSettingsTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_render_scale_is_the_starters_own_key_or_the_framebuffer_against_the_window()
|
||||
public void The_render_scale_is_the_buffer_percent_or_what_an_older_starter_left()
|
||||
{
|
||||
Assert.Equal(50, Read("gfx.buffer.percent 0.5\n").BufferScalePercent);
|
||||
Assert.Equal(75, Read("gfx.buffer.percent 75\n").BufferScalePercent);
|
||||
Assert.Equal(75, Read("starter.bufferscale 75\n").BufferScalePercent);
|
||||
Assert.Equal(50, Read("width 1920\ngfx.framebuffer.width 960\n").BufferScalePercent);
|
||||
Assert.Equal(100, Read("").BufferScalePercent);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_render_scale_is_written_as_the_framebuffer_master_reads()
|
||||
public void The_render_scale_is_written_as_the_buffer_percent()
|
||||
{
|
||||
var s = Read("width 1920\nheight 1080\nstarter.bufferscale 50\n");
|
||||
|
||||
string text = Write(s);
|
||||
|
||||
Assert.Equal("gfx.framebuffer.width 960", Line(text, "gfx.framebuffer.width"));
|
||||
Assert.Equal("gfx.framebuffer.height 540", Line(text, "gfx.framebuffer.height"));
|
||||
Assert.Null(Line(text, "gfx.buffer.percent"));
|
||||
}
|
||||
|
||||
// Borderless, the simulator takes the window's size from the monitor (application.cpp) and
|
||||
// leaves width and height unread; -1 is its own word for a buffer of the window's size
|
||||
// (opengl33renderer.cpp).
|
||||
[Fact]
|
||||
public void A_borderless_screen_draws_into_a_buffer_of_the_windows_own_size()
|
||||
{
|
||||
var s = Read("fullscreenwindowed yes\nwidth 1280\nheight 720\n");
|
||||
|
||||
string text = Write(s);
|
||||
|
||||
Assert.Equal("gfx.framebuffer.width -1", Line(text, "gfx.framebuffer.width"));
|
||||
Assert.Equal("gfx.framebuffer.height -1", Line(text, "gfx.framebuffer.height"));
|
||||
Assert.Equal("width 1280", Line(text, "width"));
|
||||
Assert.Equal(100, Read(text).BufferScalePercent);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_borderless_screen_with_a_smaller_buffer_takes_its_part_of_the_monitor()
|
||||
{
|
||||
var s = Read("fullscreenwindowed yes\nfullscreenmonitor HDMI-1:1920,0\nwidth 1280\nheight 720\nstarter.bufferscale 50\n");
|
||||
var asked = new List<string>();
|
||||
var serializer = new SettingsSerializer(id =>
|
||||
{
|
||||
asked.Add(id);
|
||||
return (2560, 1440);
|
||||
});
|
||||
var c = new ConfigFile();
|
||||
|
||||
serializer.Write(s, c);
|
||||
|
||||
Assert.Equal("1280", c.GetRaw("gfx.framebuffer.width"));
|
||||
Assert.Equal("720", c.GetRaw("gfx.framebuffer.height"));
|
||||
Assert.Equal("50", c.GetRaw("starter.bufferscale"));
|
||||
Assert.Equal(new[] { "HDMI-1:1920,0" }, asked.Distinct());
|
||||
var read = new SimulatorSettings();
|
||||
serializer.Read(read, c);
|
||||
Assert.Equal(50, read.BufferScalePercent);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_borderless_screen_on_a_monitor_of_unknown_size_keeps_the_windows_own_buffer()
|
||||
{
|
||||
var s = Read("fullscreenwindowed yes\nwidth 1280\nheight 720\nstarter.bufferscale 50\n");
|
||||
var c = new ConfigFile();
|
||||
|
||||
new SettingsSerializer(_ => null).Write(s, c);
|
||||
|
||||
Assert.Equal("-1", c.GetRaw("gfx.framebuffer.width"));
|
||||
Assert.Equal("-1", c.GetRaw("gfx.framebuffer.height"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_buffer_of_the_window_left_in_a_borderless_file_goes_on_a_save()
|
||||
{
|
||||
// As this starter wrote it before: the size of the resolution row, which borderless does not use.
|
||||
var installation = WithIni("fullscreenwindowed yes\nwidth 1280\nheight 720\nstarter.bufferscale 100\n" +
|
||||
"gfx.framebuffer.width 1280\ngfx.framebuffer.height 720\n");
|
||||
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
Assert.Equal("gfx.framebuffer.width -1", Line(saved, "gfx.framebuffer.width"));
|
||||
Assert.Equal("gfx.framebuffer.height -1", Line(saved, "gfx.framebuffer.height"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_buffer_the_file_has_for_a_window_or_a_full_screen_stays_until_changed()
|
||||
{
|
||||
var installation = WithIni("fullscreenwindowed no\nwidth 1280\nheight 720\nstarter.bufferscale 100\n" +
|
||||
"gfx.framebuffer.width 1280\ngfx.framebuffer.height 720\n");
|
||||
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
string saved = installation.Files.ReadAllText(UserIni);
|
||||
Assert.Equal("gfx.framebuffer.width 1280", Line(saved, "gfx.framebuffer.width"));
|
||||
Assert.Equal("gfx.framebuffer.height 720", Line(saved, "gfx.framebuffer.height"));
|
||||
Assert.Equal("gfx.buffer.percent 0.5", Line(text, "gfx.buffer.percent"));
|
||||
Assert.Null(Line(text, "gfx.framebuffer.width"));
|
||||
Assert.Null(Line(text, "starter.bufferscale"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_is_recognised_after_it_is_applied_and_survives_a_save()
|
||||
{
|
||||
for (int engine = 0; engine < SimulatorSettings.RenderEngines.Length; engine++)
|
||||
foreach (var backend in new[] { GraphicsBackend.Vulkan, GraphicsBackend.OpenGL })
|
||||
{
|
||||
foreach (var level in GraphicsPreset.All)
|
||||
{
|
||||
var installation = WithIni("");
|
||||
var store = installation.SettingsStore;
|
||||
store.Settings.RenderEngine = engine;
|
||||
store.Settings.Backend = backend;
|
||||
level.ApplyTo(store.Settings);
|
||||
Assert.Same(level, GraphicsPreset.Matching(store.Settings));
|
||||
|
||||
@@ -270,6 +221,7 @@ public class GraphicsSettingsTests
|
||||
again.Environment.With("HOME", "/home/kolejarz");
|
||||
again.SettingsStore.Load();
|
||||
Assert.Same(level, GraphicsPreset.Matching(again.SettingsStore.Settings));
|
||||
Assert.Equal(backend, again.SettingsStore.Settings.Backend);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,7 +231,7 @@ public class GraphicsSettingsTests
|
||||
{
|
||||
var s = new SimulatorSettings();
|
||||
GraphicsPreset.High.ApplyTo(s);
|
||||
s.DynamicLights = 2;
|
||||
s.ShadowRankCutoff = 1;
|
||||
|
||||
Assert.Null(GraphicsPreset.Matching(s));
|
||||
}
|
||||
@@ -318,7 +270,7 @@ public class GraphicsSettingsTests
|
||||
Assert.True(installation.SettingsStore.ImportFrom("/backup/eu07.ini"));
|
||||
var s = installation.SettingsStore.Settings;
|
||||
Assert.Equal(60, s.FieldOfView);
|
||||
Assert.Equal(SimulatorSettings.RenderEngineOf("legacy"), s.RenderEngine);
|
||||
Assert.Equal(GraphicsBackend.OpenGL, s.Backend);
|
||||
Assert.Equal("eu07_local.exe", s.ExecutablePath);
|
||||
|
||||
// Nothing is written until saved, and the save keeps the user's own lines.
|
||||
|
||||
@@ -31,9 +31,13 @@ public class LocalizationTests
|
||||
var english = Strings(all.Single(l => l.Code == "en").Path);
|
||||
var other = Strings(all.Single(l => l.Code == code).Path);
|
||||
|
||||
// The developer tab's rows (Ini.*) and the words of their lists (Choice.*) come in English where a
|
||||
// language lacks them (SimulatorKeyRows), as the descriptions do.
|
||||
var missing = english.Keys
|
||||
.Where(key => !key.EndsWith("Desc", StringComparison.Ordinal) &&
|
||||
!key.StartsWith("Cmd.", StringComparison.Ordinal))
|
||||
!key.StartsWith("Cmd.", StringComparison.Ordinal) &&
|
||||
!key.StartsWith("Ini.", StringComparison.Ordinal) &&
|
||||
!key.StartsWith("Choice.", StringComparison.Ordinal))
|
||||
.Where(key => !other.ContainsKey(key));
|
||||
|
||||
Assert.Empty(missing);
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
using StarterNG.Domain.Settings;
|
||||
using StarterNG.Tests.Fakes;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
public class PhysicsPresetTests
|
||||
{
|
||||
private static SimulatorSettings Defaults()
|
||||
{
|
||||
var installation = new TestInstallation();
|
||||
installation.SettingsStore.Load();
|
||||
return installation.SettingsStore.Settings.Copy();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_simulators_own_physics_are_neither_arcade_nor_realistic()
|
||||
{
|
||||
Assert.Null(PhysicsPreset.Matching(Defaults()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_of_realism_applied_is_recognised_until_one_setting_moves()
|
||||
{
|
||||
foreach (var preset in PhysicsPreset.All)
|
||||
{
|
||||
var settings = Defaults();
|
||||
preset.ApplyTo(settings);
|
||||
Assert.Same(preset, PhysicsPreset.Matching(settings));
|
||||
|
||||
settings.CrashDamage = !settings.CrashDamage;
|
||||
Assert.Null(PhysicsPreset.Matching(settings));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Arcade_forgives_and_realistic_takes_the_physical_models()
|
||||
{
|
||||
var arcade = Defaults();
|
||||
PhysicsPreset.Arcade.ApplyTo(arcade);
|
||||
Assert.False(arcade.CrashDamage);
|
||||
Assert.False(arcade.LiveTraction);
|
||||
Assert.Equal(ConsistReadyOverride.AlwaysReady, arcade.ReadyOverride);
|
||||
Assert.Equal("off", arcade.Extra["physics.derailment"]);
|
||||
|
||||
var realistic = Defaults();
|
||||
PhysicsPreset.Realistic.ApplyTo(realistic);
|
||||
Assert.True(realistic.CrashDamage);
|
||||
Assert.Equal(ConsistReadyOverride.Scenery, realistic.ReadyOverride);
|
||||
Assert.Equal("yes", realistic.Extra["couplerphysics"]);
|
||||
Assert.Equal("new", realistic.Extra["physics.derailment"]);
|
||||
Assert.Equal("new", realistic.Extra["physics.collisions"]);
|
||||
Assert.Equal("auto", realistic.Extra["physics.trackbuckling"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_value_of_a_level_is_one_its_row_offers()
|
||||
{
|
||||
foreach (var preset in PhysicsPreset.All)
|
||||
foreach (var (name, value) in preset.Keys)
|
||||
Assert.True(SimulatorKeys.Named(name).ChoiceIndex(value) >= 0, $"{preset.NameKey} {name} {value}");
|
||||
Assert.All(PhysicsPreset.All.SelectMany(preset => preset.Keys.Keys), key => Assert.Contains(key, PhysicsPreset.AllKeys));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void No_level_of_realism_touches_the_picture_nor_a_level_of_detail_the_realism()
|
||||
{
|
||||
var settings = Defaults();
|
||||
GraphicsPreset.Low.ApplyTo(settings);
|
||||
PhysicsPreset.Realistic.ApplyTo(settings);
|
||||
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(settings));
|
||||
|
||||
GraphicsPreset.VeryHigh.ApplyTo(settings);
|
||||
Assert.Same(PhysicsPreset.Realistic, PhysicsPreset.Matching(settings));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("couplerphysics", "true", "yes")]
|
||||
[InlineData("couplerphysics", "1", "yes")]
|
||||
[InlineData("physics.derailment", "no", "off")]
|
||||
[InlineData("physics.trackbuckling", "no", "off")]
|
||||
[InlineData("couplerphysics", "no", "no")]
|
||||
public void A_word_the_simulator_takes_for_another_stands_for_it(string name, string raw, string word)
|
||||
{
|
||||
var key = SimulatorKeys.Named(name);
|
||||
Assert.Equal(key.ChoiceIndex(word), key.ChoiceIndex(raw));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_of_realism_survives_a_save()
|
||||
{
|
||||
var installation = new TestInstallation();
|
||||
var store = installation.SettingsStore;
|
||||
store.Load();
|
||||
PhysicsPreset.Realistic.ApplyTo(store.Settings);
|
||||
|
||||
store.Save();
|
||||
|
||||
var again = new TestInstallation(installation.Files).SettingsStore;
|
||||
again.Load();
|
||||
Assert.Same(PhysicsPreset.Realistic, PhysicsPreset.Matching(again.Settings));
|
||||
string saved = installation.Files.ReadAllText(store.SavePath);
|
||||
Assert.Contains("physics.derailment new", saved);
|
||||
Assert.Contains("couplerphysics yes", saved);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using StarterNG.Domain.Settings;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
public class RenderersTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("default", RendererKind.Modern)]
|
||||
[InlineData("full", RendererKind.Modern)]
|
||||
[InlineData("vulkan", RendererKind.Modern)]
|
||||
[InlineData("legacy", RendererKind.Legacy)]
|
||||
[InlineData("simple", RendererKind.Legacy)]
|
||||
[InlineData("simpleshader", RendererKind.Legacy)]
|
||||
[InlineData("OFF", RendererKind.Legacy)]
|
||||
public void A_renderer_word_draws_with_the_renderer_master_gives_it(string word, RendererKind kind) =>
|
||||
Assert.Equal(kind, Renderers.KindOf(word));
|
||||
}
|
||||
@@ -57,6 +57,34 @@ public class SettingsStoreTests
|
||||
Assert.Equal(UserIni, installation.SettingsStore.LoadedFrom);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_key_set_twice_in_the_players_ini_is_left_once_on_the_first_start()
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem()
|
||||
.WithFile(UserIni, "width 800\nheight 1080\nnetwork.server zmq a\nnetwork.server zmq b\nwidth 1920\n"));
|
||||
installation.SettingsStore.Load();
|
||||
|
||||
installation.SettingsStore.RemoveDuplicatesNow();
|
||||
|
||||
string saved = SavedLines(installation);
|
||||
Assert.DoesNotContain("width 800", saved);
|
||||
Assert.Contains("width 1920\n", saved);
|
||||
Assert.Contains("network.server zmq a\n", saved);
|
||||
Assert.Contains("network.server zmq b\n", saved);
|
||||
Assert.Equal(1920, installation.SettingsStore.Settings.Width);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void An_ini_setting_each_key_once_is_not_written_on_the_first_start()
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "width 1920\n"));
|
||||
installation.SettingsStore.Load();
|
||||
|
||||
installation.SettingsStore.RemoveDuplicatesNow();
|
||||
|
||||
Assert.Equal("width 1920\n", installation.Files.ReadAllText(UserIni));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_language_the_starter_does_not_ship_survives_a_round_trip()
|
||||
{
|
||||
@@ -923,13 +951,12 @@ public class SettingsStoreTests
|
||||
Assert.Equal(floor, SimulatorSettings.ShadowRangeFloor(mapSize));
|
||||
|
||||
[Theory]
|
||||
[InlineData(150, 1024, false, 150)]
|
||||
[InlineData(150, 4096, false, 300)]
|
||||
[InlineData(150, 4096, true, 150)]
|
||||
[InlineData(100, 8192, false, 1200)]
|
||||
[InlineData(400, 8192, false, 1600)]
|
||||
public void Shadows_reach_as_far_as_the_renderer_stretches_them(int range, int mapSize, bool legacy, int reach) =>
|
||||
Assert.Equal(reach, SimulatorSettings.ShadowReach(range, mapSize, legacy));
|
||||
[InlineData(150, 1024, 150)]
|
||||
[InlineData(150, 4096, 300)]
|
||||
[InlineData(100, 8192, 1200)]
|
||||
[InlineData(400, 8192, 1600)]
|
||||
public void Shadows_reach_as_far_as_the_renderer_stretches_them(int range, int mapSize, int reach) =>
|
||||
Assert.Equal(reach, SimulatorSettings.ShadowReach(range, mapSize));
|
||||
|
||||
[Theory]
|
||||
[InlineData("anisotropicfiltering 12")]
|
||||
@@ -947,10 +974,15 @@ public class SettingsStoreTests
|
||||
|
||||
[Theory]
|
||||
[InlineData("default")]
|
||||
[InlineData("full")]
|
||||
[InlineData("opengl")]
|
||||
[InlineData("gl46")]
|
||||
[InlineData("vulkan14")]
|
||||
[InlineData("simpleshader")]
|
||||
[InlineData("off")]
|
||||
[InlineData("legacy")]
|
||||
[InlineData("simple")]
|
||||
[InlineData("experimental")]
|
||||
public void A_renderer_word_the_simulator_reads_as_another_stays_until_changed(string word)
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, $"gfxrenderer {word}\n"));
|
||||
@@ -961,16 +993,11 @@ public class SettingsStoreTests
|
||||
Assert.Contains($"gfxrenderer {word}\n", SavedLines(installation));
|
||||
}
|
||||
|
||||
// A word the starter does not know is written in by hand for a build that has it, such as one with Vulkan:
|
||||
// shown, and left as it is until another renderer is chosen.
|
||||
// A word the starter does not know is written in by hand: "null" of the test runs, or one of a newer simulator.
|
||||
// Shown, and left as it is until another renderer is chosen.
|
||||
[Theory]
|
||||
[InlineData("full")]
|
||||
[InlineData("opengl")]
|
||||
[InlineData("gl46")]
|
||||
[InlineData("vulkan")]
|
||||
[InlineData("vulkan14")]
|
||||
[InlineData("experimental")]
|
||||
[InlineData("null")]
|
||||
[InlineData("whatever")]
|
||||
public void A_renderer_word_the_starter_does_not_know_stays_until_another_is_chosen(string word)
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, $"gfxrenderer {word}\nfieldofview 45\n"));
|
||||
@@ -983,60 +1010,61 @@ public class SettingsStoreTests
|
||||
store.Save();
|
||||
Assert.Contains($"gfxrenderer {word}\n", SavedLines(installation));
|
||||
|
||||
// Picking one from the list, even the full renderer it runs as, is a choice.
|
||||
// Picking one from the list, even the renderer it runs as, is a choice.
|
||||
store.Settings.RendererWord = null;
|
||||
store.Settings.RenderEngine = 0;
|
||||
store.Settings.Backend = GraphicsBackend.Vulkan;
|
||||
store.Save();
|
||||
Assert.Contains("gfxrenderer default\n", SavedLines(installation));
|
||||
Assert.Contains("gfxrenderer vulkan\n", SavedLines(installation));
|
||||
Assert.False(store.UnreadableValues().ContainsKey("gfxrenderer"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0, "default")]
|
||||
[InlineData(1, "legacy")]
|
||||
[InlineData(2, "simple")]
|
||||
public void A_chosen_renderer_is_saved_as_the_simulator_reads_it(int engine, string saved)
|
||||
[InlineData(GraphicsBackend.Vulkan, "vulkan")]
|
||||
[InlineData(GraphicsBackend.OpenGL, "default")]
|
||||
public void A_chosen_renderer_is_saved_as_the_simulator_reads_it(GraphicsBackend backend, string saved)
|
||||
{
|
||||
// application.cpp on master knows default, legacy and simple; "simpleshader" and "off"
|
||||
// from older starters are legacy, and any other word gets the full renderer.
|
||||
// utilities/Globals.cpp knows default (OpenGL 4.6) and vulkan; the words of the renderers it no longer has
|
||||
// it reads as default.
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "gfxrenderer simpleshader\n"));
|
||||
installation.SettingsStore.Load();
|
||||
installation.SettingsStore.Settings.RenderEngine = engine == 1 ? 0 : engine;
|
||||
installation.SettingsStore.Settings.Backend = backend == GraphicsBackend.Vulkan ? GraphicsBackend.OpenGL : GraphicsBackend.Vulkan;
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
installation.SettingsStore.Settings.RenderEngine = engine;
|
||||
installation.SettingsStore.Settings.Backend = backend;
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
Assert.Contains($"gfxrenderer {saved}\n", SavedLines(installation));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("full", 0)]
|
||||
[InlineData("gl46", 0)]
|
||||
[InlineData("opengl", 0)]
|
||||
[InlineData("vulkan", 0)]
|
||||
[InlineData("VULKAN14", 0)]
|
||||
[InlineData("whatever", 0)]
|
||||
[InlineData("experimental", 0)]
|
||||
[InlineData("simpleshader", 1)]
|
||||
public void A_renderer_word_stands_where_the_simulator_reads_it(string word, int engine)
|
||||
[InlineData("full", GraphicsBackend.OpenGL)]
|
||||
[InlineData("gl46", GraphicsBackend.OpenGL)]
|
||||
[InlineData("opengl", GraphicsBackend.OpenGL)]
|
||||
[InlineData("default", GraphicsBackend.OpenGL)]
|
||||
[InlineData("vulkan", GraphicsBackend.Vulkan)]
|
||||
[InlineData("VULKAN14", GraphicsBackend.Vulkan)]
|
||||
[InlineData("whatever", GraphicsBackend.OpenGL)]
|
||||
[InlineData("experimental", GraphicsBackend.OpenGL)]
|
||||
[InlineData("simpleshader", GraphicsBackend.OpenGL)]
|
||||
public void A_renderer_word_stands_where_the_simulator_reads_it(string word, GraphicsBackend backend)
|
||||
{
|
||||
Assert.Equal(engine, SimulatorSettings.RenderEngineOf(word));
|
||||
Assert.Equal(backend, SimulatorSettings.BackendOf(word));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_buffer_is_written_as_the_framebuffer_master_reads()
|
||||
public void The_buffer_is_written_as_the_simulator_reads_it()
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "width 1000\nheight 500\n"));
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni,
|
||||
"width 1000\nheight 500\ngfx.framebuffer.width 1000\ngfx.framebuffer.height 500\n"));
|
||||
installation.SettingsStore.Load();
|
||||
installation.SettingsStore.Settings.BufferScalePercent = 50;
|
||||
|
||||
installation.SettingsStore.Save();
|
||||
|
||||
string saved = SavedLines(installation);
|
||||
Assert.DoesNotContain("gfx.buffer.percent", saved);
|
||||
Assert.Contains("gfx.framebuffer.width 500\n", saved);
|
||||
Assert.Contains("gfx.framebuffer.height 250\n", saved);
|
||||
Assert.Contains("gfx.buffer.percent 0.5\n", saved);
|
||||
Assert.DoesNotContain("\ngfx.framebuffer.width", saved);
|
||||
Assert.DoesNotContain("\ngfx.framebuffer.height", saved);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -1046,8 +1074,9 @@ public class SettingsStoreTests
|
||||
[InlineData("gfx.framebuffer.width 500\n", 100)]
|
||||
[InlineData("starter.bufferscale 60\n", 60)]
|
||||
[InlineData("starter.bufferscale 60\nwidth 1000\ngfx.framebuffer.width 800\n", 60)]
|
||||
[InlineData("gfx.buffer.percent 0.5\n", 100)]
|
||||
public void The_buffer_is_read_from_the_starters_key_or_the_framebuffer(string ini, int percent)
|
||||
[InlineData("gfx.buffer.percent 0.5\n", 50)]
|
||||
[InlineData("gfx.buffer.percent 0.6\nstarter.bufferscale 80\n", 60)]
|
||||
public void The_buffer_is_read_from_the_simulators_key_or_what_an_older_starter_left(string ini, int percent)
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, ini));
|
||||
|
||||
@@ -1257,26 +1286,23 @@ public class SettingsStoreTests
|
||||
Assert.Equal(60, store.Settings.FieldOfView);
|
||||
}
|
||||
|
||||
// The move to the standard mode puts back the keys of the rows it hides: the row of the
|
||||
// render scale has the frame buffer's two, and the percent it is worked out from is the starter's own.
|
||||
// The render scale put back is the whole window, whichever way the file had it.
|
||||
[Theory]
|
||||
[InlineData("width 1920\nheight 1080\nstarter.bufferscale 50\ngfx.framebuffer.width 960\ngfx.framebuffer.height 540\n")]
|
||||
[InlineData("width 1920\nheight 1080\ngfx.buffer.percent 0.5\n")]
|
||||
[InlineData("width 1920\nheight 1080\nstarter.bufferscale 50\n")]
|
||||
[InlineData("width 1920\nheight 1080\ngfx.framebuffer.width 960\ngfx.framebuffer.height 540\n")]
|
||||
public void The_frame_buffer_put_back_takes_the_render_scale_with_it(string ini)
|
||||
public void The_render_scale_put_back_is_the_whole_window(string ini)
|
||||
{
|
||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, ini));
|
||||
var store = installation.SettingsStore;
|
||||
store.Load();
|
||||
Assert.Equal(50, store.Settings.BufferScalePercent);
|
||||
|
||||
var reset = store.WithDefaults(store.Settings, new[] { "gfx.framebuffer.width", "gfx.framebuffer.height" });
|
||||
var reset = store.WithDefaults(store.Settings, new[] { "gfx.buffer.percent" });
|
||||
|
||||
Assert.Equal(100, reset.BufferScalePercent);
|
||||
Assert.Equal(1920, reset.Width);
|
||||
var written = store.Render(reset);
|
||||
Assert.Equal("100", written["starter.bufferscale"]);
|
||||
Assert.Equal("1920", written["gfx.framebuffer.width"]);
|
||||
Assert.Equal("1080", written["gfx.framebuffer.height"]);
|
||||
Assert.Equal("1", store.Render(reset)["gfx.buffer.percent"]);
|
||||
}
|
||||
|
||||
// ── What the screen shows otherwise ──────────────────────────────────────
|
||||
@@ -1582,7 +1608,6 @@ public class SettingsStoreTests
|
||||
|
||||
[Theory]
|
||||
[InlineData("starter.gpu")]
|
||||
[InlineData("gfx.usegles")]
|
||||
public void The_move_to_the_standard_mode_keeps_what_lets_a_machine_run_the_simulator(string key) =>
|
||||
Assert.Contains(key, StarterNG.Application.SettingsStore.KeptOnMoveToStandard);
|
||||
|
||||
|
||||
@@ -47,6 +47,10 @@ public class SettingsUnknownValueTests
|
||||
|
||||
private static string? Shown(ComboBox list) => (list.SelectedItem as ComboBoxItem)?.Content as string;
|
||||
|
||||
private static SettingRow Row(StarterNG.Views.Settings page, string key) =>
|
||||
Avalonia.LogicalTree.LogicalExtensions.GetLogicalDescendants(page).OfType<SettingRow>()
|
||||
.First(row => row.ConfigKey == key);
|
||||
|
||||
private static string? Note(StarterNG.Views.Settings page, string key) =>
|
||||
Avalonia.LogicalTree.LogicalExtensions.GetLogicalDescendants(page).OfType<SettingRow>()
|
||||
.First(row => row.ConfigKey == key).UnknownValue;
|
||||
@@ -54,24 +58,97 @@ public class SettingsUnknownValueTests
|
||||
[Fact]
|
||||
public void A_renderer_word_is_on_the_list_chosen_and_saved_as_it_is()
|
||||
{
|
||||
WithPage(Standard + "gfxrenderer vulkan\nfieldofview 45\n", (page, _, saved) =>
|
||||
WithPage(Standard + "gfxrenderer null\nfieldofview 45\n", (page, _, saved) =>
|
||||
{
|
||||
Assert.Equal("vulkan", Shown(List(page, "RenderEngineCb")));
|
||||
Assert.Contains("vulkan", Note(page, "gfxrenderer"));
|
||||
Assert.Equal("null", Shown(List(page, "RenderEngineCb")));
|
||||
Assert.Contains("null", Note(page, "gfxrenderer"));
|
||||
Assert.False(page.HasUnsavedChanges);
|
||||
|
||||
page.Save();
|
||||
|
||||
Assert.Contains("gfxrenderer vulkan\n", saved());
|
||||
Assert.Contains("gfxrenderer null\n", saved());
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_standard_mode_has_the_choice_of_the_simulator_and_of_ray_tracing_but_not_of_the_renderer()
|
||||
{
|
||||
WithPage(Standard, (page, _, _) =>
|
||||
{
|
||||
Assert.True(Row(page, "starter.exe.path").IsEffectivelyVisible);
|
||||
Assert.True(Row(page, "gfx.raytracing, gfx.raytracing.range").IsVisible);
|
||||
Assert.False(Row(page, "gfxrenderer").IsVisible);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_of_realism_picked_is_saved_and_marked_until_a_setting_moves()
|
||||
{
|
||||
WithPage(Standard, (page, services, saved) =>
|
||||
{
|
||||
var buttons = page.FindControl<StackPanel>("PhysicsPresetButtons")!.Children.OfType<Button>().ToList();
|
||||
var state = page.FindControl<TextBlock>("PhysicsPresetState")!;
|
||||
Assert.Equal(App.Loc["PresetCustom"], state.Text);
|
||||
|
||||
buttons[1].RaiseEvent(new Avalonia.Interactivity.RoutedEventArgs(Button.ClickEvent));
|
||||
Controls.Settle();
|
||||
Assert.True(buttons[1].Classes.Contains("Accent"));
|
||||
Assert.Equal("new", (((ComboBox)Row(page, "physics.derailment").Content!).SelectedItem as ComboBoxItem)?.Tag);
|
||||
page.Save();
|
||||
|
||||
Assert.Contains("physics.derailment new\n", saved());
|
||||
Assert.Contains("couplerphysics yes\n", saved());
|
||||
Assert.Contains("crashdamage yes\n", saved());
|
||||
|
||||
page.FindControl<CheckBox>("CrashDamageCb")!.IsChecked = false;
|
||||
Controls.Settle();
|
||||
Assert.Equal(App.Loc["PresetCustom"], state.Text);
|
||||
Assert.False(buttons[1].Classes.Contains("Accent"));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_level_of_ray_tracing_picked_is_saved_as_its_reach()
|
||||
{
|
||||
WithPage(Standard, (page, services, saved) =>
|
||||
{
|
||||
var list = List(page, "RayTracingCb");
|
||||
Assert.Equal(App.Loc["RayTracingOff"], Shown(list));
|
||||
|
||||
list.SelectedIndex = 3;
|
||||
page.Save();
|
||||
|
||||
Assert.Contains("gfx.raytracing yes\n", saved());
|
||||
Assert.Contains("gfx.raytracing.range 1000\n", saved());
|
||||
|
||||
list.SelectedIndex = 0;
|
||||
page.Save();
|
||||
|
||||
Assert.Contains("gfx.raytracing no\n", saved());
|
||||
Assert.Contains("gfx.raytracing.range 1000\n", saved());
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_reach_of_ray_tracing_no_level_has_is_shown_as_it_is_and_kept()
|
||||
{
|
||||
WithPage(Standard + "gfx.raytracing yes\ngfx.raytracing.range 750\n", (page, _, saved) =>
|
||||
{
|
||||
Assert.Contains("750", Shown(List(page, "RayTracingCb")));
|
||||
Assert.False(page.HasUnsavedChanges);
|
||||
|
||||
page.Save();
|
||||
|
||||
Assert.Contains("gfx.raytracing.range 750\n", saved());
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Another_renderer_picked_from_the_list_replaces_it()
|
||||
{
|
||||
WithPage(Standard + "gfxrenderer vulkan\n", (page, services, saved) =>
|
||||
WithPage(Standard + "gfxrenderer null\n", (page, services, saved) =>
|
||||
{
|
||||
List(page, "RenderEngineCb").SelectedIndex = 0;
|
||||
List(page, "RenderEngineCb").SelectedIndex = 1;
|
||||
|
||||
page.Save();
|
||||
|
||||
@@ -165,18 +242,67 @@ public class SettingsUnknownValueTests
|
||||
[Fact]
|
||||
public void The_move_to_the_standard_mode_puts_values_of_the_file_right()
|
||||
{
|
||||
WithPage("gfxrenderer vulkan\nstarter.batterydefault 7\nvsync moze\ngfx.usegles yes\n", (page, _, saved) =>
|
||||
WithPage("gfxrenderer null\nstarter.batterydefault 7\nvsync moze\nstarter.gpu system\n", (page, _, saved) =>
|
||||
{
|
||||
page.MoveToStandardOnce();
|
||||
|
||||
string text = saved();
|
||||
Assert.Contains("gfxrenderer vulkan\n", text);
|
||||
Assert.Contains("starter.batterydefault 0\n", text);
|
||||
Assert.Contains("vsync no\n", text);
|
||||
// What lets some machines run the simulator at all stays.
|
||||
Assert.Contains("starter.gpu system\n", text);
|
||||
Assert.Null(Note(page, "gfxrenderer"));
|
||||
Assert.NotEqual("7", Shown(List(page, "ReadyOverrideCb")));
|
||||
});
|
||||
}
|
||||
|
||||
// A player of the standard mode of an older starter: Vulkan, every optimisation on and the developer's settings
|
||||
// at the starter's own values, the picture's level and what the player chose in the standard mode as it was.
|
||||
[Fact]
|
||||
public void The_standard_mode_of_an_older_layout_moves_to_vulkan_and_the_fast_choices()
|
||||
{
|
||||
WithPage(Standard + "gfxrenderer default\ngfx.gpucull no\nphysicslog yes\nfriction 2\nmaxtexturesize 1024\n" +
|
||||
"fieldofview 60\ngfx.ssr low\nblackbox yes\n", (page, services, saved) =>
|
||||
{
|
||||
page.MoveToStandardOnce();
|
||||
|
||||
string text = saved();
|
||||
Assert.Contains("gfxrenderer vulkan\n", text);
|
||||
Assert.Contains("gfx.gpucull yes\n", text);
|
||||
Assert.Contains("physicslog no\n", text);
|
||||
Assert.Contains("friction 1\n", text);
|
||||
Assert.Contains("maxtexturesize 1024\n", text);
|
||||
Assert.Contains("gfx.ssr low\n", text);
|
||||
Assert.Contains("fieldofview 60\n", text);
|
||||
Assert.Contains("blackbox yes\n", text);
|
||||
Assert.Contains($"starter.settings.revision {StarterNG.Domain.Settings.SimulatorSettings.CurrentRevision}\n", text);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_advanced_mode_of_an_older_layout_keeps_what_its_developer_chose()
|
||||
{
|
||||
WithPage(Standard + "starter.settings.advanced yes\ngfxrenderer default\ngfx.gpucull no\n", (page, services, saved) =>
|
||||
{
|
||||
page.MoveToStandardOnce();
|
||||
|
||||
string text = saved();
|
||||
Assert.Contains("gfxrenderer default\n", text);
|
||||
Assert.Contains("starter.batterydefault 0\n", text);
|
||||
Assert.Contains("vsync no\n", text);
|
||||
// What lets some machines run the simulator at all stays.
|
||||
Assert.Contains("gfx.usegles yes\n", text);
|
||||
Assert.Null(Note(page, "gfxrenderer"));
|
||||
Assert.NotEqual("7", Shown(List(page, "ReadyOverrideCb")));
|
||||
Assert.Contains("gfx.gpucull no\n", text);
|
||||
Assert.True(services.Settings.AdvancedSettings);
|
||||
Assert.Equal(StarterNG.Domain.Settings.SimulatorSettings.CurrentRevision, services.Settings.Revision);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_layout_of_this_starter_is_moved_to_once_only()
|
||||
{
|
||||
WithPage(Standard + "starter.settings.revision 2\ngfxrenderer default\n", (page, _, saved) =>
|
||||
{
|
||||
page.MoveToStandardOnce();
|
||||
|
||||
Assert.Contains("gfxrenderer default\n", saved());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ public class SliderStepsTests
|
||||
public void The_old_starters_steps_are_offered_and_a_value_outside_them_stays()
|
||||
{
|
||||
var slider = new Avalonia.Controls.Slider();
|
||||
var steps = new SliderSteps(slider, SliderRanges.ReflectionUpdates) { Value = 1 / 300.0 };
|
||||
var steps = new SliderSteps(slider, SliderRanges.ReflectionUpdates) { Value = 0.5 };
|
||||
|
||||
// The simulator's own once in five minutes, shown before the old starter's 1 to 60.
|
||||
Assert.Equal(1 / 300.0, steps.Value);
|
||||
// Twice a second is none of the steps: shown among them, between once in five seconds and once a second.
|
||||
Assert.Equal(0.5, steps.Value);
|
||||
Assert.Equal(SliderRanges.ReflectionUpdates.Length, slider.Maximum);
|
||||
|
||||
slider.Value = slider.Maximum;
|
||||
@@ -44,11 +44,11 @@ public class SliderStepsTests
|
||||
public void Clamping_leaves_a_value_between_two_steps_where_it_is()
|
||||
{
|
||||
var slider = new Avalonia.Controls.Slider();
|
||||
var steps = new SliderSteps(slider, SliderRanges.CabShadowRanges) { Clamps = true, Value = 15 };
|
||||
var steps = new SliderSteps(slider, SliderRanges.DrawRangeFactors) { Clamps = true, Value = 1.5 };
|
||||
|
||||
Assert.Equal(15, steps.Value);
|
||||
Assert.Equal(1.5, steps.Value);
|
||||
|
||||
steps.Value = -5;
|
||||
Assert.Equal(0, steps.Value);
|
||||
Assert.Equal(1, steps.Value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,12 +152,12 @@ public class StartSimulationTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)]
|
||||
[InlineData(3)]
|
||||
public void Any_renderer_is_left_for_the_simulator_to_take(int renderer)
|
||||
[InlineData(StarterNG.Domain.Settings.GraphicsBackend.Vulkan)]
|
||||
[InlineData(StarterNG.Domain.Settings.GraphicsBackend.OpenGL)]
|
||||
public void Any_renderer_is_left_for_the_simulator_to_take(StarterNG.Domain.Settings.GraphicsBackend renderer)
|
||||
{
|
||||
var (start, launcher, installation) = Rig(files => files.WithExecutable(Build, "\u007fELF binary"));
|
||||
installation.SettingsStore.Settings.RenderEngine = renderer;
|
||||
installation.SettingsStore.Settings.Backend = renderer;
|
||||
|
||||
Assert.Equal(SimulationStartOutcome.Started, start.Execute(freeFly: true, saveSettings: false).Outcome);
|
||||
Assert.NotNull(launcher.Executable);
|
||||
|
||||
@@ -35,6 +35,7 @@ public partial class App : Avalonia.Application
|
||||
|
||||
AppServices.Current.SettingsStore.Load();
|
||||
AppServices.Current.SettingsStore.StartAtHighWithoutOwnSettings();
|
||||
AppServices.Current.SettingsStore.RemoveDuplicatesNow();
|
||||
|
||||
KeyboardConfig.Instance.Load();
|
||||
|
||||
|
||||
@@ -65,10 +65,7 @@ public sealed class AppServices
|
||||
SceneryFiles = new SceneryFileWatch(files, Sceneries, Library, State);
|
||||
|
||||
Executables = new ExecutableLocator(files, paths, environment, log);
|
||||
// Read when a borderless screen with a smaller buffer is first written, and once.
|
||||
var monitors = new Lazy<IReadOnlyList<DisplayMonitor>>(() => Monitors.List(environment));
|
||||
SettingsStore = new SettingsStore(files, clock, log, settingsPaths,
|
||||
new SettingsSerializer(id => Monitors.SizeOf(monitors.Value, id)), Executables);
|
||||
SettingsStore = new SettingsStore(files, clock, log, settingsPaths, new SettingsSerializer(), Executables);
|
||||
MissingVehicleLog = new MissingVehicleLog(SettingsStore.Settings, missingAssets, Library, log);
|
||||
Favorites = new FavoriteSceneries(files, log, settingsPaths.FavoritesPath());
|
||||
Tapes = new HaslerTapes(files, paths, log, clock, Timetables, () => State.SimulatorRunning);
|
||||
|
||||
@@ -12,10 +12,7 @@ public sealed class GraphicsGroupLevels
|
||||
|
||||
public GraphicsGroupLevels(SettingsStore store) => _store = store;
|
||||
|
||||
/// <summary>
|
||||
/// The level each group is at in <paramref name="settings"/>, null where it is at none. At
|
||||
/// Ultra the level under it fits too, as it leaves alone what only Ultra sets: the highest counts.
|
||||
/// </summary>
|
||||
/// <summary>The level each group is at in <paramref name="settings"/>, null where it is at none.</summary>
|
||||
public IReadOnlyDictionary<GraphicsGroup, GraphicsPreset?> LevelsOf(SimulatorSettings settings)
|
||||
{
|
||||
var now = _store.Render(settings);
|
||||
@@ -24,18 +21,10 @@ public sealed class GraphicsGroupLevels
|
||||
(GraphicsPreset?)rendered.LastOrDefault(level => Same(group, level.Keys, now)).Level);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A copy of <paramref name="settings"/> with the group at <paramref name="level"/>. What only
|
||||
/// an end of the scale sets goes back to the simulator's own on leaving that end.
|
||||
/// </summary>
|
||||
/// <summary>A copy of <paramref name="settings"/> with the group at <paramref name="level"/>.</summary>
|
||||
public SimulatorSettings Apply(GraphicsGroup group, GraphicsPreset level, SimulatorSettings settings)
|
||||
{
|
||||
var current = LevelsOf(settings)[group];
|
||||
var source = settings.Copy();
|
||||
if (level.Extras is null && current?.Extras is not null)
|
||||
GraphicsExtras.None.ApplyTo(source);
|
||||
if (level.Top is null && current?.Top is not null)
|
||||
GraphicsTop.None.ApplyTo(source);
|
||||
level.ApplyTo(source);
|
||||
return _store.WithKeysOf(settings, source, group.Keys);
|
||||
}
|
||||
|
||||
@@ -131,8 +131,9 @@ public sealed class SettingsStore
|
||||
return;
|
||||
|
||||
GraphicsPreset.High.ApplyTo(Settings);
|
||||
// Nothing of an older starter to bring over: the settings start in the standard mode.
|
||||
// Nothing of an older starter to bring over: the settings start in the standard mode, of this layout.
|
||||
Settings.MovedToStandard = true;
|
||||
Settings.Revision = SimulatorSettings.CurrentRevision;
|
||||
Save();
|
||||
}
|
||||
|
||||
@@ -181,12 +182,11 @@ public sealed class SettingsStore
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// What lets some machines run the simulator at all: the card it is put on (offloading
|
||||
/// to the discrete one fails with some drivers) and OpenGL ES where desktop OpenGL does
|
||||
/// not work. The move to the standard mode, done without asking, leaves them as they are.
|
||||
/// What lets some machines run the simulator at all: the card it is put on (offloading to the discrete one
|
||||
/// fails with some drivers). The move to the standard mode, done without asking, leaves it as it is.
|
||||
/// </summary>
|
||||
public static readonly IReadOnlySet<string> KeptOnMoveToStandard =
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "starter.gpu", "gfx.usegles" };
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "starter.gpu" };
|
||||
|
||||
/// <summary>
|
||||
/// The mode is this installation's, like its simulator and its card: another file, a
|
||||
@@ -267,6 +267,8 @@ public sealed class SettingsStore
|
||||
}
|
||||
|
||||
ApplyChanges(_config, Changes(Settings));
|
||||
RemoveDuplicates(_config, path);
|
||||
KeepAntiAliasingLast(_config);
|
||||
if (merged)
|
||||
{
|
||||
// What is held follows the file: the player's changes and the others' together.
|
||||
@@ -291,6 +293,32 @@ public sealed class SettingsStore
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The lines of a key set again above the one the simulator reads go, and the log says which.</summary>
|
||||
private void RemoveDuplicates(ConfigFile config, string path)
|
||||
{
|
||||
var removed = config.RemoveDuplicates(SettingsSerializer.RepeatableKeys);
|
||||
if (removed.Count > 0)
|
||||
_log.Log($"{path}: lines of keys set again further down removed: {string.Join(", ", removed)}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The player's own eu07.ini, as read, set a key more than once: it is saved at once, without the lines the
|
||||
/// simulator passes over. A file of the installation, read for want of the player's own, is left alone.
|
||||
/// </summary>
|
||||
public void RemoveDuplicatesNow()
|
||||
{
|
||||
if (LoadFailed || !string.Equals(LoadedFrom, _savePath, StringComparison.Ordinal) ||
|
||||
ConfigFile.Parse(_config.ToText()).RemoveDuplicates(SettingsSerializer.RepeatableKeys).Count == 0)
|
||||
return;
|
||||
Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Of gfx.antialiasing and the older multisampling the simulator heeds the one further down, so the newer goes
|
||||
/// below the older, which only the simulators before it read.
|
||||
/// </summary>
|
||||
private static void KeepAntiAliasingLast(ConfigFile config) => config.MoveAfter("gfx.antialiasing", "multisampling");
|
||||
|
||||
private static void ApplyChanges(ConfigFile config, IReadOnlyList<IniChange> changes)
|
||||
{
|
||||
foreach (var change in changes)
|
||||
@@ -357,6 +385,8 @@ public sealed class SettingsStore
|
||||
|
||||
var copy = ConfigFile.Parse(_config.ToText());
|
||||
ApplyChanges(copy, Changes(settings ?? Settings));
|
||||
copy.RemoveDuplicates(SettingsSerializer.RepeatableKeys);
|
||||
KeepAntiAliasingLast(copy);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -415,6 +445,7 @@ public sealed class SettingsStore
|
||||
bool readable = key.Kind switch
|
||||
{
|
||||
SimulatorKeyKind.Toggle => Bool(first) is not null,
|
||||
SimulatorKeyKind.Choice => key.ChoiceIndex(first) >= 0,
|
||||
SimulatorKeyKind.Number => double.TryParse(first, NumberStyles.Float, CultureInfo.InvariantCulture, out _),
|
||||
_ => true
|
||||
};
|
||||
@@ -431,7 +462,7 @@ public sealed class SettingsStore
|
||||
// Written from other keys, or rewritten on purpose whatever they say: what they hold is no setting of their own.
|
||||
private static readonly HashSet<string> NotReadAlone = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"mousescale", "gfxrenderer", "gfx.shadowmap.enabled", "gfx.framebuffer.width", "gfx.framebuffer.height"
|
||||
"mousescale", "gfxrenderer", "multisampling"
|
||||
};
|
||||
|
||||
private SimulatorSettings WithFile(ConfigFile config)
|
||||
@@ -520,9 +551,9 @@ public sealed class SettingsStore
|
||||
return false;
|
||||
if (overCap.Contains(key))
|
||||
return false;
|
||||
// The simulator goes by these to the letter: a buffer of a window's size stretched
|
||||
// over the monitor, a monitor's name it does not find. The file's own is no choice to keep.
|
||||
if (AsWritten(key) && _config.GetRaw(key) != value)
|
||||
// The simulator goes by this to the letter: a monitor's name it does not find. The file's own is no
|
||||
// choice to keep.
|
||||
if (string.Equals(key, "fullscreenmonitor", StringComparison.OrdinalIgnoreCase) && _config.GetRaw(key) != value)
|
||||
return false;
|
||||
string? synced = _synced.GetValueOrDefault(key);
|
||||
if (shown.TryGetValue(key, out var onScreen) && onScreen.Shown == value && onScreen.Held == synced)
|
||||
@@ -530,11 +561,6 @@ public sealed class SettingsStore
|
||||
return _config.Has(key) && synced == value;
|
||||
}
|
||||
|
||||
bool AsWritten(string key) =>
|
||||
string.Equals(key, "fullscreenmonitor", StringComparison.OrdinalIgnoreCase) ||
|
||||
(settings.FullscreenWindowed &&
|
||||
SettingsSerializer.FramebufferKeys.Contains(key, StringComparer.OrdinalIgnoreCase));
|
||||
|
||||
void Add(string key, string? value)
|
||||
{
|
||||
// To the simulator a key past endconfig is not set yet, whatever it says.
|
||||
|
||||
@@ -204,6 +204,42 @@ public sealed class ConfigFile
|
||||
_index.Remove(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the lines that set a key again where a later line, the one the simulator goes by, sets it too:
|
||||
/// reading top down, it heeds the last of them, so the earlier ones only mislead whoever reads the file.
|
||||
/// Past endconfig nothing is read, so nothing there is touched, nor the keys the simulator takes more than
|
||||
/// one of (<paramref name="repeatable"/>), nor a line starting with no letter, which may carry on the value
|
||||
/// of the line above. Returns the keys of the lines deleted.
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> RemoveDuplicates(IReadOnlyCollection<string> repeatable)
|
||||
{
|
||||
var removed = new List<string>();
|
||||
bool inBlock = false;
|
||||
int end = _end < 0 ? _lines.Count : _end;
|
||||
var keep = new List<string>(_lines.Count);
|
||||
for (int line = 0; line < _lines.Count; line++)
|
||||
{
|
||||
bool startsInBlock = inBlock;
|
||||
inBlock = EndsInBlock(_lines[line], startsInBlock);
|
||||
if (line < end && !startsInBlock && TryParseKey(_lines[line], out string key) && char.IsLetter(key[0]) &&
|
||||
!repeatable.Contains(key, StringComparer.OrdinalIgnoreCase) &&
|
||||
_index.TryGetValue(key, out int read) && read != line && read < end &&
|
||||
!EndsInBlock(_lines[line], false))
|
||||
{
|
||||
removed.Add(key);
|
||||
continue;
|
||||
}
|
||||
keep.Add(_lines[line]);
|
||||
}
|
||||
|
||||
if (removed.Count == 0)
|
||||
return removed;
|
||||
_lines.Clear();
|
||||
_lines.AddRange(keep);
|
||||
Reindex();
|
||||
return removed;
|
||||
}
|
||||
|
||||
public void SetBool(string key, bool value) => Set(key, value ? "yes" : "no");
|
||||
public void SetInt(string key, int value) =>
|
||||
Set(key, value.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
@@ -5,208 +5,139 @@ using System.Linq;
|
||||
namespace StarterNG.Domain.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// What only the two ends of the scale touch: the effects left to taste at every other
|
||||
/// level and how often the screens refresh. The lowest level gives them up, the highest
|
||||
/// takes the most there is.
|
||||
/// </summary>
|
||||
/// <param name="PythonUpdateMs">python.updatetime, one of the steps of its list.</param>
|
||||
public sealed record GraphicsExtras(
|
||||
bool MotionBlur,
|
||||
bool ChromaticAberration,
|
||||
bool Smoke,
|
||||
int PythonUpdateMs)
|
||||
{
|
||||
/// <summary>The eu07.ini keys these values live in.</summary>
|
||||
public static readonly IReadOnlyList<string> Keys = new[]
|
||||
{
|
||||
"gfx.postfx.motionblur.enabled", "gfx.postfx.chromaticaberration.enabled",
|
||||
"gfx.smoke", "python.updatetime"
|
||||
};
|
||||
|
||||
/// <summary>The simulator's own, for leaving a level chosen before this run: what was there earlier is gone.</summary>
|
||||
public static readonly GraphicsExtras None = new(true, true, true, 200);
|
||||
|
||||
public static GraphicsExtras Of(SimulatorSettings s) =>
|
||||
new(s.MotionBlur, s.ChromaticAberration, s.Smoke, s.PythonScreenUpdateRate);
|
||||
|
||||
public void ApplyTo(SimulatorSettings s)
|
||||
{
|
||||
s.MotionBlur = MotionBlur;
|
||||
s.ChromaticAberration = ChromaticAberration;
|
||||
s.Smoke = Smoke;
|
||||
s.PythonScreenUpdateRate = PythonUpdateMs;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// What only Ultra sets, with no scale to climb: the longest shadows, at the bottom of their
|
||||
/// limit, and the screens drawn. What only the advanced mode shows no level sets.
|
||||
/// </summary>
|
||||
/// <param name="ShadowAngleLimit">gfx.shadow.angle.min: how low the sun counts for shadows, so how long they
|
||||
/// get: up to 5× the height of what casts them at 0.2, no longer than it at 1 (opengl33renderer.cpp).</param>
|
||||
/// <param name="Screens">python.enabled.</param>
|
||||
public sealed record GraphicsTop(double ShadowAngleLimit, bool Screens)
|
||||
{
|
||||
/// <summary>The eu07.ini keys these values live in.</summary>
|
||||
public static readonly IReadOnlyList<string> Keys = new[] { "gfx.shadow.angle.min", "python.enabled" };
|
||||
|
||||
/// <summary>What they are with nothing set, as <see cref="GraphicsExtras.None"/>.</summary>
|
||||
public static readonly GraphicsTop None = new(0.2, true);
|
||||
|
||||
public static GraphicsTop Of(SimulatorSettings s) => new(s.ShadowAngleLimit, s.PythonScreens);
|
||||
|
||||
public void ApplyTo(SimulatorSettings s)
|
||||
{
|
||||
s.ShadowAngleLimit = ShadowAngleLimit;
|
||||
s.PythonScreens = Screens;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A level of detail set in one go: what weighs on the graphics card. Every scale climbs in
|
||||
/// even steps from <see cref="Minimal"/> to <see cref="Ultra"/>, as far as it has steps for six
|
||||
/// levels. A level sets only what the standard mode shows, and only to what its sliders offer
|
||||
/// (<see cref="SliderRanges"/>, the old starter's ranges): never past the old starter. The screen
|
||||
/// (resolution, buffer, field of view), the frame pacing and the effects that are a matter of
|
||||
/// taste - motion blur, chromatic aberration - stay as they are, except at the two ends of the
|
||||
/// scale, which have <see cref="Extras"/>.
|
||||
/// A level of detail set in one go, as games offer them: what weighs on the graphics card, from Low for a weak or
|
||||
/// old card to Very high for a strong one. High is about the simulator's own values, the start of a player with no
|
||||
/// settings of their own; Very high is the most worth having, not everything at its top - ray tracing, MSAA x8 and
|
||||
/// the largest shadow maps cost far more than they show, and stay for the developer tab. The screen (resolution,
|
||||
/// render scale, field of view), the frame pacing and the effects that are a matter of taste - motion blur,
|
||||
/// chromatic aberration - are no level's.
|
||||
/// </summary>
|
||||
/// <param name="NameKey">Its name's translation key.</param>
|
||||
/// <param name="CabShadowsRange">gfx.shadows.cab.range, in metres, read only by the legacy renderer.</param>
|
||||
/// <param name="AntiAliasing">multisampling.</param>
|
||||
/// <param name="ReflectionsRate">gfx.reflections.framerate, in updates a second, one of the old starter's steps.</param>
|
||||
/// <param name="ReflectionsRate">gfx.reflections.framerate, in updates a second.</param>
|
||||
/// <param name="DrawRangeFactor">gfx.drawrange.factor.max: how far the regulator may stretch the draw range.</param>
|
||||
/// <param name="Keys">The <see cref="SimulatorKeys"/> it sets, in the file's words.</param>
|
||||
public sealed record GraphicsPreset(
|
||||
string NameKey,
|
||||
int TextureSize,
|
||||
int CabTextureSize,
|
||||
double Anisotropy,
|
||||
bool ExtraEffects,
|
||||
AntiAliasingMode AntiAliasing,
|
||||
int DynamicLights,
|
||||
int SmokeFidelity,
|
||||
bool Shadows,
|
||||
int ShadowMap,
|
||||
int ShadowRange,
|
||||
int ShadowRank,
|
||||
bool EnvMap,
|
||||
int ReflectionsFidelity,
|
||||
double ReflectionsRate,
|
||||
bool ExtraEffects,
|
||||
int SplineFidelity,
|
||||
double DrawRangeFactor,
|
||||
int CabShadowsRange,
|
||||
GraphicsExtras? Extras = null,
|
||||
GraphicsTop? Top = null)
|
||||
int SmokeFidelity,
|
||||
IReadOnlyDictionary<string, string> Keys)
|
||||
{
|
||||
/// <summary>The simulator's own rate of the reflections: once in five minutes, or a kilometre on.</summary>
|
||||
public const double ReflectionsSeldom = 1 / 300.0;
|
||||
|
||||
/// <summary>The eu07.ini keys a level sets.</summary>
|
||||
public static readonly IReadOnlyList<string> Keys = new[]
|
||||
{
|
||||
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering", "multisampling", "dynamiclights",
|
||||
"gfx.smoke.fidelity", "shadows", "gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff",
|
||||
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.extraeffects",
|
||||
"splinefidelity", "gfx.drawrange.factor.max", "gfx.shadows.cab.range"
|
||||
};
|
||||
public static IReadOnlyList<string> AllKeys =>
|
||||
GraphicsGroup.All.SelectMany(group => group.Keys).Concat(GraphicsGroup.AntiAliasingKeys).ToList();
|
||||
|
||||
/// <summary>The last resort: no shadows, no reflections, no effects, no smoke.</summary>
|
||||
public static readonly GraphicsPreset Minimal = new(
|
||||
"PresetMinimal", TextureSize: 512, CabTextureSize: 512, Anisotropy: 1, AntiAliasing: AntiAliasingMode.Off,
|
||||
DynamicLights: 1, SmokeFidelity: 1, Shadows: false, ShadowMap: 1024, ShadowRange: 75, ShadowRank: 1,
|
||||
EnvMap: false, ReflectionsFidelity: 0, ReflectionsRate: 1, ExtraEffects: false,
|
||||
SplineFidelity: 1, DrawRangeFactor: 1, CabShadowsRange: 0,
|
||||
Extras: new GraphicsExtras(MotionBlur: false, ChromaticAberration: false, Smoke: false, PythonUpdateMs: 800));
|
||||
private static Dictionary<string, string> Values(params (string Key, string Value)[] values) =>
|
||||
values.ToDictionary(pair => pair.Key, pair => pair.Value, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>For a weak or old card, or a laptop on its own graphics: the shadows short, no screen-space effects.</summary>
|
||||
public static readonly GraphicsPreset Low = new(
|
||||
"PresetLow", TextureSize: 1024, CabTextureSize: 1024, Anisotropy: 2, AntiAliasing: AntiAliasingMode.Off,
|
||||
DynamicLights: 3, SmokeFidelity: 1, Shadows: true, ShadowMap: 1024, ShadowRange: 125, ShadowRank: 2,
|
||||
EnvMap: true, ReflectionsFidelity: 0, ReflectionsRate: 1, ExtraEffects: true,
|
||||
SplineFidelity: 2, DrawRangeFactor: 1, CabShadowsRange: 0);
|
||||
"PresetLow", TextureSize: 1024, CabTextureSize: 1024, Anisotropy: 4, ExtraEffects: false,
|
||||
AntiAliasing: AntiAliasingMode.Off, ShadowMap: 1024, ShadowRange: 125, ShadowRank: 1,
|
||||
ReflectionsFidelity: 0, ReflectionsRate: ReflectionsSeldom, SplineFidelity: 1, DrawRangeFactor: 1,
|
||||
SmokeFidelity: 1,
|
||||
Values(("gfx.lights.shadows", "low"), ("gfx.contactshadows", "no"), ("gfx.ssr", "no"), ("gfx.cabprobe", "low"),
|
||||
("gfx.postfx.ao", "no"), ("gfx.fog.quality", "low"), ("gfx.clouds", "low"),
|
||||
("gfx.grass", "yes"), ("gfx.grass.distance", "40"), ("gfx.grass.fadedistance", "50"),
|
||||
("gfx.grass.density", "0.5"), ("gfx.precipitation.particles", "16384")));
|
||||
|
||||
public static readonly GraphicsPreset Medium = new(
|
||||
"PresetMedium", TextureSize: 2048, CabTextureSize: 2048, Anisotropy: 4, AntiAliasing: AntiAliasingMode.Msaa2,
|
||||
DynamicLights: 5, SmokeFidelity: 2, Shadows: true, ShadowMap: 1024, ShadowRange: 175, ShadowRank: 2,
|
||||
EnvMap: true, ReflectionsFidelity: 1, ReflectionsRate: 1, ExtraEffects: true,
|
||||
SplineFidelity: 2, DrawRangeFactor: 2, CabShadowsRange: 20);
|
||||
"PresetMedium", TextureSize: 2048, CabTextureSize: 2048, Anisotropy: 8, ExtraEffects: true,
|
||||
AntiAliasing: AntiAliasingMode.Msaa2, ShadowMap: 2048, ShadowRange: 175, ShadowRank: 2,
|
||||
ReflectionsFidelity: 1, ReflectionsRate: ReflectionsSeldom, SplineFidelity: 2, DrawRangeFactor: 2,
|
||||
SmokeFidelity: 1,
|
||||
Values(("gfx.lights.shadows", "low"), ("gfx.contactshadows", "no"), ("gfx.ssr", "low"), ("gfx.cabprobe", "low"),
|
||||
("gfx.postfx.ao", "ssao"), ("gfx.fog.quality", "medium"), ("gfx.clouds", "low"),
|
||||
("gfx.grass", "yes"), ("gfx.grass.distance", "60"), ("gfx.grass.fadedistance", "70"),
|
||||
("gfx.grass.density", "1"), ("gfx.precipitation.particles", "32768")));
|
||||
|
||||
/// <summary>
|
||||
/// Where a player with no settings of their own starts. The simulator's own values (Globals.h),
|
||||
/// but for smoke, track curves, reflections and cab shadows: theirs are the bottom of a scale
|
||||
/// with levels to go under this one, or below what the old starter offered.
|
||||
/// </summary>
|
||||
/// <summary>Where a player with no settings of their own starts: about the simulator's own values.</summary>
|
||||
public static readonly GraphicsPreset High = new(
|
||||
"PresetHigh", TextureSize: 4096, CabTextureSize: 4096, Anisotropy: 8, AntiAliasing: AntiAliasingMode.Msaa4,
|
||||
DynamicLights: 7, SmokeFidelity: 2, Shadows: true, ShadowMap: 2048, ShadowRange: 250, ShadowRank: 3,
|
||||
EnvMap: true, ReflectionsFidelity: 1, ReflectionsRate: 3, ExtraEffects: true,
|
||||
SplineFidelity: 2, DrawRangeFactor: 3, CabShadowsRange: 30);
|
||||
"PresetHigh", TextureSize: 4096, CabTextureSize: 4096, Anisotropy: 8, ExtraEffects: true,
|
||||
AntiAliasing: AntiAliasingMode.Msaa4, ShadowMap: 2048, ShadowRange: 250, ShadowRank: 3,
|
||||
ReflectionsFidelity: 2, ReflectionsRate: ReflectionsSeldom, SplineFidelity: 2, DrawRangeFactor: 3,
|
||||
SmokeFidelity: 2,
|
||||
Values(("gfx.lights.shadows", "medium"), ("gfx.contactshadows", "no"), ("gfx.ssr", "medium"),
|
||||
("gfx.cabprobe", "medium"), ("gfx.postfx.ao", "gtao"), ("gfx.fog.quality", "medium"),
|
||||
("gfx.clouds", "medium"), ("gfx.grass", "yes"), ("gfx.grass.distance", "60"),
|
||||
("gfx.grass.fadedistance", "70"), ("gfx.grass.density", "1"), ("gfx.precipitation.particles", "65536")));
|
||||
|
||||
/// <summary>
|
||||
/// For a strong card. A map of 4096 doubles the cascades, so the range here reaches 800 m.
|
||||
/// Filtering stays as High's, so the textures tell this level from Ultra.
|
||||
/// For a strong card. A map of 4096 doubles the cascades, so the range here reaches 600 m; the textures of the
|
||||
/// cab stay at 4096, the most the starter gives them.
|
||||
/// </summary>
|
||||
public static readonly GraphicsPreset VeryHigh = new(
|
||||
"PresetVeryHigh", TextureSize: 8192, CabTextureSize: 4096, Anisotropy: 8, AntiAliasing: AntiAliasingMode.Msaa8,
|
||||
DynamicLights: 7, SmokeFidelity: 3, Shadows: true, ShadowMap: 4096, ShadowRange: 400, ShadowRank: 3,
|
||||
EnvMap: true, ReflectionsFidelity: 2, ReflectionsRate: 10, ExtraEffects: true,
|
||||
SplineFidelity: 3, DrawRangeFactor: 3, CabShadowsRange: 50);
|
||||
"PresetVeryHigh", TextureSize: 8192, CabTextureSize: 4096, Anisotropy: 16, ExtraEffects: true,
|
||||
AntiAliasing: AntiAliasingMode.Msaa4, ShadowMap: 4096, ShadowRange: 300, ShadowRank: 3,
|
||||
ReflectionsFidelity: 2, ReflectionsRate: 1, SplineFidelity: 3, DrawRangeFactor: 3,
|
||||
SmokeFidelity: 3,
|
||||
Values(("gfx.lights.shadows", "high"), ("gfx.contactshadows", "low"), ("gfx.ssr", "high"),
|
||||
("gfx.cabprobe", "high"), ("gfx.postfx.ao", "gtao"), ("gfx.fog.quality", "high"),
|
||||
("gfx.clouds", "high"), ("gfx.grass", "yes"), ("gfx.grass.distance", "100"),
|
||||
("gfx.grass.fadedistance", "120"), ("gfx.grass.density", "1.25"), ("gfx.precipitation.particles", "65536")));
|
||||
|
||||
/// <summary>
|
||||
/// The top of every slider, which is the most the old starter gave. Not the best picture
|
||||
/// throughout: a map of 8192 stretches the cascades fourfold, so shadows reach 1600 m but are
|
||||
/// coarser up close than at <see cref="VeryHigh"/>.
|
||||
/// </summary>
|
||||
public static readonly GraphicsPreset Ultra = new(
|
||||
"PresetUltra", TextureSize: 8192, CabTextureSize: 4096, Anisotropy: 16, AntiAliasing: AntiAliasingMode.Msaa8,
|
||||
DynamicLights: 7, SmokeFidelity: 4, Shadows: true, ShadowMap: 8192, ShadowRange: 400, ShadowRank: 3,
|
||||
EnvMap: true, ReflectionsFidelity: 2, ReflectionsRate: 60, ExtraEffects: true,
|
||||
SplineFidelity: 4, DrawRangeFactor: 3, CabShadowsRange: 100,
|
||||
Extras: new GraphicsExtras(MotionBlur: true, ChromaticAberration: true, Smoke: true, PythonUpdateMs: 200),
|
||||
Top: new GraphicsTop(ShadowAngleLimit: 0.2, Screens: true));
|
||||
|
||||
public static readonly IReadOnlyList<GraphicsPreset> All = new[] { Minimal, Low, Medium, High, VeryHigh, Ultra };
|
||||
public static readonly IReadOnlyList<GraphicsPreset> All = new[] { Low, Medium, High, VeryHigh };
|
||||
|
||||
public void ApplyTo(SimulatorSettings s)
|
||||
{
|
||||
s.MaxTextureSize = TextureSize;
|
||||
s.MaxCabTextureSize = CabTextureSize;
|
||||
s.TextureFiltering = Anisotropy;
|
||||
s.ExtraEffects = ExtraEffects;
|
||||
s.AntiAliasing = AntiAliasing;
|
||||
s.CabShadowsRange = CabShadowsRange;
|
||||
s.DynamicLights = DynamicLights;
|
||||
s.SmokeFidelity = SmokeFidelity;
|
||||
s.RenderShadows = Shadows;
|
||||
s.RenderShadows = true;
|
||||
s.ShadowMapResolution = ShadowMap;
|
||||
s.ShadowProjectionRange = ShadowRange;
|
||||
s.ShadowRankCutoff = ShadowRank;
|
||||
s.EnvMap = EnvMap;
|
||||
s.EnvMap = true;
|
||||
s.ReflectionsFidelity = ReflectionsFidelity;
|
||||
s.ReflectionsFramerate = ReflectionsRate;
|
||||
s.ExtraEffects = ExtraEffects;
|
||||
s.SplineFidelity = SplineFidelity;
|
||||
s.DrawRangeFactor = DrawRangeFactor;
|
||||
Extras?.ApplyTo(s);
|
||||
Top?.ApplyTo(s);
|
||||
s.SmokeFidelity = SmokeFidelity;
|
||||
foreach (var (key, value) in Keys)
|
||||
s.Extra[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>Whether <paramref name="s"/> is at this level throughout.</summary>
|
||||
public bool Matches(SimulatorSettings s) =>
|
||||
s.MaxTextureSize == TextureSize && s.MaxCabTextureSize == CabTextureSize &&
|
||||
Near(s.TextureFiltering, Anisotropy) && s.AntiAliasing == AntiAliasing &&
|
||||
s.DynamicLights == DynamicLights && s.SmokeFidelity == SmokeFidelity &&
|
||||
s.RenderShadows == Shadows && s.ShadowMapResolution == ShadowMap &&
|
||||
Near(s.TextureFiltering, Anisotropy) && s.ExtraEffects == ExtraEffects && s.AntiAliasing == AntiAliasing &&
|
||||
s.RenderShadows && s.ShadowMapResolution == ShadowMap &&
|
||||
s.ShadowProjectionRange == ShadowRange && s.ShadowRankCutoff == ShadowRank &&
|
||||
s.EnvMap == EnvMap && s.ReflectionsFidelity == ReflectionsFidelity &&
|
||||
Near(s.ReflectionsFramerate, ReflectionsRate) && s.ExtraEffects == ExtraEffects &&
|
||||
s.EnvMap && s.ReflectionsFidelity == ReflectionsFidelity &&
|
||||
Near(s.ReflectionsFramerate, ReflectionsRate) &&
|
||||
s.SplineFidelity == SplineFidelity && Near(s.DrawRangeFactor, DrawRangeFactor) &&
|
||||
s.CabShadowsRange == CabShadowsRange &&
|
||||
(Extras is null || GraphicsExtras.Of(s) == Extras) &&
|
||||
(Top is null || GraphicsTop.Of(s) == Top);
|
||||
s.SmokeFidelity == SmokeFidelity &&
|
||||
Keys.All(pair => SameValue(SimulatorKeys.Named(pair.Key), pair.Value, s));
|
||||
|
||||
/// <summary>The level <paramref name="s"/> is at throughout, if any.</summary>
|
||||
public static GraphicsPreset? Matching(SimulatorSettings s) => All.FirstOrDefault(preset => preset.Matches(s));
|
||||
|
||||
internal static double NumberOf(SimulatorSettings s, string name)
|
||||
/// <summary>Whether <paramref name="s"/> gives the key the value <paramref name="value"/> means, written its own way.</summary>
|
||||
private static bool SameValue(SimulatorKey key, string value, SimulatorSettings s)
|
||||
{
|
||||
var key = SimulatorKeys.Named(name);
|
||||
return key.ParseNumber(key.RawIn(s));
|
||||
string raw = key.RawIn(s);
|
||||
return key.Kind switch
|
||||
{
|
||||
SimulatorKeyKind.Toggle => SimulatorKey.ParseToggle(raw) == SimulatorKey.ParseToggle(value),
|
||||
SimulatorKeyKind.Number => Near(key.ParseNumber(raw), key.ParseNumber(value)),
|
||||
SimulatorKeyKind.Choice => key.ChoiceIndex(raw) == key.ChoiceIndex(value),
|
||||
_ => string.Equals(raw.Trim(), value, StringComparison.OrdinalIgnoreCase)
|
||||
};
|
||||
}
|
||||
|
||||
// As the file rounds it.
|
||||
@@ -215,69 +146,49 @@ public sealed record GraphicsPreset(
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A part of the picture with a level of its own, as its section on the screen has it. The rest
|
||||
/// of a level - the anti-aliasing, the post-processing switches, the dynamic lights and the smoke - goes only with the whole.
|
||||
/// A part of the picture with a level of its own: one row of the standard mode, which the levels set in one go and
|
||||
/// the player can take further up or down. The anti-aliasing has a row of its own.
|
||||
/// </summary>
|
||||
/// <param name="NameKey">Its row's translation key.</param>
|
||||
/// <param name="Keys">The eu07.ini keys it sets.</param>
|
||||
public sealed record GraphicsGroup(IReadOnlyList<string> Keys)
|
||||
public sealed record GraphicsGroup(string NameKey, IReadOnlyList<string> Keys)
|
||||
{
|
||||
public static readonly GraphicsGroup DrawRange = new(new[] { "splinefidelity", "gfx.drawrange.factor.max" });
|
||||
/// <summary>The keys of the anti-aliasing, which a level sets too.</summary>
|
||||
public static readonly IReadOnlyList<string> AntiAliasingKeys = new[] { "gfx.antialiasing", "multisampling" };
|
||||
|
||||
public static readonly GraphicsGroup Textures = new(new[]
|
||||
public static readonly GraphicsGroup Textures = new("GroupTextures", new[]
|
||||
{
|
||||
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering"
|
||||
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering", "gfx.extraeffects"
|
||||
});
|
||||
|
||||
public static readonly GraphicsGroup Shadows = new(new[]
|
||||
public static readonly GraphicsGroup Shadows = new("GroupShadows", new[]
|
||||
{
|
||||
"shadows", "gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff", "gfx.shadow.angle.min", "gfx.shadows.cab.range"
|
||||
"gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff", "gfx.lights.shadows", "gfx.contactshadows"
|
||||
});
|
||||
|
||||
public static readonly GraphicsGroup Reflections = new(new[]
|
||||
public static readonly GraphicsGroup Reflections = new("GroupReflections", new[]
|
||||
{
|
||||
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate"
|
||||
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.ssr", "gfx.cabprobe"
|
||||
});
|
||||
|
||||
public static readonly GraphicsGroup Lighting = new("GroupLighting", new[]
|
||||
{
|
||||
"gfx.postfx.ao", "gfx.fog.quality", "gfx.clouds"
|
||||
});
|
||||
|
||||
public static readonly GraphicsGroup DrawRange = new("GroupDrawRange", new[]
|
||||
{
|
||||
"splinefidelity", "gfx.drawrange.factor.max", "gfx.grass", "gfx.grass.distance", "gfx.grass.fadedistance",
|
||||
"gfx.grass.density"
|
||||
});
|
||||
|
||||
public static readonly GraphicsGroup Particles = new("GroupParticles", new[]
|
||||
{
|
||||
"gfx.smoke.fidelity", "gfx.precipitation.particles"
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyList<GraphicsGroup> All = new[]
|
||||
{
|
||||
DrawRange, Textures, Shadows, Reflections
|
||||
Textures, Shadows, Reflections, Lighting, DrawRange, Particles
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>What applying a level touched.</summary>
|
||||
/// <param name="ChosenKeys">The eu07.ini keys it chose as a whole.</param>
|
||||
public sealed record PresetApplied(IReadOnlyList<string> ChosenKeys);
|
||||
|
||||
/// <summary>
|
||||
/// Remembers what was there before an end of the scale, which comes back with any level
|
||||
/// between. Leaving one chosen before this run, what was there earlier is gone, so the
|
||||
/// simulator's own values take its place.
|
||||
/// </summary>
|
||||
public sealed class GraphicsPresetMemory
|
||||
{
|
||||
private GraphicsExtras? _beforeExtras;
|
||||
|
||||
private GraphicsTop? _beforeTop;
|
||||
|
||||
/// <summary>Puts <paramref name="preset"/> in <paramref name="settings"/>, with what an end of the scale left behind.</summary>
|
||||
public PresetApplied Apply(GraphicsPreset preset, SimulatorSettings settings)
|
||||
{
|
||||
var current = GraphicsPreset.Matching(settings);
|
||||
var coming = preset.Extras is not null ? null
|
||||
: _beforeExtras ?? (current?.Extras is not null ? GraphicsExtras.None : null);
|
||||
_beforeExtras = preset.Extras is not null ? _beforeExtras ?? GraphicsExtras.Of(settings) : null;
|
||||
var comingTop = preset.Top is not null ? null
|
||||
: _beforeTop ?? (current?.Top is not null ? GraphicsTop.None : null);
|
||||
_beforeTop = preset.Top is not null ? _beforeTop ?? GraphicsTop.Of(settings) : null;
|
||||
coming?.ApplyTo(settings);
|
||||
comingTop?.ApplyTo(settings);
|
||||
preset.ApplyTo(settings);
|
||||
|
||||
var chosen = new List<string>(GraphicsPreset.Keys);
|
||||
if (preset.Extras is not null || coming is not null)
|
||||
chosen.AddRange(GraphicsExtras.Keys);
|
||||
if (preset.Top is not null || comingTop is not null)
|
||||
chosen.AddRange(GraphicsTop.Keys);
|
||||
return new PresetApplied(chosen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StarterNG.Domain.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// How true to life the driving is, set in one go. Arcade forgives: no derailment, the legacy couplings and
|
||||
/// collisions, no damage, no broken pantograph, power without the wires, every consist ready to drive. Realistic
|
||||
/// takes the physical models of the simulator: the couplings of the player's train with their play and their
|
||||
/// breaking, the derailment by its criteria (a track's own speed limit still derails nothing, as
|
||||
/// physics.derailment.trustlimits keeps it), the crush of the ends in a collision, the track buckling in the heat,
|
||||
/// and the consists as the scenario has them. The simulator's own values stand between the two.
|
||||
/// </summary>
|
||||
/// <param name="NameKey">Its name's translation key.</param>
|
||||
/// <param name="Keys">The <see cref="SimulatorKeys"/> it sets, in the file's words.</param>
|
||||
public sealed record PhysicsPreset(
|
||||
string NameKey,
|
||||
bool CrashDamage,
|
||||
bool PantographsBreak,
|
||||
bool PowerFromWiresOnly,
|
||||
ConsistReadyOverride ReadyOverride,
|
||||
IReadOnlyDictionary<string, string> Keys)
|
||||
{
|
||||
/// <summary>The eu07.ini keys a level sets.</summary>
|
||||
public static readonly IReadOnlyList<string> AllKeys = new[]
|
||||
{
|
||||
"crashdamage", "enabletraction", "livetraction", "starter.batterydefault",
|
||||
"couplerphysics", "physics.derailment", "physics.collisions", "physics.trackbuckling"
|
||||
};
|
||||
|
||||
private static Dictionary<string, string> Values(params (string Key, string Value)[] values) =>
|
||||
values.ToDictionary(pair => pair.Key, pair => pair.Value, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public static readonly PhysicsPreset Arcade = new(
|
||||
"PhysicsArcade", CrashDamage: false, PantographsBreak: false, PowerFromWiresOnly: false,
|
||||
ReadyOverride: ConsistReadyOverride.AlwaysReady,
|
||||
Values(("couplerphysics", "no"), ("physics.derailment", "off"), ("physics.collisions", "old"),
|
||||
("physics.trackbuckling", "off")));
|
||||
|
||||
public static readonly PhysicsPreset Realistic = new(
|
||||
"PhysicsRealistic", CrashDamage: true, PantographsBreak: true, PowerFromWiresOnly: true,
|
||||
ReadyOverride: ConsistReadyOverride.Scenery,
|
||||
Values(("couplerphysics", "yes"), ("physics.derailment", "new"), ("physics.collisions", "new"),
|
||||
("physics.trackbuckling", "auto")));
|
||||
|
||||
public static readonly IReadOnlyList<PhysicsPreset> All = new[] { Arcade, Realistic };
|
||||
|
||||
public void ApplyTo(SimulatorSettings s)
|
||||
{
|
||||
s.CrashDamage = CrashDamage;
|
||||
s.EnableTraction = PantographsBreak;
|
||||
s.LiveTraction = PowerFromWiresOnly;
|
||||
s.ReadyOverride = ReadyOverride;
|
||||
foreach (var (key, value) in Keys)
|
||||
s.Extra[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>Whether <paramref name="s"/> is at this level throughout.</summary>
|
||||
public bool Matches(SimulatorSettings s) =>
|
||||
s.CrashDamage == CrashDamage && s.EnableTraction == PantographsBreak && s.LiveTraction == PowerFromWiresOnly &&
|
||||
s.ReadyOverride == ReadyOverride &&
|
||||
Keys.All(pair => SimulatorKeys.Named(pair.Key) is var key &&
|
||||
key.ChoiceIndex(key.RawIn(s)) == key.ChoiceIndex(pair.Value));
|
||||
|
||||
/// <summary>The level <paramref name="s"/> is at throughout, if any.</summary>
|
||||
public static PhysicsPreset? Matching(SimulatorSettings s) => All.FirstOrDefault(preset => preset.Matches(s));
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StarterNG.Domain.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// The ray-traced reflections as the standard mode offers them: off, or on at one of four levels, a level being how
|
||||
/// far the rays reach (gfx.raytracing.range). Only the Vulkan renderer on a card with ray queries draws them. No
|
||||
/// level of detail turns them on or off: they cost far more than anything a level sets, so they are the player's
|
||||
/// own choice.
|
||||
/// </summary>
|
||||
public static class RayTracing
|
||||
{
|
||||
public const string Key = "gfx.raytracing";
|
||||
|
||||
public const string RangeKey = "gfx.raytracing.range";
|
||||
|
||||
/// <summary>The levels, as the other parts of the picture name theirs, and the reach of each in metres.</summary>
|
||||
public static readonly IReadOnlyList<(string NameKey, int Range)> Levels = new[]
|
||||
{
|
||||
("PresetLow", 250), ("PresetMedium", 500), ("PresetHigh", 1000), ("PresetVeryHigh", 2000)
|
||||
};
|
||||
|
||||
/// <summary>Off.</summary>
|
||||
public const int Off = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Where <paramref name="s"/> stands: <see cref="Off"/>, the index of its level, or null for a reach none of
|
||||
/// them has.
|
||||
/// </summary>
|
||||
public static int? LevelOf(SimulatorSettings s) => LevelOf(SimulatorKeys.Named(Key).RawIn(s), SimulatorKeys.Named(RangeKey).RawIn(s));
|
||||
|
||||
/// <summary>The level of the two keys as the file writes them.</summary>
|
||||
public static int? LevelOf(string enabled, string range)
|
||||
{
|
||||
if (!SimulatorKey.ParseToggle(enabled))
|
||||
return Off;
|
||||
double metres = SimulatorKeys.Named(RangeKey).ParseNumber(range);
|
||||
for (int i = 0; i < Levels.Count; i++)
|
||||
if (Math.Abs(Levels[i].Range - metres) < 0.5)
|
||||
return i;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The two keys at <paramref name="level"/>, in the file's words. Off leaves the reach as it is, for the next
|
||||
/// time they are turned on.
|
||||
/// </summary>
|
||||
public static (string Enabled, string? Range) ValuesOf(int level) =>
|
||||
level == Off
|
||||
? (SimulatorKey.FormatToggle(false), null)
|
||||
: (SimulatorKey.FormatToggle(true), Levels[level].Range.ToString(System.Globalization.CultureInfo.InvariantCulture));
|
||||
|
||||
public static void Apply(SimulatorSettings s, int level)
|
||||
{
|
||||
var (enabled, range) = ValuesOf(level);
|
||||
s.Extra[Key] = enabled;
|
||||
if (range is not null)
|
||||
s.Extra[RangeKey] = range;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace StarterNG.Domain.Settings;
|
||||
|
||||
/// <summary>The renderers a gfxrenderer word picks, as application.cpp tells them apart.</summary>
|
||||
public enum RendererKind { Modern, Legacy }
|
||||
|
||||
public static class Renderers
|
||||
{
|
||||
/// <summary>"legacy", "simple", "simpleshader" and "off" draw with the legacy renderer, any other word with the full one.</summary>
|
||||
public static RendererKind KindOf(string renderer) => renderer.ToLowerInvariant() switch
|
||||
{
|
||||
"legacy" or "simple" or "simpleshader" or "off" => RendererKind.Legacy,
|
||||
_ => RendererKind.Modern
|
||||
};
|
||||
}
|
||||
@@ -5,13 +5,14 @@ using System.Linq;
|
||||
|
||||
namespace StarterNG.Domain.Settings;
|
||||
|
||||
public enum SimulatorKeyKind { Toggle, Number, Text }
|
||||
public enum SimulatorKeyKind { Toggle, Number, Text, Choice }
|
||||
|
||||
/// <summary>
|
||||
/// An eu07.ini key the simulator reads that needs no logic of the starter's own:
|
||||
/// a switch, a number or a word, shown as one row of the settings. The default
|
||||
/// is the simulator's own, from Globals.h, used while the file does not carry
|
||||
/// the key.
|
||||
/// a switch, a number, a word or one of a few words, shown as one row of the settings.
|
||||
/// The default is the simulator's own, from Globals.h, used while the file does not
|
||||
/// carry the key - but for a key the starter <see cref="Writes"/>, where it is the
|
||||
/// starter's own: the faster choice the simulator does not make by itself.
|
||||
/// </summary>
|
||||
public sealed record SimulatorKey(
|
||||
string Key,
|
||||
@@ -24,7 +25,9 @@ public sealed record SimulatorKey(
|
||||
double Step = 1,
|
||||
string Unit = "",
|
||||
bool ZeroIsOff = false,
|
||||
int Repeat = 1)
|
||||
int Repeat = 1,
|
||||
bool Writes = false,
|
||||
IReadOnlyList<string>? Choices = null)
|
||||
{
|
||||
/// <summary>The label's translation key; the explanation's adds "Desc".</summary>
|
||||
public string LabelKey => "Ini." + Key;
|
||||
@@ -36,6 +39,42 @@ public sealed record SimulatorKey(
|
||||
|
||||
public static string FormatToggle(bool value) => value ? "yes" : "no";
|
||||
|
||||
/// <summary>The words of a level the simulator takes for 0 to 3 as well.</summary>
|
||||
public static readonly IReadOnlyList<string> Levels = new[] { "no", "low", "medium", "high" };
|
||||
|
||||
/// <summary>
|
||||
/// Where <paramref name="raw"/> stands among the <see cref="Choices"/>: its word, or the number the simulator
|
||||
/// takes for a level (gfx.ssr 2 is medium); -1 for one it is not.
|
||||
/// </summary>
|
||||
public int ChoiceIndex(string raw)
|
||||
{
|
||||
if (Choices is null)
|
||||
return -1;
|
||||
string word = FirstToken(raw);
|
||||
for (int i = 0; i < Choices.Count; i++)
|
||||
if (string.Equals(Choices[i], word, StringComparison.OrdinalIgnoreCase))
|
||||
return i;
|
||||
// The other words the simulator takes for one of them (couplerphysics true, physics.derailment no).
|
||||
string? alias = word.ToLowerInvariant() switch
|
||||
{
|
||||
"true" or "1" => "yes",
|
||||
"no" => "off",
|
||||
_ => null
|
||||
};
|
||||
if (alias is not null)
|
||||
for (int i = 0; i < Choices.Count; i++)
|
||||
if (string.Equals(Choices[i], alias, StringComparison.Ordinal))
|
||||
return i;
|
||||
if (ReferenceEquals(Choices, Levels) &&
|
||||
int.TryParse(word, NumberStyles.Integer, CultureInfo.InvariantCulture, out int level) &&
|
||||
level >= 0 && level < Choices.Count)
|
||||
return level;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>The label's translation key of the word <paramref name="choice"/>.</summary>
|
||||
public static string ChoiceLabelKey(string choice) => "Choice." + choice;
|
||||
|
||||
/// <summary>The key's value in <paramref name="s"/>, in the file's words: what is set, or else the default.</summary>
|
||||
public string RawIn(SimulatorSettings s) => s.Extra.TryGetValue(Key, out string? raw) ? raw : Default;
|
||||
|
||||
@@ -64,10 +103,14 @@ public sealed record SimulatorKey(
|
||||
public static class SimulatorKeys
|
||||
{
|
||||
/// <summary>
|
||||
/// The keys a player sees in the standard mode, which has what the old starter had. It had
|
||||
/// none of these: they are all for the advanced mode.
|
||||
/// The keys a player sees in the standard mode. The rest are the developer tab's, which only the advanced
|
||||
/// mode shows: a player in the standard mode has them at their defaults, the fast choice.
|
||||
/// </summary>
|
||||
public static readonly IReadOnlySet<string> Standard = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
public static readonly IReadOnlySet<string> Standard = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"ui.scale",
|
||||
"couplerphysics", "physics.derailment", "physics.collisions", "physics.trackbuckling", "deer"
|
||||
};
|
||||
|
||||
public const string General = "general";
|
||||
public const string Graphics = "graphics";
|
||||
@@ -75,8 +118,13 @@ public static class SimulatorKeys
|
||||
public const string Physics = "physics";
|
||||
public const string Advanced = "advanced";
|
||||
|
||||
private static SimulatorKey Toggle(string key, bool value, string category, string section) =>
|
||||
new(key, SimulatorKeyKind.Toggle, SimulatorKey.FormatToggle(value), category, section);
|
||||
public const string RendererSection = "IniSectionRenderer";
|
||||
public const string QualitySection = "IniSectionQuality";
|
||||
public const string PerformanceSection = "IniSectionPerformance";
|
||||
public const string LogsSection = "IniSectionLogs";
|
||||
|
||||
private static SimulatorKey Toggle(string key, bool value, string category, string section, bool writes = false) =>
|
||||
new(key, SimulatorKeyKind.Toggle, SimulatorKey.FormatToggle(value), category, section, Writes: writes);
|
||||
|
||||
private static SimulatorKey Number(string key, double value, string category, string section,
|
||||
double min, double max, double step, string unit = "",
|
||||
@@ -87,47 +135,112 @@ public static class SimulatorKeys
|
||||
private static SimulatorKey Text(string key, string category, string section) =>
|
||||
new(key, SimulatorKeyKind.Text, string.Empty, category, section);
|
||||
|
||||
private static SimulatorKey Choice(string key, string value, string section, IReadOnlyList<string>? choices = null,
|
||||
string category = Advanced) =>
|
||||
new(key, SimulatorKeyKind.Choice, value, category, section, Choices: choices ?? SimulatorKey.Levels);
|
||||
|
||||
public const string RealismSection = "RealismSection";
|
||||
|
||||
public static SimulatorKey Named(string key) => All.First(k => k.Key == key);
|
||||
|
||||
public static IReadOnlyList<SimulatorKey> All { get; } = new[]
|
||||
{
|
||||
Number("ui.scale", 1, General, "IniSectionInterface", 0.5, 3, 0.05, "×"),
|
||||
Number("ui.fontsize", 13, General, "IniSectionInterface", 8, 32, 1, " px"),
|
||||
Number("ui.bg.opacity", 0.94, General, "IniSectionInterface", 0.1, 1, 0.05),
|
||||
Toggle("gui.defaultwindows", true, General, "IniSectionInterface"),
|
||||
Toggle("gui.trainingdefault", false, General, "IniSectionInterface"),
|
||||
Toggle("gui.showtranscripts", true, General, "IniSectionInterface"),
|
||||
Toggle("loadinglog", false, General, "IniSectionInterface"),
|
||||
Toggle("captureonstart", true, General, "IniSectionInterface"),
|
||||
Toggle("mousecontrol", true, General, "IniSectionInterface"),
|
||||
Text("screenshotsdir", General, "IniSectionInterface"),
|
||||
Number("ui.fontsize", 13, Advanced, "IniSectionInterface", 8, 32, 1, " px"),
|
||||
Number("ui.bg.opacity", 0.94, Advanced, "IniSectionInterface", 0.1, 1, 0.05),
|
||||
Toggle("gui.defaultwindows", true, Advanced, "IniSectionInterface"),
|
||||
Toggle("gui.trainingdefault", false, Advanced, "IniSectionInterface"),
|
||||
Toggle("gui.showtranscripts", true, Advanced, "IniSectionInterface"),
|
||||
Toggle("captureonstart", true, Advanced, "IniSectionInterface"),
|
||||
Toggle("mousecontrol", true, Advanced, "IniSectionInterface"),
|
||||
Text("screenshotsdir", Advanced, "IniSectionInterface"),
|
||||
|
||||
Number("basedrawrange", 2500, Graphics, "IniSectionRanges", 500, 10000, 250, " m"),
|
||||
Number("heightbase", 1, Graphics, "IniSectionRanges", 0.5, 3, 0.05, "×"),
|
||||
Number("targetfps", 0, Graphics, "IniSectionRanges", 0, 240, 5, " FPS", zeroIsOff: true),
|
||||
Number("sleeperdistance", 250, Graphics, "IniSectionRanges", 0, 1000, 50, " m", zeroIsOff: true),
|
||||
Number("gfx.reflections.range_instances", 750, Graphics, "IniSectionRanges", 0, 3000, 50, " m"),
|
||||
Number("gfx.reflections.range_vehicles", 250, Graphics, "IniSectionRanges", 0, 2000, 50, " m"),
|
||||
Toggle("gfx.textures.streaming", false, Graphics, "IniSectionRanges"),
|
||||
Number("gfx.textures.releasedistance", 0, Graphics, "IniSectionRanges", 0, 10, 0.5, "×", zeroIsOff: true),
|
||||
Toggle("skyenabled", true, Graphics, "IniSectionRanges"),
|
||||
Toggle("rendercab", true, Graphics, "IniSectionRanges"),
|
||||
Number("gfx.postfx.motionblur.shutter", 0.01, Graphics, "IniSectionRanges", 0.001, 0.1, 0.001, " s"),
|
||||
Number("python.fpslimit", 100, Graphics, "IniSectionRanges", 5, 200, 5, " FPS"),
|
||||
Toggle("python.vsync", true, Graphics, "IniSectionRanges"),
|
||||
Toggle("python.displaywindows", false, Graphics, "IniSectionRanges"),
|
||||
Toggle("newaircouplers", true, Graphics, "IniSectionRanges"),
|
||||
Toggle("smoothtraction", true, Graphics, "IniSectionRanges"),
|
||||
// The renderer: what only Vulkan reads, and the shaders of either.
|
||||
Text("gfx.vulkan.device", Advanced, RendererSection),
|
||||
Toggle("gfx.vulkan.renderthread", true, Advanced, RendererSection),
|
||||
Number("gfx.threads", 0, Advanced, RendererSection, 0, 64, 1, zeroIsOff: true),
|
||||
Toggle("gfx.vulkan.asyncresources", true, Advanced, RendererSection),
|
||||
Toggle("gfx.vulkan.parallelpasses", true, Advanced, RendererSection),
|
||||
Toggle("gfx.vulkan.parallelmodels", true, Advanced, RendererSection),
|
||||
Toggle("gfx.vulkan.asynccompute", false, Advanced, RendererSection),
|
||||
Number("gfx.vulkan.framesinflight", 2, Advanced, RendererSection, 2, 3, 1),
|
||||
Toggle("gfx.shaders.binaries", true, Advanced, RendererSection),
|
||||
|
||||
Number("sound.maxsources", 30, Sound, "IniSectionAudio", 8, 256, 8),
|
||||
Toggle("sound.asyncload", false, Sound, "IniSectionAudio"),
|
||||
// The parts of the picture of the OpenGL 4.6 and Vulkan renderers the levels set, one by one.
|
||||
Choice("gfx.lights.shadows", "medium", QualitySection),
|
||||
Choice("gfx.contactshadows", "no", QualitySection),
|
||||
Toggle("gfx.shadow.sdsm", false, Advanced, QualitySection),
|
||||
Choice("gfx.ssr", "medium", QualitySection),
|
||||
Toggle("gfx.raytracing", false, Advanced, QualitySection),
|
||||
Number("gfx.raytracing.range", 500, Advanced, QualitySection, 10, 5000, 10, " m"),
|
||||
Choice("gfx.cabprobe", "medium", QualitySection),
|
||||
Toggle("gfx.water.realistic", false, Advanced, QualitySection),
|
||||
Choice("gfx.postfx.ao", "gtao", QualitySection, new[] { "no", "ssao", "gtao" }),
|
||||
Choice("gfx.fog.quality", "medium", QualitySection, new[] { "low", "medium", "high", "ultra" }),
|
||||
Choice("gfx.clouds", "medium", QualitySection, new[] { "no", "low", "medium", "high", "ultra" }),
|
||||
Toggle("gfx.postfx.bloom", true, Advanced, QualitySection),
|
||||
Toggle("gfx.grass", true, Advanced, QualitySection),
|
||||
Number("gfx.grass.distance", 60, Advanced, QualitySection, 5, 500, 5, " m"),
|
||||
Number("gfx.grass.fadedistance", 70, Advanced, QualitySection, 5, 600, 5, " m"),
|
||||
Number("gfx.grass.density", 1, Advanced, QualitySection, 0, 4, 0.25, "×"),
|
||||
Number("gfx.precipitation.particles", 65536, Advanced, QualitySection, 0, 262144, 4096),
|
||||
Choice("gfx.dlss.preset", "default", QualitySection, new[] { "default", "j", "k", "l", "m" }),
|
||||
Choice("gfx.framegeneration", "off", QualitySection, new[] { "off", "x2", "x3", "x4" }),
|
||||
Choice("gfx.reflex", "off", QualitySection, new[] { "off", "on", "boost" }),
|
||||
|
||||
Toggle("loadtraction", true, Physics, "IniSectionPhysics"),
|
||||
Toggle("rollfix", true, Physics, "IniSectionPhysics"),
|
||||
Number("shakefactor", 1, Physics, "IniSectionPhysics", 0, 3, 0.1, "×", repeat: 3),
|
||||
Toggle("map.manualswitchcontrol", false, Physics, "IniSectionPhysics"),
|
||||
Number("map.highlightdistance", 3000, Physics, "IniSectionPhysics", 0, 10000, 250, " m", zeroIsOff: true),
|
||||
Number("basedrawrange", 2500, Advanced, "IniSectionRanges", 500, 10000, 250, " m"),
|
||||
Number("heightbase", 1, Advanced, "IniSectionRanges", 0.5, 3, 0.05, "×"),
|
||||
Number("targetfps", 0, Advanced, "IniSectionRanges", 0, 240, 5, " FPS", zeroIsOff: true),
|
||||
Number("sleeperdistance", 250, Advanced, "IniSectionRanges", 0, 1000, 50, " m", zeroIsOff: true),
|
||||
Number("gfx.reflections.range_instances", 750, Advanced, "IniSectionRanges", 0, 3000, 50, " m"),
|
||||
Number("gfx.reflections.range_vehicles", 250, Advanced, "IniSectionRanges", 0, 2000, 50, " m"),
|
||||
Toggle("rendercab", true, Advanced, "IniSectionRanges"),
|
||||
Number("gfx.postfx.motionblur.shutter", 0.01, Advanced, "IniSectionRanges", 0.001, 0.1, 0.001, " s"),
|
||||
Number("python.fpslimit", 100, Advanced, "IniSectionRanges", 5, 200, 5, " FPS"),
|
||||
Toggle("python.vsync", true, Advanced, "IniSectionRanges"),
|
||||
Toggle("python.displaywindows", false, Advanced, "IniSectionRanges"),
|
||||
Toggle("newaircouplers", true, Advanced, "IniSectionRanges"),
|
||||
|
||||
Toggle("showsystemconsole", false, Advanced, "IniSectionConsole"),
|
||||
// What makes the simulator faster at no cost to the picture. Where the simulator's own default is the
|
||||
// slower one, the starter writes its own: the standard mode keeps them all on.
|
||||
Toggle("gfx.gpucull", true, Advanced, PerformanceSection, writes: true),
|
||||
Toggle("gfx.gpucull.occlusion", true, Advanced, PerformanceSection),
|
||||
Toggle("gfx.depthprepass", true, Advanced, PerformanceSection),
|
||||
Toggle("gfx.textures.streaming", true, Advanced, PerformanceSection, writes: true),
|
||||
Number("gfx.textures.releasedistance", 0, Advanced, PerformanceSection, 0, 10, 0.5, "×", zeroIsOff: true),
|
||||
Toggle("sound.asyncload", true, Advanced, PerformanceSection, writes: true),
|
||||
Toggle("physics.sleepheld", true, Advanced, PerformanceSection, writes: true),
|
||||
Toggle("physics.roadlod", true, Advanced, PerformanceSection, writes: true),
|
||||
Toggle("performance.multithreading", true, Advanced, PerformanceSection),
|
||||
Toggle("file.binary.terrain", true, Advanced, PerformanceSection),
|
||||
Toggle("gfx.smoke.gpu", true, Advanced, PerformanceSection),
|
||||
Toggle("gfx.weather.occlusion", true, Advanced, PerformanceSection),
|
||||
Toggle("gfx.clouds.interleave", true, Advanced, PerformanceSection),
|
||||
Toggle("screens.gpupost", true, Advanced, PerformanceSection),
|
||||
Number("screens.cabframes", 4, Advanced, PerformanceSection, 1, 60, 1),
|
||||
Number("screens.externalframes", 30, Advanced, PerformanceSection, 1, 120, 1),
|
||||
|
||||
Number("sound.maxsources", 30, Advanced, "IniSectionAudio", 8, 256, 8),
|
||||
|
||||
// How true to life the driving is: the physics/ models of utilities/Globals.cpp, from the legacy ones on.
|
||||
Choice("couplerphysics", "no", RealismSection, new[] { "no", "yes", "all" }, Physics),
|
||||
Choice("physics.derailment", "monitor", RealismSection, new[] { "off", "monitor", "new", "old" }, Physics),
|
||||
Choice("physics.collisions", "new", RealismSection, new[] { "old", "new", "monitor" }, Physics),
|
||||
Choice("physics.trackbuckling", "scenery", RealismSection, new[] { "off", "scenery", "auto" }, Physics),
|
||||
Toggle("deer", false, Physics, RealismSection),
|
||||
Toggle("physics.derailment.trustlimits", true, Advanced, "IniSectionPhysics"),
|
||||
Toggle("controlcoupling.enginecheck", true, Advanced, "IniSectionPhysics"),
|
||||
Toggle("ai.brakesetting.cw1", true, Advanced, "IniSectionPhysics"),
|
||||
Toggle("loadtraction", true, Advanced, "IniSectionPhysics"),
|
||||
Toggle("rollfix", true, Advanced, "IniSectionPhysics"),
|
||||
Number("shakefactor", 1, Advanced, "IniSectionPhysics", 0, 3, 0.1, "×", repeat: 3),
|
||||
Toggle("map.manualswitchcontrol", false, Advanced, "IniSectionPhysics"),
|
||||
Number("map.highlightdistance", 3000, Advanced, "IniSectionPhysics", 0, 10000, 250, " m", zeroIsOff: true),
|
||||
|
||||
Toggle("loadinglog", false, Advanced, LogsSection),
|
||||
Toggle("showsystemconsole", false, Advanced, LogsSection),
|
||||
Number("debug.perflog", 0, Advanced, LogsSection, 0, 60, 1, " s", zeroIsOff: true),
|
||||
Toggle("crashdump.full", false, Advanced, LogsSection),
|
||||
Toggle("physics.trackcheck", false, Advanced, LogsSection),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,8 +8,13 @@ public enum ConsistReadyOverride { Scenery = 0, AlwaysCold = 1, AlwaysReady = 2
|
||||
|
||||
public enum ExeProblem { None, NotFound, NotExecutable, WrongPlatform, NotAProgram }
|
||||
|
||||
// multisampling: 0 off, then 2, 4 and 8 samples.
|
||||
public enum AntiAliasingMode { Off, Msaa2, Msaa4, Msaa8 }
|
||||
// gfx.antialiasing (and the older multisampling, 0 off, then 2, 4 and 8 samples). Dlss and Dlaa are the Vulkan
|
||||
// renderer's only, on an NVIDIA RTX card with a build that has DLSS; the simulator falls back to TAA elsewhere.
|
||||
public enum AntiAliasingMode { Off, Msaa2, Msaa4, Msaa8, Msaa16, Taa, Dlss, Dlaa }
|
||||
|
||||
// gfxrenderer: the Vulkan 1.4 renderer, which the simulator leaves for the OpenGL one where it cannot run, or the
|
||||
// OpenGL 4.6 one ("default").
|
||||
public enum GraphicsBackend { Vulkan, OpenGL }
|
||||
|
||||
public sealed class SimulatorSettings
|
||||
{
|
||||
@@ -52,16 +57,19 @@ public sealed class SimulatorSettings
|
||||
public bool VirtualShunting = true;
|
||||
public bool LogMissingVehicleFiles;
|
||||
|
||||
public int RenderEngine;
|
||||
/// <summary>The renderer: Vulkan unless the advanced mode chose OpenGL.</summary>
|
||||
public GraphicsBackend Backend = GraphicsBackend.Vulkan;
|
||||
|
||||
/// <summary>
|
||||
/// The file's gfxrenderer word where it is none the starter knows - vulkan, written in by
|
||||
/// hand for a build that has it: written back as it is until another renderer is chosen.
|
||||
/// The file's gfxrenderer word where it is none the starter knows - "null" of the test runs, or one of a
|
||||
/// newer simulator: written back as it is until another renderer is chosen.
|
||||
/// </summary>
|
||||
public string? RendererWord;
|
||||
|
||||
public int Width = 1280;
|
||||
public int Height = 720;
|
||||
|
||||
/// <summary>gfx.buffer.percent, in percent: the part of the window the picture is drawn at, then stretched to it.</summary>
|
||||
public int BufferScalePercent = 100;
|
||||
public int MaxTextureSize = 4096;
|
||||
public int MaxCabTextureSize = 4096;
|
||||
@@ -78,19 +86,13 @@ public sealed class SimulatorSettings
|
||||
public bool EnvMap = true;
|
||||
public bool RenderShadows = true;
|
||||
|
||||
// Only the legacy renderer, or only Windows builds, read these.
|
||||
public bool UseVbo = true;
|
||||
public bool RenderAngleVulkan;
|
||||
public bool UseGLES;
|
||||
public int CabShadowsRange;
|
||||
|
||||
/// <summary>Updates of the reflections a second; the simulator's own is one in five minutes.</summary>
|
||||
public double ReflectionsFramerate = 1 / 300.0;
|
||||
public int ShadowMapResolution = 2048;
|
||||
/// <summary>The third number of shadowtune; the second and fourth go unread.</summary>
|
||||
public int ShadowProjectionRange = 250;
|
||||
public int ShadowRankCutoff = 3;
|
||||
public int ReflectionsFidelity;
|
||||
public int ReflectionsFidelity = 2;
|
||||
public int FieldOfView = 45;
|
||||
public bool PythonScreens = true;
|
||||
public bool PythonThreadedUpload = true;
|
||||
@@ -165,6 +167,16 @@ public sealed class SimulatorSettings
|
||||
/// </summary>
|
||||
public bool MovedToStandard;
|
||||
|
||||
/// <summary>
|
||||
/// starter.settings.revision: the layout of the settings this file was last brought to. Below
|
||||
/// <see cref="CurrentRevision"/>, a player in the standard mode is moved to it once: the renderer and what
|
||||
/// only the developer tab shows at the starter's own values, the fast ones.
|
||||
/// </summary>
|
||||
public int Revision;
|
||||
|
||||
/// <summary>The layout of this starter: the standard mode on Vulkan, the rest in the developer tab.</summary>
|
||||
public const int CurrentRevision = 2;
|
||||
|
||||
/// <summary>Warn at start when the processor cannot run the official simulator builds.</summary>
|
||||
public bool CpuNotice = true;
|
||||
|
||||
@@ -197,26 +209,20 @@ public sealed class SimulatorSettings
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The gfxrenderer words the starter offers. "default" is the full renderer, the one to use
|
||||
/// wherever it runs; the other two draw with the legacy one. The experimental renderer is
|
||||
/// not offered: the simulator a player has is built without it.
|
||||
/// </summary>
|
||||
public static readonly string[] RenderEngines = { "default", "legacy", "simple" };
|
||||
|
||||
/// <summary>
|
||||
/// The words the starter places among <see cref="RenderEngines"/>: those application.cpp on
|
||||
/// master knows, but "experimental". Any other word is kept as <see cref="RendererWord"/>.
|
||||
/// The gfxrenderer words the simulator knows (utilities/Globals.cpp): the Vulkan ones, the OpenGL ones and
|
||||
/// those of the renderers it no longer has, which it reads as OpenGL. Any other word is kept as
|
||||
/// <see cref="RendererWord"/>.
|
||||
/// </summary>
|
||||
public static bool KnownRendererWord(string? word) =>
|
||||
word?.Trim().ToLowerInvariant() is "default" or "legacy" or "simple" or "simpleshader" or "off";
|
||||
word?.Trim().ToLowerInvariant() is "vulkan" or "vulkan14" or "default" or "full" or "opengl" or "gl46"
|
||||
or "legacy" or "simple" or "simpleshader" or "off" or "experimental";
|
||||
|
||||
/// <summary>Where <paramref name="word"/> stands among <see cref="RenderEngines"/>, as the simulator reads it.</summary>
|
||||
public static int RenderEngineOf(string word) => word.Trim().ToLowerInvariant() switch
|
||||
{
|
||||
"legacy" or "simpleshader" or "off" => 1,
|
||||
"simple" => 2,
|
||||
_ => 0
|
||||
};
|
||||
/// <summary>The renderer <paramref name="word"/> picks, as the simulator reads it.</summary>
|
||||
public static GraphicsBackend BackendOf(string word) =>
|
||||
word.Trim().ToLowerInvariant() is "vulkan" or "vulkan14" ? GraphicsBackend.Vulkan : GraphicsBackend.OpenGL;
|
||||
|
||||
/// <summary>The gfxrenderer word of <paramref name="backend"/>.</summary>
|
||||
public static string WordOf(GraphicsBackend backend) => backend == GraphicsBackend.Vulkan ? "vulkan" : "default";
|
||||
|
||||
/// <summary>
|
||||
/// The least shadow range the simulator keeps for a map size: a map above
|
||||
@@ -225,14 +231,13 @@ public sealed class SimulatorSettings
|
||||
public static int ShadowRangeFloor(int mapSize) => mapSize <= 2048 ? 75 : 75 * mapSize / 2048;
|
||||
|
||||
/// <summary>
|
||||
/// How far shadows actually reach. The full renderer's cascades stretch with a
|
||||
/// map above 2048 px (opengl33renderer.cpp), on top of the floor; the legacy
|
||||
/// one draws a single map out to the range itself.
|
||||
/// How far shadows actually reach: the cascades stretch with a map above 2048 px
|
||||
/// (rendering/common/shadowfit.cpp), on top of the floor.
|
||||
/// </summary>
|
||||
public static int ShadowReach(int range, int mapSize, bool legacyRenderer)
|
||||
public static int ShadowReach(int range, int mapSize)
|
||||
{
|
||||
int reach = Math.Max(range, ShadowRangeFloor(mapSize));
|
||||
return legacyRenderer || mapSize <= 2048 ? reach : reach * (mapSize / 2048);
|
||||
return mapSize <= 2048 ? reach : reach * (mapSize / 2048);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,15 +16,15 @@ public static class SliderRanges
|
||||
/// <summary>dynamiclights: 1 to 7.</summary>
|
||||
public const int MinDynamicLights = 1;
|
||||
|
||||
/// <summary>gfx.reflections.framerate, in updates a second.</summary>
|
||||
public static readonly double[] ReflectionUpdates = { 1, 3, 10, 25, 60 };
|
||||
/// <summary>
|
||||
/// gfx.reflections.framerate, in updates a second: from the simulator's own once in five minutes, which the
|
||||
/// levels below Very high keep, up to every frame.
|
||||
/// </summary>
|
||||
public static readonly double[] ReflectionUpdates = { 1 / 300.0, 1 / 60.0, 0.2, 1, 3, 10, 25, 60 };
|
||||
|
||||
/// <summary>gfx.drawrange.factor.max: normal, high and very high.</summary>
|
||||
public static readonly double[] DrawRangeFactors = { 1, 2, 3 };
|
||||
|
||||
/// <summary>gfx.shadows.cab.range, in metres: off, then 10 to 100.</summary>
|
||||
public static readonly double[] CabShadowRanges = { 0, 10, 20, 30, 50, 100 };
|
||||
|
||||
/// <summary>fpslimit: none, or up to 240, where the fastest usual monitors run.</summary>
|
||||
public static readonly double[] FrameRateLimits =
|
||||
{ 0, 20, 25, 30, 40, 45, 50, 60, 72, 75, 90, 100, 120, 144, 165, 180, 200, 240 };
|
||||
|
||||
@@ -11,15 +11,6 @@ namespace StarterNG.Infrastructure.Settings;
|
||||
|
||||
public sealed class SettingsSerializer
|
||||
{
|
||||
private readonly Func<string, (int Width, int Height)?>? _monitorSize;
|
||||
|
||||
/// <param name="monitorSize">
|
||||
/// The size of the monitor a full screen of the simulator goes to, by what fullscreenmonitor
|
||||
/// says; null where it is not known.
|
||||
/// </param>
|
||||
public SettingsSerializer(Func<string, (int Width, int Height)?>? monitorSize = null) =>
|
||||
_monitorSize = monitorSize;
|
||||
|
||||
/// <summary>
|
||||
/// An ini of before the tapes of the trains, its recording turned on ("blackbox yes", with the physics log of every
|
||||
/// vehicle, hundreds of files on a big scenery): moved to the tapes of the trains, the log of every vehicle off.
|
||||
@@ -91,8 +82,9 @@ public sealed class SettingsSerializer
|
||||
s.VirtualShunting = c.GetBool("ai.trainman", true);
|
||||
s.LogMissingVehicleFiles = c.GetBool("starter.logmissingvehicles", false);
|
||||
|
||||
string renderer = c.GetString("gfxrenderer", "default").Trim();
|
||||
s.RenderEngine = SimulatorSettings.RenderEngineOf(renderer);
|
||||
// Vulkan unless the file says otherwise: the simulator's own is OpenGL, so the starter always writes it.
|
||||
string renderer = c.GetString("gfxrenderer", SimulatorSettings.WordOf(GraphicsBackend.Vulkan)).Trim();
|
||||
s.Backend = SimulatorSettings.BackendOf(renderer);
|
||||
s.RendererWord = renderer.Length > 0 && !SimulatorSettings.KnownRendererWord(renderer) ? renderer : null;
|
||||
s.Width = c.GetInt("width", 1280);
|
||||
s.Height = c.GetInt("height", 720);
|
||||
@@ -110,8 +102,7 @@ public sealed class SettingsSerializer
|
||||
s.MotionBlur = c.GetBool("gfx.postfx.motionblur.enabled", true);
|
||||
s.ExtraEffects = c.GetBool("gfx.extraeffects", true);
|
||||
s.EnvMap = c.GetBool("gfx.envmap.enabled", true);
|
||||
s.UseVbo = c.GetBool("usevbo", true);
|
||||
s.RenderShadows = c.GetBool("shadows", true);
|
||||
s.RenderShadows = c.GetBool("gfx.shadowmap.enabled", true);
|
||||
// A negative rate counts as its size; none at all, as never.
|
||||
double reflections = Math.Abs(c.GetDouble("gfx.reflections.framerate", 1 / 300.0));
|
||||
s.ReflectionsFramerate = reflections > 0 ? reflections : 1 / 300.0;
|
||||
@@ -123,9 +114,9 @@ public sealed class SettingsSerializer
|
||||
if (shadowTune.Length >= 2) s.ShadowTuneUnused[0] = shadowTune[1];
|
||||
if (shadowTune.Length >= 4) s.ShadowTuneUnused[1] = shadowTune[3];
|
||||
|
||||
s.CabShadowsRange = (int)Math.Round(c.GetDouble("gfx.shadows.cab.range", 0));
|
||||
s.ShadowRankCutoff = c.GetInt("gfx.shadow.rank.cutoff", 3);
|
||||
s.ReflectionsFidelity = Clamp(c.GetInt("gfx.reflections.fidelity", 0), 0, 2);
|
||||
// the simulator's own: track sections, models and vehicles (Globals.h)
|
||||
s.ReflectionsFidelity = Clamp(c.GetInt("gfx.reflections.fidelity", 2), 0, 2);
|
||||
s.FieldOfView = Clamp((int)Math.Round(c.GetDouble("fieldofview", 45)), 10, 75);
|
||||
s.PythonScreens = c.GetBool("python.enabled", true);
|
||||
s.PythonThreadedUpload = c.GetBool("python.threadedupload", true);
|
||||
@@ -136,7 +127,6 @@ public sealed class SettingsSerializer
|
||||
s.ShadowAngleLimit = c.GetDouble("gfx.shadow.angle.min", 0.2);
|
||||
s.FullscreenWindowed = c.GetBool("fullscreenwindowed", false);
|
||||
s.FullscreenMonitor = LegacyText.Utf8From1250(c.GetString("fullscreenmonitor", "").Trim());
|
||||
s.RenderAngleVulkan = string.Equals(c.GetString("gfx.angleplatform", ""), "vulkan", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
s.SplineFidelity = Clamp(c.GetInt("splinefidelity", 1), 1, 4);
|
||||
s.FullPhysics = c.GetBool("fullphysics", true);
|
||||
@@ -172,7 +162,6 @@ public sealed class SettingsSerializer
|
||||
|
||||
s.CompressTextures = c.GetBool("compresstex", true);
|
||||
s.ScaleSpeculars = c.GetBool("scalespeculars", true);
|
||||
s.UseGLES = c.GetBool("gfx.usegles", false);
|
||||
s.ShaderGamma = c.GetBool("gfx.shadergamma", false);
|
||||
s.ScreenMipmaps = c.GetBool("python.mipmaps", true);
|
||||
s.ExtendedModelConversion = c.GetInt("convertmodels", 0) != 0;
|
||||
@@ -186,6 +175,7 @@ public sealed class SettingsSerializer
|
||||
s.AutoExpandSceneryTree = c.GetBool("starter.expandtree", false);
|
||||
s.AdvancedSettings = c.GetBool("starter.settings.advanced", false);
|
||||
s.MovedToStandard = c.GetBool("starter.settings.standard", false);
|
||||
s.Revision = c.GetInt("starter.settings.revision", 0);
|
||||
s.CpuNotice = c.GetBool("starter.cpunotice", true);
|
||||
s.Gpu = string.Equals(c.GetString("starter.gpu", "discrete"), "system", StringComparison.OrdinalIgnoreCase)
|
||||
? GpuPreference.System
|
||||
@@ -209,6 +199,9 @@ public sealed class SettingsSerializer
|
||||
foreach (var key in SimulatorKeys.All)
|
||||
if (c.Has(key.Key))
|
||||
s.Extra[key.Key] = c.GetRaw(key.Key) ?? string.Empty;
|
||||
// the faster choice the simulator's own default is not: written whether or not the file had it
|
||||
else if (key.Writes)
|
||||
s.Extra[key.Key] = key.Default;
|
||||
|
||||
GraphicsRules.Normalize(s);
|
||||
}
|
||||
@@ -220,16 +213,36 @@ public sealed class SettingsSerializer
|
||||
/// </summary>
|
||||
public static readonly string[] FixedLengthKeys = { "uart", "uarttune", "uartfeature" };
|
||||
|
||||
/// <summary>Keys written only when they say something, besides those of <see cref="SimulatorKeys"/>.</summary>
|
||||
public static readonly string[] OptionalKeys = { "fpslimit", "gfx.angleplatform", "fullscreenmonitor" };
|
||||
/// <summary>
|
||||
/// Keys the simulator takes more than one line of (utilities/Globals.cpp), each adding one more: of these a
|
||||
/// line again is no duplicate.
|
||||
/// </summary>
|
||||
public static readonly string[] RepeatableKeys = { "network.server", "python.viewport", "extraviewport", "test.vehicle" };
|
||||
|
||||
/// <summary>Keys no simulator reads any more, taken out of the file on a save.</summary>
|
||||
/// <summary>Keys written only when they say something, besides those of <see cref="SimulatorKeys"/>.</summary>
|
||||
public static readonly string[] OptionalKeys = { "fpslimit", "fullscreenmonitor" };
|
||||
|
||||
/// <summary>
|
||||
/// Keys the simulator no longer goes by, taken out of the file on a save: those of the renderers it has no more,
|
||||
/// which it logs as unsupported (usevbo, gfx.usegles, gfx.angleplatform, the frame buffer's size in pixels in
|
||||
/// place of gfx.buffer.percent), those it reads and does nothing with, and the starter's own of before.
|
||||
/// </summary>
|
||||
public static readonly string[] ObsoleteKeys =
|
||||
{
|
||||
"gfx.postfx.tonemapping",
|
||||
"starter.developertools",
|
||||
// The keys of the OpenGL 4.6 and Vulkan renderers (gfx.vulkan.device, gfx.raytracing...) are not here:
|
||||
// written in by hand for a build that has them, they stay as the file has them.
|
||||
"usevbo",
|
||||
"gfx.usegles",
|
||||
"gfx.angleplatform",
|
||||
"gfx.framebuffer.width",
|
||||
"gfx.framebuffer.height",
|
||||
"starter.bufferscale",
|
||||
"shadows",
|
||||
"gfx.shadows.cab.range",
|
||||
"smoothtraction",
|
||||
"skyenabled",
|
||||
"hideconsole",
|
||||
"slowmotion",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -283,18 +296,18 @@ public sealed class SettingsSerializer
|
||||
c.SetBool("ai.trainman", s.VirtualShunting);
|
||||
c.SetBool("starter.logmissingvehicles", s.LogMissingVehicleFiles);
|
||||
|
||||
c.Set("gfxrenderer", s.RendererWord ?? SimulatorSettings.RenderEngines[Clamp(s.RenderEngine, 0, SimulatorSettings.RenderEngines.Length - 1)]);
|
||||
c.Set("gfxrenderer", s.RendererWord ?? SimulatorSettings.WordOf(s.Backend));
|
||||
c.SetInt("width", s.Width);
|
||||
c.SetInt("height", s.Height);
|
||||
c.SetInt("starter.bufferscale", s.BufferScalePercent);
|
||||
// The simulator draws into a buffer of this size and stretches it to the window.
|
||||
var (bufferWidth, bufferHeight) = FramebufferSize(s);
|
||||
c.SetInt("gfx.framebuffer.width", bufferWidth);
|
||||
c.SetInt("gfx.framebuffer.height", bufferHeight);
|
||||
// The simulator draws at this part of the window and stretches it to the window.
|
||||
c.SetDouble("gfx.buffer.percent", s.BufferScalePercent / 100.0);
|
||||
c.SetInt("maxtexturesize", s.MaxTextureSize);
|
||||
c.SetInt("maxcabtexturesize", s.MaxCabTextureSize);
|
||||
c.SetDouble("anisotropicfiltering", s.TextureFiltering);
|
||||
// The older key for the simulators before gfx.antialiasing; of the two, the simulator heeds the one further
|
||||
// down, which SettingsStore keeps gfx.antialiasing.
|
||||
c.SetInt("multisampling", MultisamplingLevel(s.AntiAliasing));
|
||||
c.Set("gfx.antialiasing", AntiAliasingWord(s.AntiAliasing));
|
||||
c.SetInt("dynamiclights", s.DynamicLights);
|
||||
c.SetDouble("gfx.drawrange.factor.max", s.DrawRangeFactor);
|
||||
c.SetBool("vsync", s.VSync);
|
||||
@@ -304,14 +317,11 @@ public sealed class SettingsSerializer
|
||||
c.SetBool("gfx.postfx.motionblur.enabled", s.MotionBlur);
|
||||
c.SetBool("gfx.extraeffects", s.ExtraEffects);
|
||||
c.SetBool("gfx.envmap.enabled", s.EnvMap);
|
||||
c.SetBool("usevbo", s.UseVbo);
|
||||
c.SetBool("shadows", s.RenderShadows);
|
||||
c.SetBool("gfx.shadowmap.enabled", s.RenderShadows);
|
||||
c.Set("gfx.reflections.framerate", s.ReflectionsFramerate.ToString("0.######", CultureInfo.InvariantCulture));
|
||||
c.Set("shadowtune",
|
||||
$"{s.ShadowMapResolution} {s.ShadowTuneUnused[0]} " +
|
||||
$"{s.ShadowProjectionRange} {s.ShadowTuneUnused[1]}");
|
||||
c.SetInt("gfx.shadows.cab.range", s.CabShadowsRange);
|
||||
c.SetInt("gfx.shadow.rank.cutoff", s.ShadowRankCutoff);
|
||||
c.SetInt("gfx.reflections.fidelity", s.ReflectionsFidelity);
|
||||
c.SetInt("fieldofview", s.FieldOfView);
|
||||
@@ -323,7 +333,6 @@ public sealed class SettingsSerializer
|
||||
// The simulator compares the word with GLFW's name of the monitor, which is UTF-8.
|
||||
if (!string.IsNullOrWhiteSpace(s.FullscreenMonitor))
|
||||
c.Set("fullscreenmonitor", LegacyText.Utf8As1250(s.FullscreenMonitor.Trim()));
|
||||
if (s.RenderAngleVulkan) c.Set("gfx.angleplatform", "vulkan");
|
||||
|
||||
c.SetInt("splinefidelity", s.SplineFidelity);
|
||||
c.SetBool("fullphysics", s.FullPhysics);
|
||||
@@ -357,7 +366,6 @@ public sealed class SettingsSerializer
|
||||
|
||||
c.SetBool("compresstex", s.CompressTextures);
|
||||
c.SetBool("scalespeculars", s.ScaleSpeculars);
|
||||
c.SetBool("gfx.usegles", s.UseGLES);
|
||||
c.SetBool("gfx.shadergamma", s.ShaderGamma);
|
||||
c.SetBool("python.mipmaps", s.ScreenMipmaps);
|
||||
c.Set("convertmodels", s.ExtendedModelConversion ? "143" : "0");
|
||||
@@ -371,6 +379,7 @@ public sealed class SettingsSerializer
|
||||
c.SetBool("starter.expandtree", s.AutoExpandSceneryTree);
|
||||
c.SetBool("starter.settings.advanced", s.AdvancedSettings);
|
||||
c.SetBool("starter.settings.standard", s.MovedToStandard);
|
||||
c.SetInt("starter.settings.revision", s.Revision);
|
||||
c.SetBool("starter.cpunotice", s.CpuNotice);
|
||||
c.Set("starter.gpu", s.Gpu == GpuPreference.System ? "system" : "discrete");
|
||||
c.SetInt("starter.batterydefault", (int)s.ReadyOverride);
|
||||
@@ -389,49 +398,33 @@ public sealed class SettingsSerializer
|
||||
c.Set(key.Key, value.Trim());
|
||||
}
|
||||
|
||||
/// <summary>The keys of the frame buffer's size.</summary>
|
||||
public static readonly string[] FramebufferKeys = { "gfx.framebuffer.width", "gfx.framebuffer.height" };
|
||||
|
||||
/// <summary>What the simulator takes for "as large as the window" (opengl33renderer.cpp), its own default.</summary>
|
||||
public const int FramebufferOfWindow = -1;
|
||||
|
||||
/// <summary>
|
||||
/// The frame buffer of <paramref name="s"/>: its part of the window. Borderless, the window
|
||||
/// is the monitor whatever width and height say (application.cpp), so the buffer is the
|
||||
/// window's own, or its part of the monitor's size where that is known.
|
||||
/// </summary>
|
||||
private (int Width, int Height) FramebufferSize(SimulatorSettings s)
|
||||
{
|
||||
if (!s.FullscreenWindowed)
|
||||
return (Part(s.Width, s.BufferScalePercent), Part(s.Height, s.BufferScalePercent));
|
||||
if (s.BufferScalePercent < 100 &&
|
||||
_monitorSize?.Invoke(s.FullscreenMonitor.Trim()) is { Width: > 0, Height: > 0 } monitor)
|
||||
return (Part(monitor.Width, s.BufferScalePercent), Part(monitor.Height, s.BufferScalePercent));
|
||||
return (FramebufferOfWindow, FramebufferOfWindow);
|
||||
}
|
||||
|
||||
private static int Part(int size, int percent) => (int)Math.Round(size * percent / 100.0);
|
||||
|
||||
/// <summary>
|
||||
/// <paramref name="keys"/> with the keys that say the same setting along with them: the
|
||||
/// starter's own percent goes wherever the frame buffer's size does, or it would stand
|
||||
/// when the size is put back.
|
||||
/// <paramref name="keys"/> with the keys that say the same setting along with them: the anti-aliasing is
|
||||
/// written in two keys, the older for the simulators before the newer one.
|
||||
/// </summary>
|
||||
public static IReadOnlyCollection<string> WithCompanions(IReadOnlyCollection<string> keys)
|
||||
{
|
||||
if (!keys.Intersect(FramebufferKeys, StringComparer.OrdinalIgnoreCase).Any())
|
||||
if (!keys.Intersect(GraphicsGroup.AntiAliasingKeys, StringComparer.OrdinalIgnoreCase).Any())
|
||||
return keys;
|
||||
var all = new HashSet<string>(keys, StringComparer.OrdinalIgnoreCase) { "starter.bufferscale" };
|
||||
all.UnionWith(FramebufferKeys);
|
||||
var all = new HashSet<string>(keys, StringComparer.OrdinalIgnoreCase);
|
||||
all.UnionWith(GraphicsGroup.AntiAliasingKeys);
|
||||
return all;
|
||||
}
|
||||
|
||||
private static int ReadBufferScale(ConfigFile c) =>
|
||||
Clamp(BufferScaleIn(c), 25, GraphicsRules.MaxBufferScale);
|
||||
|
||||
// The starter's own percent, or the framebuffer the file sets against its window.
|
||||
/// <summary>
|
||||
/// The render scale in percent: gfx.buffer.percent as the simulator reads it (a fraction, or above 4 a percent),
|
||||
/// else what a starter of before left - its own percent, or the frame buffer the file set against its window.
|
||||
/// </summary>
|
||||
private static int BufferScaleIn(ConfigFile c)
|
||||
{
|
||||
if (c.Has("gfx.buffer.percent"))
|
||||
{
|
||||
double part = c.GetDouble("gfx.buffer.percent", 1);
|
||||
return (int)Math.Round(part > 4 ? part : part * 100);
|
||||
}
|
||||
if (c.Has("starter.bufferscale"))
|
||||
return c.GetInt("starter.bufferscale", 100);
|
||||
int width = c.GetInt("width", 0);
|
||||
@@ -452,16 +445,53 @@ public sealed class SettingsSerializer
|
||||
if (shadowTune.Length >= 3 && ParseDouble(shadowTune[2], 0) > GraphicsRules.MaxShadowRange)
|
||||
keys.Add("shadowtune");
|
||||
if (BufferScaleIn(c) > GraphicsRules.MaxBufferScale)
|
||||
keys.UnionWith(new[] { "starter.bufferscale", "gfx.framebuffer.width", "gfx.framebuffer.height" });
|
||||
keys.Add("gfx.buffer.percent");
|
||||
return keys;
|
||||
}
|
||||
|
||||
private static AntiAliasingMode ReadAntiAliasing(ConfigFile c) => c.GetInt("multisampling", 2) switch
|
||||
/// <summary>
|
||||
/// The anti-aliasing as the simulator reads it: of gfx.antialiasing and the older multisampling, the one further
|
||||
/// down the file, and with neither its own MSAA x4.
|
||||
/// </summary>
|
||||
private static AntiAliasingMode ReadAntiAliasing(ConfigFile c)
|
||||
{
|
||||
<= 0 => AntiAliasingMode.Off,
|
||||
1 => AntiAliasingMode.Msaa2,
|
||||
2 => AntiAliasingMode.Msaa4,
|
||||
_ => AntiAliasingMode.Msaa8
|
||||
if (c.Has("gfx.antialiasing") && c.LineOf("gfx.antialiasing") > c.LineOf("multisampling") &&
|
||||
AntiAliasingOfWord(c.GetString("gfx.antialiasing", "")) is { } mode)
|
||||
return mode;
|
||||
return c.GetInt("multisampling", 2) switch
|
||||
{
|
||||
<= 0 => AntiAliasingMode.Off,
|
||||
1 => AntiAliasingMode.Msaa2,
|
||||
2 => AntiAliasingMode.Msaa4,
|
||||
3 => AntiAliasingMode.Msaa8,
|
||||
_ => AntiAliasingMode.Msaa16
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>The mode of a gfx.antialiasing word; null for one the simulator does not know.</summary>
|
||||
private static AntiAliasingMode? AntiAliasingOfWord(string word) => word.Trim().ToLowerInvariant() switch
|
||||
{
|
||||
"off" or "no" or "none" or "0" => AntiAliasingMode.Off,
|
||||
"msaax2" => AntiAliasingMode.Msaa2,
|
||||
"msaax4" => AntiAliasingMode.Msaa4,
|
||||
"msaax8" => AntiAliasingMode.Msaa8,
|
||||
"msaax16" => AntiAliasingMode.Msaa16,
|
||||
"taa" => AntiAliasingMode.Taa,
|
||||
"dlss" => AntiAliasingMode.Dlss,
|
||||
"dlaa" => AntiAliasingMode.Dlaa,
|
||||
_ => null
|
||||
};
|
||||
|
||||
public static string AntiAliasingWord(AntiAliasingMode mode) => mode switch
|
||||
{
|
||||
AntiAliasingMode.Msaa2 => "msaax2",
|
||||
AntiAliasingMode.Msaa4 => "msaax4",
|
||||
AntiAliasingMode.Msaa8 => "msaax8",
|
||||
AntiAliasingMode.Msaa16 => "msaax16",
|
||||
AntiAliasingMode.Taa => "taa",
|
||||
AntiAliasingMode.Dlss => "dlss",
|
||||
AntiAliasingMode.Dlaa => "dlaa",
|
||||
_ => "off"
|
||||
};
|
||||
|
||||
private static int MultisamplingLevel(AntiAliasingMode mode) => mode switch
|
||||
@@ -469,6 +499,7 @@ public sealed class SettingsSerializer
|
||||
AntiAliasingMode.Msaa2 => 1,
|
||||
AntiAliasingMode.Msaa4 => 2,
|
||||
AntiAliasingMode.Msaa8 => 3,
|
||||
AntiAliasingMode.Msaa16 => 4,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
|
||||
@@ -23,14 +23,6 @@ internal static class SettingTexts
|
||||
|
||||
public static string Anisotropy(double value) => "x" + value.ToString("0.#", CultureInfo.CurrentCulture);
|
||||
|
||||
public static string AntiAliasing(AntiAliasingMode mode) => mode switch
|
||||
{
|
||||
AntiAliasingMode.Msaa2 => "MSAA x2",
|
||||
AntiAliasingMode.Msaa4 => "MSAA x4",
|
||||
AntiAliasingMode.Msaa8 => "MSAA x8",
|
||||
_ => App.Loc["MsaaNone"]
|
||||
};
|
||||
|
||||
public static string TwoDecimals(double value) => value.ToString("0.00", CultureInfo.CurrentCulture);
|
||||
|
||||
/// <summary>A rate below one a second reads better as the time between updates.</summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ using Avalonia.Platform.Storage;
|
||||
using StarterNG.Application;
|
||||
using StarterNG.Domain.Settings;
|
||||
using StarterNG.Infrastructure;
|
||||
using StarterNG.Infrastructure.Settings;
|
||||
|
||||
namespace StarterNG.Views;
|
||||
|
||||
@@ -37,12 +38,11 @@ public partial class Settings
|
||||
{
|
||||
if (_fileRendererItem is not null && ReferenceEquals(RenderEngineCb.SelectedItem, _fileRendererItem))
|
||||
{
|
||||
s.RenderEngine = 0;
|
||||
s.RendererWord = _fileRendererItem.Tag as string;
|
||||
}
|
||||
else
|
||||
{
|
||||
s.RenderEngine = Math.Max(0, RenderEngineCb.SelectedIndex);
|
||||
s.Backend = SelectedBackend();
|
||||
s.RendererWord = null;
|
||||
}
|
||||
if (!ShowsFileValue(AntiAliasingCb))
|
||||
@@ -78,7 +78,7 @@ public partial class Settings
|
||||
RenderEngineCb.SelectedItem = _fileRendererItem;
|
||||
}
|
||||
else
|
||||
RenderEngineCb.SelectedIndex = s.RenderEngine;
|
||||
SelectTag(RenderEngineCb, SimulatorSettings.WordOf(s.Backend));
|
||||
}
|
||||
|
||||
// ── How the simulator shows: full screen, borderless or in a window ──────
|
||||
@@ -252,19 +252,18 @@ public partial class Settings
|
||||
cb.SelectedIndex = index;
|
||||
}
|
||||
|
||||
private static string AntiAliasingTag(AntiAliasingMode mode) => mode switch
|
||||
{
|
||||
AntiAliasingMode.Msaa2 => "msaax2",
|
||||
AntiAliasingMode.Msaa4 => "msaax4",
|
||||
AntiAliasingMode.Msaa8 => "msaax8",
|
||||
_ => "off"
|
||||
};
|
||||
// The list's tags are the gfx.antialiasing words.
|
||||
private static string AntiAliasingTag(AntiAliasingMode mode) => SettingsSerializer.AntiAliasingWord(mode);
|
||||
|
||||
private static AntiAliasingMode AntiAliasingFromTag(string? tag) => tag switch
|
||||
{
|
||||
"msaax2" => AntiAliasingMode.Msaa2,
|
||||
"msaax4" => AntiAliasingMode.Msaa4,
|
||||
"msaax8" => AntiAliasingMode.Msaa8,
|
||||
"msaax16" => AntiAliasingMode.Msaa16,
|
||||
"taa" => AntiAliasingMode.Taa,
|
||||
"dlss" => AntiAliasingMode.Dlss,
|
||||
"dlaa" => AntiAliasingMode.Dlaa,
|
||||
_ => AntiAliasingMode.Off
|
||||
};
|
||||
}
|
||||
|
||||
+405
-314
@@ -80,12 +80,11 @@
|
||||
SelectionChanged="CategoryList_OnSelectionChanged">
|
||||
<ListBoxItem Tag="general" Content="{Binding [General], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="graphics" Content="{Binding [Graphic], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="effects" Content="{Binding [Effects], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="sound" Content="{Binding [Sounds], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="physics" Content="{Binding [Physics], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="devices" Content="{Binding [Communication], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="controls" Content="{Binding [Controls], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="advanced" Content="{Binding [Advanced], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ListBoxItem Tag="advanced" Content="{Binding [DeveloperTab], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
@@ -119,13 +118,37 @@
|
||||
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel x:Name="SettingsStack" Margin="20,18,20,18" MaxWidth="880">
|
||||
|
||||
<!-- The standard mode: the categories a player sees, every row one they understand. What only
|
||||
a developer needs is in the last category, which only the advanced mode shows. -->
|
||||
|
||||
<!-- ============================ GENERAL ============================ -->
|
||||
<StackPanel Tag="general">
|
||||
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
||||
Text="{Binding [General], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingsSection Header="{Binding [General], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="starter.exe.path" Label="{Binding [SelectEXE], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:SettingRow ConfigKey="lang" x:Name="LanguageRow" Label="{Binding [Language], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ChangeLanguageCb"
|
||||
SelectionChanged="LanguageComboBox_OnSelectionChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="ui.scale" />
|
||||
<ctl:SettingRow ConfigKey="inactivepause">
|
||||
<CheckBox x:Name="PauseInactiveCb" Content="{Binding [PauseSimInactive], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="pause">
|
||||
<CheckBox x:Name="PauseStartCb" Content="{Binding [PauseSimStart], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="ai.trainman" Description="{Binding [VirtualShuntingDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="VirtualShuntingCb" Content="{Binding [VirtualShunting], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<!-- Which simulator the start button runs: several builds can sit side by side. -->
|
||||
<ctl:SettingsSection Header="{Binding [SimulatorSection], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="starter.exe.path" Label="{Binding [SelectEXE], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [SelectEXEDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<Grid ColumnDefinitions="*,Auto" ColumnSpacing="6">
|
||||
<ComboBox x:Name="SelectExeCb" Classes="Localized" SelectedIndex="0" HorizontalAlignment="Stretch" />
|
||||
<Button x:Name="BrowseExeButton" Grid.Column="1" Classes="Flat" Cursor="Hand"
|
||||
@@ -133,16 +156,11 @@
|
||||
Content="{Binding [SelectEXEBrowse], Source={x:Static starterNg:App.Loc}}" />
|
||||
</Grid>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="lang" x:Name="LanguageRow" Label="{Binding [Language], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ChangeLanguageCb"
|
||||
SelectionChanged="LanguageComboBox_OnSelectionChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="inactivepause">
|
||||
<CheckBox x:Name="PauseInactiveCb" Content="{Binding [PauseSimInactive], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="pause">
|
||||
<CheckBox x:Name="PauseStartCb" Content="{Binding [PauseSimStart], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [MouseSection], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="mousescale" x:Name="CursorSensitivityRow"
|
||||
Label="{Binding [CursorSensitivity], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="CursorSensitivitySlider" Minimum="1" Maximum="4" TickFrequency="1"
|
||||
@@ -169,29 +187,6 @@
|
||||
<ctl:SettingRow ConfigKey="starter.expandtree">
|
||||
<CheckBox x:Name="AutoExpandTreeCb" Content="{Binding [AutoExpandSceneryTree], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="starter.batterydefault"
|
||||
Label="{Binding [ReadyOverride], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ReadyOverrideDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ReadyOverrideCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [ReadyOverrideScenery], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [ReadyOverrideCold], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [ReadyOverrideReady], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [Others], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow Description="{Binding [DebugModeDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="debugmode">
|
||||
<CheckBox x:Name="DebugModeCb" Content="{Binding [DebugMode], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="ai.trainman" Description="{Binding [VirtualShuntingDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="VirtualShuntingCb" Content="{Binding [VirtualShunting], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="starter.logmissingvehicles" Description="{Binding [LogMissingVehicleFilesDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="LogMissingVehicleFilesCb" Content="{Binding [LogMissingVehicleFiles], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
</StackPanel>
|
||||
@@ -200,48 +195,6 @@
|
||||
<StackPanel Tag="graphics" IsVisible="False">
|
||||
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
||||
Text="{Binding [Graphic], Source={x:Static starterNg:App.Loc}}" />
|
||||
<!-- Which renderer comes first: it decides which of the rows below the simulator reads. -->
|
||||
<ctl:SettingsSection Header="{Binding [GfxColRendering], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="gfxrenderer" Label="{Binding [RenderEngine], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [RenderEngineDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel Spacing="6">
|
||||
<ComboBox x:Name="RenderEngineCb" Classes="Localized" SelectedIndex="0"
|
||||
SelectionChanged="RenderEngineCb_OnSelectionChanged">
|
||||
<ComboBoxItem Content="{Binding [REFull], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [REOld], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [RESimp], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Advanced="True" x:Name="GpuRow" ConfigKey="starter.gpu" Label="{Binding [GpuChoice], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="GpuCb" Classes="Localized" SelectedIndex="0"
|
||||
SelectionChanged="GpuCb_OnSelectionChanged">
|
||||
<ComboBoxItem Content="{Binding [GpuDiscrete], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [GpuSystem], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.angleplatform" Description="{Binding [RenderAngleVulkanDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="RenderAngleVulkanCb" Content="{Binding [RenderAngleVulkan], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.extraeffects">
|
||||
<CheckBox x:Name="AdditionalShadersCb" Content="{Binding [AdditionalShadersEffects], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.skippipeline" Advanced="True" Description="{Binding [SkipPipelineDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel Spacing="6">
|
||||
<CheckBox x:Name="SkipPipelineCb" Content="{Binding [SkipPipeline], Source={x:Static starterNg:App.Loc}}" />
|
||||
</StackPanel>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="usevbo" Description="{Binding [RenderVBODesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="RenderVBOCb" Content="{Binding [RenderVBO], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="skyenabled" />
|
||||
<ctl:KeySlot Key="rendercab" />
|
||||
<ctl:KeySlot Key="newaircouplers" />
|
||||
<ctl:KeySlot Key="smoothtraction" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [GfxColImage], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<!-- fullscreen and fullscreenwindowed as the simulator reads them together; see DisplayModeOf. -->
|
||||
@@ -260,31 +213,13 @@
|
||||
<ctl:SettingRow x:Name="ResolutionRow" ConfigKey="width, height" Label="{Binding [Resolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ResolutionCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow x:Name="BufferScaleRow" Advanced="True" ConfigKey="gfx.framebuffer.width, gfx.framebuffer.height"
|
||||
<ctl:SettingRow x:Name="BufferScaleRow" ConfigKey="gfx.buffer.percent"
|
||||
Label="{Binding [BufforResolution], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [BufforResolutionDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ValueText="{Binding #bufferScale.Value, StringFormat='{}{0:0}%'}">
|
||||
<ctl:ReadableSlider Name="bufferScale" Minimum="25" Maximum="100" TickFrequency="1"
|
||||
<ctl:ReadableSlider Name="bufferScale" Minimum="50" Maximum="100" TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="fieldofview" Label="{Binding [FieldOfView], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [FieldOfViewDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ValueText="{Binding #fovSlider.Value, StringFormat='{}{0:0}°'}">
|
||||
<ctl:ReadableSlider Name="fovSlider" Minimum="10" Maximum="75" TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="45" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="multisampling"
|
||||
Label="{Binding [AntiAliasing], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [AntiAliasingDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel Spacing="6">
|
||||
<ComboBox x:Name="AntiAliasingCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Tag="off" Content="{Binding [MsaaNone], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="msaax2" Content="MSAA x2" />
|
||||
<ComboBoxItem Tag="msaax4" Content="MSAA x4" />
|
||||
<ComboBoxItem Tag="msaax8" Content="MSAA x8" />
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="vsync" Description="{Binding [VSyncDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="VSyncCb" Content="{Binding [VSync], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
@@ -301,199 +236,85 @@
|
||||
Text="{Binding [FpsVSyncNote], Source={x:Static starterNg:App.Loc}}" />
|
||||
</StackPanel>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="fieldofview" Label="{Binding [FieldOfView], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [FieldOfViewDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ValueText="{Binding #fovSlider.Value, StringFormat='{}{0:0}°'}">
|
||||
<ctl:ReadableSlider Name="fovSlider" Minimum="10" Maximum="75" TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="45" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection x:Name="DrawRangeSection" Header="{Binding [GfxColDrawRange], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- The parts of the picture a level sets in one go, each to take further on its own. -->
|
||||
<ctl:SettingsSection x:Name="QualitySection" Header="{Binding [GfxColQuality], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:KeySlot Key="basedrawrange" />
|
||||
<ctl:KeySlot Key="targetfps" />
|
||||
<ctl:SettingRow ConfigKey="gfx.drawrange.factor.max" x:Name="RenderRangeRow"
|
||||
Label="{Binding [RenderRange], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [RenderRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through Steps.DrawRangeFactors; see SliderSteps. -->
|
||||
<ctl:ReadableSlider x:Name="RenderRangeSlider"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="sleeperdistance" />
|
||||
<ctl:SettingRow ConfigKey="splinefidelity" x:Name="TrackCurvesRow"
|
||||
Label="{Binding [TrackCurvesQuality], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [TrackCurvesQualityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="TrackCurvesSlider" Minimum="1" Maximum="4" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="4"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection x:Name="TexturesSection" Header="{Binding [GfxColTextures], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="maxtexturesize" x:Name="TexResolutionRow"
|
||||
Label="{Binding [MaxTexResolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider Name="textureResolutionSlider" Minimum="9" Maximum="13" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12"
|
||||
ValueChanged="TextureResolutionSlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="maxcabtexturesize" x:Name="CabTexResolutionRow"
|
||||
Label="{Binding [MaxTexCabResolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider Name="cabTextureResolutionSlider" Minimum="9" Maximum="12" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12"
|
||||
ValueChanged="CabTextureResolutionSlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="anisotropicfiltering" x:Name="TexFilteringRow"
|
||||
Label="{Binding [TexFilteringQuality], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [TexFilteringQualityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through Steps.Anisotropy; see SliderSteps. -->
|
||||
<ctl:ReadableSlider x:Name="TexFilteringSlider"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.textures.streaming" />
|
||||
<ctl:KeySlot Key="gfx.textures.releasedistance" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [GfxColScripts], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="python.enabled" Description="{Binding [RenderScreensDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="RenderScreensCb" Content="{Binding [RenderScreens], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<StackPanel IsEnabled="{Binding #RenderScreensCb.IsChecked}">
|
||||
<ctl:SettingRow ConfigKey="python.threadedupload">
|
||||
<CheckBox x:Name="RenderScreensThreadCb" Content="{Binding [RenderScreensThread], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="python.updatetime" Label="{Binding [PyScreenPriority], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [PyScreenPriorityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="PyScreenPriorityCb" Classes="Localized">
|
||||
<ComboBoxItem Tag="200" Content="{Binding [PyPriorityNormal], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="400" Content="{Binding [PyPriorityLower], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="800" Content="{Binding [PyPriorityLowest], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="1600" Content="{Binding [PyPriorityIdle], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="python.fpslimit" />
|
||||
<ctl:KeySlot Key="python.vsync" />
|
||||
<ctl:KeySlot Key="python.displaywindows" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ============================ EFFECTS ============================ -->
|
||||
<StackPanel Tag="effects" IsVisible="False">
|
||||
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
||||
Text="{Binding [Effects], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingsSection ToggleKey="shadows" x:Name="ShadowsSection" Header="{Binding [GfxColShadows], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:SettingsSection.Toggle>
|
||||
<CheckBox x:Name="RenderShadowsCb" FontSize="12" MinHeight="0"
|
||||
Content="{Binding [RenderShadows], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingsSection.Toggle>
|
||||
<StackPanel IsEnabled="{Binding #RenderShadowsCb.IsChecked}">
|
||||
<ctl:SettingRow Description="{Binding [ShadowDisplayDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="gfx.shadow.rank.cutoff" Label="{Binding [ShadowDisplay], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ShadowDisplayCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [CSROnlyImportant], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [CSRLimited], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [CSRAll], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingRow ConfigKey="gfx.antialiasing, multisampling"
|
||||
Label="{Binding [AntiAliasing], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [AntiAliasingDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="AntiAliasingCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Tag="off" Content="{Binding [MsaaNone], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="taa" Content="TAA" />
|
||||
<ComboBoxItem Tag="msaax2" Content="MSAA x2" />
|
||||
<ComboBoxItem Tag="msaax4" Content="MSAA x4" />
|
||||
<ComboBoxItem Tag="msaax8" Content="MSAA x8" />
|
||||
<ComboBoxItem Tag="msaax16" Content="MSAA x16" />
|
||||
<ComboBoxItem Tag="dlss" Content="{Binding [AaDlss], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="dlaa" Content="{Binding [AaDlaa], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="shadowtune" x:Name="ShadowResolutionRow"
|
||||
Label="{Binding [ShadowsResolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider Name="shaderResolutionSlider" Minimum="10" Maximum="13" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12"
|
||||
ValueChanged="shaderResolutionSlider_OnValueChanged" />
|
||||
<ctl:SettingRow x:Name="GroupTexturesRow" Label="{Binding [GroupTextures], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [GroupTexturesDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="maxtexturesize, maxcabtexturesize, anisotropicfiltering, gfx.extraeffects">
|
||||
<ComboBox x:Name="GroupTexturesCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="shadowtune" x:Name="ShadowRangeRow"
|
||||
Label="{Binding [ShaderRange], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ShaderRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- The simulator's floor follows the map size: see shaderResolutionSlider_OnValueChanged. -->
|
||||
<ctl:ReadableSlider Name="shaderRange" Minimum="75" Maximum="400" TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="150"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
<ctl:SettingRow x:Name="GroupShadowsRow" Label="{Binding [GroupShadows], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [GroupShadowsDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="gfx.shadowmap.enabled, shadowtune, gfx.shadow.rank.cutoff, gfx.lights.shadows, gfx.contactshadows">
|
||||
<ComboBox x:Name="GroupShadowsCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.shadows.cab.range" x:Name="CabShadowRangeRow"
|
||||
Label="{Binding [CabShadowsRange], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [CabShadowsRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through SliderRanges.CabShadowRanges; see SliderSteps. -->
|
||||
<ctl:ReadableSlider Name="cabShaderSourceRange"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
<ctl:SettingRow x:Name="GroupReflectionsRow" Label="{Binding [GroupReflections], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [GroupReflectionsDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="gfx.envmap.enabled, gfx.reflections.fidelity, gfx.reflections.framerate, gfx.ssr, gfx.cabprobe">
|
||||
<ComboBox x:Name="GroupReflectionsCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.shadow.angle.min" x:Name="ShadowAngleLimitRow"
|
||||
Label="{Binding [ShadowAngleLimit], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ShadowAngleLimitDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:ReadableSlider x:Name="ShadowAngleLimitSlider" Minimum="0.2" Maximum="1.0"
|
||||
TickFrequency="0.1" IsSnapToTickEnabled="True" Value="0.2" HorizontalAlignment="Stretch"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
<DockPanel>
|
||||
<TextBlock DockPanel.Dock="Right" Classes="FieldHint"
|
||||
Text="{Binding [ShadowLimitShort], Source={x:Static starterNg:App.Loc}}" />
|
||||
<TextBlock Classes="FieldHint"
|
||||
Text="{Binding [ShadowLimitNone], Source={x:Static starterNg:App.Loc}}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<!-- Its own choice: no level turns it on, a level of it is how far the rays reach. -->
|
||||
<ctl:SettingRow x:Name="RayTracingRow" Label="{Binding [RayTracing], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [RayTracingDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="gfx.raytracing, gfx.raytracing.range">
|
||||
<ComboBox x:Name="RayTracingCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow x:Name="GroupLightingRow" Label="{Binding [GroupLighting], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [GroupLightingDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="gfx.postfx.ao, gfx.fog.quality, gfx.clouds">
|
||||
<ComboBox x:Name="GroupLightingCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow x:Name="GroupDrawRangeRow" Label="{Binding [GroupDrawRange], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [GroupDrawRangeDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="splinefidelity, gfx.drawrange.factor.max, gfx.grass, gfx.grass.distance, gfx.grass.fadedistance, gfx.grass.density">
|
||||
<ComboBox x:Name="GroupDrawRangeCb" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow x:Name="GroupParticlesRow" Label="{Binding [GroupParticles], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [GroupParticlesDesc], Source={x:Static starterNg:App.Loc}}"
|
||||
ConfigKey="gfx.smoke.fidelity, gfx.precipitation.particles">
|
||||
<ComboBox x:Name="GroupParticlesCb" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [GfxColLights], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow x:Name="DynamicLightsRow" Description="{Binding [DynamicLightsDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="dynamiclights" Label="{Binding [DynamicLights], Source={x:Static starterNg:App.Loc}}"
|
||||
ValueText="{Binding #DynamicLightsSlider.Value, StringFormat='{}{0:0}'}">
|
||||
<ctl:ReadableSlider x:Name="DynamicLightsSlider" Minimum="1" Maximum="7" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="7" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection x:Name="ReflectionsSection" Header="{Binding [GfxColReflections], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="gfx.envmap.enabled" Description="{Binding [ReflectionsCubeMapDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ReflectionsCubeMapCb" Content="{Binding [ReflectionsCubeMap], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<StackPanel x:Name="ReflectionRows">
|
||||
<ctl:SettingRow ConfigKey="gfx.reflections.fidelity" Label="{Binding [ReflectionsDetails], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ReflectionsDetailsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ReflectionsDetailsCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [RDTerrain], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModels], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModelsVehicles], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.reflections.framerate" x:Name="ReflectionsFramerateRow"
|
||||
Label="{Binding [ReflectionsFramerate], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ReflectionsFramerateDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through Steps.ReflectionUpdates; see SliderSteps. -->
|
||||
<ctl:ReadableSlider Name="reflectionsFramerate"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.reflections.range_instances" />
|
||||
<ctl:KeySlot Key="gfx.reflections.range_vehicles" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection x:Name="PostFxSection" Header="{Binding [GfxColPostFx], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- What is a matter of taste rather than of the card: no level touches these. -->
|
||||
<ctl:SettingsSection Header="{Binding [Effects], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="gfx.postfx.motionblur.enabled">
|
||||
<CheckBox x:Name="MotionBlurCb" Content="{Binding [MotionBlur], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.postfx.motionblur.shutter" />
|
||||
<ctl:SettingRow ConfigKey="gfx.postfx.chromaticaberration.enabled">
|
||||
<CheckBox x:Name="ChromaticAberrationCb" Content="{Binding [ChromaticAberration], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [GfxColNature], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="gfx.smoke" Margin="0,0,0,4">
|
||||
<ctl:SettingRow ConfigKey="gfx.smoke">
|
||||
<CheckBox x:Name="SmokeDisplayCb" Content="{Binding [SmokeDisplay], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.smoke.fidelity" x:Name="SmokeParticlesRow"
|
||||
Label="{Binding [SmokeParticlesMultiplier], Source={x:Static starterNg:App.Loc}}"
|
||||
IsEnabled="{Binding #SmokeDisplayCb.IsChecked}">
|
||||
<ctl:ReadableSlider x:Name="SmokeParticlesSlider" Minimum="1" Maximum="4" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="2"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
<ctl:SettingRow ConfigKey="python.enabled" Description="{Binding [RenderScreensDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="RenderScreensCb" Content="{Binding [RenderScreens], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
@@ -542,10 +363,23 @@
|
||||
<StackPanel Tag="physics" IsVisible="False">
|
||||
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
||||
Text="{Binding [Physics], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingsSection Header="{Binding [Physics], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- How true to life the driving is: a level in one go, each model to change on its own. -->
|
||||
<ctl:SettingsSection Header="{Binding [RealismSection], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="fullphysics" Description="{Binding [PhysicsAccuracyIncreasedDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="PhysicsAccuracyCb" Content="{Binding [PhysicsAccuracyIncreased], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingRow Label="{Binding [PhysicsPresets], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [PhysicsPresetsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<StackPanel x:Name="PhysicsPresetButtons" Orientation="Horizontal" Spacing="6" />
|
||||
<TextBlock x:Name="PhysicsPresetState" ctl:Announcer.Changes="True" VerticalAlignment="Center"
|
||||
FontSize="12" Foreground="{StaticResource CarbonFgDim}" />
|
||||
</StackPanel>
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="couplerphysics" />
|
||||
<ctl:KeySlot Key="physics.derailment" />
|
||||
<ctl:KeySlot Key="physics.collisions" />
|
||||
<ctl:KeySlot Key="physics.trackbuckling" />
|
||||
<ctl:SettingRow Description="{Binding [CrashDamageDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="crashdamage">
|
||||
<CheckBox x:Name="CrashDamageCb" Content="{Binding [CrashDamage], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="enabletraction" Description="{Binding [BreakingPantographPossibilityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="PantographBreakCb" Content="{Binding [BreakingPantographPossibility], Source={x:Static starterNg:App.Loc}}" />
|
||||
@@ -553,36 +387,21 @@
|
||||
<ctl:SettingRow ConfigKey="livetraction" Description="{Binding [PowerOverheadLineOnlyDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="OverheadOnlyCb" Content="{Binding [PowerOverheadLineOnly], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [SaveBlackBoxDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="blackbox">
|
||||
<CheckBox x:Name="BlackBoxCb" Content="{Binding [SaveBlackBox], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [SaveTrainTapesDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="physicslog.trains">
|
||||
<CheckBox x:Name="TrainTapesCb" Content="{Binding [SaveTrainTapes], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [SaveSpeedometerTapesDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="physicslog">
|
||||
<CheckBox x:Name="SpeedometerTapesCb" Content="{Binding [SaveSpeedometerTapes], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="debuglog">
|
||||
<CheckBox x:Name="SimLogsCb" Content="{Binding [SaveSimLogs], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [KeepPrevLogsDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="multiplelogs">
|
||||
<CheckBox x:Name="KeepLogsCb" Content="{Binding [KeepPrevLogs], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [DisplaySimulationDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="gfx.skiprendering">
|
||||
<CheckBox x:Name="DisplaySimulationCb" Content="{Binding [DisplaySimulation], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="debuglog">
|
||||
<CheckBox x:Name="DebugLogVisibleCb" Content="{Binding [DebugLogVisible], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [CrashDamageDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="crashdamage">
|
||||
<CheckBox x:Name="CrashDamageCb" Content="{Binding [CrashDamage], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingRow ConfigKey="starter.batterydefault"
|
||||
Label="{Binding [ReadyOverride], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ReadyOverrideDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ReadyOverrideCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [ReadyOverrideScenery], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [ReadyOverrideCold], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [ReadyOverrideReady], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="deer" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingRow ConfigKey="friction" x:Name="FrictionRow" Label="{Binding [Friction], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [FrictionDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="FrictionSlider" Minimum="0.1" Maximum="3.0" TickFrequency="0.1" Value="1.0"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingsSection Header="{Binding [BrakeKeysSection], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="brakestep" x:Name="BrakeStepRow" Label="{Binding [BrakeStep], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [BrakeStepDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="BrakeStepSlider" Minimum="0.4" Maximum="3.0" TickFrequency="0.1" Value="1.0"
|
||||
@@ -595,6 +414,17 @@
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Header="{Binding [RecordingSection], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow Description="{Binding [SaveBlackBoxDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="blackbox">
|
||||
<CheckBox x:Name="BlackBoxCb" Content="{Binding [SaveBlackBox], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [SaveTrainTapesDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="physicslog.trains">
|
||||
<CheckBox x:Name="TrainTapesCb" Content="{Binding [SaveTrainTapes], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ============================ DEVICES ============================ -->
|
||||
@@ -672,29 +502,244 @@
|
||||
</ctl:SettingsSection>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ============================ ADVANCED ============================ -->
|
||||
<!-- =========================== DEVELOPER =========================== -->
|
||||
<!-- Only the advanced mode shows this category, and leaving it puts all of it back at the
|
||||
starter's own values: the fast ones, and the details of the picture as its level has them. -->
|
||||
<StackPanel Tag="advanced" IsVisible="False">
|
||||
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
||||
Text="{Binding [Advanced], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [AdvancedResources], Source={x:Static starterNg:App.Loc}}">
|
||||
Text="{Binding [DeveloperTab], Source={x:Static starterNg:App.Loc}}" />
|
||||
<!-- In a border: the bare captions of a category are the search's, which hides them otherwise. -->
|
||||
<Border Margin="0,0,0,12">
|
||||
<TextBlock Classes="FieldHint" TextWrapping="Wrap"
|
||||
Text="{Binding [DeveloperTabNote], Source={x:Static starterNg:App.Loc}}" />
|
||||
</Border>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [GfxColRendering], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="compresstex" Description="{Binding [CompressTexturesDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="CompressTexCb" Content="{Binding [CompressTextures], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingRow ConfigKey="gfxrenderer" Label="{Binding [RenderEngine], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [RenderEngineDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="RenderEngineCb" Classes="Localized" SelectedIndex="0"
|
||||
SelectionChanged="RenderEngineCb_OnSelectionChanged">
|
||||
<ComboBoxItem Tag="vulkan" Content="{Binding [REVulkan], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="default" Content="{Binding [REOpenGL], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="scalespeculars" Description="{Binding [ScaleSpecularsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ScaleSpecularsCb" Content="{Binding [ScaleSpeculars], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingRow x:Name="GpuRow" ConfigKey="starter.gpu" Label="{Binding [GpuChoice], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="GpuCb" Classes="Localized" SelectedIndex="0"
|
||||
SelectionChanged="GpuCb_OnSelectionChanged">
|
||||
<ComboBoxItem Content="{Binding [GpuDiscrete], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [GpuSystem], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="python.mipmaps" Description="{Binding [ScreenMipmapsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ScreenMipmapsCb" Content="{Binding [ScreenMipmaps], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:KeySlot Key="gfx.vulkan.device" />
|
||||
<ctl:KeySlot Key="gfx.dlss.preset" />
|
||||
<ctl:KeySlot Key="gfx.framegeneration" />
|
||||
<ctl:KeySlot Key="gfx.reflex" />
|
||||
<ctl:SettingRow ConfigKey="gfx.skippipeline" Description="{Binding [SkipPipelineDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="SkipPipelineCb" Content="{Binding [SkipPipeline], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.shadergamma" Description="{Binding [ShaderGammaDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ShaderGammaCb" Content="{Binding [ShaderGamma], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.usegles" Description="{Binding [UseGLESDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="UseGlesCb" Content="{Binding [UseGLES], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ctl:SettingRow ConfigKey="scalespeculars" Description="{Binding [ScaleSpecularsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ScaleSpecularsCb" Content="{Binding [ScaleSpeculars], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="convertmodels" Description="{Binding [ExtendedModelConversionDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ConvertModelsCb" Content="{Binding [ExtendedModelConversion], Source={x:Static starterNg:App.Loc}}" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [GfxColTextures], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="maxtexturesize" x:Name="TexResolutionRow"
|
||||
Label="{Binding [MaxTexResolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider Name="textureResolutionSlider" Minimum="9" Maximum="13" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12"
|
||||
ValueChanged="TextureResolutionSlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="maxcabtexturesize" x:Name="CabTexResolutionRow"
|
||||
Label="{Binding [MaxTexCabResolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider Name="cabTextureResolutionSlider" Minimum="9" Maximum="12" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12"
|
||||
ValueChanged="CabTextureResolutionSlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="anisotropicfiltering" x:Name="TexFilteringRow"
|
||||
Label="{Binding [TexFilteringQuality], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [TexFilteringQualityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through Steps.Anisotropy; see SliderSteps. -->
|
||||
<ctl:ReadableSlider x:Name="TexFilteringSlider"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.extraeffects">
|
||||
<CheckBox x:Name="AdditionalShadersCb" Content="{Binding [AdditionalShadersEffects], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" ToggleKey="gfx.shadowmap.enabled" x:Name="ShadowsSection" Header="{Binding [GfxColShadows], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:SettingsSection.Toggle>
|
||||
<CheckBox x:Name="RenderShadowsCb" FontSize="12" MinHeight="0"
|
||||
Content="{Binding [RenderShadows], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingsSection.Toggle>
|
||||
<StackPanel IsEnabled="{Binding #RenderShadowsCb.IsChecked}">
|
||||
<ctl:SettingRow Description="{Binding [ShadowDisplayDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="gfx.shadow.rank.cutoff" Label="{Binding [ShadowDisplay], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ShadowDisplayCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [CSROnlyImportant], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [CSRLimited], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [CSRAll], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="shadowtune" x:Name="ShadowResolutionRow"
|
||||
Label="{Binding [ShadowsResolution], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider Name="shaderResolutionSlider" Minimum="10" Maximum="13" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12"
|
||||
ValueChanged="shaderResolutionSlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="shadowtune" x:Name="ShadowRangeRow"
|
||||
Label="{Binding [ShaderRange], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ShaderRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- The simulator's floor follows the map size: see shaderResolutionSlider_OnValueChanged. -->
|
||||
<ctl:ReadableSlider Name="shaderRange" Minimum="75" Maximum="400" TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="150"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.shadow.angle.min" x:Name="ShadowAngleLimitRow"
|
||||
Label="{Binding [ShadowAngleLimit], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ShadowAngleLimitDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:ReadableSlider x:Name="ShadowAngleLimitSlider" Minimum="0.2" Maximum="1.0"
|
||||
TickFrequency="0.1" IsSnapToTickEnabled="True" Value="0.2" HorizontalAlignment="Stretch"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
<DockPanel>
|
||||
<TextBlock DockPanel.Dock="Right" Classes="FieldHint"
|
||||
Text="{Binding [ShadowLimitShort], Source={x:Static starterNg:App.Loc}}" />
|
||||
<TextBlock Classes="FieldHint"
|
||||
Text="{Binding [ShadowLimitNone], Source={x:Static starterNg:App.Loc}}" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.lights.shadows" />
|
||||
<ctl:KeySlot Key="gfx.contactshadows" />
|
||||
<ctl:KeySlot Key="gfx.shadow.sdsm" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" x:Name="ReflectionsSection" Header="{Binding [GfxColReflections], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="gfx.envmap.enabled" Description="{Binding [ReflectionsCubeMapDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ReflectionsCubeMapCb" Content="{Binding [ReflectionsCubeMap], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<StackPanel x:Name="ReflectionRows">
|
||||
<ctl:SettingRow ConfigKey="gfx.reflections.fidelity" Label="{Binding [ReflectionsDetails], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ReflectionsDetailsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="ReflectionsDetailsCb" Classes="Localized" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [RDTerrain], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModels], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModelsVehicles], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.reflections.framerate" x:Name="ReflectionsFramerateRow"
|
||||
Label="{Binding [ReflectionsFramerate], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [ReflectionsFramerateDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through Steps.ReflectionUpdates; see SliderSteps. -->
|
||||
<ctl:ReadableSlider Name="reflectionsFramerate"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.reflections.range_instances" />
|
||||
<ctl:KeySlot Key="gfx.reflections.range_vehicles" />
|
||||
</StackPanel>
|
||||
<ctl:KeySlot Key="gfx.ssr" />
|
||||
<ctl:KeySlot Key="gfx.raytracing" />
|
||||
<ctl:KeySlot Key="gfx.raytracing.range" />
|
||||
<ctl:KeySlot Key="gfx.cabprobe" />
|
||||
<ctl:KeySlot Key="gfx.water.realistic" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [GfxColLights], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:KeySlot Key="gfx.postfx.ao" />
|
||||
<ctl:KeySlot Key="gfx.fog.quality" />
|
||||
<ctl:KeySlot Key="gfx.clouds" />
|
||||
<ctl:KeySlot Key="gfx.postfx.bloom" />
|
||||
<ctl:SettingRow x:Name="DynamicLightsRow" Description="{Binding [DynamicLightsDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="dynamiclights" Label="{Binding [DynamicLights], Source={x:Static starterNg:App.Loc}}"
|
||||
ValueText="{Binding #DynamicLightsSlider.Value, StringFormat='{}{0:0}'}">
|
||||
<ctl:ReadableSlider x:Name="DynamicLightsSlider" Minimum="1" Maximum="7" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="7" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.postfx.motionblur.shutter" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [GfxColDrawRange], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:KeySlot Key="basedrawrange" />
|
||||
<ctl:KeySlot Key="targetfps" />
|
||||
<ctl:SettingRow ConfigKey="gfx.drawrange.factor.max" x:Name="RenderRangeRow"
|
||||
Label="{Binding [RenderRange], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [RenderRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<!-- Moves through Steps.DrawRangeFactors; see SliderSteps. -->
|
||||
<ctl:ReadableSlider x:Name="RenderRangeSlider"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="sleeperdistance" />
|
||||
<ctl:SettingRow ConfigKey="splinefidelity" x:Name="TrackCurvesRow"
|
||||
Label="{Binding [TrackCurvesQuality], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [TrackCurvesQualityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="TrackCurvesSlider" Minimum="1" Maximum="4" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="4"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.grass" />
|
||||
<ctl:KeySlot Key="gfx.grass.distance" />
|
||||
<ctl:KeySlot Key="gfx.grass.fadedistance" />
|
||||
<ctl:KeySlot Key="gfx.grass.density" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [GfxColNature], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="gfx.smoke.fidelity" x:Name="SmokeParticlesRow"
|
||||
Label="{Binding [SmokeParticlesMultiplier], Source={x:Static starterNg:App.Loc}}"
|
||||
IsEnabled="{Binding #SmokeDisplayCb.IsChecked}">
|
||||
<ctl:ReadableSlider x:Name="SmokeParticlesSlider" Minimum="1" Maximum="4" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="2"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="gfx.precipitation.particles" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [GfxColScripts], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel IsEnabled="{Binding #RenderScreensCb.IsChecked}">
|
||||
<ctl:SettingRow ConfigKey="python.threadedupload">
|
||||
<CheckBox x:Name="RenderScreensThreadCb" Content="{Binding [RenderScreensThread], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="python.updatetime" Label="{Binding [PyScreenPriority], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [PyScreenPriorityDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ComboBox x:Name="PyScreenPriorityCb" Classes="Localized">
|
||||
<ComboBoxItem Tag="200" Content="{Binding [PyPriorityNormal], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="400" Content="{Binding [PyPriorityLower], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="800" Content="{Binding [PyPriorityLowest], Source={x:Static starterNg:App.Loc}}" />
|
||||
<ComboBoxItem Tag="1600" Content="{Binding [PyPriorityIdle], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ComboBox>
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="python.mipmaps" Description="{Binding [ScreenMipmapsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ScreenMipmapsCb" Content="{Binding [ScreenMipmaps], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="python.fpslimit" />
|
||||
<ctl:KeySlot Key="python.vsync" />
|
||||
<ctl:KeySlot Key="python.displaywindows" />
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [AdvancedResources], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:KeySlot Key="gfx.gpucull" />
|
||||
<ctl:KeySlot Key="gfx.gpucull.occlusion" />
|
||||
<ctl:KeySlot Key="gfx.depthprepass" />
|
||||
<ctl:KeySlot Key="gfx.textures.streaming" />
|
||||
<ctl:KeySlot Key="gfx.textures.releasedistance" />
|
||||
<ctl:SettingRow ConfigKey="compresstex" Description="{Binding [CompressTexturesDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="CompressTexCb" Content="{Binding [CompressTextures], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="gfx.resource.sweep" Description="{Binding [GfxResourceSweepDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ResourceSweepCb" Content="{Binding [GfxResourceSweep], Source={x:Static starterNg:App.Loc}}" />
|
||||
@@ -702,20 +747,66 @@
|
||||
<ctl:SettingRow ConfigKey="gfx.resource.move" Description="{Binding [GfxResourceMoveDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ResourceMoveCb" Content="{Binding [GfxResourceMove], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="performance.multithreading" />
|
||||
<ctl:SettingRow ConfigKey="async.trainThreads" x:Name="TrainThreadsRow"
|
||||
Label="{Binding [TrainPhysicsThreads], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [TrainPhysicsThreadsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="TrainThreadsSlider" Minimum="0" Maximum="16" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="physics.sleepheld" />
|
||||
<ctl:KeySlot Key="physics.roadlod" />
|
||||
<ctl:KeySlot Key="sound.asyncload" />
|
||||
<ctl:KeySlot Key="file.binary.terrain" />
|
||||
<ctl:SettingRow ConfigKey="convertmodels" Description="{Binding [ExtendedModelConversionDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="ConvertModelsCb" Content="{Binding [ExtendedModelConversion], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="starter.ignoreirrelevant" Description="{Binding [IgnoreIrrelevantTrainsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="IgnoreIrrelevantCb" Content="{Binding [IgnoreIrrelevantTrains], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [DevSimulation], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow ConfigKey="fullphysics" Description="{Binding [PhysicsAccuracyIncreasedDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="PhysicsAccuracyCb" Content="{Binding [PhysicsAccuracyIncreased], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="friction" x:Name="FrictionRow" Label="{Binding [Friction], Source={x:Static starterNg:App.Loc}}"
|
||||
Description="{Binding [FrictionDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<ctl:ReadableSlider x:Name="FrictionSlider" Minimum="0.1" Maximum="3.0" TickFrequency="0.1" Value="1.0"
|
||||
ValueChanged="QualitySlider_OnValueChanged" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [DisplaySimulationDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="gfx.skiprendering">
|
||||
<CheckBox x:Name="DisplaySimulationCb" Content="{Binding [DisplaySimulation], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<ctl:SettingsSection Advanced="True" Header="{Binding [AdvancedLogTools], Source={x:Static starterNg:App.Loc}}">
|
||||
<StackPanel>
|
||||
<ctl:SettingRow Description="{Binding [DebugModeDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="debugmode">
|
||||
<CheckBox x:Name="DebugModeCb" Content="{Binding [DebugMode], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="debuglog">
|
||||
<CheckBox x:Name="SimLogsCb" Content="{Binding [SaveSimLogs], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="debuglog">
|
||||
<CheckBox x:Name="DebugLogVisibleCb" Content="{Binding [DebugLogVisible], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [KeepPrevLogsDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="multiplelogs">
|
||||
<CheckBox x:Name="KeepLogsCb" Content="{Binding [KeepPrevLogs], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow Description="{Binding [SaveSpeedometerTapesDesc], Source={x:Static starterNg:App.Loc}}" ConfigKey="physicslog">
|
||||
<CheckBox x:Name="SpeedometerTapesCb" Content="{Binding [SaveSpeedometerTapes], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:SettingRow ConfigKey="starter.logmissingvehicles" Description="{Binding [LogMissingVehicleFilesDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<CheckBox x:Name="LogMissingVehicleFilesCb" Content="{Binding [LogMissingVehicleFiles], Source={x:Static starterNg:App.Loc}}" />
|
||||
</ctl:SettingRow>
|
||||
<ctl:KeySlot Key="loadinglog" />
|
||||
<ctl:KeySlot Key="showsystemconsole" />
|
||||
<ctl:KeySlot Key="debug.perflog" />
|
||||
<ctl:KeySlot Key="crashdump.full" />
|
||||
<ctl:SettingRow Description="{Binding [OpenLogToolsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||
<Button x:Name="OpenLogToolsButton" Classes="Flat" Cursor="Hand"
|
||||
HorizontalContentAlignment="Center"
|
||||
@@ -724,7 +815,7 @@
|
||||
</ctl:SettingRow>
|
||||
</StackPanel>
|
||||
</ctl:SettingsSection>
|
||||
|
||||
<!-- The rest of the SimulatorKeys follow in sections of their own (SimulatorKeyRows). -->
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -39,7 +39,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
private readonly SliderSteps _anisotropy;
|
||||
|
||||
private readonly SliderSteps _drawRangeFactor;
|
||||
private readonly SliderSteps _cabShadows;
|
||||
|
||||
// False while the layout loads: the handlers it names fire as it sets their controls'
|
||||
// values, before the fields of the controls are there, and do nothing until this is set.
|
||||
@@ -65,7 +64,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
_reflections = new SliderSteps(reflectionsFramerate, SliderRanges.ReflectionUpdates);
|
||||
_anisotropy = new SliderSteps(TexFilteringSlider, Steps.Anisotropy);
|
||||
_drawRangeFactor = new SliderSteps(RenderRangeSlider, SliderRanges.DrawRangeFactors);
|
||||
_cabShadows = new SliderSteps(cabShaderSourceRange, SliderRanges.CabShadowRanges);
|
||||
_built = true;
|
||||
|
||||
SettingsPathText.Text = AppServices.Current.SettingsStore.LoadedFrom;
|
||||
@@ -102,17 +100,16 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
_keyRows.Changed += MarkDirty;
|
||||
_keyRows.Changed += QueuePresetMarks;
|
||||
BuildPresetButtons();
|
||||
BuildRayTracing();
|
||||
BuildPhysicsPresets();
|
||||
BuildMonitorRates();
|
||||
ReadGraphicsCards();
|
||||
App.Loc.LanguageChanged += UpdateCardText;
|
||||
App.Loc.LanguageChanged += _keyRows.UpdateTexts;
|
||||
|
||||
FeedbackCb.SelectionChanged += FeedbackCb_OnSelectionChanged;
|
||||
// What decides whether the simulator starts and draws at all is changed only on purpose.
|
||||
AskBeforeChange(RenderAngleVulkanCb);
|
||||
AskBeforeChange(AdditionalShadersCb);
|
||||
// What decides whether the simulator draws its picture at all is changed only on purpose.
|
||||
AskBeforeChange(SkipPipelineCb);
|
||||
AskBeforeChange(RenderVBOCb);
|
||||
// Ignoring the gamepad is the recommended default; reading it has been trouble, so turning it on is asked.
|
||||
GamepadIgnoreCb.IsCheckedChanged += async (_, _) =>
|
||||
{
|
||||
@@ -408,6 +405,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
SelectActiveLanguage();
|
||||
ShowValues(s);
|
||||
_keyRows.Apply(s);
|
||||
ShowRayTracing();
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -480,12 +478,10 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
MotionBlurCb.IsChecked = s.MotionBlur;
|
||||
AdditionalShadersCb.IsChecked = s.ExtraEffects;
|
||||
ReflectionsCubeMapCb.IsChecked = s.EnvMap;
|
||||
RenderVBOCb.IsChecked = s.UseVbo;
|
||||
RenderShadowsCb.IsChecked = s.RenderShadows;
|
||||
_reflections.Value = s.ReflectionsFramerate;
|
||||
shaderResolutionSlider.Value = Log2(s.ShadowMapResolution, 12);
|
||||
shaderRange.Value = s.ShadowProjectionRange;
|
||||
_cabShadows.Value = s.CabShadowsRange;
|
||||
ShadowDisplayCb.SelectedIndex = Math.Clamp(s.ShadowRankCutoff - 1, 0, 2);
|
||||
ReflectionsDetailsCb.SelectedIndex = s.ReflectionsFidelity;
|
||||
fovSlider.Value = s.FieldOfView;
|
||||
@@ -493,7 +489,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
RenderScreensThreadCb.IsChecked = s.PythonThreadedUpload;
|
||||
_fpsLimit.Value = s.FpsLimitEnabled ? s.FpsLimit : 0;
|
||||
ShadowAngleLimitSlider.Value = s.ShadowAngleLimit;
|
||||
RenderAngleVulkanCb.IsChecked = s.RenderAngleVulkan;
|
||||
|
||||
TrackCurvesSlider.Value = s.SplineFidelity;
|
||||
PhysicsAccuracyCb.IsChecked = s.FullPhysics;
|
||||
@@ -528,7 +523,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
|
||||
CompressTexCb.IsChecked = s.CompressTextures;
|
||||
ScaleSpecularsCb.IsChecked = s.ScaleSpeculars;
|
||||
UseGlesCb.IsChecked = s.UseGLES;
|
||||
ShaderGammaCb.IsChecked = s.ShaderGamma;
|
||||
ScreenMipmapsCb.IsChecked = s.ScreenMipmaps;
|
||||
ConvertModelsCb.IsChecked = s.ExtendedModelConversion;
|
||||
@@ -593,20 +587,20 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
_presetButtons.Add((preset, button));
|
||||
}
|
||||
|
||||
foreach (var (section, group) in new[]
|
||||
foreach (var (levels, group) in new[]
|
||||
{
|
||||
(DrawRangeSection, GraphicsGroup.DrawRange), (TexturesSection, GraphicsGroup.Textures),
|
||||
(ShadowsSection, GraphicsGroup.Shadows), (ReflectionsSection, GraphicsGroup.Reflections)
|
||||
(GroupTexturesCb, GraphicsGroup.Textures), (GroupShadowsCb, GraphicsGroup.Shadows),
|
||||
(GroupReflectionsCb, GraphicsGroup.Reflections), (GroupLightingCb, GraphicsGroup.Lighting),
|
||||
(GroupDrawRangeCb, GraphicsGroup.DrawRange), (GroupParticlesCb, GraphicsGroup.Particles)
|
||||
})
|
||||
{
|
||||
var levels = new ComboBox();
|
||||
levels.Classes.Add("SectionLevel");
|
||||
// Marks the list as a part's, which applies its level itself rather than as a row of its own.
|
||||
levels.Tag = group;
|
||||
levels.SelectionChanged += (_, _) =>
|
||||
{
|
||||
if (!_markingLevels && levels.SelectedItem is ComboBoxItem { Tag: GraphicsPreset level })
|
||||
ApplyGroupLevel(group, level);
|
||||
};
|
||||
section.Level = levels;
|
||||
_groupLevels.Add((group, levels));
|
||||
}
|
||||
|
||||
@@ -634,8 +628,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
UpdatePresetMarks();
|
||||
}
|
||||
|
||||
private readonly GraphicsPresetMemory _presetMemory = new();
|
||||
|
||||
private readonly List<(GraphicsGroup Group, ComboBox Levels)> _groupLevels = new();
|
||||
|
||||
private GraphicsGroupLevels? _groups;
|
||||
@@ -649,11 +641,14 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
private void ApplyPreset(GraphicsPreset preset)
|
||||
{
|
||||
var trial = Trial();
|
||||
var applied = _presetMemory.Apply(preset, trial);
|
||||
ShowAsEdits(trial, applied.ChosenKeys.ToList());
|
||||
preset.ApplyTo(trial);
|
||||
var chosen = GraphicsPreset.AllKeys;
|
||||
ShowAsEdits(trial, chosen);
|
||||
foreach (var (key, value) in preset.Keys)
|
||||
_keyRows.Show(key, value);
|
||||
|
||||
// Chosen as a whole, its values are choices, not ones the screen could not show.
|
||||
ForgetShown(applied.ChosenKeys);
|
||||
ForgetShown(chosen);
|
||||
UpdatePresetMarks();
|
||||
Announcer.Say(this, ScreenReaderNames.PickerText(App.Loc["GfxColPresets"], App.Loc[preset.NameKey]));
|
||||
}
|
||||
@@ -686,6 +681,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
private void UpdatePresetMarks()
|
||||
{
|
||||
var trial = Trial();
|
||||
UpdatePhysicsPresetMarks(trial);
|
||||
var matching = GraphicsPreset.Matching(trial);
|
||||
foreach (var (preset, button) in _presetButtons)
|
||||
{
|
||||
@@ -702,6 +698,138 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
_markingLevels = false;
|
||||
}
|
||||
|
||||
// ── How true to life the driving is ─────────────────────────────────────
|
||||
|
||||
private readonly List<(PhysicsPreset Preset, Button Button)> _physicsButtons = new();
|
||||
|
||||
private void BuildPhysicsPresets()
|
||||
{
|
||||
foreach (var preset in PhysicsPreset.All)
|
||||
{
|
||||
var button = new Button { Cursor = new Cursor(StandardCursorType.Hand) };
|
||||
button.Classes.Add("Flat");
|
||||
button.Click += (_, _) => ApplyPhysicsPreset(preset);
|
||||
PhysicsPresetButtons.Children.Add(button);
|
||||
_physicsButtons.Add((preset, button));
|
||||
}
|
||||
UpdatePhysicsPresetTexts();
|
||||
App.Loc.LanguageChanged += UpdatePhysicsPresetTexts;
|
||||
}
|
||||
|
||||
private void UpdatePhysicsPresetTexts()
|
||||
{
|
||||
foreach (var (preset, button) in _physicsButtons)
|
||||
button.Content = App.Loc[preset.NameKey];
|
||||
UpdatePhysicsPresetMarks(Trial());
|
||||
}
|
||||
|
||||
/// <summary>Puts a level of realism on the screen, as edits waiting for Save.</summary>
|
||||
private void ApplyPhysicsPreset(PhysicsPreset preset)
|
||||
{
|
||||
var trial = Trial();
|
||||
preset.ApplyTo(trial);
|
||||
ShowAsEdits(trial, PhysicsPreset.AllKeys);
|
||||
foreach (var (key, value) in preset.Keys)
|
||||
_keyRows.Show(key, value);
|
||||
|
||||
ForgetShown(PhysicsPreset.AllKeys);
|
||||
UpdatePresetMarks();
|
||||
Announcer.Say(this, ScreenReaderNames.PickerText(App.Loc["PhysicsPresets"], App.Loc[preset.NameKey]));
|
||||
}
|
||||
|
||||
private void UpdatePhysicsPresetMarks(SimulatorSettings trial)
|
||||
{
|
||||
if (!_built)
|
||||
return;
|
||||
var matching = PhysicsPreset.Matching(trial);
|
||||
foreach (var (preset, button) in _physicsButtons)
|
||||
{
|
||||
button.Classes.Set("Accent", preset == matching);
|
||||
button.Classes.Set("Flat", preset != matching);
|
||||
}
|
||||
PhysicsPresetState.Text = matching is null ? App.Loc["PresetCustom"] : string.Empty;
|
||||
}
|
||||
|
||||
// ── The ray-traced reflections ───────────────────────────────────────────
|
||||
|
||||
/// <summary>The list's item for a reach none of the levels has, while the rows have one.</summary>
|
||||
private ComboBoxItem? _rayTracingCustom;
|
||||
|
||||
// Set while the list follows the rows, which is no choice of the player's to pass on.
|
||||
private bool _showingRayTracing;
|
||||
|
||||
private void BuildRayTracing()
|
||||
{
|
||||
RayTracingCb.Items.Add(new ComboBoxItem { Tag = RayTracing.Off });
|
||||
for (int level = 0; level < RayTracing.Levels.Count; level++)
|
||||
RayTracingCb.Items.Add(new ComboBoxItem { Tag = level });
|
||||
UpdateRayTracingTexts();
|
||||
App.Loc.LanguageChanged += UpdateRayTracingTexts;
|
||||
|
||||
RayTracingCb.SelectionChanged += (_, _) =>
|
||||
{
|
||||
if (_showingRayTracing || RayTracingCb.SelectedItem is not ComboBoxItem { Tag: int level })
|
||||
return;
|
||||
var (enabled, range) = RayTracing.ValuesOf(level);
|
||||
_keyRows.Show(RayTracing.Key, enabled);
|
||||
if (range is not null)
|
||||
_keyRows.Show(RayTracing.RangeKey, range);
|
||||
ShowRayTracing();
|
||||
};
|
||||
// Moved in the developer tab, or put back at its default: the list follows.
|
||||
_keyRows.Moved += key =>
|
||||
{
|
||||
if (key.Key is RayTracing.Key or RayTracing.RangeKey)
|
||||
ShowRayTracing();
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateRayTracingTexts()
|
||||
{
|
||||
foreach (var item in RayTracingCb.Items.OfType<ComboBoxItem>())
|
||||
if (item.Tag is int level)
|
||||
item.Content = App.Loc[level == RayTracing.Off ? "RayTracingOff" : RayTracing.Levels[level].NameKey];
|
||||
ShowRayTracing();
|
||||
}
|
||||
|
||||
/// <summary>The list at the level the two rows are at, or at an item of their own reach where it is none.</summary>
|
||||
private void ShowRayTracing()
|
||||
{
|
||||
if (!_built)
|
||||
return;
|
||||
string enabled = _keyRows.ValueOf(RayTracing.Key) ?? SimulatorKey.FormatToggle(false);
|
||||
string range = _keyRows.ValueOf(RayTracing.RangeKey) ?? SimulatorKeys.Named(RayTracing.RangeKey).Default;
|
||||
int? level = RayTracing.LevelOf(enabled, range);
|
||||
|
||||
_showingRayTracing = true;
|
||||
try
|
||||
{
|
||||
if (level is { } known)
|
||||
{
|
||||
if (_rayTracingCustom is not null)
|
||||
{
|
||||
RayTracingCb.Items.Remove(_rayTracingCustom);
|
||||
_rayTracingCustom = null;
|
||||
}
|
||||
RayTracingCb.SelectedItem = RayTracingCb.Items.OfType<ComboBoxItem>()
|
||||
.FirstOrDefault(item => item.Tag is int tag && tag == known);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_rayTracingCustom is null)
|
||||
{
|
||||
_rayTracingCustom = new ComboBoxItem { Tag = "custom" };
|
||||
RayTracingCb.Items.Add(_rayTracingCustom);
|
||||
}
|
||||
_rayTracingCustom.Content = $"{App.Loc["PresetCustom"]} ({range} m)";
|
||||
RayTracingCb.SelectedItem = _rayTracingCustom;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_showingRayTracing = false;
|
||||
}
|
||||
}
|
||||
|
||||
// ── The player's graphics card, beside the levels ────────────────────────
|
||||
|
||||
private IReadOnlyList<GraphicsCard> _cards = Array.Empty<GraphicsCard>();
|
||||
@@ -866,22 +994,32 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rows that only matter while another is on: the shutter with motion blur,
|
||||
/// and the reflections with their cube map - which only the full renderer can
|
||||
/// switch off; the others draw reflections regardless.
|
||||
/// Rows that only matter while another is on: the shutter with motion blur, the reflections with their cube
|
||||
/// map, and what only Vulkan reads with Vulkan.
|
||||
/// </summary>
|
||||
private void UpdateDependentRows()
|
||||
{
|
||||
if (_keyRows.RowOf("gfx.postfx.motionblur.shutter") is { } shutter)
|
||||
shutter.IsEnabled = IsChecked(MotionBlurCb);
|
||||
ReflectionRows.IsEnabled = IsChecked(ReflectionsCubeMapCb) ||
|
||||
SelectedRendererKind() != RendererKind.Modern;
|
||||
ReflectionRows.IsEnabled = IsChecked(ReflectionsCubeMapCb);
|
||||
bool vulkan = SelectedBackend() == GraphicsBackend.Vulkan;
|
||||
RayTracingRow.IsEnabled = vulkan;
|
||||
foreach (string key in VulkanOnlyKeys)
|
||||
if (_keyRows.RowOf(key) is { } row)
|
||||
row.IsEnabled = vulkan;
|
||||
}
|
||||
|
||||
private string SelectedRenderer() =>
|
||||
SelectedTag(RenderEngineCb) ?? SimulatorSettings.RenderEngines.ElementAtOrDefault(RenderEngineCb.SelectedIndex) ?? "full";
|
||||
/// <summary>The keys only the Vulkan renderer reads (utilities/Globals.cpp).</summary>
|
||||
private static readonly string[] VulkanOnlyKeys =
|
||||
{
|
||||
"gfx.vulkan.device", "gfx.vulkan.renderthread", "gfx.threads", "gfx.vulkan.asyncresources",
|
||||
"gfx.vulkan.parallelpasses", "gfx.vulkan.parallelmodels", "gfx.vulkan.asynccompute",
|
||||
"gfx.vulkan.framesinflight", "gfx.raytracing", "gfx.raytracing.range", "gfx.dlss.preset", "gfx.framegeneration", "gfx.reflex",
|
||||
"gfx.weather.occlusion", "gfx.clouds.interleave"
|
||||
};
|
||||
|
||||
private RendererKind SelectedRendererKind() => Renderers.KindOf(SelectedRenderer());
|
||||
private GraphicsBackend SelectedBackend() =>
|
||||
SelectedTag(RenderEngineCb) is { } word ? SimulatorSettings.BackendOf(word) : GraphicsBackend.Vulkan;
|
||||
|
||||
/// <summary>
|
||||
/// Writes the pending edits on this screen into the settings, so a save from
|
||||
@@ -934,12 +1072,10 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
s.MotionBlur = IsChecked(MotionBlurCb);
|
||||
s.ExtraEffects = IsChecked(AdditionalShadersCb);
|
||||
s.EnvMap = IsChecked(ReflectionsCubeMapCb);
|
||||
s.UseVbo = IsChecked(RenderVBOCb);
|
||||
s.RenderShadows = IsChecked(RenderShadowsCb);
|
||||
s.ReflectionsFramerate = _reflections.Value;
|
||||
s.ShadowMapResolution = 1 << (int)shaderResolutionSlider.Value;
|
||||
s.ShadowProjectionRange = (int)shaderRange.Value;
|
||||
s.CabShadowsRange = (int)_cabShadows.Value;
|
||||
if (!ShowsFileValue(ShadowDisplayCb)) s.ShadowRankCutoff = Math.Max(0, ShadowDisplayCb.SelectedIndex) + 1;
|
||||
if (!ShowsFileValue(ReflectionsDetailsCb)) s.ReflectionsFidelity = Math.Max(0, ReflectionsDetailsCb.SelectedIndex);
|
||||
s.FieldOfView = Math.Clamp((int)fovSlider.Value, 10, 75);
|
||||
@@ -951,7 +1087,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
if (fpsLimit > 0)
|
||||
s.FpsLimit = fpsLimit;
|
||||
s.ShadowAngleLimit = ShadowAngleLimitSlider.Value;
|
||||
s.RenderAngleVulkan = IsChecked(RenderAngleVulkanCb);
|
||||
|
||||
s.SplineFidelity = (int)TrackCurvesSlider.Value;
|
||||
s.FullPhysics = IsChecked(PhysicsAccuracyCb);
|
||||
@@ -987,7 +1122,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
|
||||
s.CompressTextures = IsChecked(CompressTexCb);
|
||||
s.ScaleSpeculars = IsChecked(ScaleSpecularsCb);
|
||||
s.UseGLES = IsChecked(UseGlesCb);
|
||||
s.ShaderGamma = IsChecked(ShaderGammaCb);
|
||||
s.ScreenMipmaps = IsChecked(ScreenMipmapsCb);
|
||||
s.ExtendedModelConversion = IsChecked(ConvertModelsCb);
|
||||
@@ -1422,8 +1556,8 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
return;
|
||||
|
||||
// Leaving the mode leaves nothing of it behind: what only it shows goes back to the
|
||||
// simulator's own values, and the page is saved with them.
|
||||
ShowDefaults(AdvancedKeys());
|
||||
// starter's own values, and the page is saved with them.
|
||||
ShowDefaults(DeveloperKeys());
|
||||
settings.AdvancedSettings = false;
|
||||
Save();
|
||||
}
|
||||
@@ -1434,40 +1568,49 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Once, on the first start of this starter, for the settings an older one left: the
|
||||
/// standard mode, what only the advanced one shows at the simulator's own values, and
|
||||
/// every slider's value within its range, saved. eu07.ini is copied aside first.
|
||||
/// Once, on the first start of this starter, for the settings an older one left: the standard mode, what only
|
||||
/// the developer tab shows at the starter's own values - Vulkan, and everything that makes the simulator faster -
|
||||
/// and every slider's value within its range, saved. eu07.ini is copied aside first. A player already in the
|
||||
/// standard mode of an older layout is brought to this one the same way; one in the advanced mode chose what
|
||||
/// the developer tab has, and only the layout's number moves.
|
||||
/// </summary>
|
||||
public void MoveToStandardOnce()
|
||||
{
|
||||
var settings = AppServices.Current.Settings;
|
||||
var store = AppServices.Current.SettingsStore;
|
||||
if (settings.MovedToStandard || store.LoadFailed)
|
||||
bool firstTime = !settings.MovedToStandard;
|
||||
if (store.LoadFailed || (!firstTime && settings.Revision >= SimulatorSettings.CurrentRevision))
|
||||
return;
|
||||
|
||||
store.KeepCopy(".before-standard");
|
||||
var moved = AdvancedKeys();
|
||||
// A value the starter does not know, or a control cannot show, is put right too.
|
||||
moved.UnionWith(FileValues().Keys);
|
||||
moved.ExceptWith(SettingsStore.KeptOnMoveToStandard);
|
||||
_clamping = true;
|
||||
try
|
||||
{
|
||||
ShowDefaults(moved);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_clamping = false;
|
||||
}
|
||||
// A value moved into its slider is saved as moved, not left as the file had it.
|
||||
ForgetShown(SliderKeys());
|
||||
|
||||
bool wasAdvanced = settings.AdvancedSettings;
|
||||
settings.AdvancedSettings = false;
|
||||
if (firstTime || !wasAdvanced)
|
||||
{
|
||||
store.KeepCopy(firstTime ? ".before-standard" : ".before-revision" + SimulatorSettings.CurrentRevision);
|
||||
var moved = DeveloperKeys();
|
||||
// A value the starter does not know, or a control cannot show, is put right too.
|
||||
if (firstTime)
|
||||
moved.UnionWith(FileValues().Keys);
|
||||
moved.ExceptWith(SettingsStore.KeptOnMoveToStandard);
|
||||
_clamping = firstTime;
|
||||
try
|
||||
{
|
||||
ShowDefaults(moved);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_clamping = false;
|
||||
}
|
||||
// A value moved into its slider is saved as moved, not left as the file had it.
|
||||
if (firstTime)
|
||||
ForgetShown(SliderKeys());
|
||||
settings.AdvancedSettings = false;
|
||||
}
|
||||
|
||||
settings.MovedToStandard = true;
|
||||
settings.Revision = SimulatorSettings.CurrentRevision;
|
||||
Save();
|
||||
|
||||
if (wasAdvanced)
|
||||
if (wasAdvanced != settings.AdvancedSettings)
|
||||
AdvancedModeChanged?.Invoke();
|
||||
UpdateAdvancedModeButton();
|
||||
ApplyFilter();
|
||||
@@ -1514,24 +1657,29 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
SaveStatus.Text = App.Loc["DefaultsRestored"];
|
||||
}
|
||||
|
||||
/// <summary>The keys of every row only the advanced mode shows.</summary>
|
||||
private HashSet<string> AdvancedKeys()
|
||||
/// <summary>
|
||||
/// The keys only the developer tab sets: those of its rows and switches but the ones a row of the standard mode
|
||||
/// sets too - the details of the picture, which its level of detail holds there.
|
||||
/// </summary>
|
||||
private HashSet<string> DeveloperKeys()
|
||||
{
|
||||
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
var developer = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
var standard = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var section in SettingsStack.GetLogicalDescendants().OfType<SettingsSection>())
|
||||
{
|
||||
if (section.Advanced && !string.IsNullOrEmpty(section.ToggleKey))
|
||||
keys.Add(section.ToggleKey);
|
||||
if (!string.IsNullOrEmpty(section.ToggleKey))
|
||||
(section.Advanced ? developer : standard).Add(section.ToggleKey);
|
||||
foreach (var row in section.GetLogicalDescendants().OfType<SettingRow>())
|
||||
if (section.Advanced || row.Advanced)
|
||||
foreach (string key in (row.ConfigKey ?? string.Empty)
|
||||
.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
|
||||
keys.Add(key);
|
||||
(section.Advanced || row.Advanced ? developer : standard).UnionWith(KeysOf(row));
|
||||
}
|
||||
keys.ExceptWith(KeptOnReset);
|
||||
return keys;
|
||||
developer.ExceptWith(standard);
|
||||
developer.ExceptWith(KeptOnReset);
|
||||
return developer;
|
||||
}
|
||||
|
||||
private static string[] KeysOf(SettingRow row) =>
|
||||
(row.ConfigKey ?? string.Empty).Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
|
||||
private bool Advanced => AppServices.Current.Settings.AdvancedSettings;
|
||||
|
||||
/// <summary>A value of eu07.ini a list does not offer, listed under the file's own words.</summary>
|
||||
@@ -1542,7 +1690,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
{
|
||||
(FeedbackCb, "feedbackmode"), (GpuCb, "starter.gpu"), (ShadowDisplayCb, "gfx.shadow.rank.cutoff"),
|
||||
(ReflectionsDetailsCb, "gfx.reflections.fidelity"), (PyScreenPriorityCb, "python.updatetime"),
|
||||
(ReadyOverrideCb, "starter.batterydefault"), (AntiAliasingCb, "multisampling")
|
||||
(ReadyOverrideCb, "starter.batterydefault"), (AntiAliasingCb, "gfx.antialiasing")
|
||||
};
|
||||
|
||||
private static bool ShowsFileValue(ComboBox list) => list.SelectedItem is ComboBoxItem { Tag: FileValue };
|
||||
@@ -1689,10 +1837,8 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
SettingsScroll.IsVisible = !bindings;
|
||||
PresetBar.IsVisible = category is "graphics" or "effects" && !searching;
|
||||
|
||||
// The standard mode keeps to what a player needs; a search still finds everything,
|
||||
// since whoever types a setting's name is looking for it.
|
||||
// The standard mode keeps to what a player needs, a search too: the developer tab is the advanced mode's.
|
||||
bool advanced = Advanced;
|
||||
bool everything = advanced || searching;
|
||||
|
||||
if (bindings)
|
||||
{
|
||||
@@ -1711,14 +1857,10 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
foreach (var section in panel.GetLogicalDescendants().OfType<SettingsSection>())
|
||||
{
|
||||
bool anyInSection = false;
|
||||
if (section.Level is Control level)
|
||||
level.IsVisible = advanced;
|
||||
|
||||
foreach (var row in section.GetLogicalDescendants().OfType<SettingRow>())
|
||||
{
|
||||
// A value the starter cannot read is shown in either mode, so it can be put right.
|
||||
bool standard = (!section.Advanced && !row.Advanced) || !string.IsNullOrEmpty(row.UnknownValue);
|
||||
bool visible = ConditionAllows(row) && (everything || standard) &&
|
||||
bool standard = !section.Advanced && !row.Advanced;
|
||||
bool visible = ConditionAllows(row) && (advanced || standard) &&
|
||||
(!searching || TextMatch.Contains(RowSearchText(row), query));
|
||||
row.IsVisible = visible;
|
||||
row.Classes.Set("HideKey", !advanced);
|
||||
@@ -1742,7 +1884,8 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
{
|
||||
item.Classes.Set("NoHits", searching && !anyRow);
|
||||
// A category with nothing for the standard mode leaves the list.
|
||||
item.IsVisible = everything || anyRow;
|
||||
// A search lists every category, but the developer tab only in the advanced mode.
|
||||
item.IsVisible = advanced || anyRow || (searching && tag != SimulatorKeys.Advanced);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1797,10 +1940,13 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
// Choosing a profile changes nothing until Apply is pressed, and a
|
||||
// language is saved the moment it is picked.
|
||||
case ComboBox combo when ReferenceEquals(combo, ProfileCb) ||
|
||||
ReferenceEquals(combo, ChangeLanguageCb):
|
||||
ReferenceEquals(combo, ChangeLanguageCb) ||
|
||||
// the ray tracing's list sets its two rows, which tell of their changes
|
||||
ReferenceEquals(combo, RayTracingCb):
|
||||
break;
|
||||
// The rows of SimulatorKeyRows report their own changes.
|
||||
case { Tag: SimulatorKey }:
|
||||
// The rows of SimulatorKeyRows report their own changes, and the lists of the parts put their
|
||||
// levels on the screen as edits themselves.
|
||||
case { Tag: SimulatorKey or GraphicsGroup }:
|
||||
break;
|
||||
case CheckBox cb:
|
||||
cb.IsCheckedChanged += (_, _) => OnControlChanged(cb);
|
||||
@@ -1884,7 +2030,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
DynamicLightsSlider.Minimum = widen
|
||||
? Math.Min(SliderRanges.MinDynamicLights, s.DynamicLights)
|
||||
: SliderRanges.MinDynamicLights;
|
||||
foreach (var steps in new[] { _fpsLimit, _reflections, _anisotropy, _drawRangeFactor, _cabShadows })
|
||||
foreach (var steps in new[] { _fpsLimit, _reflections, _anisotropy, _drawRangeFactor })
|
||||
steps.Clamps = _clamping;
|
||||
}
|
||||
|
||||
@@ -1926,14 +2072,9 @@ public partial class Settings : UserControl, ISettingsCapture
|
||||
};
|
||||
|
||||
int metres = (int)shaderRange.Value;
|
||||
// Only the full renderer's cascades are known to stretch.
|
||||
int reach = SimulatorSettings.ShadowReach(metres, 1 << (int)shaderResolutionSlider.Value,
|
||||
SelectedRendererKind() != RendererKind.Modern);
|
||||
int reach = SimulatorSettings.ShadowReach(metres, 1 << (int)shaderResolutionSlider.Value);
|
||||
ShadowRangeRow.ValueText = reach == metres ? $"{metres} m" : $"{metres} m → {reach} m";
|
||||
|
||||
int cabMetres = (int)_cabShadows.Value;
|
||||
CabShadowRangeRow.ValueText = cabMetres <= 0 ? App.Loc["RangeDisabled"] : $"{cabMetres} m";
|
||||
|
||||
ReflectionsFramerateRow.ValueText = SettingTexts.ReflectionsInterval(_reflections.Value);
|
||||
|
||||
FpsLimitRow.ValueText = _fpsLimit.Value <= 0
|
||||
|
||||
@@ -77,6 +77,7 @@ internal sealed class SimulatorKeyRows
|
||||
TickFrequency = key.Step,
|
||||
IsSnapToTickEnabled = true
|
||||
},
|
||||
SimulatorKeyKind.Choice => ChoiceList(key),
|
||||
_ => new TextBox { MinWidth = 200 }
|
||||
};
|
||||
|
||||
@@ -102,11 +103,35 @@ internal sealed class SimulatorKeyRows
|
||||
case TextBox text:
|
||||
text.TextChanged += (_, _) => OnEdited(row);
|
||||
break;
|
||||
case ComboBox list:
|
||||
list.SelectionChanged += (_, _) => OnEdited(row);
|
||||
break;
|
||||
}
|
||||
|
||||
return setting;
|
||||
}
|
||||
|
||||
/// <summary>The list of the words of a <see cref="SimulatorKeyKind.Choice"/>, each item tagged with its word.</summary>
|
||||
private static ComboBox ChoiceList(SimulatorKey key)
|
||||
{
|
||||
var list = new ComboBox { MinWidth = 160 };
|
||||
foreach (string choice in key.Choices ?? Array.Empty<string>())
|
||||
list.Items.Add(new ComboBoxItem { Tag = choice, Content = ChoiceText(key, choice) });
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A word of a list as the player reads it: as that key names it (the "new" of the derailment), else as every
|
||||
/// list names it (no, low, high...), translated where the language has it, else in English, else as the
|
||||
/// simulator writes it (DLSS's preset letters).
|
||||
/// </summary>
|
||||
private static string ChoiceText(SimulatorKey key, string choice) =>
|
||||
App.Loc.OptOrEnglish(SimulatorKey.ChoiceLabelKey(key.Key + "." + choice)) is { Length: > 0 } own ? own
|
||||
: App.Loc.OptOrEnglish(SimulatorKey.ChoiceLabelKey(choice)) is { Length: > 0 } text ? text : choice;
|
||||
|
||||
/// <summary>The developer tab's rows are named in the language where it has them, else in English.</summary>
|
||||
private static string Text(string key) => App.Loc.OptOrEnglish(key);
|
||||
|
||||
/// <summary>
|
||||
/// Only a value other than the one shown counts: a text box reports the text it
|
||||
/// was given after the fact, and a slider reports its own clamping.
|
||||
@@ -118,6 +143,9 @@ internal sealed class SimulatorKeyRows
|
||||
Changed?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>What the row of <paramref name="key"/> holds now, in the file's words; null for a key with no row.</summary>
|
||||
public string? ValueOf(string key) => Find(key) is { } row ? Current(row) : null;
|
||||
|
||||
/// <summary>The row of <paramref name="key"/>, wherever it was put.</summary>
|
||||
public SettingRow? RowOf(string key) => Find(key)?.Setting;
|
||||
|
||||
@@ -147,8 +175,8 @@ internal sealed class SimulatorKeyRows
|
||||
|
||||
foreach (var row in _rows)
|
||||
{
|
||||
string label = App.Loc[row.Key.LabelKey];
|
||||
row.Setting.Description = App.Loc[row.Key.DescriptionKey];
|
||||
string label = Text(row.Key.LabelKey) is { Length: > 0 } named ? named : row.Key.Key;
|
||||
row.Setting.Description = Text(row.Key.DescriptionKey);
|
||||
|
||||
switch (row.Input)
|
||||
{
|
||||
@@ -159,6 +187,11 @@ internal sealed class SimulatorKeyRows
|
||||
row.Setting.Label = label;
|
||||
text.PlaceholderText = App.Loc["IniDefault"];
|
||||
break;
|
||||
case ComboBox list:
|
||||
row.Setting.Label = label;
|
||||
foreach (var item in list.Items.OfType<ComboBoxItem>())
|
||||
item.Content = ChoiceText(row.Key, item.Tag as string ?? string.Empty);
|
||||
break;
|
||||
default:
|
||||
row.Setting.Label = label;
|
||||
UpdateValueText(row);
|
||||
@@ -224,6 +257,10 @@ internal sealed class SimulatorKeyRows
|
||||
case TextBox text:
|
||||
text.Text = raw.Trim();
|
||||
break;
|
||||
case ComboBox list:
|
||||
int at = row.Key.ChoiceIndex(raw);
|
||||
list.SelectedIndex = at >= 0 ? at : row.Key.ChoiceIndex(row.Key.Default);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,6 +269,7 @@ internal sealed class SimulatorKeyRows
|
||||
CheckBox box => SimulatorKey.FormatToggle(box.IsChecked == true),
|
||||
Slider slider => row.Key.FormatNumber(slider.Value),
|
||||
TextBox text => (text.Text ?? string.Empty).Trim(),
|
||||
ComboBox { SelectedItem: ComboBoxItem { Tag: string word } } => word,
|
||||
_ => string.Empty
|
||||
};
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<String key="LogMissingVehicleFiles">Zaznamenat chybějící soubory vozidel při exportu</String>
|
||||
|
||||
<String key="Graphic">Grafika</String>
|
||||
<String key="RenderEngine">Vykreslovací engine</String>
|
||||
<String key="RenderEngine">Grafické API</String>
|
||||
<String key="ConfirmRenderingChange">Změna „{0}“ může způsobit, že se simulátor nespustí nebo bude obraz vypadat špatně. Změnit?</String>
|
||||
<String key="RenderEngineDesc">Plný je doporučený renderer simulátoru. Starý a Zjednodušený kreslí klasickým rendererem a nejsou doporučeny, pokud Plný funguje – jsou pro grafické karty, se kterými má Plný potíže.</String>
|
||||
<String key="GpuChoice">Grafická karta (Linux)</String>
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
<String key="Resolution">Rozlišení</String>
|
||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||
<String key="BufforResolution">Rozlišení bufferu</String>
|
||||
<String key="BufforResolution">Měřítko vykreslování</String>
|
||||
<String key="MaxTexResolution">Maximální rozlišení textur</String>
|
||||
<String key="MaxTexCabResolution">Maximální rozlišení textur kabiny</String>
|
||||
<String key="TexFilteringQuality">Kvalita filtrování textur</String>
|
||||
@@ -530,9 +530,9 @@
|
||||
<String key="AdvancedMode">Pokročilý režim</String>
|
||||
<String key="AdvancedModeMenu">Pokročilý režim…</String>
|
||||
<String key="AdvancedModeOff">Vypnout pokročilý režim</String>
|
||||
<String key="AdvancedModeOffConfirm">Vypnutí pokročilého režimu vrátí výchozí hodnoty všech nastavení, která jsou dostupná jen v něm, a uloží nastavení z této stránky. Vypnout?</String>
|
||||
<String key="AdvancedModeOffConfirm">Vypnutí pokročilého režimu vrátí vše z karty Vývojář na hodnoty spouštěče – Vulkan a všechny optimalizace zapnuté – a uloží nastavení této stránky. Kvalita grafiky zůstane taková, jak ji ukazuje karta Grafika. Vypnout?</String>
|
||||
<String key="AdvancedModeOn">Zapnout</String>
|
||||
<String key="AdvancedModeWarning">Pokročilý režim zobrazí všechna nastavení simulátoru a starteru, i ta, po jejichž změně se simulátor nemusí spustit, může být nestabilní nebo vypadat špatně. Umožní také měnit obsazení souprav, soupravy AI a dekorace, takže scénář nemusí fungovat tak, jak ho autor zamýšlel. Tato nastavení měňte, jen když víte, co dělají. Potíže, které způsobí, nejsou chybami simulátoru: než chybu nahlásíte, vypněte pokročilý režim a obnovte výchozí nastavení. Přečtěte si to pozorně. Tlačítko pro zapnutí bude funkční za 20 sekund.</String>
|
||||
<String key="AdvancedModeWarning">Pokročilý režim je určen vývojářům a testerům. Otevírá kartu Vývojář se všemi nastaveními simulátoru: rendererem (OpenGL místo Vulkanu), podrobnostmi obrazu, přepínači optimalizací, protokoly a diagnostikou. Po změně mnoha z nich se simulátor nemusí spustit, může běžet pomaleji či nestabilně nebo vypadat špatně. Umožňuje také měnit osádky souprav, soupravy AI a dekorace, takže scénář nemusí fungovat tak, jak jej autor zamýšlel. Potíže způsobené těmito nastaveními nejsou chybami simulátoru: než chybu nahlásíte, vypněte pokročilý režim, což vrátí vše z karty Vývojář na hodnoty spouštěče. Přečtěte si to pozorně. Tlačítko pro zapnutí bude funkční za 20 sekund.</String>
|
||||
<String key="CompressTextures">Komprimovat textury TGA</String>
|
||||
<String key="ScaleSpeculars">Škálovat odlesky (kompatibilita starých modelů)</String>
|
||||
<String key="ScaleSpecularsDesc">Zeslabuje lesk modelů dělaných pro starší renderery.</String>
|
||||
@@ -755,7 +755,7 @@
|
||||
<String key="ShortcutCardMenu">Otevřít nabídku vozidla</String>
|
||||
|
||||
<!-- Package author's tab - awaiting translation -->
|
||||
<String key="AdvancedResources">Prostředky a kompatibilita</String>
|
||||
<String key="AdvancedResources">Výkon</String>
|
||||
<String key="AdvancedLogTools">Protokol a nástroje</String>
|
||||
<String key="LogAndTools">Protokol událostí a nástroje</String>
|
||||
<String key="OpenLogTools">Otevřít protokol a nástroje…</String>
|
||||
@@ -833,13 +833,11 @@
|
||||
<String key="Ini.gfx.reflections.range_vehicles">Dosah odrazů vozidel</String>
|
||||
<String key="Ini.gfx.textures.streaming">Načítat textury na pozadí</String>
|
||||
<String key="Ini.gfx.textures.releasedistance">Uvolňovat textury vzdálených vozidel</String>
|
||||
<String key="Ini.skyenabled">Vykreslovat oblohu</String>
|
||||
<String key="Ini.rendercab">Vykreslovat kabinu</String>
|
||||
<String key="Ini.gfx.postfx.motionblur.shutter">Doba závěrky rozmazání pohybu</String>
|
||||
<String key="Ini.python.vsync">Vertikální synchronizace oken obrazovek</String>
|
||||
<String key="Ini.python.displaywindows">Obrazovky z kabiny v samostatných oknech</String>
|
||||
<String key="Ini.newaircouplers">Vzduchové hadice podle spojení vozidel</String>
|
||||
<String key="Ini.smoothtraction">Vyhlazení trolejového vedení (klasický renderer)</String>
|
||||
<String key="Ini.sound.maxsources">Maximální počet zdrojů zvuku</String>
|
||||
<String key="Ini.sound.asyncload">Dekódovat zvuky na pozadí</String>
|
||||
<String key="Ini.loadtraction">Načítat trolejové vedení</String>
|
||||
@@ -857,7 +855,6 @@
|
||||
<String key="IniChangesNone">Uložení v eu07.ini nic nezmění.</String>
|
||||
<String key="IniChangesKeyboard">Změněné klávesy se uloží do eu07_input-keyboard.ini.</String>
|
||||
<String key="GfxColPresets">Kvalita grafiky</String>
|
||||
<String key="PresetMinimal">Minimální</String>
|
||||
<String key="PresetLow">Nízká</String>
|
||||
<String key="PresetMedium">Střední</String>
|
||||
<String key="PresetHigh">Vysoká</String>
|
||||
@@ -865,7 +862,7 @@
|
||||
<String key="MonitorRate">Monitor: {0} Hz</String>
|
||||
<String key="MonitorRateUse">Nastavit {0} FPS</String>
|
||||
<String key="FpsVSyncNote">S VSync nebude víc snímků, než má monitor Hz, takže stejný nebo vyšší limit nic nemění.</String>
|
||||
<String key="GfxPresetDesc">Najetím na úroveň zobrazíte hodnoty.</String>
|
||||
<String key="GfxPresetDesc">Úroveň nastaví všechny části níže najednou; každou pak lze změnit zvlášť.</String>
|
||||
<String key="TextureBaseDateHint">RRRR-MM-DD</String>
|
||||
<String key="LanguageStarterMissing">Starter nemá překlad: zůstane anglicky. Simulátor dostane tento jazyk.</String>
|
||||
<String key="ProfileNone">Žádné profily</String>
|
||||
@@ -899,8 +896,6 @@
|
||||
<String key="Ini.heightbase">Násobitel dosahu</String>
|
||||
<String key="Ini.heightbase.Desc">Zkracuje nebo prodlužuje dohlednost scenérie. Cílové FPS ji přepíše.</String>
|
||||
<String key="PresetVeryHigh">Velmi vysoká</String>
|
||||
<String key="PresetUltra">Ultra</String>
|
||||
<String key="PresetUltraNote">Vše na maximum. Může to být moc i pro silnou kartu.</String>
|
||||
<String key="Ini.python.fpslimit">Limit snímků oken obrazovek</String>
|
||||
<String key="Ini.python.fpslimit.Desc">Funguje jen s obrazovkami v samostatných oknech; bez nich nic nemění.</String>
|
||||
<String key="ShadowLimitNone">Nejdelší</String>
|
||||
@@ -926,7 +921,7 @@
|
||||
<String key="GfxColImage">Rozlišení a vyhlazování</String>
|
||||
<String key="GfxColLights">Osvětlení</String>
|
||||
<String key="GfxColPostFx">Postprocessing</String>
|
||||
<String key="GfxColNature">Kouř</String>
|
||||
<String key="GfxColNature">Kouř a srážky</String>
|
||||
<String key="AntiAliasing">Vyhlazování hran</String>
|
||||
<String key="SettingsFile">Soubor eu07.ini</String>
|
||||
<String key="ImportIni">Importovat…</String>
|
||||
@@ -939,14 +934,50 @@
|
||||
<String key="ExportIniFailed">Soubor se nepodařilo zapsat:
|
||||
{0}</String>
|
||||
<String key="ExportIniDone">Exportováno do {0}</String>
|
||||
<String key="REFull">Plný</String>
|
||||
<String key="REOld">Starý (nedoporučeno, pokud Plný funguje)</String>
|
||||
<String key="RESimp">Zjednodušený (nedoporučeno, pokud Plný funguje)</String>
|
||||
<String key="RenderAngleVulkan">Použít renderer ANGLE Vulkan</String>
|
||||
<String key="RenderVBO">Vykreslování VBO</String>
|
||||
<String key="CabShadowsRange">Dosah zdrojů stínů v kabině</String>
|
||||
<String key="UseGLES">Použít OpenGL ES</String>
|
||||
<String key="UseGLESDesc">OpenGL ES místo OpenGL. Nefunguje s rendererem legacy.</String>
|
||||
<String key="GpuCard">{0}, {1} GB</String>
|
||||
<String key="GpuCardShared">{0}, sdílená paměť</String>
|
||||
<String key="DeveloperTab">Vývojář</String>
|
||||
<String key="DeveloperTabNote">Nastavení pro vývojáře a testery. Hráč tu má vše na hodnotách spouštěče, se kterými simulátor běží nejrychleji; vypnutí pokročilého režimu je vrátí.</String>
|
||||
<String key="MouseSection">Myš</String>
|
||||
<String key="RecordingSection">Záznam jízdy</String>
|
||||
<String key="DevSimulation">Simulace</String>
|
||||
<String key="GfxColQuality">Podrobnosti kvality</String>
|
||||
<String key="GroupTextures">Textury</String>
|
||||
<String key="GroupShadows">Stíny</String>
|
||||
<String key="GroupReflections">Odrazy</String>
|
||||
<String key="GroupLighting">Osvětlení a obloha</String>
|
||||
<String key="GroupDrawRange">Dohled a tráva</String>
|
||||
<String key="GroupParticles">Kouř, déšť a sníh</String>
|
||||
<String key="AaDlss">DLSS (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="AaDlaa">DLAA (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="REVulkan">Vulkan (doporučeno)</String>
|
||||
<String key="REOpenGL">OpenGL 4.6</String>
|
||||
<String key="IniSectionRenderer">Renderer</String>
|
||||
<String key="IniSectionPerformance">Výkon</String>
|
||||
<String key="SimulatorSection">Simulátor</String>
|
||||
<String key="RayTracing">Ray tracing (odrazy)</String>
|
||||
<String key="RayTracingOff">Vypnuto</String>
|
||||
<String key="RealismSection">Realismus jízdy</String>
|
||||
<String key="PhysicsPresets">Úroveň realismu</String>
|
||||
<String key="PhysicsArcade">Arkádový</String>
|
||||
<String key="PhysicsRealistic">Realistický</String>
|
||||
<String key="BrakeKeysSection">Brzda z klávesnice</String>
|
||||
<String key="Ini.couplerphysics">Spřáhla</String>
|
||||
<String key="Ini.physics.derailment">Vykolejení</String>
|
||||
<String key="Ini.physics.collisions">Srážky</String>
|
||||
<String key="Ini.physics.trackbuckling">Vybočení koleje v horku</String>
|
||||
<String key="Ini.deer">Zvěř u trati</String>
|
||||
<String key="Choice.couplerphysics.no">Zjednodušená</String>
|
||||
<String key="Choice.couplerphysics.yes">Fyzikální – vlak hráče</String>
|
||||
<String key="Choice.couplerphysics.all">Fyzikální – všechny vlaky</String>
|
||||
<String key="Choice.physics.derailment.off">Vypnuto</String>
|
||||
<String key="Choice.physics.derailment.monitor">Klasické</String>
|
||||
<String key="Choice.physics.derailment.new">Fyzikální</String>
|
||||
<String key="Choice.physics.derailment.old">Klasické, bez protokolu</String>
|
||||
<String key="Choice.physics.collisions.old">Klasické</String>
|
||||
<String key="Choice.physics.collisions.new">Fyzikální</String>
|
||||
<String key="Choice.physics.collisions.monitor">Klasické, fyzikální do protokolu</String>
|
||||
<String key="Choice.physics.trackbuckling.off">Vypnuto</String>
|
||||
<String key="Choice.physics.trackbuckling.scenery">Ze scenérie</String>
|
||||
<String key="Choice.physics.trackbuckling.auto">I z horka</String>
|
||||
</Language>
|
||||
|
||||
@@ -420,9 +420,9 @@
|
||||
<String key="LogMissingVehicleFilesDesc">When exporting, writes the missing vehicles to the log.</String>
|
||||
|
||||
<String key="Graphic">Graphics</String>
|
||||
<String key="RenderEngine">Renderer</String>
|
||||
<String key="RenderEngine">Graphics API</String>
|
||||
<String key="ConfirmRenderingChange">Changing “{0}” can stop the simulator from starting or spoil the picture. Change it?</String>
|
||||
<String key="RenderEngineDesc">Use Full. Old and Simplified are only for cards Full does not work on.</String>
|
||||
<String key="RenderEngineDesc">Vulkan is faster. Where it does not run, the simulator falls back to OpenGL 4.6 by itself; choose OpenGL only to test it.</String>
|
||||
<String key="GpuChoice">Graphics card</String>
|
||||
<String key="GpuDiscrete">Dedicated</String>
|
||||
<String key="GpuSystem">System</String>
|
||||
@@ -435,8 +435,8 @@
|
||||
|
||||
<String key="Resolution">Resolution</String>
|
||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||
<String key="BufforResolution">Buffer resolution</String>
|
||||
<String key="BufforResolutionDesc">The resolution the picture is drawn at. Below 100% is faster but less sharp.</String>
|
||||
<String key="BufforResolution">Render scale</String>
|
||||
<String key="BufforResolutionDesc">The part of the window the picture is drawn at, then stretched to it. Below 100% faster, but less sharp.</String>
|
||||
<String key="MaxTexResolution">Textures</String>
|
||||
<String key="MaxTexCabResolution">Cab textures</String>
|
||||
<String key="TexFilteringQuality">Texture filtering</String>
|
||||
@@ -556,9 +556,9 @@
|
||||
<String key="AdvancedMode">Advanced mode</String>
|
||||
<String key="AdvancedModeMenu">Advanced mode…</String>
|
||||
<String key="AdvancedModeOff">Turn off advanced mode</String>
|
||||
<String key="AdvancedModeOffConfirm">Turning advanced mode off puts every setting only it shows back to its default and saves the settings of this page. Turn it off?</String>
|
||||
<String key="AdvancedModeOffConfirm">Turning advanced mode off puts everything of the Developer tab back to the starter's own values - Vulkan, and every optimisation on - and saves the settings of this page. The quality of the picture stays as the Graphics tab shows it. Turn it off?</String>
|
||||
<String key="AdvancedModeOn">Turn it on</String>
|
||||
<String key="AdvancedModeWarning">Advanced mode shows every setting of the simulator and the starter, including ones that can stop the simulator from starting, make it unstable or spoil the picture. It also lets you change the crews of consists, AI consists and decorations, so a scenario may not play as its author meant. Change these settings only if you know what they do. Trouble they cause is not a bug of the simulator: before reporting one, turn advanced mode off and restore the default settings. Read this carefully. The button to turn it on works in 20 seconds.</String>
|
||||
<String key="AdvancedModeWarning">Advanced mode is meant for developers and testers. It opens the Developer tab with every setting of the simulator: the renderer (OpenGL instead of Vulkan), the details of the picture, the switches of its optimisations, logs and diagnostics. Many of them can stop the simulator from starting, make it slower or unstable, or spoil the picture. It also lets you change the crews of consists, AI consists and decorations, so a scenario may not play as its author meant. Trouble these settings cause is not a bug of the simulator: before reporting one, turn advanced mode off, which puts everything of the Developer tab back to the starter's own values. Read this carefully. The button to turn it on works in 20 seconds.</String>
|
||||
<String key="CompressTextures">Compress TGA textures</String>
|
||||
<String key="ScaleSpeculars">Specular scaling</String>
|
||||
<String key="ScaleSpecularsDesc">Less shine on older models.</String>
|
||||
@@ -785,7 +785,7 @@
|
||||
|
||||
<!-- Key binding descriptions, by eu07_input-keyboard.ini command. Polish takes them
|
||||
from the bundled key file; a language without its own falls back to these. -->
|
||||
<String key="AdvancedResources">Resources</String>
|
||||
<String key="AdvancedResources">Performance</String>
|
||||
<String key="AdvancedLogTools">Log and tools</String>
|
||||
<String key="LogAndTools">Event log and tools</String>
|
||||
<String key="OpenLogTools">Open the log and tools…</String>
|
||||
@@ -863,13 +863,11 @@
|
||||
<String key="Ini.gfx.reflections.range_vehicles">Vehicle reflection range</String>
|
||||
<String key="Ini.gfx.textures.streaming">Textures in background</String>
|
||||
<String key="Ini.gfx.textures.releasedistance">Release vehicle textures</String>
|
||||
<String key="Ini.skyenabled">Sky</String>
|
||||
<String key="Ini.rendercab">Cab</String>
|
||||
<String key="Ini.gfx.postfx.motionblur.shutter">Blur time</String>
|
||||
<String key="Ini.python.vsync">Screen windows VSync</String>
|
||||
<String key="Ini.python.displaywindows">Screens in own windows</String>
|
||||
<String key="Ini.newaircouplers">Hoses by coupling</String>
|
||||
<String key="Ini.smoothtraction">Smooth wires</String>
|
||||
<String key="Ini.sound.maxsources">Sound sources</String>
|
||||
<String key="Ini.sound.asyncload">Sounds in background</String>
|
||||
<String key="Ini.loadtraction">Overhead line</String>
|
||||
@@ -1085,7 +1083,6 @@
|
||||
<String key="IniChangesNone">Saving would change nothing in eu07.ini.</String>
|
||||
<String key="IniChangesKeyboard">Changed key bindings go to eu07_input-keyboard.ini.</String>
|
||||
<String key="GfxColPresets">Graphics quality</String>
|
||||
<String key="PresetMinimal">Minimal</String>
|
||||
<String key="PresetLow">Low</String>
|
||||
<String key="PresetMedium">Medium</String>
|
||||
<String key="PresetHigh">High</String>
|
||||
@@ -1093,7 +1090,7 @@
|
||||
<String key="MonitorRate">Screen: {0} Hz</String>
|
||||
<String key="MonitorRateUse">Set {0} FPS</String>
|
||||
<String key="FpsVSyncNote">With VSync, frames never exceed the monitor's Hz, so a limit at or above it changes nothing.</String>
|
||||
<String key="GfxPresetDesc">Hover over a level to see its values.</String>
|
||||
<String key="GfxPresetDesc">A level sets every part below in one go; each can then be changed on its own.</String>
|
||||
<String key="TextureBaseDateHint">YYYY-MM-DD</String>
|
||||
<String key="LanguageStarterMissing">No starter translation: it stays in English. The simulator gets this language.</String>
|
||||
<String key="ProfileNone">No profiles</String>
|
||||
@@ -1127,8 +1124,6 @@
|
||||
<String key="Ini.heightbase">Distance factor</String>
|
||||
<String key="Ini.heightbase.Desc">Shortens or stretches the draw range.</String>
|
||||
<String key="PresetVeryHigh">Very high</String>
|
||||
<String key="PresetUltra">Ultra</String>
|
||||
<String key="PresetUltraNote">Everything at maximum. It may be too much even for a strong card.</String>
|
||||
<String key="Ini.python.fpslimit">Screen windows FPS</String>
|
||||
<String key="Ini.python.fpslimit.Desc">Only for screens in their own windows.</String>
|
||||
<String key="ShadowLimitNone">Longest</String>
|
||||
@@ -1154,9 +1149,9 @@
|
||||
<String key="GfxColImage">Picture</String>
|
||||
<String key="GfxColLights">Lighting</String>
|
||||
<String key="GfxColPostFx">Post-processing</String>
|
||||
<String key="GfxColNature">Smoke</String>
|
||||
<String key="AntiAliasing">Multisampling</String>
|
||||
<String key="AntiAliasingDesc">Smooths edges. A higher level gives a smoother picture and fewer FPS.</String>
|
||||
<String key="GfxColNature">Smoke and weather</String>
|
||||
<String key="AntiAliasing">Anti-aliasing</String>
|
||||
<String key="AntiAliasingDesc">Smooths jagged edges. TAA costs least; MSAA is sharper and costs more with every step; DLSS and DLAA need an NVIDIA RTX card, Vulkan and a simulator built with DLSS, else TAA is used.</String>
|
||||
<String key="SettingsFile">eu07.ini file</String>
|
||||
<String key="ImportIni">Import…</String>
|
||||
<String key="ImportIniTitle">Import settings from eu07.ini</String>
|
||||
@@ -1168,17 +1163,132 @@
|
||||
<String key="ExportIniFailed">The file could not be written:
|
||||
{0}</String>
|
||||
<String key="ExportIniDone">Exported to {0}</String>
|
||||
<String key="REFull">Full</String>
|
||||
<String key="REOld">Old (not recommended)</String>
|
||||
<String key="RESimp">Simplified (not recommended)</String>
|
||||
<String key="RenderAngleVulkan">ANGLE (Vulkan)</String>
|
||||
<String key="RenderAngleVulkanDesc">Draws through ANGLE on Vulkan. Turn on if plain OpenGL gives trouble.</String>
|
||||
<String key="RenderVBO">VBO</String>
|
||||
<String key="RenderVBODesc">Turn off only if an older card has picture problems.</String>
|
||||
<String key="CabShadowsRange">Cab shadows</String>
|
||||
<String key="CabShadowsRangeDesc">How far lights cast shadows in the cab. 0 turns cab shadows off.</String>
|
||||
<String key="UseGLES">OpenGL ES</String>
|
||||
<String key="UseGLESDesc">OpenGL ES instead of OpenGL. Does not work with the old renderer.</String>
|
||||
<String key="GpuCard">{0}, {1} GB</String>
|
||||
<String key="GpuCardShared">{0}, shared memory</String>
|
||||
<String key="DeveloperTab">Developer</String>
|
||||
<String key="DeveloperTabNote">Settings for developers and testers. A player has everything here at the starter's own values, which keep the simulator as fast as it can be; turning advanced mode off puts them back.</String>
|
||||
<String key="MouseSection">Mouse</String>
|
||||
<String key="RecordingSection">Recording</String>
|
||||
<String key="DevSimulation">Simulation</String>
|
||||
<String key="GfxColQuality">Quality details</String>
|
||||
<String key="GroupTextures">Textures</String>
|
||||
<String key="GroupShadows">Shadows</String>
|
||||
<String key="GroupReflections">Reflections</String>
|
||||
<String key="GroupLighting">Lighting and sky</String>
|
||||
<String key="GroupDrawRange">Draw distance and grass</String>
|
||||
<String key="GroupParticles">Smoke, rain and snow</String>
|
||||
<String key="AaDlss">DLSS (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="AaDlaa">DLAA (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="REVulkan">Vulkan (recommended)</String>
|
||||
<String key="REOpenGL">OpenGL 4.6</String>
|
||||
<String key="IniSectionRenderer">Renderer</String>
|
||||
<String key="IniSectionPerformance">Performance</String>
|
||||
<String key="GroupTexturesDesc">Texture sharpness, filtering at an angle and surface relief. Costs mostly video memory.</String>
|
||||
<String key="GroupShadowsDesc">Shadows of the sun, of lamps and headlights, contact shadows.</String>
|
||||
<String key="GroupReflectionsDesc">Reflections of the surroundings, on screen and in the cab.</String>
|
||||
<String key="GroupLightingDesc">Ambient occlusion, volumetric fog and clouds.</String>
|
||||
<String key="GroupDrawRangeDesc">How far the scenery may be drawn, the smoothness of track curves, and the grass.</String>
|
||||
<String key="GroupParticlesDesc">Smoke particles, raindrops and snowflakes.</String>
|
||||
<String key="Ini.gfx.vulkan.device">Vulkan GPU</String>
|
||||
<String key="Ini.gfx.vulkan.device.Desc">A number from the log's list, or part of the card's name. Empty – the best card.</String>
|
||||
<String key="Ini.gfx.vulkan.renderthread">Separate submit thread</String>
|
||||
<String key="Ini.gfx.threads">Command recording threads</String>
|
||||
<String key="Ini.gfx.threads.Desc">0 – automatic (cores − 2).</String>
|
||||
<String key="Ini.gfx.vulkan.asyncresources">Resources built in the background</String>
|
||||
<String key="Ini.gfx.vulkan.parallelpasses">Shadow passes in parallel</String>
|
||||
<String key="Ini.gfx.vulkan.parallelmodels">Models walked in parallel</String>
|
||||
<String key="Ini.gfx.vulkan.asynccompute">Sky and weather on async compute</String>
|
||||
<String key="Ini.gfx.vulkan.asynccompute.Desc">Experimental, its gain not yet measured.</String>
|
||||
<String key="Ini.gfx.vulkan.framesinflight">Frames in flight</String>
|
||||
<String key="Ini.gfx.shaders.binaries">Saved shader binaries</String>
|
||||
<String key="Ini.gfx.shaders.binaries.Desc">Faster start.</String>
|
||||
<String key="Ini.gfx.lights.shadows">Lamp shadows</String>
|
||||
<String key="Ini.gfx.contactshadows">Contact shadows</String>
|
||||
<String key="Ini.gfx.shadow.sdsm">Cascades fitted to the view (SDSM)</String>
|
||||
<String key="Ini.gfx.ssr">Screen-space reflections</String>
|
||||
<String key="Ini.gfx.raytracing">Ray-traced reflections</String>
|
||||
<String key="Ini.gfx.raytracing.Desc">Vulkan, on a card with ray queries.</String>
|
||||
<String key="Ini.gfx.cabprobe">Cab light probe</String>
|
||||
<String key="Ini.gfx.water.realistic">Realistic water</String>
|
||||
<String key="Ini.gfx.postfx.ao">Ambient occlusion</String>
|
||||
<String key="Ini.gfx.fog.quality">Fog quality</String>
|
||||
<String key="Ini.gfx.clouds">Clouds</String>
|
||||
<String key="Ini.gfx.postfx.bloom">Bloom</String>
|
||||
<String key="Ini.gfx.grass">Grass</String>
|
||||
<String key="Ini.gfx.grass.distance">Grass range</String>
|
||||
<String key="Ini.gfx.grass.fadedistance">Grass fades out by</String>
|
||||
<String key="Ini.gfx.grass.density">Grass density</String>
|
||||
<String key="Ini.gfx.precipitation.particles">Rain and snow particles</String>
|
||||
<String key="Ini.gfx.dlss.preset">DLSS preset</String>
|
||||
<String key="Ini.gfx.framegeneration">Frame generation (DLSS)</String>
|
||||
<String key="Ini.gfx.reflex">NVIDIA Reflex</String>
|
||||
<String key="Ini.gfx.gpucull">Culling on the GPU</String>
|
||||
<String key="Ini.gfx.gpucull.Desc">Faster with many objects in view. The simulator's own is off; the starter turns it on.</String>
|
||||
<String key="Ini.gfx.gpucull.occlusion">Occlusion culling</String>
|
||||
<String key="Ini.gfx.depthprepass">Depth prepass</String>
|
||||
<String key="Ini.performance.multithreading">Multithreading</String>
|
||||
<String key="Ini.physics.sleepheld">Rest braked vehicles</String>
|
||||
<String key="Ini.physics.sleepheld.Desc">The physics of a standing vehicle held by its brakes waits until something moves it.</String>
|
||||
<String key="Ini.physics.roadlod">Simpler far road vehicles</String>
|
||||
<String key="Ini.physics.roadlod.Desc">Beyond 1 km one physics step a frame.</String>
|
||||
<String key="Ini.file.binary.terrain">Binary terrain cache</String>
|
||||
<String key="Ini.gfx.smoke.gpu">Smoke simulated on the GPU</String>
|
||||
<String key="Ini.gfx.weather.occlusion">Skip hidden clouds and fog</String>
|
||||
<String key="Ini.gfx.clouds.interleave">Clouds drawn interleaved</String>
|
||||
<String key="Ini.screens.gpupost">Screen effects on the GPU</String>
|
||||
<String key="Ini.screens.cabframes">Cab screens every N frames</String>
|
||||
<String key="Ini.screens.externalframes">Outside screens every N frames</String>
|
||||
<String key="Ini.debug.perflog">Renderer timings</String>
|
||||
<String key="Ini.debug.perflog.Desc">Written to perf.txt every so many seconds. 0 – off.</String>
|
||||
<String key="Ini.crashdump.full">Full crash dump</String>
|
||||
<String key="Choice.no">Off</String>
|
||||
<String key="Choice.low">Low</String>
|
||||
<String key="Choice.medium">Medium</String>
|
||||
<String key="Choice.high">High</String>
|
||||
<String key="Choice.ultra">Ultra</String>
|
||||
<String key="Choice.ssao">SSAO</String>
|
||||
<String key="Choice.gtao">GTAO</String>
|
||||
<String key="Choice.off">Off</String>
|
||||
<String key="Choice.on">On</String>
|
||||
<String key="Choice.boost">Boost</String>
|
||||
<String key="Choice.default">Default</String>
|
||||
<String key="SimulatorSection">Simulator</String>
|
||||
<String key="RayTracing">Ray tracing (reflections)</String>
|
||||
<String key="RayTracingOff">Off</String>
|
||||
<String key="RayTracingDesc">Ray-traced reflections: more exact, but costly. Vulkan and a card with ray tracing only (NVIDIA RTX, AMD RX 6000 and newer). The level is how far the rays reach; no level of detail turns them on.</String>
|
||||
<String key="SelectEXEDesc">Automatic picks the build that runs on this processor. Choose another only when several builds are installed.</String>
|
||||
<String key="RealismSection">Driving realism</String>
|
||||
<String key="PhysicsPresets">Realism level</String>
|
||||
<String key="PhysicsArcade">Arcade</String>
|
||||
<String key="PhysicsRealistic">Realistic</String>
|
||||
<String key="BrakeKeysSection">Brake from the keyboard</String>
|
||||
<String key="Ini.couplerphysics">Couplings</String>
|
||||
<String key="Ini.physics.derailment">Derailment</String>
|
||||
<String key="Ini.physics.collisions">Collisions</String>
|
||||
<String key="Ini.physics.trackbuckling">Track buckling in heat</String>
|
||||
<String key="Ini.deer">Animals by the track</String>
|
||||
<String key="Choice.couplerphysics.no">Simplified</String>
|
||||
<String key="Choice.couplerphysics.yes">Physical – the player's train</String>
|
||||
<String key="Choice.couplerphysics.all">Physical – every train</String>
|
||||
<String key="Choice.physics.derailment.off">Off</String>
|
||||
<String key="Choice.physics.derailment.monitor">Classic</String>
|
||||
<String key="Choice.physics.derailment.new">Physical</String>
|
||||
<String key="Choice.physics.derailment.old">Classic, nothing to the log</String>
|
||||
<String key="Choice.physics.collisions.old">Classic</String>
|
||||
<String key="Choice.physics.collisions.new">Physical</String>
|
||||
<String key="Choice.physics.collisions.monitor">Classic, physical to the log</String>
|
||||
<String key="Choice.physics.trackbuckling.off">Off</String>
|
||||
<String key="Choice.physics.trackbuckling.scenery">From the scenery</String>
|
||||
<String key="Choice.physics.trackbuckling.auto">Also from heat</String>
|
||||
<String key="PhysicsPresetsDesc">Arcade forgives: no derailment, no damage, power without the wires, every consist ready to drive. Realistic takes the physical models of the couplings, derailment, collisions and track. Each setting below can still be changed on its own.</String>
|
||||
<String key="Ini.couplerphysics.Desc">Physical: buffers and draw gear with play, give and breaking, as a rough start or a hard stop shows. On every train it costs more processor time.</String>
|
||||
<String key="Ini.physics.derailment.Desc">Physical: a vehicle too fast in a curve overturns or climbs the rail; within the track's own speed limit nothing derails. Classic: the old rule.</String>
|
||||
<String key="Ini.physics.collisions.Desc">Physical: the ends crush, a vehicle may ride up onto another or be pushed off the track. Classic: the old rule of a safe closing speed.</String>
|
||||
<String key="Ini.physics.trackbuckling.Desc">From the scenery: only where its author put a buckle. Also from heat: weak places of welded track buckle when the rails get hot.</String>
|
||||
<String key="Ini.deer.Desc">Deer graze by the track ahead and run away from the horn.</String>
|
||||
<String key="Ini.physics.derailment.trustlimits">A track's speed limit derails nothing</String>
|
||||
<String key="Ini.physics.derailment.trustlimits.Desc">With physical derailment: within the limit only the couplings, a buckle or damage derail.</String>
|
||||
<String key="Ini.controlcoupling.enginecheck">No multiple-unit control of electric and diesel</String>
|
||||
<String key="Ini.ai.brakesetting.cw1">AI sets the brakes by Cw-1</String>
|
||||
<String key="Ini.physics.trackcheck">Suspicious track geometry to the log</String>
|
||||
</Language>
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<String key="LogMissingVehicleFiles">Hiányzó járműfájlok naplózása exportáláskor</String>
|
||||
|
||||
<String key="Graphic">Grafika</String>
|
||||
<String key="RenderEngine">Megjelenítő motor</String>
|
||||
<String key="RenderEngine">Grafikus API</String>
|
||||
<String key="ConfirmRenderingChange">A(z) „{0}” módosítása miatt a szimulátor nem indulhat el, vagy rossz lehet a kép. Módosítja?</String>
|
||||
<String key="RenderEngineDesc">A Teljes a szimulátor ajánlott renderelője. A Régi és az Egyszerűsített a klasszikus renderelővel rajzol, és nem ajánlott, ha a Teljes működik – azokhoz a videokártyákhoz valók, amelyekkel a Teljesnek gondja van.</String>
|
||||
<String key="GpuChoice">Videokártya (Linux)</String>
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
<String key="Resolution">Felbontás</String>
|
||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||
<String key="BufforResolution">Puffer felbontása</String>
|
||||
<String key="BufforResolution">Renderelési lépték</String>
|
||||
<String key="MaxTexResolution">Textúrák legnagyobb felbontása</String>
|
||||
<String key="MaxTexCabResolution">Vezetőállás-textúrák legnagyobb felbontása</String>
|
||||
<String key="TexFilteringQuality">Textúraszűrés minősége</String>
|
||||
@@ -530,9 +530,9 @@
|
||||
<String key="AdvancedMode">Haladó mód</String>
|
||||
<String key="AdvancedModeMenu">Haladó mód…</String>
|
||||
<String key="AdvancedModeOff">Haladó mód kikapcsolása</String>
|
||||
<String key="AdvancedModeOffConfirm">A haladó mód kikapcsolása visszaállítja az alapértéket minden csak benne elérhető beállításnál, és menti az oldal beállításait. Kikapcsolja?</String>
|
||||
<String key="AdvancedModeOffConfirm">A haladó mód kikapcsolása a Fejlesztő lap mindenét visszaállítja az indító saját értékeire – Vulkan és minden optimalizálás bekapcsolva –, és menti ennek az oldalnak a beállításait. A grafika minősége olyan marad, ahogy a Grafika lap mutatja. Kikapcsolod?</String>
|
||||
<String key="AdvancedModeOn">Bekapcsolom</String>
|
||||
<String key="AdvancedModeWarning">A haladó mód a szimulátor és az indító minden beállítását megmutatja, azokat is, amelyek módosítása után a szimulátor nem indulhat el, instabil lehet, vagy rossz lehet a kép. A szerelvények személyzetét, az AI-szerelvényeket és a díszleteket is módosíthatja, így a forgatókönyv nem úgy működhet, ahogy a szerzője tervezte. Csak akkor módosítsa ezeket, ha tudja, mit csinálnak. Az ebből eredő gondok nem a szimulátor hibái: hibabejelentés előtt kapcsolja ki a haladó módot, és állítsa vissza az alapbeállításokat. Olvassa el figyelmesen. A bekapcsoló gomb 20 másodperc múlva működik.</String>
|
||||
<String key="AdvancedModeWarning">A haladó mód fejlesztőknek és tesztelőknek készült. Megnyitja a Fejlesztő lapot a szimulátor összes beállításával: a renderelővel (OpenGL a Vulkan helyett), a kép részleteivel, az optimalizálások kapcsolóival, a naplókkal és a diagnosztikával. Sokuk módosítása után a szimulátor nem indulhat el, lassabb vagy instabil lehet, vagy rosszul nézhet ki. Lehetővé teszi a szerelvények személyzetének, az AI-szerelvényeknek és a díszleteknek a módosítását is, így a forgatókönyv nem úgy működhet, ahogy a szerzője tervezte. Az ezekből a beállításokból eredő gondok nem a szimulátor hibái: hibabejelentés előtt kapcsold ki a haladó módot, ami a Fejlesztő lap mindenét visszaállítja az indító saját értékeire. Olvasd el figyelmesen. A bekapcsoló gomb 20 másodperc múlva működik.</String>
|
||||
<String key="CompressTextures">TGA textúrák tömörítése</String>
|
||||
<String key="ScaleSpeculars">Csillanások skálázása (régi modellek kompatibilitása)</String>
|
||||
<String key="ScaleSpecularsDesc">Csökkenti a régebbi megjelenítőkhöz készült modellek csillogását.</String>
|
||||
@@ -755,7 +755,7 @@
|
||||
<String key="ShortcutCardMenu">Jármű menüjének megnyitása</String>
|
||||
|
||||
<!-- Package author's tab - awaiting translation -->
|
||||
<String key="AdvancedResources">Erőforrások és kompatibilitás</String>
|
||||
<String key="AdvancedResources">Teljesítmény</String>
|
||||
<String key="AdvancedLogTools">Napló és eszközök</String>
|
||||
<String key="LogAndTools">Eseménynapló és eszközök</String>
|
||||
<String key="OpenLogTools">Napló és eszközök megnyitása…</String>
|
||||
@@ -833,13 +833,11 @@
|
||||
<String key="Ini.gfx.reflections.range_vehicles">Járművek tükröződési távolsága</String>
|
||||
<String key="Ini.gfx.textures.streaming">Textúrák betöltése a háttérben</String>
|
||||
<String key="Ini.gfx.textures.releasedistance">Távoli járművek textúráinak felszabadítása</String>
|
||||
<String key="Ini.skyenabled">Égbolt megjelenítése</String>
|
||||
<String key="Ini.rendercab">Vezetőfülke megjelenítése</String>
|
||||
<String key="Ini.gfx.postfx.motionblur.shutter">Mozgási elmosódás záridő</String>
|
||||
<String key="Ini.python.vsync">Kijelzőablakok függőleges szinkronizálása</String>
|
||||
<String key="Ini.python.displaywindows">Vezetőfülke-kijelzők külön ablakokban</String>
|
||||
<String key="Ini.newaircouplers">Légvezetékek megjelenítése a kapcsolás szerint</String>
|
||||
<String key="Ini.smoothtraction">Felsővezeték simítása (klasszikus megjelenítő)</String>
|
||||
<String key="Ini.sound.maxsources">Hangforrások maximális száma</String>
|
||||
<String key="Ini.sound.asyncload">Hangok dekódolása a háttérben</String>
|
||||
<String key="Ini.loadtraction">Felsővezeték betöltése</String>
|
||||
@@ -857,7 +855,6 @@
|
||||
<String key="IniChangesNone">A mentés semmit sem változtat az eu07.ini-ben.</String>
|
||||
<String key="IniChangesKeyboard">A módosított billentyűk az eu07_input-keyboard.ini-be kerülnek.</String>
|
||||
<String key="GfxColPresets">Grafikai minőség</String>
|
||||
<String key="PresetMinimal">Minimális</String>
|
||||
<String key="PresetLow">Alacsony</String>
|
||||
<String key="PresetMedium">Közepes</String>
|
||||
<String key="PresetHigh">Magas</String>
|
||||
@@ -865,7 +862,7 @@
|
||||
<String key="MonitorRate">Monitor: {0} Hz</String>
|
||||
<String key="MonitorRateUse">{0} FPS beállítása</String>
|
||||
<String key="FpsVSyncNote">VSync mellett nem lesz több képkocka, mint a monitor Hz-e, így ennyi vagy nagyobb korlát semmit sem változtat.</String>
|
||||
<String key="GfxPresetDesc">Vidd az egeret a szintre az értékekhez.</String>
|
||||
<String key="GfxPresetDesc">A szint egyszerre állítja be az alábbi részeket; utána mindegyik külön is módosítható.</String>
|
||||
<String key="TextureBaseDateHint">ÉÉÉÉ-HH-NN</String>
|
||||
<String key="LanguageStarterMissing">Nincs fordítás az indítóhoz: angol marad. A szimulátor ezt a nyelvet kapja.</String>
|
||||
<String key="ProfileNone">Nincs profil</String>
|
||||
@@ -899,8 +896,6 @@
|
||||
<String key="Ini.heightbase">Távolságszorzó</String>
|
||||
<String key="Ini.heightbase.Desc">Rövidíti vagy nyújtja a színtér rajzolási távolságát. A cél FPS felülírja.</String>
|
||||
<String key="PresetVeryHigh">Nagyon magas</String>
|
||||
<String key="PresetUltra">Ultra</String>
|
||||
<String key="PresetUltraNote">Minden a maximumon. Erős kártyának is sok lehet.</String>
|
||||
<String key="Ini.python.fpslimit">Kijelzőablakok képkockakorlátja</String>
|
||||
<String key="Ini.python.fpslimit.Desc">Csak a külön ablakban lévő kijelzőknél működik; nélkülük nem változtat semmit.</String>
|
||||
<String key="ShadowLimitNone">Leghosszabb</String>
|
||||
@@ -926,7 +921,7 @@
|
||||
<String key="GfxColImage">Felbontás és élsimítás</String>
|
||||
<String key="GfxColLights">Világítás</String>
|
||||
<String key="GfxColPostFx">Utófeldolgozás</String>
|
||||
<String key="GfxColNature">Füst</String>
|
||||
<String key="GfxColNature">Füst és csapadék</String>
|
||||
<String key="AntiAliasing">Élsimítás</String>
|
||||
<String key="SettingsFile">eu07.ini fájl</String>
|
||||
<String key="ImportIni">Importálás…</String>
|
||||
@@ -939,14 +934,50 @@
|
||||
<String key="ExportIniFailed">A fájl nem írható:
|
||||
{0}</String>
|
||||
<String key="ExportIniDone">Exportálva ide: {0}</String>
|
||||
<String key="REFull">Teljes</String>
|
||||
<String key="REOld">Régi (nem ajánlott, ha a Teljes működik)</String>
|
||||
<String key="RESimp">Egyszerűsített (nem ajánlott, ha a Teljes működik)</String>
|
||||
<String key="RenderAngleVulkan">ANGLE Vulkan megjelenítő használata</String>
|
||||
<String key="RenderVBO">VBO megjelenítés</String>
|
||||
<String key="CabShadowsRange">Vezetőállás árnyékforrásainak hatótávolsága</String>
|
||||
<String key="UseGLES">OpenGL ES használata</String>
|
||||
<String key="UseGLESDesc">OpenGL ES az OpenGL helyett. A legacy megjelenítővel nem működik.</String>
|
||||
<String key="GpuCard">{0}, {1} GB</String>
|
||||
<String key="GpuCardShared">{0}, megosztott memória</String>
|
||||
<String key="DeveloperTab">Fejlesztő</String>
|
||||
<String key="DeveloperTabNote">Beállítások fejlesztőknek és tesztelőknek. A játékosnál itt minden az indító saját értékén áll, amellyel a szimulátor a leggyorsabb; a haladó mód kikapcsolása visszaállítja őket.</String>
|
||||
<String key="MouseSection">Egér</String>
|
||||
<String key="RecordingSection">Menetrögzítés</String>
|
||||
<String key="DevSimulation">Szimuláció</String>
|
||||
<String key="GfxColQuality">Minőség részletei</String>
|
||||
<String key="GroupTextures">Textúrák</String>
|
||||
<String key="GroupShadows">Árnyékok</String>
|
||||
<String key="GroupReflections">Tükröződések</String>
|
||||
<String key="GroupLighting">Megvilágítás és égbolt</String>
|
||||
<String key="GroupDrawRange">Látótávolság és fű</String>
|
||||
<String key="GroupParticles">Füst, eső és hó</String>
|
||||
<String key="AaDlss">DLSS (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="AaDlaa">DLAA (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="REVulkan">Vulkan (ajánlott)</String>
|
||||
<String key="REOpenGL">OpenGL 4.6</String>
|
||||
<String key="IniSectionRenderer">Renderelő</String>
|
||||
<String key="IniSectionPerformance">Teljesítmény</String>
|
||||
<String key="SimulatorSection">Szimulátor</String>
|
||||
<String key="RayTracing">Sugárkövetés (tükröződések)</String>
|
||||
<String key="RayTracingOff">Ki</String>
|
||||
<String key="RealismSection">Vezetési realizmus</String>
|
||||
<String key="PhysicsPresets">Realizmus szintje</String>
|
||||
<String key="PhysicsArcade">Árkád</String>
|
||||
<String key="PhysicsRealistic">Valósághű</String>
|
||||
<String key="BrakeKeysSection">Fék a billentyűzetről</String>
|
||||
<String key="Ini.couplerphysics">Kapcsolókészülékek</String>
|
||||
<String key="Ini.physics.derailment">Kisiklás</String>
|
||||
<String key="Ini.physics.collisions">Ütközések</String>
|
||||
<String key="Ini.physics.trackbuckling">Vágánykivetődés hőségben</String>
|
||||
<String key="Ini.deer">Állatok a pálya mellett</String>
|
||||
<String key="Choice.couplerphysics.no">Egyszerűsített</String>
|
||||
<String key="Choice.couplerphysics.yes">Fizikai – a játékos vonata</String>
|
||||
<String key="Choice.couplerphysics.all">Fizikai – minden vonat</String>
|
||||
<String key="Choice.physics.derailment.off">Ki</String>
|
||||
<String key="Choice.physics.derailment.monitor">Klasszikus</String>
|
||||
<String key="Choice.physics.derailment.new">Fizikai</String>
|
||||
<String key="Choice.physics.derailment.old">Klasszikus, napló nélkül</String>
|
||||
<String key="Choice.physics.collisions.old">Klasszikus</String>
|
||||
<String key="Choice.physics.collisions.new">Fizikai</String>
|
||||
<String key="Choice.physics.collisions.monitor">Klasszikus, a fizikai a naplóba</String>
|
||||
<String key="Choice.physics.trackbuckling.off">Ki</String>
|
||||
<String key="Choice.physics.trackbuckling.scenery">A pályáról</String>
|
||||
<String key="Choice.physics.trackbuckling.auto">Hőségtől is</String>
|
||||
</Language>
|
||||
|
||||
@@ -420,9 +420,9 @@
|
||||
<String key="LogMissingVehicleFilesDesc">Przy eksporcie zapisuje w logu pojazdy, których brakuje.</String>
|
||||
|
||||
<String key="Graphic">Grafika</String>
|
||||
<String key="RenderEngine">Renderer</String>
|
||||
<String key="RenderEngine">Interfejs graficzny (API)</String>
|
||||
<String key="ConfirmRenderingChange">Zmiana „{0}” może sprawić, że symulator się nie uruchomi albo obraz będzie wyglądał źle. Zmienić?</String>
|
||||
<String key="RenderEngineDesc">Używaj Pełnego. Stary i Uproszczony są tylko dla kart, na których Pełny nie działa.</String>
|
||||
<String key="RenderEngineDesc">Vulkan jest szybszy. Tam, gdzie nie działa, symulator sam przełącza się na OpenGL 4.6; wybieraj OpenGL tylko do testów.</String>
|
||||
<String key="GpuChoice">Karta graficzna</String>
|
||||
<String key="GpuDiscrete">Dedykowana</String>
|
||||
<String key="GpuSystem">Systemowa</String>
|
||||
@@ -435,8 +435,8 @@
|
||||
|
||||
<String key="Resolution">Rozdzielczość</String>
|
||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||
<String key="BufforResolution">Rozdzielczość bufora</String>
|
||||
<String key="BufforResolutionDesc">W jakiej rozdzielczości rysowany jest obraz. Poniżej 100% szybciej, ale mniej ostro.</String>
|
||||
<String key="BufforResolution">Skala renderowania</String>
|
||||
<String key="BufforResolutionDesc">Przy jakiej części rozdzielczości okna rysowany jest obraz, potem rozciągany do okna. Poniżej 100% szybciej, ale mniej ostro.</String>
|
||||
<String key="MaxTexResolution">Tekstury</String>
|
||||
<String key="MaxTexCabResolution">Tekstury kabiny</String>
|
||||
<String key="TexFilteringQuality">Filtrowanie tekstur</String>
|
||||
@@ -556,9 +556,9 @@
|
||||
<String key="AdvancedMode">Tryb zaawansowany</String>
|
||||
<String key="AdvancedModeMenu">Tryb zaawansowany…</String>
|
||||
<String key="AdvancedModeOff">Wyłącz tryb zaawansowany</String>
|
||||
<String key="AdvancedModeOffConfirm">Wyłączenie trybu zaawansowanego przywróci domyślne wartości wszystkich ustawień, które są dostępne tylko w nim, i zapisze ustawienia z tej strony. Wyłączyć?</String>
|
||||
<String key="AdvancedModeOffConfirm">Wyłączenie trybu zaawansowanego przywróci wszystko z zakładki Deweloper do wartości startera – Vulkan i wszystkie optymalizacje włączone – i zapisze ustawienia z tej strony. Jakość grafiki zostanie taka, jak pokazuje ją zakładka Grafika. Wyłączyć?</String>
|
||||
<String key="AdvancedModeOn">Włączam</String>
|
||||
<String key="AdvancedModeWarning">Tryb zaawansowany pokazuje wszystkie ustawienia symulatora i startera, także te, po których zmianie symulator może się nie uruchomić, działać niestabilnie albo wyglądać źle. Pozwala też zmieniać obsadę składów, składy AI i dekoracje, przez co scenariusz może nie działać tak, jak zaplanował autor. Zmieniaj te ustawienia tylko wtedy, gdy wiesz, co robią. Kłopoty, które z nich wynikną, nie są błędami symulatora: zanim zgłosisz błąd, wyłącz tryb zaawansowany i przywróć ustawienia domyślne. Przeczytaj to uważnie. Przycisk włączenia zadziała za 20 sekund.</String>
|
||||
<String key="AdvancedModeWarning">Tryb zaawansowany jest przeznaczony dla deweloperów i testerów. Otwiera zakładkę Deweloper ze wszystkimi ustawieniami symulatora: rendererem (OpenGL zamiast Vulkana), szczegółami obrazu, przełącznikami optymalizacji, logami i diagnostyką. Po zmianie wielu z nich symulator może się nie uruchomić, działać wolniej lub niestabilnie albo wyglądać źle. Pozwala też zmieniać obsadę składów, składy AI i dekoracje, przez co scenariusz może nie działać tak, jak zaplanował autor. Kłopoty wynikające z tych ustawień nie są błędami symulatora: zanim zgłosisz błąd, wyłącz tryb zaawansowany, co przywraca wszystko z zakładki Deweloper do wartości startera. Przeczytaj to uważnie. Przycisk włączenia zadziała za 20 sekund.</String>
|
||||
<String key="CompressTextures">Kompresja tekstur TGA</String>
|
||||
<String key="ScaleSpeculars">Skalowanie specular</String>
|
||||
<String key="ScaleSpecularsDesc">Słabszy połysk starszych modeli.</String>
|
||||
@@ -782,7 +782,7 @@
|
||||
<String key="ShortcutCardMenu">Otwórz menu pojazdu</String>
|
||||
|
||||
<!-- Zakladka dla tworcow paczek -->
|
||||
<String key="AdvancedResources">Zasoby</String>
|
||||
<String key="AdvancedResources">Wydajność</String>
|
||||
<String key="AdvancedLogTools">Dziennik i narzędzia</String>
|
||||
<String key="LogAndTools">Dziennik zdarzeń i narzędzia</String>
|
||||
<String key="OpenLogTools">Otwórz dziennik i narzędzia…</String>
|
||||
@@ -860,13 +860,11 @@
|
||||
<String key="Ini.gfx.reflections.range_vehicles">Zasięg odbić pojazdów</String>
|
||||
<String key="Ini.gfx.textures.streaming">Tekstury w tle</String>
|
||||
<String key="Ini.gfx.textures.releasedistance">Zwalnianie tekstur pojazdów</String>
|
||||
<String key="Ini.skyenabled">Niebo</String>
|
||||
<String key="Ini.rendercab">Kabina</String>
|
||||
<String key="Ini.gfx.postfx.motionblur.shutter">Czas rozmycia</String>
|
||||
<String key="Ini.python.vsync">VSync okien ekranów</String>
|
||||
<String key="Ini.python.displaywindows">Ekrany w osobnych oknach</String>
|
||||
<String key="Ini.newaircouplers">Węże wg sprzęgnięcia</String>
|
||||
<String key="Ini.smoothtraction">Wygładzanie sieci</String>
|
||||
<String key="Ini.sound.maxsources">Źródła dźwięku</String>
|
||||
<String key="Ini.sound.asyncload">Dźwięki w tle</String>
|
||||
<String key="Ini.loadtraction">Sieć trakcyjna</String>
|
||||
@@ -907,7 +905,6 @@
|
||||
<String key="IniChangesNone">Zapis niczego w eu07.ini nie zmieni.</String>
|
||||
<String key="IniChangesKeyboard">Zmienione klawisze trafią do eu07_input-keyboard.ini.</String>
|
||||
<String key="GfxColPresets">Jakość grafiki</String>
|
||||
<String key="PresetMinimal">Minimalna</String>
|
||||
<String key="PresetLow">Niska</String>
|
||||
<String key="PresetMedium">Średnia</String>
|
||||
<String key="PresetHigh">Wysoka</String>
|
||||
@@ -915,7 +912,7 @@
|
||||
<String key="MonitorRate">Monitor: {0} Hz</String>
|
||||
<String key="MonitorRateUse">Ustaw {0} FPS</String>
|
||||
<String key="FpsVSyncNote">Z VSync nie będzie więcej klatek niż Hz monitora, więc limit równy lub wyższy nic nie zmienia.</String>
|
||||
<String key="GfxPresetDesc">Najedź na zestaw, żeby zobaczyć wartości.</String>
|
||||
<String key="GfxPresetDesc">Poziom ustawia naraz wszystkie części poniżej; każdą możesz potem zmienić osobno.</String>
|
||||
<String key="TextureBaseDateHint">RRRR-MM-DD</String>
|
||||
<String key="LanguageStarterMissing">Brak tłumaczenia Startera: zostaje angielski. Symulator dostanie ten język.</String>
|
||||
<String key="ProfileNone">Brak profili</String>
|
||||
@@ -949,8 +946,6 @@
|
||||
<String key="Ini.heightbase">Mnożnik zasięgu</String>
|
||||
<String key="Ini.heightbase.Desc">Skraca albo wydłuża zasięg rysowania.</String>
|
||||
<String key="PresetVeryHigh">Bardzo wysoka</String>
|
||||
<String key="PresetUltra">Ultra</String>
|
||||
<String key="PresetUltraNote">Wszystko na maksimum. Może być za ciężkie nawet dla mocnej karty.</String>
|
||||
<String key="Ini.python.fpslimit">FPS okien ekranów</String>
|
||||
<String key="Ini.python.fpslimit.Desc">Tylko dla ekranów w osobnych oknach.</String>
|
||||
<String key="ShadowLimitNone">Najdłuższe</String>
|
||||
@@ -976,9 +971,9 @@
|
||||
<String key="GfxColImage">Obraz</String>
|
||||
<String key="GfxColLights">Oświetlenie</String>
|
||||
<String key="GfxColPostFx">Postprocessing</String>
|
||||
<String key="GfxColNature">Dym</String>
|
||||
<String key="AntiAliasing">Multisampling</String>
|
||||
<String key="AntiAliasingDesc">Wygładza krawędzie. Wyższy poziom to gładszy obraz i mniej FPS.</String>
|
||||
<String key="GfxColNature">Dym i opady</String>
|
||||
<String key="AntiAliasing">Wygładzanie krawędzi</String>
|
||||
<String key="AntiAliasingDesc">Wygładza poszarpane krawędzie. TAA kosztuje najmniej; MSAA jest ostrzejsze i każdy poziom kosztuje więcej; DLSS i DLAA wymagają karty NVIDIA RTX, Vulkana i symulatora zbudowanego z DLSS, w innym razie działa TAA.</String>
|
||||
<String key="SettingsFile">Plik eu07.ini</String>
|
||||
<String key="ImportIni">Importuj…</String>
|
||||
<String key="ImportIniTitle">Importuj ustawienia z eu07.ini</String>
|
||||
@@ -990,17 +985,132 @@
|
||||
<String key="ExportIniFailed">Nie udało się zapisać pliku:
|
||||
{0}</String>
|
||||
<String key="ExportIniDone">Wyeksportowano do {0}</String>
|
||||
<String key="REFull">Pełny</String>
|
||||
<String key="REOld">Stary (niezalecany)</String>
|
||||
<String key="RESimp">Uproszczony (niezalecany)</String>
|
||||
<String key="RenderAngleVulkan">ANGLE (Vulkan)</String>
|
||||
<String key="RenderAngleVulkanDesc">Rysuje przez ANGLE na Vulkanie. Włącz, jeśli zwykły OpenGL sprawia problemy.</String>
|
||||
<String key="RenderVBO">VBO</String>
|
||||
<String key="RenderVBODesc">Wyłącz tylko, gdy starsza karta ma problemy z obrazem.</String>
|
||||
<String key="CabShadowsRange">Cienie w kabinie</String>
|
||||
<String key="CabShadowsRangeDesc">Do jakiej odległości światła rzucają cień w kabinie. 0 wyłącza cienie w kabinie.</String>
|
||||
<String key="UseGLES">OpenGL ES</String>
|
||||
<String key="UseGLESDesc">OpenGL ES zamiast OpenGL. Nie działa ze starym rendererem.</String>
|
||||
<String key="GpuCard">{0}, {1} GB</String>
|
||||
<String key="GpuCardShared">{0}, pamięć wspólna</String>
|
||||
<String key="DeveloperTab">Deweloper</String>
|
||||
<String key="DeveloperTabNote">Ustawienia dla deweloperów i testerów. Gracz ma tu wszystko na wartościach startera, przy których symulator działa najszybciej; wyłączenie trybu zaawansowanego je przywraca.</String>
|
||||
<String key="MouseSection">Mysz</String>
|
||||
<String key="RecordingSection">Rejestracja jazdy</String>
|
||||
<String key="DevSimulation">Symulacja</String>
|
||||
<String key="GfxColQuality">Szczegóły jakości</String>
|
||||
<String key="GroupTextures">Tekstury</String>
|
||||
<String key="GroupShadows">Cienie</String>
|
||||
<String key="GroupReflections">Odbicia</String>
|
||||
<String key="GroupLighting">Oświetlenie i niebo</String>
|
||||
<String key="GroupDrawRange">Zasięg widzenia i trawa</String>
|
||||
<String key="GroupParticles">Dym, deszcz i śnieg</String>
|
||||
<String key="AaDlss">DLSS (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="AaDlaa">DLAA (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="REVulkan">Vulkan (zalecany)</String>
|
||||
<String key="REOpenGL">OpenGL 4.6</String>
|
||||
<String key="IniSectionRenderer">Renderer</String>
|
||||
<String key="IniSectionPerformance">Wydajność</String>
|
||||
<String key="GroupTexturesDesc">Ostrość tekstur, filtrowanie pod kątem i rzeźba powierzchni. Kosztuje głównie pamięć karty.</String>
|
||||
<String key="GroupShadowsDesc">Cienie od słońca, od lamp i reflektorów, cienie kontaktowe.</String>
|
||||
<String key="GroupReflectionsDesc">Odbicia otoczenia, na ekranie i w kabinie.</String>
|
||||
<String key="GroupLightingDesc">Okluzja otoczenia, mgła wolumetryczna i chmury.</String>
|
||||
<String key="GroupDrawRangeDesc">Jak daleko może być rysowana sceneria, gładkość łuków toru i trawa.</String>
|
||||
<String key="GroupParticlesDesc">Cząsteczki dymu, krople deszczu i płatki śniegu.</String>
|
||||
<String key="Ini.gfx.vulkan.device">Karta dla Vulkana</String>
|
||||
<String key="Ini.gfx.vulkan.device.Desc">Numer z listy w logu albo część nazwy karty. Puste – najlepsza karta.</String>
|
||||
<String key="Ini.gfx.vulkan.renderthread">Osobny wątek wysyłania klatek</String>
|
||||
<String key="Ini.gfx.threads">Wątki nagrywania poleceń</String>
|
||||
<String key="Ini.gfx.threads.Desc">0 – automatycznie (rdzenie − 2).</String>
|
||||
<String key="Ini.gfx.vulkan.asyncresources">Zasoby budowane w tle</String>
|
||||
<String key="Ini.gfx.vulkan.parallelpasses">Przebiegi cieni równolegle</String>
|
||||
<String key="Ini.gfx.vulkan.parallelmodels">Modele przetwarzane równolegle</String>
|
||||
<String key="Ini.gfx.vulkan.asynccompute">Niebo i pogoda w async compute</String>
|
||||
<String key="Ini.gfx.vulkan.asynccompute.Desc">Eksperymentalne, zysk jeszcze niezmierzony.</String>
|
||||
<String key="Ini.gfx.vulkan.framesinflight">Klatki w locie</String>
|
||||
<String key="Ini.gfx.shaders.binaries">Zapisane binaria shaderów</String>
|
||||
<String key="Ini.gfx.shaders.binaries.Desc">Szybszy start.</String>
|
||||
<String key="Ini.gfx.lights.shadows">Cienie lamp</String>
|
||||
<String key="Ini.gfx.contactshadows">Cienie kontaktowe</String>
|
||||
<String key="Ini.gfx.shadow.sdsm">Kaskady dopasowane do widoku (SDSM)</String>
|
||||
<String key="Ini.gfx.ssr">Odbicia w przestrzeni ekranu</String>
|
||||
<String key="Ini.gfx.raytracing">Odbicia ray tracing</String>
|
||||
<String key="Ini.gfx.raytracing.Desc">Vulkan, na karcie z obsługą ray query.</String>
|
||||
<String key="Ini.gfx.cabprobe">Sonda światła kabiny</String>
|
||||
<String key="Ini.gfx.water.realistic">Realistyczna woda</String>
|
||||
<String key="Ini.gfx.postfx.ao">Okluzja otoczenia</String>
|
||||
<String key="Ini.gfx.fog.quality">Jakość mgły</String>
|
||||
<String key="Ini.gfx.clouds">Chmury</String>
|
||||
<String key="Ini.gfx.postfx.bloom">Poświata (bloom)</String>
|
||||
<String key="Ini.gfx.grass">Trawa</String>
|
||||
<String key="Ini.gfx.grass.distance">Zasięg trawy</String>
|
||||
<String key="Ini.gfx.grass.fadedistance">Trawa znika do</String>
|
||||
<String key="Ini.gfx.grass.density">Gęstość trawy</String>
|
||||
<String key="Ini.gfx.precipitation.particles">Cząsteczki deszczu i śniegu</String>
|
||||
<String key="Ini.gfx.dlss.preset">Profil DLSS</String>
|
||||
<String key="Ini.gfx.framegeneration">Generowanie klatek (DLSS)</String>
|
||||
<String key="Ini.gfx.reflex">NVIDIA Reflex</String>
|
||||
<String key="Ini.gfx.gpucull">Odrzucanie obiektów na GPU</String>
|
||||
<String key="Ini.gfx.gpucull.Desc">Szybciej przy wielu obiektach w kadrze. Symulator sam tego nie włącza; starter tak.</String>
|
||||
<String key="Ini.gfx.gpucull.occlusion">Odrzucanie zasłoniętych obiektów</String>
|
||||
<String key="Ini.gfx.depthprepass">Wstępny przebieg głębi</String>
|
||||
<String key="Ini.performance.multithreading">Wielowątkowość</String>
|
||||
<String key="Ini.physics.sleepheld">Usypiaj zahamowane pojazdy</String>
|
||||
<String key="Ini.physics.sleepheld.Desc">Fizyka stojącego, zahamowanego pojazdu czeka, aż coś go ruszy.</String>
|
||||
<String key="Ini.physics.roadlod">Uproszczone dalekie pojazdy drogowe</String>
|
||||
<String key="Ini.physics.roadlod.Desc">Dalej niż 1 km jeden krok fizyki na klatkę.</String>
|
||||
<String key="Ini.file.binary.terrain">Binarna pamięć terenu</String>
|
||||
<String key="Ini.gfx.smoke.gpu">Dym liczony na GPU</String>
|
||||
<String key="Ini.gfx.weather.occlusion">Pomijaj zasłonięte chmury i mgłę</String>
|
||||
<String key="Ini.gfx.clouds.interleave">Chmury rysowane z przeplotem</String>
|
||||
<String key="Ini.screens.gpupost">Efekty ekranów na GPU</String>
|
||||
<String key="Ini.screens.cabframes">Ekrany w kabinie co N klatek</String>
|
||||
<String key="Ini.screens.externalframes">Ekrany zewnętrzne co N klatek</String>
|
||||
<String key="Ini.debug.perflog">Czasy renderera</String>
|
||||
<String key="Ini.debug.perflog.Desc">Zapisywane do perf.txt co tyle sekund. 0 – wyłączone.</String>
|
||||
<String key="Ini.crashdump.full">Pełny zrzut po awarii</String>
|
||||
<String key="Choice.no">Wyłączone</String>
|
||||
<String key="Choice.low">Niska</String>
|
||||
<String key="Choice.medium">Średnia</String>
|
||||
<String key="Choice.high">Wysoka</String>
|
||||
<String key="Choice.ultra">Ultra</String>
|
||||
<String key="Choice.ssao">SSAO</String>
|
||||
<String key="Choice.gtao">GTAO</String>
|
||||
<String key="Choice.off">Wyłączone</String>
|
||||
<String key="Choice.on">Włączone</String>
|
||||
<String key="Choice.boost">Boost</String>
|
||||
<String key="Choice.default">Domyślny</String>
|
||||
<String key="SimulatorSection">Symulator</String>
|
||||
<String key="RayTracing">Ray tracing (odbicia)</String>
|
||||
<String key="RayTracingOff">Wyłączony</String>
|
||||
<String key="RayTracingDesc">Odbicia liczone ray tracingiem: dokładniejsze, ale kosztowne. Tylko Vulkan i karta z ray tracingiem (NVIDIA RTX, AMD RX 6000 i nowsze). Poziom to zasięg promieni; poziomy jakości grafiki go nie włączają.</String>
|
||||
<String key="SelectEXEDesc">Automatycznie wybiera wersję, która działa na tym procesorze. Wybierz inną tylko wtedy, gdy masz zainstalowanych kilka wersji.</String>
|
||||
<String key="RealismSection">Realizm jazdy</String>
|
||||
<String key="PhysicsPresets">Poziom realizmu</String>
|
||||
<String key="PhysicsArcade">Arcade</String>
|
||||
<String key="PhysicsRealistic">Realistyczny</String>
|
||||
<String key="BrakeKeysSection">Hamulec z klawiatury</String>
|
||||
<String key="Ini.couplerphysics">Sprzęgi</String>
|
||||
<String key="Ini.physics.derailment">Wykolejenia</String>
|
||||
<String key="Ini.physics.collisions">Zderzenia</String>
|
||||
<String key="Ini.physics.trackbuckling">Wyboczenie toru w upale</String>
|
||||
<String key="Ini.deer">Zwierzęta przy torach</String>
|
||||
<String key="Choice.couplerphysics.no">Uproszczone</String>
|
||||
<String key="Choice.couplerphysics.yes">Fizyczne – pociąg gracza</String>
|
||||
<String key="Choice.couplerphysics.all">Fizyczne – wszystkie pociągi</String>
|
||||
<String key="Choice.physics.derailment.off">Wyłączone</String>
|
||||
<String key="Choice.physics.derailment.monitor">Klasyczne</String>
|
||||
<String key="Choice.physics.derailment.new">Fizyczne</String>
|
||||
<String key="Choice.physics.derailment.old">Klasyczne, bez wpisów w logu</String>
|
||||
<String key="Choice.physics.collisions.old">Klasyczne</String>
|
||||
<String key="Choice.physics.collisions.new">Fizyczne</String>
|
||||
<String key="Choice.physics.collisions.monitor">Klasyczne, fizyczne do logu</String>
|
||||
<String key="Choice.physics.trackbuckling.off">Wyłączone</String>
|
||||
<String key="Choice.physics.trackbuckling.scenery">Ze scenerii</String>
|
||||
<String key="Choice.physics.trackbuckling.auto">Także od upału</String>
|
||||
<String key="PhysicsPresetsDesc">Arcade wybacza: bez wykolejeń i uszkodzeń, prąd bez sieci, każdy skład gotowy do jazdy. Realistyczny włącza fizyczne modele sprzęgów, wykolejeń, zderzeń i toru. Każde ustawienie poniżej można potem zmienić osobno.</String>
|
||||
<String key="Ini.couplerphysics.Desc">Fizyczne: zderzaki i sprzęgi z luzem, uginaniem i zrywaniem, co czuć przy szarpnięciu i ostrym hamowaniu. Dla wszystkich pociągów bardziej obciąża procesor.</String>
|
||||
<String key="Ini.physics.derailment.Desc">Fizyczne: pojazd za szybki w łuku przewraca się albo wspina na szynę; w granicach prędkości dozwolonej na torze nic się nie wykoleja. Klasyczne: dawna reguła.</String>
|
||||
<String key="Ini.physics.collisions.Desc">Fizyczne: czoła się zgniatają, pojazd może wjechać na drugi albo zostać zepchnięty z toru. Klasyczne: dawna reguła bezpiecznej prędkości najazdu.</String>
|
||||
<String key="Ini.physics.trackbuckling.Desc">Ze scenerii: tylko tam, gdzie umieścił je autor. Także od upału: słabe miejsca toru bezstykowego wyboczają się, gdy szyny się nagrzeją.</String>
|
||||
<String key="Ini.deer.Desc">Sarny pasą się przy torze przed pociągiem i uciekają przed sygnałem.</String>
|
||||
<String key="Ini.physics.derailment.trustlimits">Prędkość dozwolona toru nie wykoleja</String>
|
||||
<String key="Ini.physics.derailment.trustlimits.Desc">Przy fizycznych wykolejeniach: w granicach dozwolonej prędkości wykolejają tylko sprzęgi, wyboczenie albo uszkodzenie.</String>
|
||||
<String key="Ini.controlcoupling.enginecheck">Bez sterowania wielokrotnego elektrycznych ze spalinowymi</String>
|
||||
<String key="Ini.ai.brakesetting.cw1">AI nastawia hamulce według Cw-1</String>
|
||||
<String key="Ini.physics.trackcheck">Podejrzana geometria torów do logu</String>
|
||||
</Language>
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<String key="LogMissingVehicleFiles">Записывать в журнал отсутствующие файлы состава при экспорте</String>
|
||||
|
||||
<String key="Graphic">Графика</String>
|
||||
<String key="RenderEngine">Движок отрисовки</String>
|
||||
<String key="RenderEngine">Графический API</String>
|
||||
<String key="ConfirmRenderingChange">Изменение «{0}» может помешать запуску симулятора или испортить изображение. Изменить?</String>
|
||||
<String key="RenderEngineDesc">Полный — рекомендуемый рендерер симулятора. Старый и Упрощённый рисуют классическим рендерером и не рекомендуются, если Полный работает, — они для видеокарт, с которыми у Полного проблемы.</String>
|
||||
<String key="GpuChoice">Видеокарта (Linux)</String>
|
||||
@@ -428,7 +428,7 @@
|
||||
|
||||
<String key="Resolution">Разрешение</String>
|
||||
<String key="ResolutionOnMonitor">{0} (монитор)</String>
|
||||
<String key="BufforResolution">Разрешение буфера</String>
|
||||
<String key="BufforResolution">Масштаб рендеринга</String>
|
||||
<String key="MaxTexResolution">Максимальное разрешение текстур</String>
|
||||
<String key="MaxTexCabResolution">Максимальное разрешение текстур кабины</String>
|
||||
<String key="TexFilteringQuality">Качество фильтрации текстур</String>
|
||||
@@ -530,9 +530,9 @@
|
||||
<String key="AdvancedMode">Расширенный режим</String>
|
||||
<String key="AdvancedModeMenu">Расширенный режим…</String>
|
||||
<String key="AdvancedModeOff">Выключить расширенный режим</String>
|
||||
<String key="AdvancedModeOffConfirm">Выключение расширенного режима вернёт значения по умолчанию для всех настроек, доступных только в нём, и сохранит настройки этой страницы. Выключить?</String>
|
||||
<String key="AdvancedModeOffConfirm">Выключение расширенного режима вернёт всё на вкладке «Разработчик» к значениям лаунчера — Vulkan и все оптимизации включены — и сохранит настройки этой страницы. Качество графики останется таким, как показывает вкладка «Графика». Выключить?</String>
|
||||
<String key="AdvancedModeOn">Включить</String>
|
||||
<String key="AdvancedModeWarning">Расширенный режим показывает все настройки симулятора и стартера, в том числе те, после изменения которых симулятор может не запуститься, работать нестабильно или показывать плохую картинку. Он также позволяет менять экипажи составов, составы ИИ и декорации, поэтому сценарий может работать не так, как задумал автор. Меняйте эти настройки, только если знаете, что они делают. Проблемы из-за них — не ошибки симулятора: прежде чем сообщить об ошибке, выключите расширенный режим и восстановите настройки по умолчанию. Прочитайте внимательно. Кнопка включения заработает через 20 секунд.</String>
|
||||
<String key="AdvancedModeWarning">Расширенный режим предназначен для разработчиков и тестировщиков. Он открывает вкладку «Разработчик» со всеми настройками симулятора: рендерером (OpenGL вместо Vulkan), деталями изображения, переключателями оптимизаций, журналами и диагностикой. После изменения многих из них симулятор может не запуститься, работать медленнее или нестабильно либо выглядеть плохо. Он также позволяет менять экипажи составов, составы ИИ и декорации, поэтому сценарий может работать не так, как задумал автор. Проблемы, вызванные этими настройками, не являются ошибками симулятора: прежде чем сообщить об ошибке, выключите расширенный режим — это вернёт всё на вкладке «Разработчик» к значениям лаунчера. Прочитайте это внимательно. Кнопка включения заработает через 20 секунд.</String>
|
||||
<String key="CompressTextures">Сжимать текстуры TGA</String>
|
||||
<String key="ScaleSpeculars">Масштабировать блики (совместимость со старыми моделями)</String>
|
||||
<String key="ScaleSpecularsDesc">Ослабляет блеск моделей, сделанных для старых рендереров.</String>
|
||||
@@ -755,7 +755,7 @@
|
||||
<String key="ShortcutCardMenu">Открыть меню вагона</String>
|
||||
|
||||
<!-- Package author's tab - awaiting translation -->
|
||||
<String key="AdvancedResources">Ресурсы и совместимость</String>
|
||||
<String key="AdvancedResources">Производительность</String>
|
||||
<String key="AdvancedLogTools">Журнал и инструменты</String>
|
||||
<String key="LogAndTools">Журнал событий и инструменты</String>
|
||||
<String key="OpenLogTools">Открыть журнал и инструменты…</String>
|
||||
@@ -833,13 +833,11 @@
|
||||
<String key="Ini.gfx.reflections.range_vehicles">Дальность отражений подвижного состава</String>
|
||||
<String key="Ini.gfx.textures.streaming">Загружать текстуры в фоне</String>
|
||||
<String key="Ini.gfx.textures.releasedistance">Выгружать текстуры удалённых составов</String>
|
||||
<String key="Ini.skyenabled">Отображать небо</String>
|
||||
<String key="Ini.rendercab">Отображать кабину</String>
|
||||
<String key="Ini.gfx.postfx.motionblur.shutter">Выдержка размытия движения</String>
|
||||
<String key="Ini.python.vsync">Вертикальная синхронизация окон экранов</String>
|
||||
<String key="Ini.python.displaywindows">Экраны кабины в отдельных окнах</String>
|
||||
<String key="Ini.newaircouplers">Отображать воздушные рукава по сцепке</String>
|
||||
<String key="Ini.smoothtraction">Сглаживание контактной сети (классический рендерер)</String>
|
||||
<String key="Ini.sound.maxsources">Максимум источников звука</String>
|
||||
<String key="Ini.sound.asyncload">Декодировать звуки в фоне</String>
|
||||
<String key="Ini.loadtraction">Загружать контактную сеть</String>
|
||||
@@ -857,7 +855,6 @@
|
||||
<String key="IniChangesNone">Сохранение ничего не изменит в eu07.ini.</String>
|
||||
<String key="IniChangesKeyboard">Изменённые клавиши будут записаны в eu07_input-keyboard.ini.</String>
|
||||
<String key="GfxColPresets">Качество графики</String>
|
||||
<String key="PresetMinimal">Минимальное</String>
|
||||
<String key="PresetLow">Низкое</String>
|
||||
<String key="PresetMedium">Среднее</String>
|
||||
<String key="PresetHigh">Высокое</String>
|
||||
@@ -865,7 +862,7 @@
|
||||
<String key="MonitorRate">Монитор: {0} Гц</String>
|
||||
<String key="MonitorRateUse">Задать {0} FPS</String>
|
||||
<String key="FpsVSyncNote">С VSync кадров не будет больше, чем Гц монитора, поэтому ограничение на этом уровне или выше ничего не меняет.</String>
|
||||
<String key="GfxPresetDesc">Наведите на уровень, чтобы увидеть значения.</String>
|
||||
<String key="GfxPresetDesc">Уровень задаёт все части ниже сразу; затем каждую можно изменить отдельно.</String>
|
||||
<String key="TextureBaseDateHint">ГГГГ-ММ-ДД</String>
|
||||
<String key="LanguageStarterMissing">Нет перевода стартера: останется английский. Симулятор получит этот язык.</String>
|
||||
<String key="ProfileNone">Нет профилей</String>
|
||||
@@ -899,8 +896,6 @@
|
||||
<String key="Ini.heightbase">Множитель дальности</String>
|
||||
<String key="Ini.heightbase.Desc">Сокращает или удлиняет дальность отрисовки сценария. Целевой FPS её перекрывает.</String>
|
||||
<String key="PresetVeryHigh">Очень высокое</String>
|
||||
<String key="PresetUltra">Ультра</String>
|
||||
<String key="PresetUltraNote">Всё на максимуме. Может быть слишком тяжело даже для мощной карты.</String>
|
||||
<String key="Ini.python.fpslimit">Ограничение кадров окон экранов</String>
|
||||
<String key="Ini.python.fpslimit.Desc">Работает только с экранами в отдельных окнах; без них ничего не меняет.</String>
|
||||
<String key="ShadowLimitNone">Самые длинные</String>
|
||||
@@ -926,7 +921,7 @@
|
||||
<String key="GfxColImage">Разрешение и сглаживание</String>
|
||||
<String key="GfxColLights">Освещение</String>
|
||||
<String key="GfxColPostFx">Постобработка</String>
|
||||
<String key="GfxColNature">Дым</String>
|
||||
<String key="GfxColNature">Дым и осадки</String>
|
||||
<String key="AntiAliasing">Сглаживание</String>
|
||||
<String key="SettingsFile">Файл eu07.ini</String>
|
||||
<String key="ImportIni">Импорт…</String>
|
||||
@@ -939,14 +934,50 @@
|
||||
<String key="ExportIniFailed">Не удалось записать файл:
|
||||
{0}</String>
|
||||
<String key="ExportIniDone">Экспортировано в {0}</String>
|
||||
<String key="REFull">Полный</String>
|
||||
<String key="REOld">Старый (не рекомендуется, если Полный работает)</String>
|
||||
<String key="RESimp">Упрощённый (не рекомендуется, если Полный работает)</String>
|
||||
<String key="RenderAngleVulkan">Использовать рендерер ANGLE Vulkan</String>
|
||||
<String key="RenderVBO">Отрисовка VBO</String>
|
||||
<String key="CabShadowsRange">Дальность источников теней в кабине</String>
|
||||
<String key="UseGLES">Использовать OpenGL ES</String>
|
||||
<String key="UseGLESDesc">OpenGL ES вместо OpenGL. Не работает с рендерером legacy.</String>
|
||||
<String key="GpuCard">{0}, {1} ГБ</String>
|
||||
<String key="GpuCardShared">{0}, общая память</String>
|
||||
<String key="DeveloperTab">Разработчик</String>
|
||||
<String key="DeveloperTabNote">Настройки для разработчиков и тестировщиков. У игрока здесь всё на значениях лаунчера, при которых симулятор работает быстрее всего; выключение расширенного режима возвращает их.</String>
|
||||
<String key="MouseSection">Мышь</String>
|
||||
<String key="RecordingSection">Запись поездки</String>
|
||||
<String key="DevSimulation">Симуляция</String>
|
||||
<String key="GfxColQuality">Детали качества</String>
|
||||
<String key="GroupTextures">Текстуры</String>
|
||||
<String key="GroupShadows">Тени</String>
|
||||
<String key="GroupReflections">Отражения</String>
|
||||
<String key="GroupLighting">Освещение и небо</String>
|
||||
<String key="GroupDrawRange">Дальность прорисовки и трава</String>
|
||||
<String key="GroupParticles">Дым, дождь и снег</String>
|
||||
<String key="AaDlss">DLSS (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="AaDlaa">DLAA (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="REVulkan">Vulkan (рекомендуется)</String>
|
||||
<String key="REOpenGL">OpenGL 4.6</String>
|
||||
<String key="IniSectionRenderer">Рендерер</String>
|
||||
<String key="IniSectionPerformance">Производительность</String>
|
||||
<String key="SimulatorSection">Симулятор</String>
|
||||
<String key="RayTracing">Трассировка лучей (отражения)</String>
|
||||
<String key="RayTracingOff">Выкл.</String>
|
||||
<String key="RealismSection">Реализм вождения</String>
|
||||
<String key="PhysicsPresets">Уровень реализма</String>
|
||||
<String key="PhysicsArcade">Аркадный</String>
|
||||
<String key="PhysicsRealistic">Реалистичный</String>
|
||||
<String key="BrakeKeysSection">Тормоз с клавиатуры</String>
|
||||
<String key="Ini.couplerphysics">Сцепки</String>
|
||||
<String key="Ini.physics.derailment">Сход с рельсов</String>
|
||||
<String key="Ini.physics.collisions">Столкновения</String>
|
||||
<String key="Ini.physics.trackbuckling">Выброс пути в жару</String>
|
||||
<String key="Ini.deer">Животные у пути</String>
|
||||
<String key="Choice.couplerphysics.no">Упрощённые</String>
|
||||
<String key="Choice.couplerphysics.yes">Физические – поезд игрока</String>
|
||||
<String key="Choice.couplerphysics.all">Физические – все поезда</String>
|
||||
<String key="Choice.physics.derailment.off">Выкл.</String>
|
||||
<String key="Choice.physics.derailment.monitor">Классические</String>
|
||||
<String key="Choice.physics.derailment.new">Физические</String>
|
||||
<String key="Choice.physics.derailment.old">Классические, без журнала</String>
|
||||
<String key="Choice.physics.collisions.old">Классические</String>
|
||||
<String key="Choice.physics.collisions.new">Физические</String>
|
||||
<String key="Choice.physics.collisions.monitor">Классические, физические в журнал</String>
|
||||
<String key="Choice.physics.trackbuckling.off">Выкл.</String>
|
||||
<String key="Choice.physics.trackbuckling.scenery">Из сценерии</String>
|
||||
<String key="Choice.physics.trackbuckling.auto">Также от жары</String>
|
||||
</Language>
|
||||
|
||||
@@ -420,8 +420,8 @@
|
||||
<String key="LogMissingVehicleFilesDesc">将启动器找不到的车辆写入日志。</String>
|
||||
|
||||
<String key="Graphic">图形</String>
|
||||
<String key="RenderEngine">渲染引擎</String>
|
||||
<String key="ConfirmRenderingChange">Changing “{0}” can stop the simulator from starting or spoil the picture. Change it?</String> <!-- untranslated -->
|
||||
<String key="RenderEngine">图形 API</String>
|
||||
<String key="ConfirmRenderingChange">更改“{0}”可能导致模拟器无法启动或画面异常。要更改吗?</String>
|
||||
<String key="RenderEngineDesc">完整引擎适用于所有 exe。旧版、简化版和实验版仅适用于旧版 exe;新版 exe 会改用完整引擎启动。</String>
|
||||
<String key="GpuChoice">显卡(Linux)</String>
|
||||
<String key="GpuDiscrete">更快的(独立显卡)</String>
|
||||
@@ -435,7 +435,7 @@
|
||||
|
||||
<String key="Resolution">分辨率</String>
|
||||
<String key="ResolutionOnMonitor">{0}(显示器)</String>
|
||||
<String key="BufforResolution">缓冲分辨率</String>
|
||||
<String key="BufforResolution">渲染比例</String>
|
||||
<String key="BufforResolutionDesc">相对于窗口分辨率缩放内部渲染缓冲。</String>
|
||||
<String key="MaxTexResolution">最大纹理分辨率</String>
|
||||
<String key="MaxTexCabResolution">最大驾驶室纹理分辨率</String>
|
||||
@@ -552,9 +552,7 @@
|
||||
<String key="AdvancedMode">Advanced mode</String> <!-- untranslated -->
|
||||
<String key="AdvancedModeMenu">Advanced mode…</String> <!-- untranslated -->
|
||||
<String key="AdvancedModeOff">Turn off advanced mode</String> <!-- untranslated -->
|
||||
<String key="AdvancedModeOffConfirm">Turning advanced mode off puts every setting only it shows back to its default and saves the settings of this page. Turn it off?</String> <!-- untranslated -->
|
||||
<String key="AdvancedModeOn">Turn it on</String> <!-- untranslated -->
|
||||
<String key="AdvancedModeWarning">Advanced mode shows every setting of the simulator and the starter, including ones that can stop the simulator from starting, make it unstable or spoil the picture. It also lets you change the crews of consists, AI consists and decorations, so a scenario may not play as its author meant. Change these settings only if you know what they do. Trouble they cause is not a bug of the simulator: before reporting one, turn advanced mode off and restore the default settings. Read this carefully. The button to turn it on works in 20 seconds.</String> <!-- untranslated -->
|
||||
<String key="CompressTextures">压缩 TGA 纹理</String>
|
||||
<String key="ScaleSpeculars">缩放高光(旧模型兼容)</String>
|
||||
<String key="ScaleSpecularsDesc">减弱为旧渲染器制作的模型的光泽。</String>
|
||||
@@ -778,7 +776,7 @@
|
||||
<String key="ShortcutCardMenu">打开车辆菜单</String>
|
||||
|
||||
<!-- 车辆包作者选项卡 -->
|
||||
<String key="AdvancedResources">资源与兼容性</String>
|
||||
<String key="AdvancedResources">性能</String>
|
||||
<String key="AdvancedLogTools">日志与工具</String>
|
||||
<String key="LogAndTools">事件日志与工具</String>
|
||||
<String key="OpenLogTools">打开日志与工具…</String>
|
||||
@@ -856,13 +854,11 @@
|
||||
<String key="Ini.gfx.reflections.range_vehicles">车辆反射范围</String>
|
||||
<String key="Ini.gfx.textures.streaming">在后台流式加载纹理</String>
|
||||
<String key="Ini.gfx.textures.releasedistance">释放远处车辆的纹理</String>
|
||||
<String key="Ini.skyenabled">绘制天空</String>
|
||||
<String key="Ini.rendercab">绘制驾驶室</String>
|
||||
<String key="Ini.gfx.postfx.motionblur.shutter">动态模糊快门时间</String>
|
||||
<String key="Ini.python.vsync">屏幕窗口的垂直同步</String>
|
||||
<String key="Ini.python.displaywindows">驾驶室屏幕放在独立窗口</String>
|
||||
<String key="Ini.newaircouplers">按车辆连挂方式绘制风管</String>
|
||||
<String key="Ini.smoothtraction">平滑接触网(经典渲染器)</String>
|
||||
<String key="Ini.sound.maxsources">最大声源数</String>
|
||||
<String key="Ini.sound.asyncload">在后台解码声音</String>
|
||||
<String key="Ini.loadtraction">加载接触网</String>
|
||||
@@ -1081,15 +1077,14 @@
|
||||
<String key="IniChangesNone">保存不会对 eu07.ini 做任何更改。</String>
|
||||
<String key="IniChangesKeyboard">更改过的按键绑定会写入 eu07_input-keyboard.ini。</String>
|
||||
<String key="GfxColPresets">图形质量</String>
|
||||
<String key="PresetMinimal">最低</String>
|
||||
<String key="PresetLow">低</String>
|
||||
<String key="PresetMedium">中</String>
|
||||
<String key="PresetHigh">高</String>
|
||||
<String key="PresetCustom">自定义</String>
|
||||
<String key="MonitorRate">屏幕:{0} Hz</String>
|
||||
<String key="MonitorRateUse">设为 {0} FPS</String>
|
||||
<String key="FpsVSyncNote">With VSync, frames never exceed the monitor's Hz, so a limit at or above it changes nothing.</String> <!-- untranslated -->
|
||||
<String key="GfxPresetDesc">将鼠标悬停在某一档上可查看其数值。</String>
|
||||
<String key="GfxPresetDesc">预设会一次设置下面的所有项目,之后可以单独调整每一项。</String>
|
||||
<String key="FpsVSyncNote">开启垂直同步时,帧数不会超过显示器的刷新率,因此等于或高于刷新率的限制不起作用。</String>
|
||||
<String key="TextureBaseDateHint">YYYY-MM-DD</String>
|
||||
<String key="LanguageStarterMissing">启动器没有该语言的翻译:启动器保持英文,模拟器会使用该语言。</String>
|
||||
<String key="ProfileNone">没有配置文件</String>
|
||||
@@ -1123,8 +1118,6 @@
|
||||
<String key="Ini.heightbase">距离系数</String>
|
||||
<String key="Ini.heightbase.Desc">缩短或加长线路的绘制距离。目标帧率会覆盖它。</String>
|
||||
<String key="PresetVeryHigh">非常高</String>
|
||||
<String key="PresetUltra">极致</String>
|
||||
<String key="PresetUltraNote">全部设为最高。即使是性能强劲的显卡也可能承受不住。</String>
|
||||
<String key="Ini.python.fpslimit">屏幕窗口帧率限制</String>
|
||||
<String key="Ini.python.fpslimit.Desc">仅在驾驶室屏幕位于独立窗口时生效;否则不起作用。</String>
|
||||
<String key="ShadowLimitNone">最长</String>
|
||||
@@ -1146,11 +1139,16 @@
|
||||
<String key="WarehouseSaved">在仓库中:{0}</String>
|
||||
<String key="WarehouseNothingToAdd">请选择含有车辆的编组</String>
|
||||
<String key="GfxGroupLevelTip">仅针对该图形部分的级别</String>
|
||||
<String key="REVulkan">Vulkan(推荐)</String>
|
||||
<String key="RayTracing">光线追踪(反射)</String>
|
||||
<String key="RayTracingDesc">光线追踪反射:更精确,但开销很大。仅限 Vulkan 及支持光线追踪的显卡(NVIDIA RTX、AMD RX 6000 及更新)。级别即光线的距离;画质预设不会开启它。</String>
|
||||
<String key="AaDlss">DLSS (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="AaDlaa">DLAA (NVIDIA RTX, Vulkan)</String>
|
||||
<String key="Effects">效果</String>
|
||||
<String key="GfxColImage">分辨率与抗锯齿</String>
|
||||
<String key="GfxColLights">光照</String>
|
||||
<String key="GfxColPostFx">后处理</String>
|
||||
<String key="GfxColNature">烟雾</String>
|
||||
<String key="GfxColNature">烟雾与降水</String>
|
||||
<String key="AntiAliasing">抗锯齿</String>
|
||||
<String key="AntiAliasingDesc">MSAA 平滑物体边缘,TAA 平滑整个画面但略有模糊。DLSS 和 DLAA 需要 Vulkan 和 NVIDIA RTX 显卡,否则模拟器使用 TAA。</String>
|
||||
<String key="SettingsFile">eu07.ini 文件</String>
|
||||
@@ -1164,18 +1162,49 @@
|
||||
<String key="ExportIniFailed">无法写入文件:
|
||||
{0}</String>
|
||||
<String key="ExportIniDone">已导出到 {0}</String>
|
||||
<String key="REFull">完整</String>
|
||||
<String key="REOld">旧版</String>
|
||||
<String key="RESimp">简化</String>
|
||||
<String key="RenderAngleVulkan">使用 ANGLE Vulkan 渲染器</String>
|
||||
<String key="RenderAngleVulkanDesc">在 Vulkan 而非默认后端上运行 ANGLE 渲染器。适用于 OpenGL 表现异常的情况。</String>
|
||||
<String key="RenderVBO">渲染 VBO</String>
|
||||
<String key="RenderVBODesc">将几何数据保留在 GPU 缓冲中(更快)。仅在旧显卡出现问题时才禁用。</String>
|
||||
<String key="CabShadowsRange">驾驶室阴影源范围</String>
|
||||
<String key="CabShadowsRangeDesc">光源在驾驶室内仍能投射阴影的距离。0 表示关闭驾驶室阴影。</String>
|
||||
<String key="UseGLES">使用 OpenGL ES</String>
|
||||
<String key="UseGLESDesc">使用 OpenGL ES 而非 OpenGL。与旧版渲染器不兼容。</String>
|
||||
<String key="GpuCard">{0},{1} GB</String>
|
||||
<String key="GpuCardShared">{0},共享内存</String>
|
||||
|
||||
<String key="DeveloperTab">开发者</String>
|
||||
<String key="DeveloperTabNote">供开发者和测试人员使用的设置。玩家在此处的所有选项都使用启动器自带的值,使模拟器尽可能快;关闭高级模式会恢复这些值。</String>
|
||||
<String key="MouseSection">鼠标</String>
|
||||
<String key="RecordingSection">行车记录</String>
|
||||
<String key="DevSimulation">模拟</String>
|
||||
<String key="GfxColQuality">画质细节</String>
|
||||
<String key="GroupTextures">纹理</String>
|
||||
<String key="GroupShadows">阴影</String>
|
||||
<String key="GroupReflections">反射</String>
|
||||
<String key="GroupLighting">光照与天空</String>
|
||||
<String key="GroupDrawRange">视距与草地</String>
|
||||
<String key="GroupParticles">烟雾、雨和雪</String>
|
||||
<String key="REOpenGL">OpenGL 4.6</String>
|
||||
<String key="IniSectionRenderer">渲染器</String>
|
||||
<String key="IniSectionPerformance">性能</String>
|
||||
<String key="AdvancedModeWarning">高级模式面向开发者和测试人员。它会打开“开发者”选项卡,其中包含模拟器的全部设置:渲染器(用 OpenGL 代替 Vulkan)、画面细节、各项优化开关、日志和诊断。修改其中许多设置后,模拟器可能无法启动、变慢或不稳定,或者画面变差。它还允许更改编组的乘务人员、AI 编组和装饰物,因此场景可能无法按作者的设计运行。 这些设置引起的问题不是模拟器的错误:报告错误之前,请关闭高级模式,这会把“开发者”选项卡中的所有内容恢复为启动器自带的值。 请仔细阅读。开启按钮将在 20 秒后可用。</String>
|
||||
<String key="AdvancedModeOffConfirm">关闭高级模式会把“开发者”选项卡中的所有内容恢复为启动器自带的值(Vulkan,所有优化开启),并保存本页的设置。画质保持“图形”选项卡中显示的样子。要关闭吗?</String>
|
||||
<String key="SimulatorSection">模拟器</String>
|
||||
<String key="RayTracingOff">关闭</String>
|
||||
<String key="RealismSection">驾驶真实度</String>
|
||||
<String key="PhysicsPresets">真实度</String>
|
||||
<String key="PhysicsArcade">街机</String>
|
||||
<String key="PhysicsRealistic">真实</String>
|
||||
<String key="BrakeKeysSection">键盘制动</String>
|
||||
<String key="Ini.couplerphysics">车钩</String>
|
||||
<String key="Ini.physics.derailment">脱轨</String>
|
||||
<String key="Ini.physics.collisions">碰撞</String>
|
||||
<String key="Ini.physics.trackbuckling">高温胀轨</String>
|
||||
<String key="Ini.deer">轨道旁的动物</String>
|
||||
<String key="Choice.couplerphysics.no">简化</String>
|
||||
<String key="Choice.couplerphysics.yes">物理 – 玩家列车</String>
|
||||
<String key="Choice.couplerphysics.all">物理 – 所有列车</String>
|
||||
<String key="Choice.physics.derailment.off">关闭</String>
|
||||
<String key="Choice.physics.derailment.monitor">经典</String>
|
||||
<String key="Choice.physics.derailment.new">物理</String>
|
||||
<String key="Choice.physics.derailment.old">经典(不记录日志)</String>
|
||||
<String key="Choice.physics.collisions.old">经典</String>
|
||||
<String key="Choice.physics.collisions.new">物理</String>
|
||||
<String key="Choice.physics.collisions.monitor">经典(物理结果记录日志)</String>
|
||||
<String key="Choice.physics.trackbuckling.off">关闭</String>
|
||||
<String key="Choice.physics.trackbuckling.scenery">来自场景</String>
|
||||
<String key="Choice.physics.trackbuckling.auto">也包括高温</String>
|
||||
</Language>
|
||||
|
||||
+5
-4
@@ -5,8 +5,8 @@ For every language file in StarterNG/startercfg/lang (or the codes given):
|
||||
- a key en.xml has and the language lacks is added with the English text, right after the
|
||||
key it follows in en.xml, and marked <!-- untranslated -->;
|
||||
- a key en.xml no longer has is removed.
|
||||
Keys the starter falls back to English for by itself (ending in "Desc", starting with "Cmd.")
|
||||
are only added with --all. Everything else in the file - comments, order, line endings - stays
|
||||
Keys the starter falls back to English for by itself (ending in "Desc", starting with "Cmd.", and the
|
||||
developer tab's "Ini." rows and "Choice." words, see SimulatorKeyRows) are only added with --all. Everything else in the file - comments, order, line endings - stays
|
||||
as it is.
|
||||
|
||||
python tools/sync_lang.py # every language
|
||||
@@ -26,7 +26,8 @@ UNTRANSLATED = "<!-- untranslated -->"
|
||||
|
||||
|
||||
def is_optional(key):
|
||||
return key.endswith("Desc") or key.startswith("Cmd.")
|
||||
# As LocalizationTests.Every_language_has_every_key_but_the_optional_ones has them.
|
||||
return key.endswith("Desc") or key.startswith(("Cmd.", "Ini.", "Choice."))
|
||||
|
||||
|
||||
def read(path):
|
||||
@@ -148,7 +149,7 @@ def sync(path, en_text, en_strings, add_optional, check):
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||
parser.add_argument("codes", nargs="*", help="language codes, e.g. zh cz; every language when none")
|
||||
parser.add_argument("--all", action="store_true", help="add the optional keys (*Desc, Cmd.*) too")
|
||||
parser.add_argument("--all", action="store_true", help="add the optional keys (*Desc, Cmd.*, Ini.*, Choice.*) too")
|
||||
parser.add_argument("--check", action="store_true", help="only report, change nothing")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user