Files
StarterNG/StarterNG/Views/SettingTexts.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

39 lines
1.5 KiB
C#

using System;
using System.Globalization;
using StarterNG.Domain.Settings;
namespace StarterNG.Views;
/// <summary>The captions of the settings' rows and the words for their values.</summary>
internal static class SettingTexts
{
public static string[] QualityWords => new[]
{
App.Loc["QualityVeryLow"], App.Loc["QualityLow"], App.Loc["QualityNormal"],
App.Loc["QualityHigh"], App.Loc["QualityVeryHigh"]
};
/// <summary>The words of a slider that goes from 1 to 4, which has no middle.</summary>
public static string Fidelity(int level)
{
var q = QualityWords;
string[] four = { q[0], q[1], q[3], q[4] };
return four[Math.Clamp(level, 1, 4) - 1];
}
public static string Anisotropy(double value) => "x" + value.ToString("0.#", CultureInfo.CurrentCulture);
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>
public static string ReflectionsInterval(double perSecond)
{
if (perSecond >= 1)
return string.Format(App.Loc["TimesPerSecond"], perSecond.ToString("0.##", CultureInfo.CurrentCulture));
double seconds = 1 / perSecond;
return seconds >= 60
? string.Format(App.Loc["EveryMinutes"], (seconds / 60).ToString("0.#", CultureInfo.CurrentCulture))
: string.Format(App.Loc["EverySeconds"], seconds.ToString("0.#", CultureInfo.CurrentCulture));
}
}