Files
StarterNG/StarterNG.Tests/SliderStepsTests.cs
T
Hirek 76de23c706 feat(settings): a standard mode a player understands, on Vulkan, and a developer tab for the rest
- The renderer is Vulkan, written whatever the file had: the simulator's own is
  OpenGL 4.6, to which it falls back by itself where Vulkan does not run.
  OpenGL 4.6 is chosen only in the developer tab. The words of the renderers the
  simulator no longer has (legacy, simple, ...) are read as it reads them.
- The standard mode shows what a player understands: the language, the interface
  scale, the pauses and the mouse; the screen with its render scale, VSync, frame
  limit and field of view; four levels of detail - Low, Medium, High, Very high -
  and a level for each part of the picture to take further (textures, shadows,
  reflections, lighting and sky, draw distance and grass, smoke, rain and snow);
  the anti-aliasing with TAA, MSAA and DLSS/DLAA; the effects of taste; the sound;
  the physics a player changes, the recording, the devices and the keys. A search
  in the standard mode finds nothing more.
- The levels set the keys of the OpenGL 4.6 and Vulkan renderers too: lamp and
  contact shadows, SSR, the cab probe, AO, fog, clouds, grass, rain and snow.
  High is about the simulator's own values and where a new player starts; Very
  high is the most worth having, without ray tracing, MSAA x8 or the largest
  shadow maps.
- Everything else is in the Developer tab, which only the advanced mode shows,
  behind its warning: the renderer and what only Vulkan reads, the details of
  the picture, the switches of the optimisations, the logs and diagnostics, and
  the choice of the simulator.
- What makes the simulator faster stays on in the standard mode. Where the
  simulator's own default is off, the starter writes it on: gfx.gpucull,
  gfx.textures.streaming, sound.asyncload, physics.sleepheld, physics.roadlod.
  Leaving the advanced mode puts the developer tab back at the starter's values;
  the details of the picture stay as their levels hold them.
- A player in the standard mode of an older starter is moved once
  (starter.settings.revision 2): Vulkan, and the developer tab at the starter's
  values, eu07.ini copied aside to eu07.ini.before-revision2 first. A player in
  the advanced mode keeps what they chose.
- The keys the simulator reads now are written: gfx.antialiasing, below the older
  multisampling that older simulators read, and gfx.buffer.percent for the render
  scale. The ones it no longer goes by are taken out of the file on a save:
  usevbo, gfx.usegles, gfx.angleplatform, gfx.framebuffer.width/height,
  starter.bufferscale, shadows, gfx.shadows.cab.range, smoothtraction, skyenabled,
  hideconsole, slowmotion. A simulator without gfx.buffer.percent draws at the
  whole window. gfx.reflections.fidelity missing from the file is read as the
  simulator's own 2.
- The developer tab's rows and the words of its lists come in English where a
  language lacks them; the standard mode's texts are in every language.
2026-11-29 19:29:46 +01:00

55 lines
1.8 KiB
C#

using StarterNG.Domain.Settings;
using StarterNG.Views;
namespace StarterNG.Tests;
[Collection(AvaloniaControls.Name)]
public class SliderStepsTests
{
[Fact]
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 = 0.5 };
// 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;
Assert.Equal(60, steps.Value);
}
[Fact]
public void A_frame_limit_above_the_list_stays_as_the_file_has_it()
{
var slider = new Avalonia.Controls.Slider();
var steps = new SliderSteps(slider, SliderRanges.FrameRateLimits) { Value = 300 };
Assert.Equal(300, steps.Value);
Assert.Equal(SliderRanges.FrameRateLimits.Length, slider.Maximum);
}
[Fact]
public void Clamping_puts_a_value_past_either_end_at_that_end()
{
var slider = new Avalonia.Controls.Slider();
var steps = new SliderSteps(slider, SliderRanges.FrameRateLimits) { Clamps = true, Value = 300 };
Assert.Equal(240, steps.Value);
Assert.Equal(SliderRanges.FrameRateLimits.Length - 1, slider.Maximum);
}
[Fact]
public void Clamping_leaves_a_value_between_two_steps_where_it_is()
{
var slider = new Avalonia.Controls.Slider();
var steps = new SliderSteps(slider, SliderRanges.DrawRangeFactors) { Clamps = true, Value = 1.5 };
Assert.Equal(1.5, steps.Value);
steps.Value = -5;
Assert.Equal(1, steps.Value);
}
}