mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-22 00:04:57 +01:00
Compare commits
4 Commits
feat/audio
...
feat/setti
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93f914c868 | ||
|
|
de943cf461 | ||
|
|
e63aa71bf8 | ||
|
|
ecf3067d85 |
@@ -25,8 +25,12 @@ public sealed class MapView : Control
|
|||||||
private Recording? _recording;
|
private Recording? _recording;
|
||||||
private int _builtRevision = -1;
|
private int _builtRevision = -1;
|
||||||
private int _builtTracks = -1;
|
private int _builtTracks = -1;
|
||||||
private StreamGeometry? _tracks;
|
private TrackLayer? _tracks;
|
||||||
private readonly List<(int Index, int Branch, StreamGeometry Way)> _switchWays = new();
|
private readonly List<(int Index, int Branch, IReadOnlyList<System.Numerics.Vector3> Points)> _switchWays = new();
|
||||||
|
// The switches as they lay when last drawn, and their ways in two geometries: not taken, taken.
|
||||||
|
private int[] _switchStates = Array.Empty<int>();
|
||||||
|
private StreamGeometry? _waysOff, _waysOn;
|
||||||
|
private string? _hoverShown;
|
||||||
private readonly StreamGeometry?[] _trail = new StreamGeometry?[5];
|
private readonly StreamGeometry?[] _trail = new StreamGeometry?[5];
|
||||||
private Rect _world;
|
private Rect _world;
|
||||||
|
|
||||||
@@ -135,33 +139,24 @@ public sealed class MapView : Control
|
|||||||
{
|
{
|
||||||
_builtTracks = recording.Tracks.Count;
|
_builtTracks = recording.Tracks.Count;
|
||||||
_switchWays.Clear();
|
_switchWays.Clear();
|
||||||
var tracks = new StreamGeometry();
|
|
||||||
double left = double.MaxValue, top = double.MaxValue, right = double.MinValue, bottom = double.MinValue;
|
double left = double.MaxValue, top = double.MaxValue, right = double.MinValue, bottom = double.MinValue;
|
||||||
using (var g = tracks.Open())
|
foreach (var track in recording.Tracks)
|
||||||
{
|
{
|
||||||
foreach (var track in recording.Tracks)
|
if (track.Points.Count < 2)
|
||||||
|
continue;
|
||||||
|
foreach (var p in track.Points)
|
||||||
{
|
{
|
||||||
if (track.Points.Count < 2)
|
left = Math.Min(left, -p.X);
|
||||||
continue;
|
right = Math.Max(right, -p.X);
|
||||||
foreach (var p in track.Points)
|
top = Math.Min(top, -p.Z);
|
||||||
{
|
bottom = Math.Max(bottom, -p.Z);
|
||||||
left = Math.Min(left, -p.X);
|
|
||||||
right = Math.Max(right, -p.X);
|
|
||||||
top = Math.Min(top, -p.Z);
|
|
||||||
bottom = Math.Max(bottom, -p.Z);
|
|
||||||
}
|
|
||||||
if (track.Kind == TrackKind.SwitchBranch)
|
|
||||||
{
|
|
||||||
var way = new StreamGeometry();
|
|
||||||
using (var w = way.Open())
|
|
||||||
Polyline(w, track.Points);
|
|
||||||
_switchWays.Add((track.Index, track.Branch, way));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Polyline(g, track.Points);
|
|
||||||
}
|
}
|
||||||
|
if (track.Kind == TrackKind.SwitchBranch)
|
||||||
|
_switchWays.Add((track.Index, track.Branch, track.Points));
|
||||||
}
|
}
|
||||||
_tracks = tracks;
|
_tracks = new TrackLayer(recording.Tracks);
|
||||||
|
_switchStates = Array.Empty<int>();
|
||||||
|
_waysOff = _waysOn = null;
|
||||||
_world = left <= right ? new Rect(new Point(left, top), new Point(right, bottom)) : default;
|
_world = left <= right ? new Rect(new Point(left, top), new Point(right, bottom)) : default;
|
||||||
}
|
}
|
||||||
BuildTrail(recording);
|
BuildTrail(recording);
|
||||||
@@ -247,29 +242,26 @@ public sealed class MapView : Control
|
|||||||
double pixel = 1 / _scale;
|
double pixel = 1 / _scale;
|
||||||
using (context.PushTransform(toScreen))
|
using (context.PushTransform(toScreen))
|
||||||
{
|
{
|
||||||
// The tracks on a dark casing, so they stand out where they cross and run close.
|
// The tracks on a dark casing, so they stand out where they cross and run close. Only the
|
||||||
|
// cells in view, at the detail a pixel can show.
|
||||||
var casing = new Pen(Palette.TrackCasing, 5 * pixel, lineCap: PenLineCap.Round);
|
var casing = new Pen(Palette.TrackCasing, 5 * pixel, lineCap: PenLineCap.Round);
|
||||||
if (_tracks is not null)
|
var fill = new Pen(Palette.Track, 1.7 * pixel, lineCap: PenLineCap.Round);
|
||||||
context.DrawGeometry(null, casing, _tracks);
|
if (_tracks is { } layer)
|
||||||
foreach (var (_, _, way) in _switchWays)
|
|
||||||
context.DrawGeometry(null, casing, way);
|
|
||||||
if (_tracks is not null)
|
|
||||||
context.DrawGeometry(null, new Pen(Palette.Track, 1.7 * pixel, lineCap: PenLineCap.Round), _tracks);
|
|
||||||
var off = new Pen(Palette.SwitchOff, 1.7 * pixel, lineCap: PenLineCap.Round);
|
|
||||||
var on = new Pen(Palette.Track, 1.7 * pixel, lineCap: PenLineCap.Round);
|
|
||||||
// The ways not taken under those taken.
|
|
||||||
foreach (var (index, branch, way) in _switchWays)
|
|
||||||
{
|
{
|
||||||
int state = recording.SwitchAt(index, _time);
|
var view = PlaneInView(size, 6 * pixel);
|
||||||
if (state >= 0 && state != branch)
|
int level = TrackLayer.LevelFor(_scale);
|
||||||
context.DrawGeometry(null, off, way);
|
foreach (var cell in layer.CellsIn(view, level))
|
||||||
}
|
context.DrawGeometry(null, casing, cell.Casing);
|
||||||
foreach (var (index, branch, way) in _switchWays)
|
foreach (var cell in layer.CellsIn(view, level))
|
||||||
{
|
if (cell.Fill is { } tracks)
|
||||||
int state = recording.SwitchAt(index, _time);
|
context.DrawGeometry(null, fill, tracks);
|
||||||
if (state < 0 || state == branch)
|
|
||||||
context.DrawGeometry(null, on, way);
|
|
||||||
}
|
}
|
||||||
|
// The ways not taken under those taken, each set one geometry, made again only when a switch moves.
|
||||||
|
UpdateSwitchWays(recording);
|
||||||
|
if (_waysOff is not null)
|
||||||
|
context.DrawGeometry(null, new Pen(Palette.SwitchOff, 1.7 * pixel, lineCap: PenLineCap.Round), _waysOff);
|
||||||
|
if (_waysOn is not null)
|
||||||
|
context.DrawGeometry(null, fill, _waysOn);
|
||||||
// The way the train went, in the colour of the judgement.
|
// The way the train went, in the colour of the judgement.
|
||||||
for (int kind = 0; kind < _trail.Length; kind++)
|
for (int kind = 0; kind < _trail.Length; kind++)
|
||||||
if (_trail[kind] is { } trail)
|
if (_trail[kind] is { } trail)
|
||||||
@@ -280,12 +272,67 @@ public sealed class MapView : Control
|
|||||||
DrawHornPoints(context, recording);
|
DrawHornPoints(context, recording);
|
||||||
DrawSignals(context, recording);
|
DrawSignals(context, recording);
|
||||||
DrawPassings(context, recording);
|
DrawPassings(context, recording);
|
||||||
DrawVehicles(context, recording);
|
// Once a frame: the vehicles and the hover both go by them.
|
||||||
|
var vehicles = recording.VehiclesAt(_time);
|
||||||
|
DrawVehicles(context, recording, vehicles);
|
||||||
DrawUserTrain(context, recording);
|
DrawUserTrain(context, recording);
|
||||||
DrawCamera(context, recording);
|
DrawCamera(context, recording);
|
||||||
DrawScale(context, size);
|
DrawScale(context, size);
|
||||||
DrawLegend(context, size);
|
DrawLegend(context, size);
|
||||||
DrawHover(context, recording);
|
DrawHover(context, recording, vehicles);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The part of the map's plane on screen, with a margin in plane units.</summary>
|
||||||
|
private Rect PlaneInView(Size size, double margin)
|
||||||
|
{
|
||||||
|
double halfWidth = size.Width / 2 / _scale, halfHeight = size.Height / 2 / _scale;
|
||||||
|
return new Rect(-_centerX - halfWidth - margin, -_centerZ - halfHeight - margin,
|
||||||
|
2 * (halfWidth + margin), 2 * (halfHeight + margin));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateSwitchWays(Recording recording)
|
||||||
|
{
|
||||||
|
bool changed = _switchStates.Length != _switchWays.Count;
|
||||||
|
if (changed)
|
||||||
|
_switchStates = new int[_switchWays.Count];
|
||||||
|
for (int i = 0; i < _switchWays.Count; i++)
|
||||||
|
{
|
||||||
|
int state = recording.SwitchAt(_switchWays[i].Index, _time);
|
||||||
|
if (state != _switchStates[i] || changed)
|
||||||
|
{
|
||||||
|
_switchStates[i] = state;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!changed && (_waysOff is not null || _waysOn is not null || _switchWays.Count == 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var off = new StreamGeometry();
|
||||||
|
var on = new StreamGeometry();
|
||||||
|
bool anyOff = false, anyOn = false;
|
||||||
|
using (var gOff = off.Open())
|
||||||
|
using (var gOn = on.Open())
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _switchWays.Count; i++)
|
||||||
|
{
|
||||||
|
var (_, branch, points) = _switchWays[i];
|
||||||
|
if (points.Count < 2)
|
||||||
|
continue;
|
||||||
|
int state = _switchStates[i];
|
||||||
|
if (state >= 0 && state != branch)
|
||||||
|
{
|
||||||
|
Polyline(gOff, points);
|
||||||
|
anyOff = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Polyline(gOn, points);
|
||||||
|
anyOn = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_waysOff = anyOff ? off : null;
|
||||||
|
_waysOn = anyOn ? on : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool Visible(Point p, double margin = 20) =>
|
private bool Visible(Point p, double margin = 20) =>
|
||||||
@@ -468,10 +515,10 @@ public sealed class MapView : Control
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawVehicles(DrawingContext context, Recording recording)
|
private void DrawVehicles(DrawingContext context, Recording recording, IReadOnlyList<VehicleState> vehicles)
|
||||||
{
|
{
|
||||||
int user = recording.CabAt(_time) is { } sample && _time - sample.Time < 1.5 ? sample.Vehicle : 0;
|
int user = recording.CabAt(_time) is { } sample && _time - sample.Time < 1.5 ? sample.Vehicle : 0;
|
||||||
foreach (var state in recording.VehiclesAt(_time))
|
foreach (var state in vehicles)
|
||||||
{
|
{
|
||||||
var info = recording.Vehicle(state.Id);
|
var info = recording.Vehicle(state.Id);
|
||||||
var brush = state.Id == user ? Palette.UserTrain : state.Driving == Driver.Ai ? Palette.VehicleAi : Palette.Vehicle;
|
var brush = state.Id == user ? Palette.UserTrain : state.Driving == Driver.Ai ? Palette.VehicleAi : Palette.Vehicle;
|
||||||
@@ -602,10 +649,19 @@ public sealed class MapView : Control
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>The name of the signal or the vehicle under the pointer.</summary>
|
/// <summary>The name of the signal or the vehicle under the pointer.</summary>
|
||||||
private void DrawHover(DrawingContext context, Recording recording)
|
private void DrawHover(DrawingContext context, Recording recording, IReadOnlyList<VehicleState> vehicles)
|
||||||
{
|
{
|
||||||
if (_pointer is not { } pointer || _dragFrom is not null)
|
_hoverShown = _pointer is { } at && _dragFrom is null ? HoverLabel(recording, at, vehicles) : null;
|
||||||
|
if (_hoverShown is not { } label || _pointer is not { } pointer)
|
||||||
return;
|
return;
|
||||||
|
var text = Text(label, Palette.Text, 12);
|
||||||
|
var box = new Rect(pointer.X + 14, pointer.Y - 12 - text.Height, text.Width + 16, text.Height + 8);
|
||||||
|
context.DrawRectangle(Palette.Faded(Palette.Card, 0.95), new Pen(Palette.CardBorder, 1), box, 6, 6);
|
||||||
|
context.DrawText(text, new Point(box.Left + 8, box.Top + 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
private string? HoverLabel(Recording recording, Point pointer, IReadOnlyList<VehicleState> vehicles)
|
||||||
|
{
|
||||||
string? label = null;
|
string? label = null;
|
||||||
double best = 10;
|
double best = 10;
|
||||||
foreach (var signal in recording.Signals)
|
foreach (var signal in recording.Signals)
|
||||||
@@ -646,7 +702,7 @@ public sealed class MapView : Control
|
|||||||
label = string.Format(culture, Strings["HornHover"], point.Name, point.Duration);
|
label = string.Format(culture, Strings["HornHover"], point.Name, point.Duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var state in recording.VehiclesAt(_time))
|
foreach (var state in vehicles)
|
||||||
{
|
{
|
||||||
double d = Distance(ToScreen(state.Position.X, state.Position.Z), pointer);
|
double d = Distance(ToScreen(state.Position.X, state.Position.Z), pointer);
|
||||||
if (d < best && recording.Vehicle(state.Id) is { } info)
|
if (d < best && recording.Vehicle(state.Id) is { } info)
|
||||||
@@ -657,12 +713,7 @@ public sealed class MapView : Control
|
|||||||
: $"{info.Name} ({info.Train}) · {Math.Abs(state.SpeedKmh):0} km/h";
|
: $"{info.Name} ({info.Train}) · {Math.Abs(state.SpeedKmh):0} km/h";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (label is null)
|
return label;
|
||||||
return;
|
|
||||||
var text = Text(label, Palette.Text, 12);
|
|
||||||
var box = new Rect(pointer.X + 14, pointer.Y - 12 - text.Height, text.Width + 16, text.Height + 8);
|
|
||||||
context.DrawRectangle(Palette.Faded(Palette.Card, 0.95), new Pen(Palette.CardBorder, 1), box, 6, 6);
|
|
||||||
context.DrawText(text, new Point(box.Left + 8, box.Top + 4));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>An aspect as the speeds it gives: stop, a speed, or go.</summary>
|
/// <summary>An aspect as the speeds it gives: stop, a speed, or go.</summary>
|
||||||
@@ -724,8 +775,13 @@ public sealed class MapView : Control
|
|||||||
_centerX = _dragCenter.X + moved.X / _scale;
|
_centerX = _dragCenter.X + moved.X / _scale;
|
||||||
_centerZ = _dragCenter.Z + moved.Y / _scale;
|
_centerZ = _dragCenter.Z + moved.Y / _scale;
|
||||||
}
|
}
|
||||||
|
InvalidateVisual();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
InvalidateVisual();
|
// Not dragged, the map is the same: drawn again only for a label to show, follow the pointer or go.
|
||||||
|
if (_hoverShown is not null ||
|
||||||
|
(_recording is { } recording && HoverLabel(recording, position, recording.VehiclesAt(_time)) is not null))
|
||||||
|
InvalidateVisual();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||||
|
|||||||
184
Eu07.BlackBox.Views/TrackLayer.cs
Normal file
184
Eu07.BlackBox.Views/TrackLayer.cs
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Numerics;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Media;
|
||||||
|
|
||||||
|
namespace Eu07.BlackBox.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The rails of a scenery made ready to draw fast: cut into square cells so that only those in
|
||||||
|
/// view are drawn, and kept at a few levels of detail so that from afar a track is drawn with
|
||||||
|
/// fewer points than there are pixels it covers. The casing takes the switches' ways too, which
|
||||||
|
/// it is drawn under in one colour; the fill is the plain tracks alone.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class TrackLayer
|
||||||
|
{
|
||||||
|
/// <summary>The side of a cell in metres.</summary>
|
||||||
|
public const double CellSize = 500;
|
||||||
|
|
||||||
|
/// <summary>The points of a track closer than this to the last kept are left out, by level.</summary>
|
||||||
|
public static readonly double[] Tolerances = { 0, 2, 8, 32, 128 };
|
||||||
|
|
||||||
|
/// <summary>A part of the map: what is drawn of it, and where it lies in the map's plane.</summary>
|
||||||
|
public sealed record Cell(Rect Bounds, StreamGeometry Casing, StreamGeometry? Fill);
|
||||||
|
|
||||||
|
private readonly List<Cell>[] _levels;
|
||||||
|
|
||||||
|
public TrackLayer(IReadOnlyList<MapTrack> tracks)
|
||||||
|
{
|
||||||
|
_levels = new List<Cell>[Tolerances.Length];
|
||||||
|
for (int level = 0; level < Tolerances.Length; level++)
|
||||||
|
_levels[level] = BuildLevel(tracks, Tolerances[level]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The level whose left-out points stay within <paramref name="pixels"/> on screen at this scale.</summary>
|
||||||
|
public static int LevelFor(double scale, double pixels = 0.75)
|
||||||
|
{
|
||||||
|
int level = 0;
|
||||||
|
for (int i = 1; i < Tolerances.Length; i++)
|
||||||
|
if (Tolerances[i] * scale <= pixels)
|
||||||
|
level = i;
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The cells of the level that reach into <paramref name="view"/>, a rectangle of the map's plane.</summary>
|
||||||
|
public IEnumerable<Cell> CellsIn(Rect view, int level)
|
||||||
|
{
|
||||||
|
foreach (var cell in _levels[Math.Clamp(level, 0, _levels.Length - 1)])
|
||||||
|
if (cell.Bounds.Intersects(view))
|
||||||
|
yield return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CellCount(int level) => _levels[level].Count;
|
||||||
|
|
||||||
|
/// <summary>The points of a track with those nearer than <paramref name="tolerance"/> to the last kept left out; its ends stay.</summary>
|
||||||
|
public static List<Vector3> Simplified(IReadOnlyList<Vector3> points, double tolerance)
|
||||||
|
{
|
||||||
|
var kept = new List<Vector3>(points.Count);
|
||||||
|
if (points.Count == 0)
|
||||||
|
return kept;
|
||||||
|
kept.Add(points[0]);
|
||||||
|
double square = tolerance * tolerance;
|
||||||
|
for (int i = 1; i < points.Count - 1; i++)
|
||||||
|
{
|
||||||
|
var last = kept[^1];
|
||||||
|
double dx = points[i].X - last.X, dz = points[i].Z - last.Z;
|
||||||
|
if (dx * dx + dz * dz >= square)
|
||||||
|
kept.Add(points[i]);
|
||||||
|
}
|
||||||
|
if (points.Count > 1)
|
||||||
|
kept.Add(points[^1]);
|
||||||
|
return kept;
|
||||||
|
}
|
||||||
|
|
||||||
|
private sealed class Builder
|
||||||
|
{
|
||||||
|
public readonly List<List<Point>> Casing = new();
|
||||||
|
public readonly List<List<Point>> Fill = new();
|
||||||
|
public double Left = double.MaxValue, Top = double.MaxValue, Right = double.MinValue, Bottom = double.MinValue;
|
||||||
|
|
||||||
|
public void Grow(Point p)
|
||||||
|
{
|
||||||
|
Left = Math.Min(Left, p.X);
|
||||||
|
Right = Math.Max(Right, p.X);
|
||||||
|
Top = Math.Min(Top, p.Y);
|
||||||
|
Bottom = Math.Max(Bottom, p.Y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Cell> BuildLevel(IReadOnlyList<MapTrack> tracks, double tolerance)
|
||||||
|
{
|
||||||
|
var cells = new Dictionary<(long, long), Builder>();
|
||||||
|
foreach (var track in tracks)
|
||||||
|
{
|
||||||
|
if (track.Points.Count < 2)
|
||||||
|
continue;
|
||||||
|
bool fill = track.Kind != TrackKind.SwitchBranch;
|
||||||
|
var points = tolerance > 0 ? Simplified(track.Points, tolerance) : (IReadOnlyList<Vector3>)track.Points;
|
||||||
|
|
||||||
|
// A run of the track's points in one cell; a segment over a border goes with the cell it ends in,
|
||||||
|
// which starts from the point before, so its bounds cover the whole segment.
|
||||||
|
List<Point>? casingRun = null, fillRun = null;
|
||||||
|
(long, long) current = default;
|
||||||
|
for (int i = 0; i < points.Count; i++)
|
||||||
|
{
|
||||||
|
var p = Plane(points[i]);
|
||||||
|
var key = ((long)Math.Floor(p.X / CellSize), (long)Math.Floor(p.Y / CellSize));
|
||||||
|
if (casingRun is null || key != current)
|
||||||
|
{
|
||||||
|
var builder = Of(cells, key);
|
||||||
|
var start = casingRun is null ? (Point?)null : casingRun[^1];
|
||||||
|
casingRun = new List<Point>();
|
||||||
|
builder.Casing.Add(casingRun);
|
||||||
|
fillRun = null;
|
||||||
|
if (fill)
|
||||||
|
{
|
||||||
|
fillRun = new List<Point>();
|
||||||
|
builder.Fill.Add(fillRun);
|
||||||
|
}
|
||||||
|
if (start is { } joined)
|
||||||
|
{
|
||||||
|
// The segment from the last cell starts there, so the line has no gap at the border.
|
||||||
|
casingRun.Add(joined);
|
||||||
|
fillRun?.Add(joined);
|
||||||
|
builder.Grow(joined);
|
||||||
|
}
|
||||||
|
current = key;
|
||||||
|
}
|
||||||
|
casingRun.Add(p);
|
||||||
|
fillRun?.Add(p);
|
||||||
|
Of(cells, key).Grow(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = new List<Cell>(cells.Count);
|
||||||
|
foreach (var builder in cells.Values)
|
||||||
|
{
|
||||||
|
var casing = Geometry(builder.Casing);
|
||||||
|
if (casing is null)
|
||||||
|
continue;
|
||||||
|
var bounds = new Rect(new Point(builder.Left, builder.Top), new Point(builder.Right, builder.Bottom));
|
||||||
|
result.Add(new Cell(bounds, casing, Geometry(builder.Fill)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Builder Of(Dictionary<(long, long), Builder> cells, (long, long) key)
|
||||||
|
{
|
||||||
|
if (!cells.TryGetValue(key, out var builder))
|
||||||
|
cells[key] = builder = new Builder();
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static StreamGeometry? Geometry(List<List<Point>> runs)
|
||||||
|
{
|
||||||
|
StreamGeometry? geometry = null;
|
||||||
|
StreamGeometryContext? g = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var run in runs)
|
||||||
|
{
|
||||||
|
if (run.Count < 2)
|
||||||
|
continue;
|
||||||
|
if (geometry is null)
|
||||||
|
{
|
||||||
|
geometry = new StreamGeometry();
|
||||||
|
g = geometry.Open();
|
||||||
|
}
|
||||||
|
g!.BeginFigure(run[0], false);
|
||||||
|
for (int i = 1; i < run.Count; i++)
|
||||||
|
g.LineTo(run[i]);
|
||||||
|
g.EndFigure(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
g?.Dispose();
|
||||||
|
}
|
||||||
|
return geometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
// As MapView draws the plane: x to the left, z up the screen.
|
||||||
|
private static Point Plane(Vector3 p) => new(-p.X, -p.Z);
|
||||||
|
}
|
||||||
79
StarterNG.Tests/BlackBox/TrackLayerTests.cs
Normal file
79
StarterNG.Tests/BlackBox/TrackLayerTests.cs
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
using System.Numerics;
|
||||||
|
using Avalonia;
|
||||||
|
using Eu07.BlackBox;
|
||||||
|
using Eu07.BlackBox.Views;
|
||||||
|
|
||||||
|
namespace StarterNG.Tests.BlackBox;
|
||||||
|
|
||||||
|
/// <summary>The rails of the black box map made ready to draw only what is in view, at the detail a pixel shows.</summary>
|
||||||
|
[Collection(AvaloniaControls.Name)]
|
||||||
|
public class TrackLayerTests
|
||||||
|
{
|
||||||
|
public TrackLayerTests() => HeadlessDrawing.Ensure();
|
||||||
|
|
||||||
|
private static MapTrack Track(int index, TrackKind kind, params (float X, float Z)[] points) =>
|
||||||
|
new(index, $"t{index}", kind, kind == TrackKind.SwitchBranch ? 0 : -1, 0,
|
||||||
|
points.Select(p => new Vector3(p.X, 0, p.Z)).ToList());
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(2.0, 0)] // close up: every point
|
||||||
|
[InlineData(0.3, 1)] // 2 m are 0.6 px, 8 m would be 2.4
|
||||||
|
[InlineData(0.05, 2)] // 8 m are 0.4 px, 32 m would be 1.6
|
||||||
|
[InlineData(0.002, 4)] // the whole of a big scenery: 128 m are 0.26 px
|
||||||
|
public void The_level_leaves_out_no_more_than_a_pixel_shows(double scale, int level)
|
||||||
|
{
|
||||||
|
Assert.Equal(level, TrackLayer.LevelFor(scale));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Only_the_cells_in_view_are_drawn()
|
||||||
|
{
|
||||||
|
var layer = new TrackLayer(new[]
|
||||||
|
{
|
||||||
|
Track(1, TrackKind.Normal, (0, 0), (100, 0)),
|
||||||
|
Track(2, TrackKind.Normal, (-5000, -5000), (-5100, -5000))
|
||||||
|
});
|
||||||
|
|
||||||
|
// The plane shows x to the left: the first track lies at -100..0, the second at 5000..5100.
|
||||||
|
var near = layer.CellsIn(new Rect(-200, -50, 300, 100), 0).ToList();
|
||||||
|
|
||||||
|
Assert.Single(near);
|
||||||
|
Assert.Equal(2, layer.CellCount(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_track_across_cells_is_drawn_without_a_gap_at_the_border()
|
||||||
|
{
|
||||||
|
var layer = new TrackLayer(new[] { Track(1, TrackKind.Normal, (-400, 0), (-600, 0), (-800, 0)) });
|
||||||
|
|
||||||
|
var cells = layer.CellsIn(new Rect(-10000, -10000, 20000, 20000), 0).ToList();
|
||||||
|
|
||||||
|
// The segment over the border goes with the cell it ends in, from the point the line left the last one:
|
||||||
|
// that cell reaches back to it, so it is drawn whenever any of the segment is in view.
|
||||||
|
var cell = Assert.Single(cells);
|
||||||
|
Assert.Equal(400, cell.Bounds.Left);
|
||||||
|
Assert.Equal(800, cell.Bounds.Right);
|
||||||
|
Assert.Single(layer.CellsIn(new Rect(450, -10, 20, 20), 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_switch_way_is_in_the_casing_but_not_in_the_plain_fill()
|
||||||
|
{
|
||||||
|
var layer = new TrackLayer(new[] { Track(7, TrackKind.SwitchBranch, (0, 0), (30, 5)) });
|
||||||
|
|
||||||
|
var cell = Assert.Single(layer.CellsIn(new Rect(-100, -100, 200, 200), 0));
|
||||||
|
|
||||||
|
Assert.NotNull(cell.Casing);
|
||||||
|
Assert.Null(cell.Fill);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Simplifying_keeps_the_ends_and_drops_points_closer_than_the_tolerance()
|
||||||
|
{
|
||||||
|
var points = new[] { new Vector3(0, 0, 0), new Vector3(1, 0, 0), new Vector3(2, 0, 0), new Vector3(10, 0, 0), new Vector3(11, 0, 0) };
|
||||||
|
|
||||||
|
var kept = TrackLayer.Simplified(points, 5);
|
||||||
|
|
||||||
|
Assert.Equal(new[] { 0f, 10f, 11f }, kept.Select(p => p.X));
|
||||||
|
}
|
||||||
|
}
|
||||||
68
StarterNG.Tests/ConsistRunsTests.cs
Normal file
68
StarterNG.Tests/ConsistRunsTests.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
using StarterNG.Classes;
|
||||||
|
using StarterNG.Domain;
|
||||||
|
|
||||||
|
namespace StarterNG.Tests;
|
||||||
|
|
||||||
|
public class ConsistRunsTests
|
||||||
|
{
|
||||||
|
private static List<Dynamic> Vehicles(params string[] skins) =>
|
||||||
|
new Trainset(string.Concat(
|
||||||
|
"trainset a tor 0 0\n",
|
||||||
|
string.Concat(skins.Select((s, i) => $"node -1 0 v{i} dynamic d {s} m 0 nobody 3 0 enddynamic\n")),
|
||||||
|
"endtrainset")).Vehicles;
|
||||||
|
|
||||||
|
private static List<(string Skin, int Count)> Runs(List<Dynamic> vehicles, Func<Dynamic, int, string?> keyOf) =>
|
||||||
|
ConsistRuns.Of(vehicles, keyOf).Select(r => (r.First.SkinFile!, r.Count)).ToList();
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Vehicles_alike_next_to_each_other_make_one_run()
|
||||||
|
{
|
||||||
|
var vehicles = Vehicles("eu07", "412w", "412w", "412w", "eaos", "eaos");
|
||||||
|
|
||||||
|
Assert.Equal(
|
||||||
|
[("eu07", 1), ("412w", 3), ("eaos", 2)],
|
||||||
|
Runs(vehicles, (v, _) => v.SkinFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Vehicles_alike_apart_stay_apart()
|
||||||
|
{
|
||||||
|
var vehicles = Vehicles("412w", "eaos", "412w");
|
||||||
|
|
||||||
|
Assert.Equal(
|
||||||
|
[("412w", 1), ("eaos", 1), ("412w", 1)],
|
||||||
|
Runs(vehicles, (v, _) => v.SkinFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Alike_goes_by_the_key_whatever_its_case()
|
||||||
|
{
|
||||||
|
var vehicles = Vehicles("412W", "412w");
|
||||||
|
|
||||||
|
Assert.Equal([("412W", 2)], Runs(vehicles, (v, _) => v.SkinFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_vehicle_with_no_key_stands_alone()
|
||||||
|
{
|
||||||
|
var vehicles = Vehicles("x", "x", "x");
|
||||||
|
|
||||||
|
Assert.Equal(
|
||||||
|
[("x", 1), ("x", 1), ("x", 1)],
|
||||||
|
Runs(vehicles, (_, _) => null));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_place_in_the_consist_can_set_a_vehicle_apart()
|
||||||
|
{
|
||||||
|
var vehicles = Vehicles("sm42", "sm42", "sm42");
|
||||||
|
|
||||||
|
Assert.Equal(
|
||||||
|
[("sm42", 1), ("sm42", 2)],
|
||||||
|
Runs(vehicles, (v, i) => i == 0 ? "head" : v.SkinFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void No_vehicles_no_runs() =>
|
||||||
|
Assert.Empty(ConsistRuns.Of([], (v, _) => v.SkinFile));
|
||||||
|
}
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
using StarterNG.Infrastructure;
|
|
||||||
using StarterNG.Tests.Fakes;
|
|
||||||
|
|
||||||
namespace StarterNG.Tests;
|
|
||||||
|
|
||||||
public class DisplaysTests
|
|
||||||
{
|
|
||||||
/// <summary>A 128-byte block with an 18-byte timing at 54, as a panel's base EDID has it.</summary>
|
|
||||||
private static byte[] BaseBlock(int pixelClock10KHz, int hActive, int hBlank, int vActive, int vBlank,
|
|
||||||
int extensions = 0)
|
|
||||||
{
|
|
||||||
var edid = new byte[128];
|
|
||||||
new byte[] { 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0 }.CopyTo(edid, 0);
|
|
||||||
edid[126] = (byte)extensions;
|
|
||||||
int at = 54;
|
|
||||||
edid[at] = (byte)pixelClock10KHz;
|
|
||||||
edid[at + 1] = (byte)(pixelClock10KHz >> 8);
|
|
||||||
edid[at + 2] = (byte)hActive;
|
|
||||||
edid[at + 3] = (byte)hBlank;
|
|
||||||
edid[at + 4] = (byte)((hActive >> 8) << 4 | hBlank >> 8);
|
|
||||||
edid[at + 5] = (byte)vActive;
|
|
||||||
edid[at + 6] = (byte)vBlank;
|
|
||||||
edid[at + 7] = (byte)((vActive >> 8) << 4 | vBlank >> 8);
|
|
||||||
return edid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>A DisplayID 2.0 block with one type VII timing (kHz, sizes less one).</summary>
|
|
||||||
private static byte[] DisplayIdBlock(int pixelClockKHz, int hActive, int hBlank, int vActive, int vBlank)
|
|
||||||
{
|
|
||||||
var block = new byte[128];
|
|
||||||
block[0] = 0x70;
|
|
||||||
block[1] = 0x20;
|
|
||||||
block[2] = 23; // one data block: 3 bytes of header, 20 of timing
|
|
||||||
block[3] = 2;
|
|
||||||
int at = 5;
|
|
||||||
block[at] = 0x22;
|
|
||||||
block[at + 2] = 20;
|
|
||||||
int t = at + 3, clock = pixelClockKHz - 1;
|
|
||||||
block[t] = (byte)clock;
|
|
||||||
block[t + 1] = (byte)(clock >> 8);
|
|
||||||
block[t + 2] = (byte)(clock >> 16);
|
|
||||||
void Put(int offset, int value)
|
|
||||||
{
|
|
||||||
block[t + offset] = (byte)(value - 1);
|
|
||||||
block[t + offset + 1] = (byte)((value - 1) >> 8);
|
|
||||||
}
|
|
||||||
Put(4, hActive);
|
|
||||||
Put(6, hBlank);
|
|
||||||
Put(12, vActive);
|
|
||||||
Put(14, vBlank);
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_plain_monitor_gives_its_preferred_timing()
|
|
||||||
{
|
|
||||||
// 1920x1080 at 148.5 MHz: the usual 60 Hz.
|
|
||||||
Assert.Equal(60, Edid.HighestRefreshRate(BaseBlock(14850, 1920, 280, 1080, 45)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_fast_panel_found_only_in_displayid_is_read_there()
|
|
||||||
{
|
|
||||||
// As the eDP panel of a gaming laptop: 60 Hz in the base block, 165 Hz in DisplayID.
|
|
||||||
var edid = BaseBlock(15394, 1920, 160, 1200, 35, extensions: 1)
|
|
||||||
.Concat(DisplayIdBlock(423250, 1920, 160, 1200, 33)).ToArray();
|
|
||||||
|
|
||||||
Assert.Equal(165, Edid.HighestRefreshRate(edid));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Something_too_short_for_an_edid_has_no_rate()
|
|
||||||
{
|
|
||||||
Assert.Equal(0, Edid.HighestRefreshRate(new byte[] { 0, 0xFF }));
|
|
||||||
Assert.Equal(0, Edid.HighestRefreshRate(new byte[128]));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Only_connected_screens_are_listed_by_their_connector()
|
|
||||||
{
|
|
||||||
var files = new InMemoryFileSystem(caseSensitive: true)
|
|
||||||
.WithFile("/sys/class/drm/card1-eDP-1/status", "connected\n")
|
|
||||||
.WithFile("/sys/class/drm/card1-HDMI-A-1/status", "disconnected\n")
|
|
||||||
.WithFile("/sys/class/drm/card1/device/uevent", "DRIVER=amdgpu\n");
|
|
||||||
files.WriteAllBytes("/sys/class/drm/card1-eDP-1/edid", BaseBlock(14850, 1920, 280, 1080, 45));
|
|
||||||
files.WriteAllBytes("/sys/class/drm/card1-HDMI-A-1/edid", BaseBlock(14850, 1920, 280, 1080, 45));
|
|
||||||
|
|
||||||
var displays = new Displays(files, new FakeEnvironment()).List();
|
|
||||||
|
|
||||||
Assert.Equal(new[] { new Display("eDP-1", 60) }, displays);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Off_linux_without_windows_nothing_is_read()
|
|
||||||
{
|
|
||||||
var environment = new FakeEnvironment { IsLinux = false, IsMacOS = true };
|
|
||||||
|
|
||||||
Assert.Empty(new Displays(new InMemoryFileSystem(), environment).List());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
158
StarterNG.Tests/ExternalIniTests.cs
Normal file
158
StarterNG.Tests/ExternalIniTests.cs
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
using StarterNG.Classes;
|
||||||
|
using StarterNG.Domain.Settings;
|
||||||
|
using StarterNG.Infrastructure.Settings;
|
||||||
|
using StarterNG.Tests.Fakes;
|
||||||
|
|
||||||
|
namespace StarterNG.Tests;
|
||||||
|
|
||||||
|
/// <summary>eu07.ini as other hands leave it: edited while the starter runs, and with lines the starter does not know.</summary>
|
||||||
|
public class ExternalIniTests
|
||||||
|
{
|
||||||
|
private static readonly string UserIni = Path.Combine("/home/kolejarz", ".config", "MaSzyna", "eu07.ini");
|
||||||
|
|
||||||
|
private static TestInstallation WithIni(string text)
|
||||||
|
{
|
||||||
|
var installation = new TestInstallation(new InMemoryFileSystem().WithFile(UserIni, text));
|
||||||
|
installation.Environment.With("HOME", "/home/kolejarz");
|
||||||
|
installation.SettingsStore.Load();
|
||||||
|
return installation;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SimulatorSettings Read(string text)
|
||||||
|
{
|
||||||
|
var s = new SimulatorSettings();
|
||||||
|
new SettingsSerializer().Read(s, ConfigFile.Parse(text));
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_key_inside_a_block_comment_is_not_read()
|
||||||
|
{
|
||||||
|
Assert.False(Read("/*\nfullscreen yes\n*/\n").Fullscreen);
|
||||||
|
Assert.False(Read("/* fullscreen yes */\n").Fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_comment_glued_to_a_value_is_not_part_of_it()
|
||||||
|
{
|
||||||
|
Assert.True(Read("fullscreen yes//na pelnym ekranie\n").Fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_save_keeps_what_was_changed_on_disk_meanwhile()
|
||||||
|
{
|
||||||
|
var installation = WithIni("fieldofview 45\n");
|
||||||
|
Edited(installation, "fieldofview 45\nvsync yes\ncalibratein 1 2 3 4\n");
|
||||||
|
|
||||||
|
installation.SettingsStore.Settings.FieldOfView = 60;
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
string saved = installation.Files.ReadAllText(UserIni);
|
||||||
|
Assert.Contains("fieldofview 60", saved);
|
||||||
|
Assert.Contains("calibratein 1 2 3 4", saved);
|
||||||
|
Assert.Contains("vsync yes", saved);
|
||||||
|
// What is held is the file again: a later save does not take the other change back.
|
||||||
|
Assert.True(installation.SettingsStore.Settings.VSync);
|
||||||
|
Assert.True(installation.SettingsStore.LastSaveMerged);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_key_changed_both_here_and_on_disk_takes_the_players_value()
|
||||||
|
{
|
||||||
|
var installation = WithIni("fieldofview 45\n");
|
||||||
|
Edited(installation, "fieldofview 70\n");
|
||||||
|
|
||||||
|
installation.SettingsStore.Settings.FieldOfView = 60;
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
Assert.Contains("fieldofview 60", installation.Files.ReadAllText(UserIni));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_file_nobody_else_touched_saves_as_before()
|
||||||
|
{
|
||||||
|
var installation = WithIni("fieldofview 45\n");
|
||||||
|
|
||||||
|
installation.SettingsStore.Settings.FieldOfView = 60;
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
Assert.False(installation.SettingsStore.LastSaveMerged);
|
||||||
|
Assert.Contains("fieldofview 60", installation.Files.ReadAllText(UserIni));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_known_key_with_a_value_the_starter_cannot_read_is_named_with_that_value()
|
||||||
|
{
|
||||||
|
var installation = WithIni("fieldofview abc\nfullscreen moze\nui.scale duzo\nvsync tak\nwidth 1920.0\n" +
|
||||||
|
"gfxrenderer legacy\nwidth 1920\ngfx.framebuffer.width 960\ncalibratein 1 2\n");
|
||||||
|
|
||||||
|
var unreadable = installation.SettingsStore.UnreadableValues();
|
||||||
|
|
||||||
|
Assert.Equal("abc", unreadable["fieldofview"]);
|
||||||
|
Assert.Equal("moze", unreadable["fullscreen"]);
|
||||||
|
Assert.Equal("duzo", unreadable["ui.scale"]);
|
||||||
|
// Read another way, derived from other keys, or not the starter's: none of them unknown.
|
||||||
|
Assert.False(unreadable.ContainsKey("vsync"));
|
||||||
|
Assert.False(unreadable.ContainsKey("width"));
|
||||||
|
Assert.False(unreadable.ContainsKey("gfxrenderer"));
|
||||||
|
Assert.False(unreadable.ContainsKey("gfx.framebuffer.width"));
|
||||||
|
Assert.False(unreadable.ContainsKey("calibratein"));
|
||||||
|
// The file keeps what it says until the setting is changed.
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
Assert.Contains("fieldofview abc", installation.Files.ReadAllText(UserIni));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Values_above_what_the_old_starter_gave_are_brought_down_on_the_next_save()
|
||||||
|
{
|
||||||
|
var installation = WithIni("maxcabtexturesize 8192\nshadowtune 4096 250 600 300\n" +
|
||||||
|
"width 1920\nheight 1080\ngfx.framebuffer.width 2880\ngfx.framebuffer.height 1620\n" +
|
||||||
|
"fieldofview 50\n");
|
||||||
|
var store = installation.SettingsStore;
|
||||||
|
|
||||||
|
Assert.Equal(GraphicsRules.MaxCabTextureSize, store.Settings.MaxCabTextureSize);
|
||||||
|
Assert.Equal(GraphicsRules.MaxShadowRange, store.Settings.ShadowProjectionRange);
|
||||||
|
Assert.Equal(GraphicsRules.MaxBufferScale, store.Settings.BufferScalePercent);
|
||||||
|
// Read, only brought down: not a value the starter cannot read.
|
||||||
|
Assert.Empty(store.UnreadableValues());
|
||||||
|
|
||||||
|
store.Save();
|
||||||
|
|
||||||
|
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);
|
||||||
|
Assert.Contains("fieldofview 50", saved);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Values_within_the_caps_are_left_as_the_file_has_them()
|
||||||
|
{
|
||||||
|
var installation = WithIni("maxcabtexturesize 2048\nshadowtune 2048 250 300 300\n");
|
||||||
|
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
string saved = installation.Files.ReadAllText(UserIni);
|
||||||
|
Assert.Contains("maxcabtexturesize 2048", saved);
|
||||||
|
Assert.Contains("shadowtune 2048 250 300 300", saved);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Another program writes the file a minute after the starter read it.
|
||||||
|
private static void Edited(TestInstallation installation, string text) =>
|
||||||
|
installation.Files.WithFile(UserIni, text)
|
||||||
|
.WrittenAt(UserIni, installation.Files.GetLastWriteTimeUtc(UserIni).AddMinutes(1));
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Lines_the_starter_does_not_know_survive_a_save_in_place()
|
||||||
|
{
|
||||||
|
const string ini = "// moj komentarz\nfoo bar baz\n\nfullscreen no\nzmq.address tcp://*:5555\n";
|
||||||
|
var installation = WithIni(ini);
|
||||||
|
installation.SettingsStore.Settings.Fullscreen = true;
|
||||||
|
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
string saved = installation.Files.ReadAllText(UserIni).Replace("\r\n", "\n");
|
||||||
|
Assert.StartsWith("// moj komentarz\nfoo bar baz\n\nfullscreen yes\nzmq.address tcp://*:5555\n", saved);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,16 +26,13 @@ public class GraphicsPresetTests
|
|||||||
var store = new TestInstallation().SettingsStore;
|
var store = new TestInstallation().SettingsStore;
|
||||||
var low = Defaults().Copy();
|
var low = Defaults().Copy();
|
||||||
var top = Defaults().Copy();
|
var top = Defaults().Copy();
|
||||||
// Ray tracing is one of them, and only Vulkan has it.
|
|
||||||
low.RenderEngine = top.RenderEngine = SimulatorSettings.VulkanEngine;
|
|
||||||
(GraphicsPreset.Minimal with { Extras = null }).ApplyTo(low);
|
(GraphicsPreset.Minimal with { Extras = null }).ApplyTo(low);
|
||||||
(GraphicsPreset.Ultra with { Extras = null, Top = null }).ApplyTo(top);
|
(GraphicsPreset.Ultra with { Extras = null, Top = null }).ApplyTo(top);
|
||||||
|
|
||||||
var lowKeys = store.Render(low);
|
var lowKeys = store.Render(low);
|
||||||
var topKeys = store.Render(top);
|
var topKeys = store.Render(top);
|
||||||
var differing = lowKeys.Keys.Union(topKeys.Keys)
|
var differing = lowKeys.Keys.Union(topKeys.Keys)
|
||||||
.Where(key => lowKeys.GetValueOrDefault(key) != topKeys.GetValueOrDefault(key))
|
.Where(key => lowKeys.GetValueOrDefault(key) != topKeys.GetValueOrDefault(key));
|
||||||
.Where(key => !key.StartsWith("gfx.framebuffer", StringComparison.Ordinal));
|
|
||||||
|
|
||||||
Assert.Equal(GraphicsPreset.Keys.OrderBy(k => k), differing.OrderBy(k => k));
|
Assert.Equal(GraphicsPreset.Keys.OrderBy(k => k), differing.OrderBy(k => k));
|
||||||
}
|
}
|
||||||
@@ -55,7 +52,7 @@ public class GraphicsPresetTests
|
|||||||
{
|
{
|
||||||
// Sizes and filtering run out of steps above High.
|
// Sizes and filtering run out of steps above High.
|
||||||
Climbs(p => p.TextureSize, 1);
|
Climbs(p => p.TextureSize, 1);
|
||||||
Climbs(p => p.CabTextureSize, 1);
|
Climbs(p => p.CabTextureSize, 2);
|
||||||
Climbs(p => p.Anisotropy, 1);
|
Climbs(p => p.Anisotropy, 1);
|
||||||
|
|
||||||
// Four steps or three for six levels.
|
// Four steps or three for six levels.
|
||||||
@@ -65,28 +62,23 @@ public class GraphicsPresetTests
|
|||||||
Climbs(p => p.ReflectionsFidelity, 3);
|
Climbs(p => p.ReflectionsFidelity, 3);
|
||||||
Climbs(p => p.ShadowRank, 3);
|
Climbs(p => p.ShadowRank, 3);
|
||||||
|
|
||||||
// The simulator takes no more than its own 7 lights, and draws no less than 2 km.
|
// The simulator takes no more than its own 7 lights.
|
||||||
Climbs(p => p.DynamicLights, 2);
|
Climbs(p => p.DynamicLights, 2);
|
||||||
Climbs(p => p.DrawRange, 1);
|
Climbs(p => p.DrawRangeFactor, 3);
|
||||||
Climbs(p => p.DrawRangeFactor, 2);
|
|
||||||
Climbs(p => p.CabShadowsRange, 1);
|
Climbs(p => p.CabShadowsRange, 1);
|
||||||
|
|
||||||
Climbs(p => p.ShadowMap, 1);
|
Climbs(p => p.ShadowMap, 2);
|
||||||
Climbs(p => p.ShadowRange, 0);
|
Climbs(p => p.ShadowRange, 1);
|
||||||
Climbs(p => p.ReflectionsRate, 0);
|
// The old starter's steps begin at once a second: the lower levels share it.
|
||||||
Climbs(p => p.DistanceFactor, 0);
|
Climbs(p => p.ReflectionsRate, 2);
|
||||||
Climbs(p => p.BufferScale, 0);
|
|
||||||
Climbs(p => p.SleeperDistance, 0);
|
|
||||||
Climbs(p => p.ReflectedInstances, 0);
|
|
||||||
Climbs(p => p.ReflectedVehicles, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void No_step_up_a_scale_is_more_than_a_few_steps_of_its_slider()
|
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.
|
// 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(Steps.ReflectionUpdates, p.ReflectionsRate)).ToList();
|
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, 1, 4));
|
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 (Func<GraphicsPreset, int> fidelity in new Func<GraphicsPreset, int>[] { p => p.SmokeFidelity, p => p.SplineFidelity })
|
||||||
{
|
{
|
||||||
@@ -103,9 +95,7 @@ public class GraphicsPresetTests
|
|||||||
var high = store.Render(AtHigh());
|
var high = store.Render(AtHigh());
|
||||||
|
|
||||||
var differing = own.Keys.Union(high.Keys)
|
var differing = own.Keys.Union(high.Keys)
|
||||||
.Where(key => own.GetValueOrDefault(key) != high.GetValueOrDefault(key))
|
.Where(key => own.GetValueOrDefault(key) != high.GetValueOrDefault(key));
|
||||||
.Where(key => !GraphicsPreset.RowKeys.Contains(key))
|
|
||||||
.Where(key => !key.StartsWith("gfx.framebuffer", StringComparison.Ordinal) && key != "gfx.buffer.percent");
|
|
||||||
|
|
||||||
Assert.Equal(new[] { "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.shadows.cab.range",
|
Assert.Equal(new[] { "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.shadows.cab.range",
|
||||||
"gfx.smoke.fidelity", "splinefidelity" }, differing.OrderBy(k => k));
|
"gfx.smoke.fidelity", "splinefidelity" }, differing.OrderBy(k => k));
|
||||||
@@ -128,6 +118,8 @@ public class GraphicsPresetTests
|
|||||||
var again = new TestInstallation(installation.Files).SettingsStore;
|
var again = new TestInstallation(installation.Files).SettingsStore;
|
||||||
again.Load();
|
again.Load();
|
||||||
Assert.Same(GraphicsPreset.High, GraphicsPreset.Matching(again.Settings));
|
Assert.Same(GraphicsPreset.High, GraphicsPreset.Matching(again.Settings));
|
||||||
|
// Nothing of an older starter to bring into the standard mode.
|
||||||
|
Assert.True(again.Settings.MovedToStandard);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -144,158 +136,102 @@ public class GraphicsPresetTests
|
|||||||
again.StartAtHighWithoutOwnSettings();
|
again.StartAtHighWithoutOwnSettings();
|
||||||
|
|
||||||
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(again.Settings));
|
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(again.Settings));
|
||||||
|
Assert.False(again.Settings.MovedToStandard);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void High_is_what_the_new_simulator_does_with_nothing_set()
|
public void A_copy_of_the_file_is_kept_once_and_not_written_over()
|
||||||
{
|
{
|
||||||
Assert.Equal(GraphicsPreset.High.NewRenderer, GraphicsNewRenderer.Of(Defaults()));
|
var installation = new TestInstallation();
|
||||||
|
var store = installation.SettingsStore;
|
||||||
|
store.Load();
|
||||||
|
store.Settings.FieldOfView = 50;
|
||||||
|
store.Save();
|
||||||
|
string copy = store.SavePath + ".before-standard";
|
||||||
|
|
||||||
|
store.KeepCopy(".before-standard");
|
||||||
|
string first = installation.Files.ReadAllText(copy);
|
||||||
|
Assert.Equal(installation.Files.ReadAllText(store.SavePath), first);
|
||||||
|
|
||||||
|
store.Settings.FieldOfView = 60;
|
||||||
|
store.Save();
|
||||||
|
store.KeepCopy(".before-standard");
|
||||||
|
Assert.Equal(first, installation.Files.ReadAllText(copy));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_new_renderers_scales_never_go_down()
|
public void Ultra_is_the_top_of_what_the_old_starter_offered()
|
||||||
{
|
|
||||||
void NeverDown(Func<GraphicsNewRenderer, double> value) => Climbs(p => value(p.NewRenderer), 5);
|
|
||||||
|
|
||||||
void TurnsOn(Func<GraphicsNewRenderer, bool> on)
|
|
||||||
{
|
|
||||||
var values = GraphicsPreset.All.Select(p => on(p.NewRenderer)).ToList();
|
|
||||||
Assert.Equal(values.OrderBy(value => value), values);
|
|
||||||
}
|
|
||||||
|
|
||||||
NeverDown(r => r.LampShadows);
|
|
||||||
NeverDown(r => r.ContactShadows);
|
|
||||||
NeverDown(r => r.Occlusion);
|
|
||||||
NeverDown(r => r.OcclusionSlices);
|
|
||||||
NeverDown(r => r.OcclusionSteps);
|
|
||||||
NeverDown(r => r.CabProbe);
|
|
||||||
NeverDown(r => r.ScreenReflections);
|
|
||||||
NeverDown(r => r.FogQuality);
|
|
||||||
NeverDown(r => r.Clouds);
|
|
||||||
|
|
||||||
TurnsOn(r => r.OcclusionLighting);
|
|
||||||
TurnsOn(r => r.CabProbeReflections);
|
|
||||||
TurnsOn(r => r.RayTracing);
|
|
||||||
TurnsOn(r => r.VolumetricFog);
|
|
||||||
TurnsOn(r => r.CloudShadows);
|
|
||||||
TurnsOn(r => r.Grass);
|
|
||||||
TurnsOn(r => r.Bloom);
|
|
||||||
|
|
||||||
Climbs(p => p.NewRenderer.GrassDistance, 0);
|
|
||||||
Climbs(p => p.NewRenderer.GrassDensity, 0);
|
|
||||||
Climbs(p => p.NewRenderer.Precipitation, 1);
|
|
||||||
// Frames between refreshes, so the dearer the fewer.
|
|
||||||
Climbs(p => -p.NewRenderer.CabProbeInterval, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Ultra_is_the_top_of_the_new_renderers_scales()
|
|
||||||
{
|
|
||||||
var ultra = GraphicsPreset.Ultra.NewRenderer;
|
|
||||||
|
|
||||||
Assert.Equal(3, ultra.LampShadows);
|
|
||||||
Assert.Equal(3, ultra.ContactShadows);
|
|
||||||
Assert.Equal(2, ultra.Occlusion);
|
|
||||||
Assert.Equal((6, 8), (ultra.OcclusionSlices, ultra.OcclusionSteps));
|
|
||||||
Assert.Equal(3, ultra.CabProbe);
|
|
||||||
Assert.Equal(3, ultra.ScreenReflections);
|
|
||||||
Assert.True(ultra.RayTracing && ultra.VolumetricFog);
|
|
||||||
Assert.Equal(4, ultra.FogQuality);
|
|
||||||
Assert.Equal(4, ultra.Clouds);
|
|
||||||
Assert.Equal(300, ultra.GrassDistance);
|
|
||||||
Assert.Equal(2.0, ultra.GrassDensity);
|
|
||||||
Assert.Equal(262144, ultra.Precipitation);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Grass_fades_out_beyond_where_it_is_drawn_in_full()
|
|
||||||
{
|
|
||||||
var store = new TestInstallation().SettingsStore;
|
|
||||||
foreach (var preset in GraphicsPreset.All)
|
|
||||||
{
|
|
||||||
var settings = Defaults().Copy();
|
|
||||||
preset.ApplyTo(settings);
|
|
||||||
|
|
||||||
Assert.True(int.Parse(store.Render(settings)["gfx.grass.fadedistance"]) > preset.NewRenderer.GrassDistance, preset.NameKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_level_set_in_the_new_renderers_rows_is_told_from_the_others()
|
|
||||||
{
|
|
||||||
var settings = Defaults().Copy();
|
|
||||||
GraphicsPreset.Medium.ApplyTo(settings);
|
|
||||||
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
|
||||||
|
|
||||||
settings.FogQuality = 4;
|
|
||||||
|
|
||||||
Assert.Null(GraphicsPreset.Matching(settings));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void What_is_left_to_the_player_stays_through_a_level()
|
|
||||||
{
|
|
||||||
var settings = Defaults().Copy();
|
|
||||||
settings.RenderEngine = SimulatorSettings.VulkanEngine;
|
|
||||||
settings.AntiAliasing = AntiAliasingMode.Dlss;
|
|
||||||
settings.FrameGeneration = 2;
|
|
||||||
settings.VulkanDevice = "RTX";
|
|
||||||
|
|
||||||
foreach (var preset in GraphicsPreset.All)
|
|
||||||
{
|
|
||||||
preset.ApplyTo(settings);
|
|
||||||
|
|
||||||
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
|
||||||
Assert.Equal(AntiAliasingMode.Dlss, settings.AntiAliasing);
|
|
||||||
Assert.Equal(2, settings.FrameGeneration);
|
|
||||||
Assert.Equal("RTX", settings.VulkanDevice);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Ultra_is_the_top_of_everything_the_screen_offers()
|
|
||||||
{
|
{
|
||||||
var ultra = GraphicsPreset.Ultra;
|
var ultra = GraphicsPreset.Ultra;
|
||||||
double Top(string key) => SimulatorKeys.Named(key).Maximum;
|
|
||||||
|
|
||||||
Assert.Equal(8192, ultra.TextureSize);
|
Assert.Equal(8192, ultra.TextureSize);
|
||||||
Assert.Equal(8192, ultra.CabTextureSize);
|
Assert.Equal(GraphicsRules.MaxCabTextureSize, ultra.CabTextureSize);
|
||||||
Assert.Equal(8192, ultra.ShadowMap);
|
Assert.Equal(8192, ultra.ShadowMap);
|
||||||
Assert.Equal(600, ultra.ShadowRange);
|
Assert.Equal(GraphicsRules.MaxShadowRange, ultra.ShadowRange);
|
||||||
Assert.Equal(Steps.Anisotropy.Max(), ultra.Anisotropy);
|
Assert.Equal(Steps.Anisotropy.Max(), ultra.Anisotropy);
|
||||||
Assert.Equal(AntiAliasingMode.Msaa8, ultra.AntiAliasing);
|
Assert.Equal(AntiAliasingMode.Msaa8, ultra.AntiAliasing);
|
||||||
Assert.Equal(Steps.ReflectionUpdates.Max(), ultra.ReflectionsRate);
|
Assert.Equal(SliderRanges.ReflectionUpdates.Max(), ultra.ReflectionsRate);
|
||||||
Assert.Equal(4, ultra.SmokeFidelity);
|
Assert.Equal(4, ultra.SmokeFidelity);
|
||||||
Assert.Equal(4, ultra.SplineFidelity);
|
Assert.Equal(4, ultra.SplineFidelity);
|
||||||
Assert.Equal(200, ultra.BufferScale);
|
Assert.Equal(SliderRanges.DrawRangeFactors.Max(), ultra.DrawRangeFactor);
|
||||||
Assert.Equal(Top(GraphicsPreset.DrawRangeKey), ultra.DrawRange);
|
|
||||||
Assert.Equal(Top(GraphicsPreset.DistanceFactorKey), ultra.DistanceFactor);
|
|
||||||
Assert.Equal(Top(GraphicsPreset.SleeperKey), ultra.SleeperDistance);
|
|
||||||
Assert.Equal(Steps.DrawRangeFactors.Max(), ultra.DrawRangeFactor);
|
|
||||||
Assert.Equal(Top(GraphicsPreset.ReflectedInstancesKey), ultra.ReflectedInstances);
|
|
||||||
Assert.Equal(Top(GraphicsPreset.ReflectedVehiclesKey), ultra.ReflectedVehicles);
|
|
||||||
Assert.Equal(100, ultra.CabShadowsRange);
|
Assert.Equal(100, ultra.CabShadowsRange);
|
||||||
|
|
||||||
var extras = ultra.Extras!;
|
var extras = ultra.Extras!;
|
||||||
Assert.Equal(200, extras.PythonUpdateMs);
|
Assert.Equal(200, extras.PythonUpdateMs);
|
||||||
Assert.True(extras.MotionBlur && extras.ChromaticAberration && extras.Smoke);
|
Assert.True(extras.MotionBlur && extras.ChromaticAberration && extras.Smoke);
|
||||||
|
|
||||||
var top = ultra.Top!;
|
Assert.True(ultra.Top!.Screens);
|
||||||
Assert.Equal(Top(GraphicsTop.ScreenWindowFpsKey), top.ScreenWindowFps);
|
|
||||||
Assert.True(top.Screens && top.ScreenMipmaps && top.Sky && top.Cab && top.AirCouplers && top.SmoothTraction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void At_ultra_what_would_only_take_away_is_off()
|
public void No_level_goes_past_what_the_old_starter_gave()
|
||||||
{
|
{
|
||||||
var top = GraphicsPreset.Ultra.Top!;
|
foreach (var preset in GraphicsPreset.All)
|
||||||
|
{
|
||||||
|
Assert.True(preset.ShadowRange <= GraphicsRules.MaxShadowRange, preset.NameKey);
|
||||||
|
Assert.True(preset.CabTextureSize <= GraphicsRules.MaxCabTextureSize, preset.NameKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The longest shadows, the bottom of that scale.
|
[Fact]
|
||||||
Assert.Equal(0.2, top.ShadowAngleLimit);
|
public void No_level_sets_what_only_the_advanced_mode_shows()
|
||||||
Assert.Equal(0, top.TargetFps);
|
{
|
||||||
Assert.Equal(0, top.TextureRelease);
|
var set = GraphicsPreset.Keys.Concat(GraphicsExtras.Keys).Concat(GraphicsTop.Keys).ToList();
|
||||||
Assert.False(top.CompressTextures);
|
|
||||||
Assert.False(top.SkipDecor);
|
// 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" }));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_level_leaves_what_only_the_advanced_mode_shows_as_it_is()
|
||||||
|
{
|
||||||
|
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";
|
||||||
|
|
||||||
|
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.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]
|
[Fact]
|
||||||
@@ -304,16 +240,14 @@ public class GraphicsPresetTests
|
|||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
settings.ShadowAngleLimit = 0.8;
|
settings.ShadowAngleLimit = 0.8;
|
||||||
settings.IgnoreIrrelevantTrains = true;
|
settings.IgnoreIrrelevantTrains = true;
|
||||||
settings.Extra[GraphicsTop.TargetFpsKey] = "60";
|
settings.PythonScreens = false;
|
||||||
settings.Extra[GraphicsTop.TextureReleaseKey] = "2";
|
|
||||||
|
|
||||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||||
|
|
||||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||||
Assert.Equal(0.2, settings.ShadowAngleLimit);
|
Assert.Equal(0.2, settings.ShadowAngleLimit);
|
||||||
Assert.False(settings.IgnoreIrrelevantTrains);
|
Assert.True(settings.PythonScreens);
|
||||||
Assert.Equal("0", settings.Extra[GraphicsTop.TargetFpsKey]);
|
Assert.True(settings.IgnoreIrrelevantTrains);
|
||||||
Assert.Equal("0", settings.Extra[GraphicsTop.TextureReleaseKey]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -335,12 +269,12 @@ public class GraphicsPresetTests
|
|||||||
{
|
{
|
||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
settings.IgnoreIrrelevantTrains = true;
|
settings.IgnoreIrrelevantTrains = true;
|
||||||
settings.Extra[GraphicsTop.TargetFpsKey] = "60";
|
settings.ShadowAngleLimit = 0.8;
|
||||||
|
|
||||||
preset.ApplyTo(settings);
|
preset.ApplyTo(settings);
|
||||||
|
|
||||||
Assert.True(settings.IgnoreIrrelevantTrains, preset.NameKey);
|
Assert.True(settings.IgnoreIrrelevantTrains, preset.NameKey);
|
||||||
Assert.Equal("60", settings.Extra[GraphicsTop.TargetFpsKey]);
|
Assert.Equal(0.8, settings.ShadowAngleLimit);
|
||||||
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
Assert.Same(preset, GraphicsPreset.Matching(settings));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,26 +286,11 @@ public class GraphicsPresetTests
|
|||||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||||
|
|
||||||
settings.Extra[GraphicsPreset.ReflectedVehiclesKey] = "250";
|
settings.ReflectionsFramerate = 25;
|
||||||
|
|
||||||
Assert.Null(GraphicsPreset.Matching(settings));
|
Assert.Null(GraphicsPreset.Matching(settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void No_level_asks_for_a_range_the_renderer_would_raise_anyway()
|
|
||||||
{
|
|
||||||
Assert.All(GraphicsPreset.All, preset => Assert.True(preset.DrawRange >= 2000, preset.NameKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_view_only_shortens_going_down_the_levels()
|
|
||||||
{
|
|
||||||
var factors = GraphicsPreset.All.Select(preset => preset.DistanceFactor).ToList();
|
|
||||||
|
|
||||||
Assert.Equal(factors.OrderBy(factor => factor), factors);
|
|
||||||
Assert.Equal(1, GraphicsPreset.High.DistanceFactor);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Shadows_reach_further_with_every_level_that_has_them()
|
public void Shadows_reach_further_with_every_level_that_has_them()
|
||||||
{
|
{
|
||||||
@@ -405,29 +324,17 @@ public class GraphicsPresetTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Every_level_sets_the_buffer_and_is_not_recognised_with_another()
|
public void Every_level_is_within_what_the_sliders_offer()
|
||||||
{
|
{
|
||||||
foreach (var preset in GraphicsPreset.All)
|
foreach (var preset in GraphicsPreset.All)
|
||||||
{
|
{
|
||||||
var settings = Defaults().Copy();
|
Assert.True(preset.TextureSize >= SliderRanges.MinTextureSize, preset.NameKey);
|
||||||
settings.BufferScalePercent = 120;
|
Assert.True(preset.ShadowMap >= SliderRanges.MinShadowMap, preset.NameKey);
|
||||||
|
Assert.True(preset.DynamicLights >= SliderRanges.MinDynamicLights, preset.NameKey);
|
||||||
preset.ApplyTo(settings);
|
Assert.Contains(preset.ReflectionsRate, SliderRanges.ReflectionUpdates);
|
||||||
Assert.Equal(preset.BufferScale, settings.BufferScalePercent);
|
|
||||||
|
|
||||||
settings.BufferScalePercent = 120;
|
|
||||||
Assert.Null(GraphicsPreset.Matching(settings));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_buffer_is_the_screen_at_high_and_climbs_through_it()
|
|
||||||
{
|
|
||||||
Assert.Equal(100, GraphicsPreset.High.BufferScale);
|
|
||||||
Assert.Equal(200, GraphicsPreset.Ultra.BufferScale);
|
|
||||||
Assert.InRange(GraphicsPreset.Minimal.BufferScale, 50, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_lowest_level_is_not_recognised_with_one_of_its_extras_undone()
|
public void The_lowest_level_is_not_recognised_with_one_of_its_extras_undone()
|
||||||
{
|
{
|
||||||
@@ -453,14 +360,13 @@ public class GraphicsPresetTests
|
|||||||
{
|
{
|
||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
settings.MotionBlur = false;
|
settings.MotionBlur = false;
|
||||||
settings.Extra[GraphicsTop.TargetFpsKey] = "60";
|
settings.ShadowAngleLimit = 0.8;
|
||||||
|
|
||||||
var applied = new GraphicsPresetMemory().Apply(GraphicsPreset.Medium, settings);
|
var applied = new GraphicsPresetMemory().Apply(GraphicsPreset.Medium, settings);
|
||||||
|
|
||||||
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
||||||
Assert.False(settings.MotionBlur);
|
Assert.False(settings.MotionBlur);
|
||||||
Assert.Equal("60", settings.Extra[GraphicsTop.TargetFpsKey]);
|
Assert.Equal(0.8, settings.ShadowAngleLimit);
|
||||||
Assert.Equal(GraphicsPreset.RowKeys, applied.RowKeys);
|
|
||||||
Assert.Equal(GraphicsPreset.Keys, applied.ChosenKeys);
|
Assert.Equal(GraphicsPreset.Keys, applied.ChosenKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,14 +380,12 @@ public class GraphicsPresetTests
|
|||||||
|
|
||||||
var entering = memory.Apply(GraphicsPreset.Minimal, settings);
|
var entering = memory.Apply(GraphicsPreset.Minimal, settings);
|
||||||
Assert.Equal(GraphicsPreset.Minimal.Extras, GraphicsExtras.Of(settings));
|
Assert.Equal(GraphicsPreset.Minimal.Extras, GraphicsExtras.Of(settings));
|
||||||
Assert.Equal(GraphicsPreset.RowKeys, entering.RowKeys);
|
|
||||||
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys), entering.ChosenKeys);
|
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys), entering.ChosenKeys);
|
||||||
|
|
||||||
var leaving = memory.Apply(GraphicsPreset.Medium, settings);
|
var leaving = memory.Apply(GraphicsPreset.Medium, settings);
|
||||||
|
|
||||||
Assert.Equal(before, GraphicsExtras.Of(settings));
|
Assert.Equal(before, GraphicsExtras.Of(settings));
|
||||||
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Medium, GraphicsPreset.Matching(settings));
|
||||||
Assert.Equal(GraphicsPreset.RowKeys, leaving.RowKeys);
|
|
||||||
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys), leaving.ChosenKeys);
|
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys), leaving.ChosenKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,7 +396,6 @@ public class GraphicsPresetTests
|
|||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
settings.MotionBlur = false;
|
settings.MotionBlur = false;
|
||||||
settings.ShadowAngleLimit = 0.8;
|
settings.ShadowAngleLimit = 0.8;
|
||||||
settings.Extra[GraphicsTop.TargetFpsKey] = "60";
|
|
||||||
var extras = GraphicsExtras.Of(settings);
|
var extras = GraphicsExtras.Of(settings);
|
||||||
var top = GraphicsTop.Of(settings);
|
var top = GraphicsTop.Of(settings);
|
||||||
|
|
||||||
@@ -502,7 +405,6 @@ public class GraphicsPresetTests
|
|||||||
Assert.Equal(extras, GraphicsExtras.Of(settings));
|
Assert.Equal(extras, GraphicsExtras.Of(settings));
|
||||||
Assert.Equal(top, GraphicsTop.Of(settings));
|
Assert.Equal(top, GraphicsTop.Of(settings));
|
||||||
Assert.Same(GraphicsPreset.VeryHigh, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.VeryHigh, GraphicsPreset.Matching(settings));
|
||||||
Assert.Equal(GraphicsPreset.RowKeys.Concat(GraphicsTop.RowKeys), applied.RowKeys);
|
|
||||||
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys).Concat(GraphicsTop.Keys), applied.ChosenKeys);
|
Assert.Equal(GraphicsPreset.Keys.Concat(GraphicsExtras.Keys).Concat(GraphicsTop.Keys), applied.ChosenKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,12 +414,11 @@ public class GraphicsPresetTests
|
|||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||||
|
|
||||||
var applied = new GraphicsPresetMemory().Apply(GraphicsPreset.Low, settings);
|
new GraphicsPresetMemory().Apply(GraphicsPreset.Low, settings);
|
||||||
|
|
||||||
Assert.Equal(GraphicsExtras.None, GraphicsExtras.Of(settings));
|
Assert.Equal(GraphicsExtras.None, GraphicsExtras.Of(settings));
|
||||||
Assert.Equal(GraphicsTop.None, GraphicsTop.Of(settings));
|
Assert.Equal(GraphicsTop.None, GraphicsTop.Of(settings));
|
||||||
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Low, GraphicsPreset.Matching(settings));
|
||||||
Assert.Equal(GraphicsPreset.RowKeys.Concat(GraphicsTop.RowKeys), applied.RowKeys);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -526,19 +427,18 @@ public class GraphicsPresetTests
|
|||||||
var memory = new GraphicsPresetMemory();
|
var memory = new GraphicsPresetMemory();
|
||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
settings.MotionBlur = false;
|
settings.MotionBlur = false;
|
||||||
|
settings.ShadowAngleLimit = 0.8;
|
||||||
var extras = GraphicsExtras.Of(settings);
|
var extras = GraphicsExtras.Of(settings);
|
||||||
var top = GraphicsTop.Of(settings);
|
var top = GraphicsTop.Of(settings);
|
||||||
|
|
||||||
memory.Apply(GraphicsPreset.Minimal, settings);
|
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||||
var toUltra = memory.Apply(GraphicsPreset.Ultra, settings);
|
memory.Apply(GraphicsPreset.Ultra, settings);
|
||||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(settings));
|
||||||
Assert.Equal(GraphicsPreset.RowKeys.Concat(GraphicsTop.RowKeys), toUltra.RowKeys);
|
|
||||||
|
|
||||||
var toMinimal = memory.Apply(GraphicsPreset.Minimal, settings);
|
memory.Apply(GraphicsPreset.Minimal, settings);
|
||||||
Assert.Same(GraphicsPreset.Minimal, GraphicsPreset.Matching(settings));
|
Assert.Same(GraphicsPreset.Minimal, GraphicsPreset.Matching(settings));
|
||||||
// Ultra's own values go, Minimal has no say over them.
|
// Ultra's own values go, Minimal has no say over them.
|
||||||
Assert.Equal(top, GraphicsTop.Of(settings));
|
Assert.Equal(top, GraphicsTop.Of(settings));
|
||||||
Assert.Equal(GraphicsPreset.RowKeys.Concat(GraphicsTop.RowKeys), toMinimal.RowKeys);
|
|
||||||
|
|
||||||
memory.Apply(GraphicsPreset.Medium, settings);
|
memory.Apply(GraphicsPreset.Medium, settings);
|
||||||
Assert.Equal(extras, GraphicsExtras.Of(settings));
|
Assert.Equal(extras, GraphicsExtras.Of(settings));
|
||||||
@@ -560,7 +460,6 @@ public class GraphicsPresetTests
|
|||||||
var applied = memory.Apply(GraphicsPreset.High, settings);
|
var applied = memory.Apply(GraphicsPreset.High, settings);
|
||||||
|
|
||||||
Assert.True(settings.MotionBlur);
|
Assert.True(settings.MotionBlur);
|
||||||
Assert.Equal(GraphicsPreset.RowKeys, applied.RowKeys);
|
|
||||||
Assert.Equal(GraphicsPreset.Keys, applied.ChosenKeys);
|
Assert.Equal(GraphicsPreset.Keys, applied.ChosenKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,33 +495,15 @@ public class GraphicsPresetTests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void Every_level_sits_on_the_steps_the_screen_offers()
|
public void Every_level_sits_on_the_steps_the_screen_offers()
|
||||||
{
|
{
|
||||||
void OnSteps(double value, string name)
|
|
||||||
{
|
|
||||||
var key = SimulatorKeys.Named(name);
|
|
||||||
Assert.InRange(value, key.Minimum, key.Maximum);
|
|
||||||
double steps = value / key.Step;
|
|
||||||
Assert.Equal(Math.Round(steps), steps, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var preset in GraphicsPreset.All)
|
foreach (var preset in GraphicsPreset.All)
|
||||||
{
|
{
|
||||||
OnSteps(preset.DistanceFactor, GraphicsPreset.DistanceFactorKey);
|
|
||||||
OnSteps(preset.DrawRange, GraphicsPreset.DrawRangeKey);
|
|
||||||
OnSteps(preset.SleeperDistance, GraphicsPreset.SleeperKey);
|
|
||||||
OnSteps(preset.ReflectedInstances, GraphicsPreset.ReflectedInstancesKey);
|
|
||||||
OnSteps(preset.ReflectedVehicles, GraphicsPreset.ReflectedVehiclesKey);
|
|
||||||
Assert.InRange(preset.NewRenderer.CabProbeInterval, 1, 120);
|
|
||||||
Assert.InRange(preset.NewRenderer.GrassDistance, 20, 300);
|
|
||||||
Assert.Equal(0, preset.NewRenderer.GrassDistance % 10);
|
|
||||||
Assert.Equal(0, preset.NewRenderer.GrassDensity % 0.25);
|
|
||||||
Assert.Contains(preset.NewRenderer.Precipitation, new[] { 16384, 32768, 65536, 131072, 262144 });
|
|
||||||
Assert.True(Steps.IndexOf(Steps.Anisotropy, preset.Anisotropy) >= 0, preset.NameKey);
|
Assert.True(Steps.IndexOf(Steps.Anisotropy, preset.Anisotropy) >= 0, preset.NameKey);
|
||||||
Assert.True(Steps.IndexOf(Steps.ReflectionUpdates, preset.ReflectionsRate) >= 0, preset.NameKey);
|
Assert.True(Steps.IndexOf(SliderRanges.ReflectionUpdates, preset.ReflectionsRate) >= 0, preset.NameKey);
|
||||||
Assert.True(Steps.IndexOf(Steps.DrawRangeFactors, preset.DrawRangeFactor) >= 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 })
|
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(size is >= 512 and <= 8192 && (size & (size - 1)) == 0, preset.NameKey);
|
||||||
Assert.True(preset.ShadowRange >= SimulatorSettings.ShadowRangeFloor(preset.ShadowMap), preset.NameKey);
|
Assert.True(preset.ShadowRange >= SimulatorSettings.ShadowRangeFloor(preset.ShadowMap), preset.NameKey);
|
||||||
Assert.Equal(0, preset.CabShadowsRange % 10);
|
Assert.True(Steps.IndexOf(SliderRanges.CabShadowRanges, preset.CabShadowsRange) >= 0, preset.NameKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,7 +518,7 @@ public class GraphicsPresetTests
|
|||||||
|
|
||||||
Assert.Equal(inGroups.Distinct(), inGroups);
|
Assert.Equal(inGroups.Distinct(), inGroups);
|
||||||
Assert.Empty(inGroups.Except(GraphicsPreset.Keys).Except(GraphicsExtras.Keys).Except(GraphicsTop.Keys));
|
Assert.Empty(inGroups.Except(GraphicsPreset.Keys).Except(GraphicsExtras.Keys).Except(GraphicsTop.Keys));
|
||||||
Assert.Equal(new[] { "gfx.antialiasing", "gfx.buffer.percent", "gfx.extraeffects", "gfx.postfx.bloom", "multisampling", "starter.bufferscale" },
|
Assert.Equal(new[] { "dynamiclights", "gfx.extraeffects", "gfx.smoke.fidelity", "multisampling" },
|
||||||
GraphicsPreset.Keys.Except(inGroups).OrderBy(key => key, StringComparer.Ordinal));
|
GraphicsPreset.Keys.Except(inGroups).OrderBy(key => key, StringComparer.Ordinal));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -669,27 +550,22 @@ public class GraphicsPresetTests
|
|||||||
GraphicsPreset.Ultra.ApplyTo(settings);
|
GraphicsPreset.Ultra.ApplyTo(settings);
|
||||||
|
|
||||||
Assert.All(Groups().LevelsOf(settings).Values, level => Assert.Same(GraphicsPreset.Ultra, level));
|
Assert.All(Groups().LevelsOf(settings).Values, level => Assert.Same(GraphicsPreset.Ultra, level));
|
||||||
|
|
||||||
// The row of a key at the simulator's own value leaves it out of the file.
|
|
||||||
settings.Extra.Remove(GraphicsTop.TextureReleaseKey);
|
|
||||||
|
|
||||||
Assert.Same(GraphicsPreset.Ultra, Groups().LevelsOf(settings)[GraphicsGroup.Textures]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void A_part_moved_by_hand_is_at_no_level_and_the_others_keep_theirs()
|
public void A_part_moved_by_hand_is_at_no_level_and_the_others_keep_theirs()
|
||||||
{
|
{
|
||||||
var settings = AtHigh();
|
var settings = AtHigh();
|
||||||
settings.DynamicLights = 6;
|
settings.ReflectionsFidelity = 0;
|
||||||
|
|
||||||
var levels = Groups().LevelsOf(settings);
|
var levels = Groups().LevelsOf(settings);
|
||||||
|
|
||||||
Assert.Null(levels[GraphicsGroup.Lights]);
|
Assert.Null(levels[GraphicsGroup.Reflections]);
|
||||||
Assert.Same(GraphicsPreset.High, levels[GraphicsGroup.Shadows]);
|
Assert.Same(GraphicsPreset.High, levels[GraphicsGroup.Shadows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Every_part_at_a_level_and_the_buffer_with_it_is_that_level()
|
public void Every_part_at_a_level_and_the_rest_with_it_is_that_level()
|
||||||
{
|
{
|
||||||
var groups = Groups();
|
var groups = Groups();
|
||||||
foreach (var level in GraphicsPreset.All.Where(level => level.Extras is null))
|
foreach (var level in GraphicsPreset.All.Where(level => level.Extras is null))
|
||||||
@@ -697,8 +573,9 @@ public class GraphicsPresetTests
|
|||||||
var settings = Defaults().Copy();
|
var settings = Defaults().Copy();
|
||||||
foreach (var group in GraphicsGroup.All)
|
foreach (var group in GraphicsGroup.All)
|
||||||
settings = groups.Apply(group, level, settings);
|
settings = groups.Apply(group, level, settings);
|
||||||
settings.BufferScalePercent = level.BufferScale;
|
|
||||||
settings.AntiAliasing = level.AntiAliasing;
|
settings.AntiAliasing = level.AntiAliasing;
|
||||||
|
settings.DynamicLights = level.DynamicLights;
|
||||||
|
settings.SmokeFidelity = level.SmokeFidelity;
|
||||||
|
|
||||||
Assert.Same(level, GraphicsPreset.Matching(settings));
|
Assert.Same(level, GraphicsPreset.Matching(settings));
|
||||||
}
|
}
|
||||||
@@ -718,14 +595,15 @@ public class GraphicsPresetTests
|
|||||||
{
|
{
|
||||||
var groups = Groups();
|
var groups = Groups();
|
||||||
var settings = AtHigh();
|
var settings = AtHigh();
|
||||||
|
settings.ShadowAngleLimit = 0.8;
|
||||||
|
|
||||||
var ultra = groups.Apply(GraphicsGroup.Textures, GraphicsPreset.Ultra, settings);
|
var ultra = groups.Apply(GraphicsGroup.Shadows, GraphicsPreset.Ultra, settings);
|
||||||
Assert.False(ultra.CompressTextures);
|
Assert.Equal(0.2, ultra.ShadowAngleLimit);
|
||||||
Assert.Same(GraphicsPreset.Ultra, groups.LevelsOf(ultra)[GraphicsGroup.Textures]);
|
Assert.Same(GraphicsPreset.Ultra, groups.LevelsOf(ultra)[GraphicsGroup.Shadows]);
|
||||||
|
|
||||||
var back = groups.Apply(GraphicsGroup.Textures, GraphicsPreset.High, ultra);
|
var back = groups.Apply(GraphicsGroup.Shadows, GraphicsPreset.High, ultra);
|
||||||
Assert.Equal(GraphicsTop.None.CompressTextures, back.CompressTextures);
|
Assert.Equal(GraphicsTop.None.ShadowAngleLimit, back.ShadowAngleLimit);
|
||||||
Assert.Same(GraphicsPreset.High, groups.LevelsOf(back)[GraphicsGroup.Textures]);
|
Assert.Same(GraphicsPreset.High, groups.LevelsOf(back)[GraphicsGroup.Shadows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -736,8 +614,9 @@ public class GraphicsPresetTests
|
|||||||
|
|
||||||
settings.Smoke = false;
|
settings.Smoke = false;
|
||||||
|
|
||||||
var nature = Groups().Apply(GraphicsGroup.Nature, GraphicsPreset.VeryHigh, settings);
|
var shadows = Groups().Apply(GraphicsGroup.Shadows, GraphicsPreset.VeryHigh, settings);
|
||||||
Assert.False(nature.Smoke);
|
Assert.False(shadows.Smoke);
|
||||||
Assert.Equal(GraphicsPreset.VeryHigh.SmokeFidelity, nature.SmokeFidelity);
|
Assert.False(shadows.MotionBlur);
|
||||||
|
Assert.Equal(GraphicsPreset.VeryHigh.ShadowMap, shadows.ShadowMapResolution);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,17 +17,17 @@ public class GraphicsSettingsTests
|
|||||||
return installation;
|
return installation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SimulatorSettings Read(string text, bool dlssPlatform = true)
|
private static SimulatorSettings Read(string text)
|
||||||
{
|
{
|
||||||
var s = new SimulatorSettings();
|
var s = new SimulatorSettings();
|
||||||
new SettingsSerializer(dlssPlatform).Read(s, ConfigFile.Parse(text));
|
new SettingsSerializer().Read(s, ConfigFile.Parse(text));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string Write(SimulatorSettings s, string text = "", bool dlssPlatform = true)
|
private static string Write(SimulatorSettings s, string text = "")
|
||||||
{
|
{
|
||||||
var c = ConfigFile.Parse(text);
|
var c = ConfigFile.Parse(text);
|
||||||
new SettingsSerializer(dlssPlatform).Write(s, c);
|
new SettingsSerializer().Write(s, c);
|
||||||
return c.ToText();
|
return c.ToText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,63 +37,54 @@ public class GraphicsSettingsTests
|
|||||||
private static string? Line(string text, string key) =>
|
private static string? Line(string text, string key) =>
|
||||||
Lines(text).FirstOrDefault(l => l == key || l.StartsWith(key + " ", StringComparison.Ordinal));
|
Lines(text).FirstOrDefault(l => l == key || l.StartsWith(key + " ", StringComparison.Ordinal));
|
||||||
|
|
||||||
|
// As application.cpp on master has them: a word it does not know gets the full renderer.
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("full", GraphicsBackend.OpenGL)]
|
[InlineData("default", "default")]
|
||||||
[InlineData("default", GraphicsBackend.OpenGL)]
|
[InlineData("full", "default")]
|
||||||
[InlineData("gl46", GraphicsBackend.OpenGL)]
|
[InlineData("gl46", "default")]
|
||||||
[InlineData("legacy", GraphicsBackend.OpenGL)]
|
[InlineData("vulkan", "default")]
|
||||||
[InlineData("experimental", GraphicsBackend.OpenGL)]
|
[InlineData("vulkan14", "default")]
|
||||||
[InlineData("vulkan", GraphicsBackend.Vulkan)]
|
|
||||||
[InlineData("vulkan14", GraphicsBackend.Vulkan)]
|
|
||||||
public void The_renderer_is_read_with_the_aliases_the_simulator_takes(string value, GraphicsBackend expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, Read($"gfxrenderer {value}\n").Backend);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("full", "full")]
|
|
||||||
[InlineData("gl46", "full")]
|
|
||||||
[InlineData("legacy", "legacy")]
|
[InlineData("legacy", "legacy")]
|
||||||
[InlineData("simpleshader", "legacy")]
|
[InlineData("simpleshader", "legacy")]
|
||||||
|
[InlineData("off", "legacy")]
|
||||||
[InlineData("simple", "simple")]
|
[InlineData("simple", "simple")]
|
||||||
[InlineData("experimental", "experimental")]
|
[InlineData("experimental", "default")]
|
||||||
[InlineData("vulkan14", "vulkan")]
|
public void A_renderer_is_written_by_the_name_master_knows(string read, string written)
|
||||||
public void A_renderer_is_written_by_its_name(string read, string written)
|
|
||||||
{
|
{
|
||||||
Assert.Equal($"gfxrenderer {written}", Line(Write(Read($"gfxrenderer {read}\n")), "gfxrenderer"));
|
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()
|
||||||
|
{
|
||||||
|
Assert.Equal(0, Read("").RenderEngine);
|
||||||
|
Assert.Equal("gfxrenderer default", Line(Write(Read("")), "gfxrenderer"));
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void An_older_renderer_stays_chosen_and_can_be_chosen_again()
|
public void An_older_renderer_stays_chosen_and_can_be_chosen_again()
|
||||||
{
|
{
|
||||||
var installation = WithIni("gfxrenderer legacy\n");
|
var installation = WithIni("gfxrenderer legacy\n");
|
||||||
var store = installation.SettingsStore;
|
var store = installation.SettingsStore;
|
||||||
|
|
||||||
store.Settings.Clouds = 3;
|
store.Settings.FieldOfView = 50;
|
||||||
store.Save();
|
store.Save();
|
||||||
Assert.Contains("gfxrenderer legacy", installation.Files.ReadAllText(UserIni));
|
Assert.Contains("gfxrenderer legacy", installation.Files.ReadAllText(UserIni));
|
||||||
|
|
||||||
store.Settings.RenderEngine = SimulatorSettings.VulkanEngine;
|
|
||||||
store.Save();
|
|
||||||
Assert.Contains("gfxrenderer vulkan", installation.Files.ReadAllText(UserIni));
|
|
||||||
Assert.Equal(GraphicsBackend.Vulkan, store.Settings.Backend);
|
|
||||||
|
|
||||||
store.Settings.RenderEngine = SimulatorSettings.RenderEngineOf("simple");
|
store.Settings.RenderEngine = SimulatorSettings.RenderEngineOf("simple");
|
||||||
store.Save();
|
store.Save();
|
||||||
Assert.Contains("gfxrenderer simple", installation.Files.ReadAllText(UserIni));
|
Assert.Contains("gfxrenderer simple", installation.Files.ReadAllText(UserIni));
|
||||||
Assert.Equal(GraphicsBackend.OpenGL, store.Settings.Backend);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Keys_only_an_older_simulator_reads_stay_in_the_file()
|
public void Keys_only_the_legacy_renderer_or_windows_read_stay_in_the_file()
|
||||||
{
|
{
|
||||||
string[] old =
|
string[] old =
|
||||||
{
|
{
|
||||||
"usevbo no", "gfx.angleplatform vulkan", "gfx.usegles yes",
|
"usevbo no", "gfx.angleplatform vulkan", "gfx.usegles yes", "gfx.shadows.cab.range 20"
|
||||||
"gfx.framebuffer.width 1920", "gfx.framebuffer.height 1080", "gfx.shadows.cab.range 20"
|
|
||||||
};
|
};
|
||||||
var installation = WithIni(string.Join("\n", old) + "\n");
|
var installation = WithIni(string.Join("\n", old) + "\n");
|
||||||
installation.SettingsStore.Settings.Clouds = 3;
|
installation.SettingsStore.Settings.FieldOfView = 50;
|
||||||
|
|
||||||
installation.SettingsStore.Save();
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
@@ -101,6 +92,24 @@ public class GraphicsSettingsTests
|
|||||||
Assert.All(old, line => Assert.Contains(line, saved));
|
Assert.All(old, line => Assert.Contains(line, saved));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Keys_of_the_vulkan_renderer_master_does_not_have_go_on_a_save()
|
||||||
|
{
|
||||||
|
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"
|
||||||
|
};
|
||||||
|
var installation = WithIni("calibratein 0 0 0 0\n" + string.Join("\n", vulkan) + "\n");
|
||||||
|
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
string saved = installation.Files.ReadAllText(UserIni);
|
||||||
|
Assert.Contains("calibratein 0 0 0 0", saved);
|
||||||
|
Assert.All(vulkan, line => Assert.Null(Line(saved, line.Split(' ')[0])));
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Levels_leave_the_switches_only_an_older_simulator_reads()
|
public void Levels_leave_the_switches_only_an_older_simulator_reads()
|
||||||
{
|
{
|
||||||
@@ -111,160 +120,26 @@ public class GraphicsSettingsTests
|
|||||||
Assert.Equal((false, true, true), (s.UseVbo, s.UseGLES, s.RenderAngleVulkan));
|
Assert.Equal((false, true, true), (s.UseVbo, s.UseGLES, s.RenderAngleVulkan));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Theory]
|
||||||
public void The_new_graphics_keys_are_read()
|
[InlineData("multisampling 0\n", AntiAliasingMode.Off)]
|
||||||
|
[InlineData("multisampling 1\n", AntiAliasingMode.Msaa2)]
|
||||||
|
[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)
|
||||||
{
|
{
|
||||||
var s = Read("gfxrenderer vulkan\n" +
|
Assert.Equal(expected, Read(text).AntiAliasing);
|
||||||
"gfx.antialiasing dlss\ngfx.dlss.preset K\ngfx.framegeneration x3\ngfx.reflex boost\n" +
|
|
||||||
"gfx.raytracing yes\ngfx.raytracing.range 800\ngfx.ssr high\ngfx.postfx.ao ssao\ngfx.postfx.ao.quality 4 6\n" +
|
|
||||||
"gfx.lights.shadows low\ngfx.contactshadows 3\ngfx.fog analytic\ngfx.fog.quality ultra\n" +
|
|
||||||
"gfx.clouds ultra\ngfx.clouds.shadows no\ngfx.grass no\ngfx.grass.distance 120\ngfx.grass.density 1.5\n" +
|
|
||||||
"gfx.buffer.percent 0.67\ngfx.vulkan.device RTX\n");
|
|
||||||
|
|
||||||
Assert.Equal(GraphicsBackend.Vulkan, s.Backend);
|
|
||||||
Assert.Equal(AntiAliasingMode.Dlss, s.AntiAliasing);
|
|
||||||
Assert.Equal("k", s.DlssPreset);
|
|
||||||
Assert.Equal(3, s.FrameGeneration);
|
|
||||||
Assert.Equal(2, s.Reflex);
|
|
||||||
Assert.True(s.RayTracing);
|
|
||||||
Assert.Equal(800, s.RayTracingRange);
|
|
||||||
Assert.Equal(3, s.Ssr);
|
|
||||||
Assert.Equal(1, s.AmbientOcclusion);
|
|
||||||
Assert.Equal((4, 6), (s.AoSlices, s.AoSteps));
|
|
||||||
Assert.Equal(1, s.LightShadows);
|
|
||||||
Assert.Equal(3, s.ContactShadows);
|
|
||||||
Assert.False(s.VolumetricFog);
|
|
||||||
Assert.Equal(4, s.FogQuality);
|
|
||||||
Assert.Equal(4, s.Clouds);
|
|
||||||
Assert.False(s.CloudShadows);
|
|
||||||
Assert.False(s.Grass);
|
|
||||||
Assert.Equal(120, s.GrassDistance);
|
|
||||||
Assert.Equal(1.5, s.GrassDensity);
|
|
||||||
Assert.Equal(67, s.BufferScalePercent);
|
|
||||||
Assert.Equal("RTX", s.VulkanDevice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Missing_keys_take_the_simulators_defaults()
|
public void Multisampling_is_written_to_its_own_key_only()
|
||||||
{
|
|
||||||
var s = Read("");
|
|
||||||
|
|
||||||
Assert.Equal(GraphicsBackend.OpenGL, s.Backend);
|
|
||||||
Assert.Equal(AntiAliasingMode.Msaa4, s.AntiAliasing);
|
|
||||||
Assert.Equal(2, s.Ssr);
|
|
||||||
Assert.Equal(2, s.AmbientOcclusion);
|
|
||||||
Assert.Equal(2, s.LightShadows);
|
|
||||||
Assert.Equal(0, s.ContactShadows);
|
|
||||||
Assert.True(s.VolumetricFog);
|
|
||||||
Assert.Equal(2, s.FogQuality);
|
|
||||||
Assert.Equal(2, s.Clouds);
|
|
||||||
Assert.False(s.RayTracing);
|
|
||||||
Assert.Equal(1, s.FrameGeneration);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_tokens_written_are_the_ones_the_simulator_parses()
|
|
||||||
{
|
|
||||||
var s = Read("gfxrenderer vulkan\n");
|
|
||||||
s.AntiAliasing = AntiAliasingMode.Dlaa;
|
|
||||||
s.FrameGeneration = 4;
|
|
||||||
s.Reflex = 1;
|
|
||||||
s.LightShadows = 3;
|
|
||||||
s.ContactShadows = 0;
|
|
||||||
s.Clouds = 4;
|
|
||||||
s.VolumetricFog = false;
|
|
||||||
s.FogQuality = 1;
|
|
||||||
s.AmbientOcclusion = 1;
|
|
||||||
s.Ssr = 2;
|
|
||||||
s.RayTracing = true;
|
|
||||||
|
|
||||||
string text = Write(s);
|
|
||||||
|
|
||||||
Assert.Equal("gfx.antialiasing dlaa", Line(text, "gfx.antialiasing"));
|
|
||||||
Assert.Equal("multisampling 0", Line(text, "multisampling"));
|
|
||||||
Assert.Equal("gfx.framegeneration x4", Line(text, "gfx.framegeneration"));
|
|
||||||
Assert.Equal("gfx.reflex on", Line(text, "gfx.reflex"));
|
|
||||||
Assert.Equal("gfx.lights.shadows high", Line(text, "gfx.lights.shadows"));
|
|
||||||
Assert.Equal("gfx.contactshadows no", Line(text, "gfx.contactshadows"));
|
|
||||||
Assert.Equal("gfx.clouds ultra", Line(text, "gfx.clouds"));
|
|
||||||
Assert.Equal("gfx.fog analytic", Line(text, "gfx.fog"));
|
|
||||||
Assert.Equal("gfx.fog.quality low", Line(text, "gfx.fog.quality"));
|
|
||||||
Assert.Equal("gfx.postfx.ao ssao", Line(text, "gfx.postfx.ao"));
|
|
||||||
Assert.Equal("gfx.ssr medium", Line(text, "gfx.ssr"));
|
|
||||||
Assert.Equal("gfx.raytracing yes", Line(text, "gfx.raytracing"));
|
|
||||||
Assert.Equal("gfx.buffer.percent 100", Line(text, "gfx.buffer.percent"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Msaa_is_written_to_both_keys_for_older_simulators()
|
|
||||||
{
|
{
|
||||||
var s = Read("multisampling 1\n");
|
var s = Read("multisampling 1\n");
|
||||||
Assert.Equal(AntiAliasingMode.Msaa2, s.AntiAliasing);
|
|
||||||
|
|
||||||
string text = Write(s);
|
string text = Write(s);
|
||||||
|
|
||||||
Assert.Equal("multisampling 1", Line(text, "multisampling"));
|
Assert.Equal("multisampling 1", Line(text, "multisampling"));
|
||||||
Assert.Equal("gfx.antialiasing msaax2", Line(text, "gfx.antialiasing"));
|
Assert.Null(Line(text, "gfx.antialiasing"));
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Of_the_two_anti_aliasing_keys_the_later_one_wins_as_in_the_simulator()
|
|
||||||
{
|
|
||||||
Assert.Equal(AntiAliasingMode.Taa, Read("multisampling 2\ngfx.antialiasing taa\n").AntiAliasing);
|
|
||||||
Assert.Equal(AntiAliasingMode.Msaa4, Read("gfx.antialiasing taa\nmultisampling 2\n").AntiAliasing);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void On_opengl_the_vulkan_only_features_are_written_off()
|
|
||||||
{
|
|
||||||
var s = Read("gfxrenderer full\ngfx.antialiasing dlss\ngfx.framegeneration x2\ngfx.reflex on\ngfx.raytracing yes\n");
|
|
||||||
|
|
||||||
Assert.Equal(AntiAliasingMode.Taa, s.AntiAliasing);
|
|
||||||
Assert.Equal(1, s.FrameGeneration);
|
|
||||||
Assert.Equal(0, s.Reflex);
|
|
||||||
Assert.False(s.RayTracing);
|
|
||||||
|
|
||||||
string text = Write(s);
|
|
||||||
Assert.Equal("gfx.antialiasing taa", Line(text, "gfx.antialiasing"));
|
|
||||||
Assert.Equal("gfx.framegeneration off", Line(text, "gfx.framegeneration"));
|
|
||||||
Assert.Equal("gfx.reflex off", Line(text, "gfx.reflex"));
|
|
||||||
Assert.Equal("gfx.raytracing no", Line(text, "gfx.raytracing"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Frame_generation_needs_dlss_even_on_vulkan()
|
|
||||||
{
|
|
||||||
var s = Read("gfxrenderer vulkan\ngfx.antialiasing taa\ngfx.framegeneration x2\ngfx.reflex on\n");
|
|
||||||
|
|
||||||
Assert.Equal(1, s.FrameGeneration);
|
|
||||||
Assert.Equal(1, s.Reflex);
|
|
||||||
Assert.False(GraphicsRules.ReflexForced(s, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Frame_generation_turns_reflex_on()
|
|
||||||
{
|
|
||||||
var s = Read("gfxrenderer vulkan\ngfx.antialiasing dlss\ngfx.framegeneration x2\n");
|
|
||||||
|
|
||||||
Assert.True(GraphicsRules.ReflexForced(s, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Without_a_dlss_platform_dlss_falls_back_to_taa()
|
|
||||||
{
|
|
||||||
var s = Read("gfxrenderer vulkan\ngfx.antialiasing dlss\n", dlssPlatform: false);
|
|
||||||
|
|
||||||
Assert.Equal(AntiAliasingMode.Taa, s.AntiAliasing);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Dlaa_ignores_the_render_scale()
|
|
||||||
{
|
|
||||||
var s = Read("gfxrenderer vulkan\ngfx.antialiasing dlaa\n");
|
|
||||||
Assert.False(GraphicsRules.BufferScaleUsed(s, true));
|
|
||||||
|
|
||||||
s.AntiAliasing = AntiAliasingMode.Dlss;
|
|
||||||
Assert.True(GraphicsRules.BufferScaleUsed(s, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -278,10 +153,23 @@ public class GraphicsSettingsTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_render_scale_reads_the_old_starter_key_when_the_new_one_is_missing()
|
public void The_render_scale_is_the_starters_own_key_or_the_framebuffer_against_the_window()
|
||||||
{
|
{
|
||||||
Assert.Equal(75, Read("starter.bufferscale 75\n").BufferScalePercent);
|
Assert.Equal(75, Read("starter.bufferscale 75\n").BufferScalePercent);
|
||||||
Assert.Equal(50, Read("starter.bufferscale 75\ngfx.buffer.percent 50\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()
|
||||||
|
{
|
||||||
|
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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -312,7 +200,7 @@ public class GraphicsSettingsTests
|
|||||||
{
|
{
|
||||||
var s = new SimulatorSettings();
|
var s = new SimulatorSettings();
|
||||||
GraphicsPreset.High.ApplyTo(s);
|
GraphicsPreset.High.ApplyTo(s);
|
||||||
s.Clouds = 4;
|
s.DynamicLights = 2;
|
||||||
|
|
||||||
Assert.Null(GraphicsPreset.Matching(s));
|
Assert.Null(GraphicsPreset.Matching(s));
|
||||||
}
|
}
|
||||||
@@ -328,82 +216,62 @@ public class GraphicsSettingsTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Ray_tracing_comes_with_ultra_on_vulkan_only()
|
public void No_level_leaves_decorative_consists_out()
|
||||||
{
|
{
|
||||||
var vulkan = new SimulatorSettings { RenderEngine = SimulatorSettings.VulkanEngine };
|
foreach (var level in GraphicsPreset.All)
|
||||||
var opengl = new SimulatorSettings();
|
{
|
||||||
|
var s = new SimulatorSettings { IgnoreIrrelevantTrains = false };
|
||||||
|
level.ApplyTo(s);
|
||||||
|
Assert.False(s.IgnoreIrrelevantTrains, level.NameKey);
|
||||||
|
|
||||||
GraphicsPreset.Ultra.ApplyTo(vulkan);
|
s.IgnoreIrrelevantTrains = true;
|
||||||
GraphicsPreset.Ultra.ApplyTo(opengl);
|
level.ApplyTo(s);
|
||||||
|
Assert.True(s.IgnoreIrrelevantTrains, level.NameKey);
|
||||||
Assert.True(vulkan.RayTracing);
|
}
|
||||||
Assert.False(opengl.RayTracing);
|
|
||||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(opengl));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_level_keeps_dlss_on_vulkan()
|
|
||||||
{
|
|
||||||
var s = new SimulatorSettings { RenderEngine = SimulatorSettings.VulkanEngine, AntiAliasing = AntiAliasingMode.Dlss };
|
|
||||||
|
|
||||||
GraphicsPreset.Ultra.ApplyTo(s);
|
|
||||||
|
|
||||||
Assert.Equal(AntiAliasingMode.Dlss, s.AntiAliasing);
|
|
||||||
Assert.Same(GraphicsPreset.Ultra, GraphicsPreset.Matching(s));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_level_replaces_taa_with_its_own_multisampling()
|
|
||||||
{
|
|
||||||
var s = new SimulatorSettings { AntiAliasing = AntiAliasingMode.Taa };
|
|
||||||
|
|
||||||
GraphicsPreset.Medium.ApplyTo(s);
|
|
||||||
|
|
||||||
Assert.Equal(AntiAliasingMode.Msaa2, s.AntiAliasing);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void An_import_takes_the_settings_but_keeps_this_installations_simulator_and_the_unmanaged_lines()
|
public void An_import_takes_the_settings_but_keeps_this_installations_simulator_and_the_unmanaged_lines()
|
||||||
{
|
{
|
||||||
var installation = WithIni("starter.exe.auto no\nstarter.exe.path eu07_local.exe\ncalibratein 0 0 0 0\ngfx.clouds low\n");
|
var installation = WithIni("starter.exe.auto no\nstarter.exe.path eu07_local.exe\ncalibratein 0 0 0 0\nfieldofview 45\n");
|
||||||
installation.Files.WithFile("/backup/eu07.ini", "starter.exe.auto no\nstarter.exe.path eu07_other.exe\ngfx.clouds ultra\ngfxrenderer vulkan\n");
|
installation.Files.WithFile("/backup/eu07.ini", "starter.exe.auto no\nstarter.exe.path eu07_other.exe\nfieldofview 60\ngfxrenderer legacy\n");
|
||||||
|
|
||||||
Assert.True(installation.SettingsStore.ImportFrom("/backup/eu07.ini"));
|
Assert.True(installation.SettingsStore.ImportFrom("/backup/eu07.ini"));
|
||||||
var s = installation.SettingsStore.Settings;
|
var s = installation.SettingsStore.Settings;
|
||||||
Assert.Equal(4, s.Clouds);
|
Assert.Equal(60, s.FieldOfView);
|
||||||
Assert.Equal(GraphicsBackend.Vulkan, s.Backend);
|
Assert.Equal(SimulatorSettings.RenderEngineOf("legacy"), s.RenderEngine);
|
||||||
Assert.Equal("eu07_local.exe", s.ExecutablePath);
|
Assert.Equal("eu07_local.exe", s.ExecutablePath);
|
||||||
|
|
||||||
// Nothing is written until saved, and the save keeps the user's own lines.
|
// Nothing is written until saved, and the save keeps the user's own lines.
|
||||||
Assert.Contains("gfx.clouds low", installation.Files.ReadAllText(UserIni));
|
Assert.Contains("fieldofview 45", installation.Files.ReadAllText(UserIni));
|
||||||
installation.SettingsStore.Save();
|
installation.SettingsStore.Save();
|
||||||
string saved = installation.Files.ReadAllText(UserIni);
|
string saved = installation.Files.ReadAllText(UserIni);
|
||||||
Assert.Contains("calibratein 0 0 0 0", saved);
|
Assert.Contains("calibratein 0 0 0 0", saved);
|
||||||
Assert.Contains("gfx.clouds ultra", saved);
|
Assert.Contains("fieldofview 60", saved);
|
||||||
Assert.Contains("starter.exe.path eu07_local.exe", saved);
|
Assert.Contains("starter.exe.path eu07_local.exe", saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void An_import_of_a_missing_file_changes_nothing()
|
public void An_import_of_a_missing_file_changes_nothing()
|
||||||
{
|
{
|
||||||
var installation = WithIni("gfx.clouds low\n");
|
var installation = WithIni("fieldofview 50\n");
|
||||||
|
|
||||||
Assert.False(installation.SettingsStore.ImportFrom("/nowhere/eu07.ini"));
|
Assert.False(installation.SettingsStore.ImportFrom("/nowhere/eu07.ini"));
|
||||||
Assert.Equal(1, installation.SettingsStore.Settings.Clouds);
|
Assert.Equal(50, installation.SettingsStore.Settings.FieldOfView);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void An_export_writes_a_complete_file_elsewhere_and_leaves_the_users_one_alone()
|
public void An_export_writes_a_complete_file_elsewhere_and_leaves_the_users_one_alone()
|
||||||
{
|
{
|
||||||
var installation = WithIni("calibratein 0 0 0 0\ngfx.clouds low\n");
|
var installation = WithIni("calibratein 0 0 0 0\nfieldofview 45\n");
|
||||||
installation.SettingsStore.Settings.Clouds = 3;
|
installation.SettingsStore.Settings.FieldOfView = 60;
|
||||||
|
|
||||||
Assert.True(installation.SettingsStore.ExportTo("/export/eu07.ini"));
|
Assert.True(installation.SettingsStore.ExportTo("/export/eu07.ini"));
|
||||||
|
|
||||||
string exported = installation.Files.ReadAllText("/export/eu07.ini");
|
string exported = installation.Files.ReadAllText("/export/eu07.ini");
|
||||||
Assert.Contains("calibratein 0 0 0 0", exported);
|
Assert.Contains("calibratein 0 0 0 0", exported);
|
||||||
Assert.Contains("gfx.clouds high", exported);
|
Assert.Contains("fieldofview 60", exported);
|
||||||
Assert.Contains("gfx.clouds low", installation.Files.ReadAllText(UserIni));
|
Assert.Contains("fieldofview 45", installation.Files.ReadAllText(UserIni));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -417,30 +285,34 @@ public class GraphicsSettingsTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_dlss_libraries_are_looked_for_next_to_a_windows_build()
|
public void The_gamepad_is_ignored_unless_the_file_turns_it_on()
|
||||||
{
|
{
|
||||||
var files = new InMemoryFileSystem()
|
Assert.True(Read("").IgnoreGamepad);
|
||||||
.WithDirectory(TestInstallation.Root)
|
Assert.Equal("input.gamepad no", Line(Write(Read("")), "input.gamepad"));
|
||||||
.WithExecutable(TestInstallation.At("eu07.exe"), "MZ binary")
|
Assert.False(Read("input.gamepad yes\n").IgnoreGamepad);
|
||||||
.WithFile(TestInstallation.At("nvngx_dlss.dll"), "dll");
|
Assert.True(Read("input.gamepad no\n").IgnoreGamepad);
|
||||||
var installation = new TestInstallation(files);
|
|
||||||
|
|
||||||
Assert.Equal((true, false), installation.Executables.DlssLibraries(TestInstallation.At("eu07.exe")));
|
|
||||||
|
|
||||||
files.WithFile(TestInstallation.At("nvngx_dlssg.dll"), "dll");
|
|
||||||
Assert.Equal((true, true), installation.Executables.DlssLibraries(TestInstallation.At("eu07.exe")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_dlss_libraries_of_a_linux_build_are_the_shared_objects()
|
public void The_standard_mode_is_where_a_player_starts_and_the_choice_is_kept()
|
||||||
{
|
{
|
||||||
var files = new InMemoryFileSystem()
|
Assert.False(Read("").AdvancedSettings);
|
||||||
.WithDirectory(TestInstallation.Root)
|
Assert.True(Read("starter.settings.advanced yes\n").AdvancedSettings);
|
||||||
.WithExecutable(TestInstallation.At("eu07"), "\u007fELF binary")
|
|
||||||
.WithFile(TestInstallation.At("libnvidia-ngx-dlssg.so.310.4.0"), "so");
|
|
||||||
var installation = new TestInstallation(files);
|
|
||||||
|
|
||||||
Assert.Equal((false, true), installation.Executables.DlssLibraries(TestInstallation.At("eu07")));
|
var s = Read("");
|
||||||
|
s.AdvancedSettings = true;
|
||||||
|
Assert.Equal("starter.settings.advanced yes", Line(Write(s), "starter.settings.advanced"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_move_to_the_standard_mode_is_marked_in_the_file()
|
||||||
|
{
|
||||||
|
Assert.False(Read("").MovedToStandard);
|
||||||
|
Assert.True(Read("starter.settings.standard yes\n").MovedToStandard);
|
||||||
|
|
||||||
|
var s = Read("");
|
||||||
|
s.MovedToStandard = true;
|
||||||
|
Assert.Equal("starter.settings.standard yes", Line(Write(s), "starter.settings.standard"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -455,139 +327,4 @@ public class GraphicsSettingsTests
|
|||||||
c.Set("b", "9");
|
c.Set("b", "9");
|
||||||
Assert.Equal("b 9\nc 3\na 1\n", c.ToText().Replace("\r\n", "\n"));
|
Assert.Equal("b 9\nc 3\na 1\n", c.ToText().Replace("\r\n", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_ao_lighting_and_cab_probe_keys_survive_a_round_trip_in_the_simulators_form()
|
|
||||||
{
|
|
||||||
var s = Read("gfx.postfx.ao.lighting no\ngfx.cabprobe high\ngfx.cabprobe.interval 12\ngfx.cabprobe.bounce 2.5\ngfx.cabprobe.reflections no\n");
|
|
||||||
|
|
||||||
Assert.False(s.AoLighting);
|
|
||||||
Assert.Equal(3, s.CabProbe);
|
|
||||||
Assert.Equal(12, s.CabProbeInterval);
|
|
||||||
Assert.Equal(2.5, s.CabProbeBounce);
|
|
||||||
Assert.False(s.CabProbeReflections);
|
|
||||||
|
|
||||||
string text = Write(s);
|
|
||||||
Assert.Equal("gfx.postfx.ao.lighting no", Line(text, "gfx.postfx.ao.lighting"));
|
|
||||||
Assert.Equal("gfx.cabprobe high", Line(text, "gfx.cabprobe"));
|
|
||||||
Assert.Equal("gfx.cabprobe.interval 12", Line(text, "gfx.cabprobe.interval"));
|
|
||||||
Assert.Equal("gfx.cabprobe.bounce 2.5", Line(text, "gfx.cabprobe.bounce"));
|
|
||||||
Assert.Equal("gfx.cabprobe.reflections no", Line(text, "gfx.cabprobe.reflections"));
|
|
||||||
|
|
||||||
var again = Read(text);
|
|
||||||
Assert.Equal((s.AoLighting, s.CabProbe, s.CabProbeInterval, s.CabProbeBounce, s.CabProbeReflections),
|
|
||||||
(again.AoLighting, again.CabProbe, again.CabProbeInterval, again.CabProbeBounce, again.CabProbeReflections));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Missing_ao_lighting_and_cab_probe_keys_take_the_simulators_defaults_and_are_written_like_its_export()
|
|
||||||
{
|
|
||||||
var s = Read("");
|
|
||||||
|
|
||||||
Assert.Equal((true, 2, 4, 1.0, true), (s.AoLighting, s.CabProbe, s.CabProbeInterval, s.CabProbeBounce, s.CabProbeReflections));
|
|
||||||
|
|
||||||
string text = Write(s);
|
|
||||||
Assert.Equal("gfx.postfx.ao.lighting yes", Line(text, "gfx.postfx.ao.lighting"));
|
|
||||||
Assert.Equal("gfx.cabprobe medium", Line(text, "gfx.cabprobe"));
|
|
||||||
Assert.Equal("gfx.cabprobe.interval 4", Line(text, "gfx.cabprobe.interval"));
|
|
||||||
Assert.Equal("gfx.cabprobe.bounce 1", Line(text, "gfx.cabprobe.bounce"));
|
|
||||||
Assert.Equal("gfx.cabprobe.reflections yes", Line(text, "gfx.cabprobe.reflections"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Unknown_ao_lighting_and_cab_probe_values_fall_back_to_the_simulators_defaults()
|
|
||||||
{
|
|
||||||
var s = Read("gfx.postfx.ao.lighting maybe\ngfx.cabprobe bogus\ngfx.cabprobe.interval abc\ngfx.cabprobe.bounce x\ngfx.cabprobe.reflections ?\n");
|
|
||||||
|
|
||||||
Assert.Equal((true, 2, 4, 1.0, true), (s.AoLighting, s.CabProbe, s.CabProbeInterval, s.CabProbeBounce, s.CabProbeReflections));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("no", 0)]
|
|
||||||
[InlineData("0", 0)]
|
|
||||||
[InlineData("low", 1)]
|
|
||||||
[InlineData("1", 1)]
|
|
||||||
[InlineData("medium", 2)]
|
|
||||||
[InlineData("yes", 2)]
|
|
||||||
[InlineData("2", 2)]
|
|
||||||
[InlineData("high", 3)]
|
|
||||||
[InlineData("3", 3)]
|
|
||||||
public void The_cab_probe_level_is_read_with_the_aliases_the_simulator_takes(string value, int expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, Read($"gfx.cabprobe {value}\n").CabProbe);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_cab_probe_numbers_are_kept_within_the_simulators_ranges()
|
|
||||||
{
|
|
||||||
var s = Read("gfx.cabprobe.interval 500\ngfx.cabprobe.bounce 9\n");
|
|
||||||
Assert.Equal((120, 4.0), (s.CabProbeInterval, s.CabProbeBounce));
|
|
||||||
|
|
||||||
s = Read("gfx.cabprobe.interval 0\ngfx.cabprobe.bounce -1\n");
|
|
||||||
Assert.Equal((1, 0.0), (s.CabProbeInterval, s.CabProbeBounce));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_ao_lighting_counts_with_gtao_only()
|
|
||||||
{
|
|
||||||
Assert.True(GraphicsRules.AoLightingUsed(Read("gfx.postfx.ao gtao\n")));
|
|
||||||
Assert.False(GraphicsRules.AoLightingUsed(Read("gfx.postfx.ao ssao\n")));
|
|
||||||
Assert.False(GraphicsRules.AoLightingUsed(Read("gfx.postfx.ao no\n")));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("gfx.ssr no\ngfx.contactshadows no\n", true)]
|
|
||||||
[InlineData("gfx.ssr low\ngfx.contactshadows no\n", false)]
|
|
||||||
[InlineData("gfx.ssr no\ngfx.contactshadows low\n", false)]
|
|
||||||
[InlineData("gfx.ssr no\ngfx.contactshadows no\ngfx.depthprepass.scene yes\n", false)]
|
|
||||||
[InlineData("gfx.ssr no\ngfx.contactshadows no\ngfx.postfx.ao.lighting no\n", false)]
|
|
||||||
[InlineData("gfx.ssr no\ngfx.contactshadows no\ngfx.postfx.ao ssao\n", false)]
|
|
||||||
public void The_ao_lighting_adds_the_depth_pass_only_when_nothing_else_draws_it(string text, bool expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, GraphicsRules.AoLightingAddsDepthPrepass(Read(text)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("gfx.cabprobe medium\n", true, true)]
|
|
||||||
[InlineData("gfx.cabprobe no\n", false, false)]
|
|
||||||
[InlineData("gfx.cabprobe low\ngfx.lights.clustered no\n", true, false)]
|
|
||||||
[InlineData("gfx.cabprobe high\ngfx.lights.cab no\n", true, false)]
|
|
||||||
public void The_cab_probe_lights_the_cab_only_with_its_lamp_as_a_light(string text, bool used, bool lights)
|
|
||||||
{
|
|
||||||
var s = Read(text);
|
|
||||||
|
|
||||||
Assert.Equal(used, GraphicsRules.CabProbeUsed(s));
|
|
||||||
Assert.Equal(lights, GraphicsRules.CabProbeLights(s));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(0, false, 0, 8, false)]
|
|
||||||
[InlineData(1, false, 0, 8, false)]
|
|
||||||
[InlineData(2, false, 1, 8, true)]
|
|
||||||
[InlineData(3, true, 2, 4, true)]
|
|
||||||
[InlineData(4, true, 3, 3, true)]
|
|
||||||
[InlineData(5, true, 3, 2, true)]
|
|
||||||
public void A_level_sets_the_ao_lighting_and_the_cab_probe(int place, bool aoLighting, int probe, int interval, bool reflections)
|
|
||||||
{
|
|
||||||
var level = GraphicsPreset.All[place];
|
|
||||||
var s = new SimulatorSettings { CabProbeBounce = 2.5 };
|
|
||||||
|
|
||||||
level.ApplyTo(s);
|
|
||||||
|
|
||||||
Assert.Equal((aoLighting, probe, interval, reflections), (s.AoLighting, s.CabProbe, s.CabProbeInterval, s.CabProbeReflections));
|
|
||||||
Assert.Equal(2.5, s.CabProbeBounce);
|
|
||||||
Assert.Same(level, GraphicsPreset.Matching(s));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void An_import_keeps_the_lamp_switch_of_the_users_own_file()
|
|
||||||
{
|
|
||||||
var installation = WithIni("gfx.lights.cab no\n");
|
|
||||||
installation.Files.WithFile("/backup/eu07.ini", "gfx.lights.cab yes\ngfx.cabprobe high\n");
|
|
||||||
|
|
||||||
Assert.True(installation.SettingsStore.ImportFrom("/backup/eu07.ini"));
|
|
||||||
|
|
||||||
Assert.False(installation.SettingsStore.Settings.CabLampLight);
|
|
||||||
Assert.Equal(3, installation.SettingsStore.Settings.CabProbe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
61
StarterNG.Tests/MonitorsTests.cs
Normal file
61
StarterNG.Tests/MonitorsTests.cs
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
using StarterNG.Infrastructure;
|
||||||
|
|
||||||
|
namespace StarterNG.Tests;
|
||||||
|
|
||||||
|
public class MonitorsTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void A_monitor_is_named_as_the_simulator_names_it()
|
||||||
|
{
|
||||||
|
Assert.Equal("Generic_PnP_Monitor:1920,0", Monitors.IdOf("Generic PnP Monitor", 1920, 0));
|
||||||
|
Assert.Equal("HDMI-1:-1280,-200", Monitors.IdOf("HDMI-1", -1280, -200));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Xrandr_lists_the_connected_outputs_with_their_place()
|
||||||
|
{
|
||||||
|
const string report =
|
||||||
|
"Screen 0: minimum 320 x 200, current 4480 x 1440, maximum 16384 x 16384\n" +
|
||||||
|
"eDP-1 connected primary 1920x1080+0+360 (normal left inverted right x axis y axis) 344mm x 194mm\n" +
|
||||||
|
" 1920x1080 60.00*+\n" +
|
||||||
|
"HDMI-1 connected 2560x1440+1920+0 (normal left inverted right x axis y axis) 597mm x 336mm\n" +
|
||||||
|
"DP-1 disconnected (normal left inverted right x axis y axis)\n" +
|
||||||
|
"DP-2 connected (normal left inverted right x axis y axis)\n";
|
||||||
|
|
||||||
|
var monitors = Monitors.Parse(report);
|
||||||
|
|
||||||
|
Assert.Equal(2, monitors.Count);
|
||||||
|
Assert.Equal(new DisplayMonitor("eDP-1:0,360", "eDP-1", 1920, 1080, true, 60), monitors[0]);
|
||||||
|
Assert.Equal(new DisplayMonitor("HDMI-1:1920,0", "HDMI-1", 2560, 1440, false), monitors[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Xrandr_gives_each_monitor_the_rate_its_mode_runs_at()
|
||||||
|
{
|
||||||
|
const string report =
|
||||||
|
"DP-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm\n" +
|
||||||
|
" 2560x1440 59.95 + 165.08* 143.97\n" +
|
||||||
|
" 1920x1080 60.00 50.00\n" +
|
||||||
|
"HDMI-1 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 527mm x 296mm\n" +
|
||||||
|
" 1920x1080 60.00*+ 50.00\n" +
|
||||||
|
"DP-2 disconnected (normal left inverted right x axis y axis)\n" +
|
||||||
|
" 1280x1024 75.02*\n";
|
||||||
|
|
||||||
|
var monitors = Monitors.Parse(report);
|
||||||
|
|
||||||
|
Assert.Equal(new[] { 165, 60 }, monitors.Select(m => m.RefreshRate));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_monitor_is_written_only_when_one_is_chosen()
|
||||||
|
{
|
||||||
|
var s = new StarterNG.Domain.Settings.SimulatorSettings();
|
||||||
|
var c = StarterNG.Classes.ConfigFile.Parse("");
|
||||||
|
new StarterNG.Infrastructure.Settings.SettingsSerializer().Write(s, c);
|
||||||
|
Assert.False(c.Has("fullscreenmonitor"));
|
||||||
|
|
||||||
|
s.FullscreenMonitor = "HDMI-1:1920,0";
|
||||||
|
new StarterNG.Infrastructure.Settings.SettingsSerializer().Write(s, c);
|
||||||
|
Assert.Equal("HDMI-1:1920,0", c.GetRaw("fullscreenmonitor"));
|
||||||
|
}
|
||||||
|
}
|
||||||
17
StarterNG.Tests/RenderersTests.cs
Normal file
17
StarterNG.Tests/RenderersTests.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
@@ -270,7 +270,7 @@ public class ScenerySyntaxTests
|
|||||||
trainset td/rozklad tdo_n1734 0.0 0.1
|
trainset td/rozklad tdo_n1734 0.0 0.1
|
||||||
//$o Skład gotowy na żeberku.
|
//$o Skład gotowy na żeberku.
|
||||||
endtrainset
|
endtrainset
|
||||||
include koniec.scm
|
include koniec.scm end
|
||||||
""";
|
""";
|
||||||
|
|
||||||
var scenery = TestScenery.Parser().Parse("scenery/x.scn", scn, _ => true);
|
var scenery = TestScenery.Parser().Parse("scenery/x.scn", scn, _ => true);
|
||||||
@@ -331,13 +331,61 @@ public class ScenerySyntaxTests
|
|||||||
Assert.Equal((SceneryFaultKind.MissingInclude, "x.scn", 2, null, "brak.scm"), Seen(Assert.Single(faults)));
|
Assert.Equal((SceneryFaultKind.MissingInclude, "x.scn", 2, null, "brak.scm"), Seen(Assert.Single(faults)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_vehicle_without_its_fiz_is_reported_as_one_the_simulator_leaves_out()
|
||||||
|
{
|
||||||
|
// As on Bałtyk Cargo: the wagons of a folder gone empty drop out of the consist.
|
||||||
|
const string scn = """
|
||||||
|
trainset none tor1 0 0.1
|
||||||
|
node -1 0 sm42 dynamic PKP\SM42_V1 6D-468 6D -1 headdriver 3 0 enddynamic
|
||||||
|
node -1 0 eaos-33 dynamic PKP\412W_V1 5340976-0 412wc 0 nobody 3 60 wegiel3 enddynamic
|
||||||
|
node -1 0 eaos-34 dynamic PKP\412W_V1 5351442-9 412W 0 nobody 0 60 mial1 enddynamic
|
||||||
|
endtrainset
|
||||||
|
node -1 0 auto dynamic car car car tor1 0 headdriver 0 0 enddynamic
|
||||||
|
""";
|
||||||
|
var asked = new List<(string, string)>();
|
||||||
|
|
||||||
|
var scenery = TestScenery.Parser().Parse("scenery/x.scn", scn, loadsVehicle: (folder, mmd) =>
|
||||||
|
{
|
||||||
|
asked.Add((folder, mmd));
|
||||||
|
return !folder.Equals(@"PKP\412W_V1", StringComparison.Ordinal);
|
||||||
|
});
|
||||||
|
|
||||||
|
Assert.Equal(new[]
|
||||||
|
{
|
||||||
|
(SceneryFaultKind.VehicleMissing, "x.scn", 3, (string?)"eaos-33", (string?)@"PKP\412W_V1/412wc.fiz"),
|
||||||
|
(SceneryFaultKind.VehicleMissing, "x.scn", 4, "eaos-34", @"PKP\412W_V1/412W.fiz")
|
||||||
|
}, scenery.Faults.Select(Seen));
|
||||||
|
Assert.Contains(("car", "car"), asked);
|
||||||
|
// Still listed whole: the starter writes them as they are, for when they are back.
|
||||||
|
Assert.Equal(3, Assert.Single(scenery.Trainsets).Vehicles.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_vehicle_folder_there_but_empty_is_no_vehicle()
|
||||||
|
{
|
||||||
|
var files = new InMemoryFileSystem(caseSensitive: true)
|
||||||
|
.WithLegacyFile("game/scenery/x.scn",
|
||||||
|
"trainset none tor1 0 0\n" +
|
||||||
|
"node -1 0 a1 dynamic PKP\\430W_V2 skin 430W 0 nobody 3 0 enddynamic\n" +
|
||||||
|
"node -1 0 a2 dynamic PKP\\412W_V1 skin 412W 0 nobody 0 0 enddynamic\n" +
|
||||||
|
"endtrainset\n")
|
||||||
|
.WithLegacyFile("game/dynamic/pkp/430w_v2/430w.fiz", "")
|
||||||
|
.WithLegacyFile("game/dynamic/pkp/412w_v1/412w.mmd", "");
|
||||||
|
|
||||||
|
var faults = TestScenery.Repository(files).Load("game/scenery/x.scn")!.Faults;
|
||||||
|
|
||||||
|
Assert.Equal((SceneryFaultKind.VehicleMissing, "x.scn", 3, "a2", @"PKP\412W_V1/412W.fiz"), Seen(Assert.Single(faults)));
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void An_include_named_in_another_case_is_found_as_the_simulator_finds_it()
|
public void An_include_named_in_another_case_is_found_as_the_simulator_finds_it()
|
||||||
{
|
{
|
||||||
var files = new InMemoryFileSystem(caseSensitive: true)
|
var files = new InMemoryFileSystem(caseSensitive: true)
|
||||||
.WithLegacyFile("game/scenery/x.scn", "FirstInit\ninclude Tomaszewo/Auta.SCM end\n")
|
.WithLegacyFile("game/scenery/x.scn", "FirstInit\ninclude Tomaszewo/Auta.SCM end\n")
|
||||||
.WithLegacyFile("game/scenery/tomaszewo/auta.scm",
|
.WithLegacyFile("game/scenery/tomaszewo/auta.scm",
|
||||||
"trainset auto road1 0 50\nnode -1 0 a1 dynamic car car car 0 headdriver 3 0 enddynamic\nendtrainset\n");
|
"trainset auto road1 0 50\nnode -1 0 a1 dynamic car car car 0 headdriver 3 0 enddynamic\nendtrainset\n")
|
||||||
|
.WithLegacyFile("game/dynamic/car/car.fiz", "");
|
||||||
var repository = TestScenery.Repository(files);
|
var repository = TestScenery.Repository(files);
|
||||||
|
|
||||||
var scenery = repository.Load("game/scenery/x.scn")!;
|
var scenery = repository.Load("game/scenery/x.scn")!;
|
||||||
@@ -378,4 +426,35 @@ public class ScenerySyntaxTests
|
|||||||
Assert.Equal(sbt, scenery.HasCompanionTimetable);
|
Assert.Equal(sbt, scenery.HasCompanionTimetable);
|
||||||
Assert.Equal(sbt ? 0 : 1, scenery.Faults.Count);
|
Assert.Equal(sbt ? 0 : 1, scenery.Faults.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void An_include_with_no_end_is_a_fault_even_as_the_last_line()
|
||||||
|
{
|
||||||
|
const string scn = "FirstInit\ntrainset a t 0 0\nendtrainset\ninclude dekoracje.scm //Sklady dekoracyjne\n";
|
||||||
|
|
||||||
|
var faults = TestScenery.Parser().Parse("scenery/x.scn", scn).Faults.Select(f => (f.Kind, f.Line)).ToList();
|
||||||
|
|
||||||
|
Assert.Equal(new[] { (SceneryFaultKind.IncludeNotClosed, 4) }, faults);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_consists_of_a_last_include_with_no_end_are_listed_as_the_simulator_loads_them()
|
||||||
|
{
|
||||||
|
const string decorations = "trainset d1 t1 0 0\nnode -1 0 a dynamic d s m 0 nobody 3 0 enddynamic\nendtrainset\n";
|
||||||
|
|
||||||
|
string text = SceneryIncludes.Inline("FirstInit\ninclude dekoracje.scm //Sklady dekoracyjne\n",
|
||||||
|
name => (name, decorations));
|
||||||
|
|
||||||
|
Assert.Contains(SceneryIncludes.BeginMarker + "dekoracje.scm", text);
|
||||||
|
Assert.Contains("trainset d1 t1 0 0", text);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void An_include_with_no_end_before_more_of_the_file_is_left_alone()
|
||||||
|
{
|
||||||
|
string text = SceneryIncludes.Inline("FirstInit\ninclude dekoracje.scm\ntrainset a t 0 0\nendtrainset\n",
|
||||||
|
name => (name, "trainset d1 t1 0 0\nendtrainset\n"));
|
||||||
|
|
||||||
|
Assert.DoesNotContain(SceneryIncludes.BeginMarker, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,14 +158,12 @@ public class ScreenReaderNamesTests
|
|||||||
var slider = new Slider();
|
var slider = new Slider();
|
||||||
var row = new SettingRow { Label = "Ekran", Content = Row(check, slider) };
|
var row = new SettingRow { Label = "Ekran", Content = Row(check, slider) };
|
||||||
row.Description = "Gra zajmie cały ekran.";
|
row.Description = "Gra zajmie cały ekran.";
|
||||||
row.IdleNote = "Ten symulator nie zna tego ustawienia.";
|
|
||||||
|
|
||||||
Assert.Equal("Gra zajmie cały ekran., Ten symulator nie zna tego ustawienia.", AutomationProperties.GetHelpText(check));
|
Assert.Equal("Gra zajmie cały ekran.", AutomationProperties.GetHelpText(check));
|
||||||
Assert.Equal(AutomationProperties.GetHelpText(check), AutomationProperties.GetHelpText(slider));
|
Assert.Equal(AutomationProperties.GetHelpText(check), AutomationProperties.GetHelpText(slider));
|
||||||
Assert.Null(AutomationProperties.GetName(check));
|
Assert.Null(AutomationProperties.GetName(check));
|
||||||
|
|
||||||
row.Description = null;
|
row.Description = null;
|
||||||
row.IdleNote = null;
|
|
||||||
Assert.Null(AutomationProperties.GetHelpText(check));
|
Assert.Null(AutomationProperties.GetHelpText(check));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,154 +0,0 @@
|
|||||||
using StarterNG.Domain.Settings;
|
|
||||||
using StarterNG.Tests.Fakes;
|
|
||||||
|
|
||||||
namespace StarterNG.Tests;
|
|
||||||
|
|
||||||
public class SettingReachTests
|
|
||||||
{
|
|
||||||
private static SimulatorTarget Linux(string renderer = "full", bool server = false) =>
|
|
||||||
new(WindowsBuild: false, renderer, server);
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("feedbackmode")]
|
|
||||||
[InlineData("feedbackport")]
|
|
||||||
[InlineData("showsystemconsole")]
|
|
||||||
[InlineData("gfx.angleplatform")]
|
|
||||||
public void Windows_only_keys_idle_on_a_linux_build(string key)
|
|
||||||
{
|
|
||||||
Assert.Equal(IdleReason.WindowsBuildOnly, SettingReach.Why(key, Linux()));
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why(key, Linux() with { WindowsBuild = true }));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("full", IdleReason.LegacyRendererOnly)]
|
|
||||||
[InlineData("experimental", IdleReason.LegacyRendererOnly)]
|
|
||||||
[InlineData("legacy", IdleReason.None)]
|
|
||||||
[InlineData("simpleshader", IdleReason.None)]
|
|
||||||
[InlineData("simple", IdleReason.None)]
|
|
||||||
public void Legacy_renderer_keys_follow_the_renderer(string renderer, IdleReason expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, SettingReach.Why("smoothtraction", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("usevbo", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.shadows.cab.range", Linux(renderer)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void Pausing_in_the_background_needs_a_network_server()
|
|
||||||
{
|
|
||||||
Assert.Equal(IdleReason.NeedsNetworkServer, SettingReach.Why("inactivepause", Linux()));
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("inactivepause", Linux(server: true)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_starters_own_keys_never_idle()
|
|
||||||
{
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("starter.autoclose", Linux()));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("width, height")]
|
|
||||||
[InlineData("fullscreen")]
|
|
||||||
public void The_monitors_own_mode_overrides_size_and_full_screen(string key)
|
|
||||||
{
|
|
||||||
Assert.Equal(IdleReason.MonitorModeInstead,
|
|
||||||
SettingReach.Why(key, Linux() with { FullscreenWindowed = true }));
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why(key, Linux()));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void An_ordinary_key_works_everywhere()
|
|
||||||
{
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("fieldofview", Linux()));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("full", IdleReason.None)]
|
|
||||||
[InlineData("legacy", IdleReason.ModernRendererOnly)]
|
|
||||||
[InlineData("experimental", IdleReason.ModernRendererOnly)]
|
|
||||||
public void Effects_of_the_full_renderer_follow_the_renderer(string renderer, IdleReason expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.postfx.motionblur.enabled", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.envmap.enabled", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("sleeperdistance", Linux(renderer)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("vulkan", IdleReason.None)]
|
|
||||||
[InlineData("vulkan14", IdleReason.None)]
|
|
||||||
[InlineData("full", IdleReason.VulkanOnly)]
|
|
||||||
[InlineData("gl46", IdleReason.VulkanOnly)]
|
|
||||||
[InlineData("legacy", IdleReason.VulkanOnly)]
|
|
||||||
public void What_only_vulkan_reads_follows_the_renderer(string renderer, IdleReason expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.dlss.preset", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.framegeneration", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.raytracing", Linux(renderer)));
|
|
||||||
// Both renderers of the new simulator read this one.
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("gfx.postfx.ao", Linux(renderer)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("vulkan")]
|
|
||||||
[InlineData("vulkan14")]
|
|
||||||
[InlineData("opengl")]
|
|
||||||
[InlineData("gl46")]
|
|
||||||
public void The_new_simulators_renderers_read_what_the_full_one_does(string renderer)
|
|
||||||
{
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("gfx.envmap.enabled", Linux(renderer)));
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("multisampling", Linux(renderer)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("full", IdleReason.None)]
|
|
||||||
[InlineData("legacy", IdleReason.None)]
|
|
||||||
[InlineData("experimental", IdleReason.OpenGlRenderersOnly)]
|
|
||||||
public void The_experimental_renderer_passes_over_what_only_opengl_reads(string renderer, IdleReason expected)
|
|
||||||
{
|
|
||||||
Assert.Equal(expected, SettingReach.Why("multisampling", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("anisotropicfiltering", Linux(renderer)));
|
|
||||||
Assert.Equal(expected, SettingReach.Why("gfx.smoke", Linux(renderer)));
|
|
||||||
// ...but reads the rest of the reflections and shadows.
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("gfx.reflections.fidelity", Linux(renderer)));
|
|
||||||
Assert.Equal(IdleReason.None, SettingReach.Why("shadowtune", Linux(renderer)));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(null, 0, false)]
|
|
||||||
[InlineData(0.0, 0, false)]
|
|
||||||
[InlineData(60.0, 0, true)]
|
|
||||||
[InlineData(null, 50, true)] // fpsaverage, the older regulator
|
|
||||||
public void The_draw_range_factor_needs_a_regulator(double? targetFps, double fpsAverage, bool regulated)
|
|
||||||
{
|
|
||||||
var target = Linux() with { TargetFps = targetFps, FpsAverage = fpsAverage };
|
|
||||||
|
|
||||||
Assert.Equal(regulated ? IdleReason.None : IdleReason.NeedsFrameRateTarget,
|
|
||||||
SettingReach.Why("gfx.drawrange.factor.max", target));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── The rest of the target ───────────────────────────────────────────────
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_windows_build_is_told_from_its_header()
|
|
||||||
{
|
|
||||||
var files = new InMemoryFileSystem()
|
|
||||||
.WithExecutable(TestInstallation.At("eu07"), "\u007fELF binary")
|
|
||||||
.WithFile(TestInstallation.At("eu07.exe"), "MZ binary");
|
|
||||||
var installation = new TestInstallation(files);
|
|
||||||
|
|
||||||
Assert.False(installation.Executables.IsWindowsBuild("eu07"));
|
|
||||||
Assert.True(installation.Executables.IsWindowsBuild("eu07.exe"));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_network_server_in_the_ini_is_noticed()
|
|
||||||
{
|
|
||||||
string ini = Path.Combine("/home/kolejarz", ".config", "MaSzyna", "eu07.ini");
|
|
||||||
var installation = new TestInstallation(new InMemoryFileSystem()
|
|
||||||
.WithFile(ini, "network.server tcp 0.0.0.0:7424\n"));
|
|
||||||
installation.Environment.With("HOME", "/home/kolejarz");
|
|
||||||
|
|
||||||
installation.SettingsStore.Load();
|
|
||||||
|
|
||||||
Assert.True(installation.SettingsStore.Settings.NetworkServer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -492,7 +492,7 @@ public class SettingsStoreTests
|
|||||||
[InlineData("mousescale 1.5 0.5", false, true, "mousescale 1.5 -0.5")]
|
[InlineData("mousescale 1.5 0.5", false, true, "mousescale 1.5 -0.5")]
|
||||||
[InlineData("mousescale 1.5 0.5", true, false, "mousescale -1.5 0.5")]
|
[InlineData("mousescale 1.5 0.5", true, false, "mousescale -1.5 0.5")]
|
||||||
[InlineData("mousescale -1.5 -0.5", false, false, "mousescale 1.5 0.5")]
|
[InlineData("mousescale -1.5 -0.5", false, false, "mousescale 1.5 0.5")]
|
||||||
[InlineData("mousescale 2.5 0.123456", false, true, "mousescale 2.5 -0.123456")]
|
[InlineData("mousescale 2.5 0.5", false, true, "mousescale 2.5 -0.5")]
|
||||||
// Further than the slider goes.
|
// Further than the slider goes.
|
||||||
[InlineData("mousescale 12 0.5", true, false, "mousescale -12 0.5")]
|
[InlineData("mousescale 12 0.5", true, false, "mousescale -12 0.5")]
|
||||||
public void A_mouse_scale_keeps_its_numbers_when_an_axis_is_inverted(
|
public void A_mouse_scale_keeps_its_numbers_when_an_axis_is_inverted(
|
||||||
@@ -540,7 +540,35 @@ public class SettingsStoreTests
|
|||||||
|
|
||||||
installation.SettingsStore.Save();
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
Assert.Equal("mousescale 2 0.2", LineFor(installation, "mousescale"));
|
Assert.Equal("mousescale 2 0.5", LineFor(installation, "mousescale"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
// The second number is always 0.5, as the old starter wrote it; its sign is the inversion.
|
||||||
|
[InlineData("mousescale 1.5 0.23", "mousescale 1.5 0.5")]
|
||||||
|
[InlineData("mousescale 1.5 -0.23", "mousescale 1.5 -0.5")]
|
||||||
|
[InlineData("mousescale 1.5 -2", "mousescale 1.5 -0.5")]
|
||||||
|
// A zero locks that axis in the simulator: the camera turns only left/right.
|
||||||
|
// X goes back to the default.
|
||||||
|
[InlineData("mousescale 0.5 0", "mousescale 0.5 0.5")]
|
||||||
|
[InlineData("mousescale 0.5 -0", "mousescale 0.5 0.5")]
|
||||||
|
[InlineData("mousescale 0 0.5", "mousescale 2 0.5")]
|
||||||
|
[InlineData("mousescale 0 0", "mousescale 2 0.5")]
|
||||||
|
[InlineData("mousescale 1.5 NaN", "mousescale 1.5 0.5")]
|
||||||
|
[InlineData("mousescale Infinity -0.5", "mousescale 2 -0.5")]
|
||||||
|
// One number: the simulator takes the next word of the file ("mousecontrol") for Y, and reads it as 0.
|
||||||
|
[InlineData("mousescale 1.5", "mousescale 1.5 0.5")]
|
||||||
|
[InlineData("mousescale 0.5\t// (3.2 0.5) komentarz", "mousescale 0.5 0.5\t// (3.2 0.5) komentarz")]
|
||||||
|
// A decimal comma: the simulator reads "0,2" as 0.
|
||||||
|
[InlineData("mousescale 0.5 0,2", "mousescale 0.5 0.5")]
|
||||||
|
public void A_mouse_scale_axis_that_would_not_move_gets_the_default(string line, string written)
|
||||||
|
{
|
||||||
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, line + "\n"));
|
||||||
|
installation.SettingsStore.Load();
|
||||||
|
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
Assert.Equal(written, LineFor(installation, "mousescale"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── A file that could not be read ────────────────────────────────────────
|
// ── A file that could not be read ────────────────────────────────────────
|
||||||
@@ -885,12 +913,8 @@ public class SettingsStoreTests
|
|||||||
[InlineData("default")]
|
[InlineData("default")]
|
||||||
[InlineData("simpleshader")]
|
[InlineData("simpleshader")]
|
||||||
[InlineData("off")]
|
[InlineData("off")]
|
||||||
[InlineData("opengl")]
|
|
||||||
[InlineData("gl46")]
|
|
||||||
[InlineData("vulkan14")]
|
|
||||||
[InlineData("legacy")]
|
[InlineData("legacy")]
|
||||||
[InlineData("simple")]
|
[InlineData("simple")]
|
||||||
[InlineData("experimental")]
|
|
||||||
public void A_renderer_word_the_simulator_reads_as_another_stays_until_changed(string word)
|
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"));
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, $"gfxrenderer {word}\n"));
|
||||||
@@ -901,16 +925,33 @@ public class SettingsStoreTests
|
|||||||
Assert.Contains($"gfxrenderer {word}\n", SavedLines(installation));
|
Assert.Contains($"gfxrenderer {word}\n", SavedLines(installation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Words master does not know start the full renderer with a line in its log, and the
|
||||||
|
// experimental renderer is not in a player's build: a save puts "default" in their place.
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(0, "full")]
|
[InlineData("full")]
|
||||||
|
[InlineData("opengl")]
|
||||||
|
[InlineData("gl46")]
|
||||||
|
[InlineData("vulkan14")]
|
||||||
|
[InlineData("experimental")]
|
||||||
|
[InlineData("null")]
|
||||||
|
public void A_renderer_word_master_does_not_run_is_saved_as_default(string word)
|
||||||
|
{
|
||||||
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, $"gfxrenderer {word}\n"));
|
||||||
|
installation.SettingsStore.Load();
|
||||||
|
|
||||||
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
|
Assert.Contains("gfxrenderer default\n", SavedLines(installation));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData(0, "default")]
|
||||||
[InlineData(1, "legacy")]
|
[InlineData(1, "legacy")]
|
||||||
[InlineData(2, "simple")]
|
[InlineData(2, "simple")]
|
||||||
[InlineData(3, "experimental")]
|
|
||||||
[InlineData(4, "vulkan")]
|
|
||||||
public void A_chosen_renderer_is_saved_as_the_simulator_reads_it(int engine, string saved)
|
public void A_chosen_renderer_is_saved_as_the_simulator_reads_it(int engine, string saved)
|
||||||
{
|
{
|
||||||
// application.cpp knows full (or default), experimental and simple; every
|
// application.cpp on master knows default, legacy and simple; "simpleshader" and "off"
|
||||||
// other word - "simpleshader" and "off" from older starters - is legacy.
|
// from older starters are legacy, and any other word gets the full renderer.
|
||||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "gfxrenderer simpleshader\n"));
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "gfxrenderer simpleshader\n"));
|
||||||
installation.SettingsStore.Load();
|
installation.SettingsStore.Load();
|
||||||
installation.SettingsStore.Settings.RenderEngine = engine == 1 ? 0 : engine;
|
installation.SettingsStore.Settings.RenderEngine = engine == 1 ? 0 : engine;
|
||||||
@@ -926,8 +967,10 @@ public class SettingsStoreTests
|
|||||||
[InlineData("full", 0)]
|
[InlineData("full", 0)]
|
||||||
[InlineData("gl46", 0)]
|
[InlineData("gl46", 0)]
|
||||||
[InlineData("opengl", 0)]
|
[InlineData("opengl", 0)]
|
||||||
[InlineData("vulkan", 4)]
|
[InlineData("vulkan", 0)]
|
||||||
[InlineData("VULKAN14", 4)]
|
[InlineData("VULKAN14", 0)]
|
||||||
|
[InlineData("whatever", 0)]
|
||||||
|
[InlineData("experimental", 0)]
|
||||||
[InlineData("simpleshader", 1)]
|
[InlineData("simpleshader", 1)]
|
||||||
public void A_renderer_word_stands_where_the_simulator_reads_it(string word, int engine)
|
public void A_renderer_word_stands_where_the_simulator_reads_it(string word, int engine)
|
||||||
{
|
{
|
||||||
@@ -935,7 +978,7 @@ public class SettingsStoreTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_buffer_is_written_for_old_and_new_simulators()
|
public void The_buffer_is_written_as_the_framebuffer_master_reads()
|
||||||
{
|
{
|
||||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "width 1000\nheight 500\n"));
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "width 1000\nheight 500\n"));
|
||||||
installation.SettingsStore.Load();
|
installation.SettingsStore.Load();
|
||||||
@@ -944,19 +987,20 @@ public class SettingsStoreTests
|
|||||||
installation.SettingsStore.Save();
|
installation.SettingsStore.Save();
|
||||||
|
|
||||||
string saved = SavedLines(installation);
|
string saved = SavedLines(installation);
|
||||||
Assert.Contains("gfx.buffer.percent 50\n", saved);
|
Assert.DoesNotContain("gfx.buffer.percent", saved);
|
||||||
Assert.Contains("gfx.framebuffer.width 500\n", saved);
|
Assert.Contains("gfx.framebuffer.width 500\n", saved);
|
||||||
Assert.Contains("gfx.framebuffer.height 250\n", saved);
|
Assert.Contains("gfx.framebuffer.height 250\n", saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("gfx.buffer.percent 0.5\n", 50)]
|
[InlineData("width 1000\ngfx.framebuffer.width 500\n", 50)]
|
||||||
[InlineData("gfx.buffer.percent 75\n", 75)]
|
[InlineData("width 1000\ngfx.framebuffer.width 100\n", 25)]
|
||||||
[InlineData("gfx.buffer.percent 10\n", 25)]
|
[InlineData("width 1000\ngfx.framebuffer.width 3000\n", 100)]
|
||||||
[InlineData("gfx.buffer.percent 300\n", 200)]
|
[InlineData("gfx.framebuffer.width 500\n", 100)]
|
||||||
[InlineData("starter.bufferscale 60\n", 60)]
|
[InlineData("starter.bufferscale 60\n", 60)]
|
||||||
[InlineData("starter.bufferscale 60\ngfx.buffer.percent 80\n", 80)]
|
[InlineData("starter.bufferscale 60\nwidth 1000\ngfx.framebuffer.width 800\n", 60)]
|
||||||
public void The_buffer_is_read_from_the_key_the_new_simulator_goes_by(string ini, int percent)
|
[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)
|
||||||
{
|
{
|
||||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, ini));
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, ini));
|
||||||
|
|
||||||
@@ -965,36 +1009,6 @@ public class SettingsStoreTests
|
|||||||
Assert.Equal(percent, installation.SettingsStore.Settings.BufferScalePercent);
|
Assert.Equal(percent, installation.SettingsStore.Settings.BufferScalePercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_two_anti_aliasing_keys_untouched_keep_their_order()
|
|
||||||
{
|
|
||||||
// Moving them would change which of the two the simulator goes by.
|
|
||||||
const string ini = "gfx.antialiasing taa\nwidth 800\nmultisampling 2\n";
|
|
||||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, ini));
|
|
||||||
installation.SettingsStore.Load();
|
|
||||||
|
|
||||||
installation.SettingsStore.Save();
|
|
||||||
|
|
||||||
string saved = SavedLines(installation);
|
|
||||||
Assert.True(saved.IndexOf("gfx.antialiasing taa", StringComparison.Ordinal) < saved.IndexOf("multisampling 2", StringComparison.Ordinal), saved);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_chosen_anti_aliasing_is_saved_below_multisampling_for_the_later_line_to_count()
|
|
||||||
{
|
|
||||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "gfx.antialiasing msaax4\nwidth 800\nmultisampling 2\n"));
|
|
||||||
installation.SettingsStore.Load();
|
|
||||||
|
|
||||||
installation.SettingsStore.Settings.AntiAliasing = AntiAliasingMode.Taa;
|
|
||||||
installation.SettingsStore.Save();
|
|
||||||
|
|
||||||
string saved = SavedLines(installation);
|
|
||||||
Assert.True(saved.IndexOf("multisampling ", StringComparison.Ordinal) < saved.IndexOf("gfx.antialiasing taa", StringComparison.Ordinal), saved);
|
|
||||||
var again = WithHome(installation.Files);
|
|
||||||
again.SettingsStore.Load();
|
|
||||||
Assert.Equal(AntiAliasingMode.Taa, again.SettingsStore.Settings.AntiAliasing);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void A_field_of_view_down_to_ten_degrees_survives_a_save()
|
public void A_field_of_view_down_to_ten_degrees_survives_a_save()
|
||||||
{
|
{
|
||||||
@@ -1520,75 +1534,4 @@ public class SettingsStoreTests
|
|||||||
|
|
||||||
Assert.Null(LineFor(installation, "blackbox"));
|
Assert.Null(LineFor(installation, "blackbox"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_sound_device_options_left_alone_add_nothing_to_the_file()
|
|
||||||
{
|
|
||||||
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "width 1920\n"));
|
|
||||||
installation.SettingsStore.Load();
|
|
||||||
|
|
||||||
installation.SettingsStore.Save();
|
|
||||||
|
|
||||||
string saved = SavedLines(installation);
|
|
||||||
foreach (var key in new[] { "sound.openal.renderer", "sound.outputmode", "sound.hrtf", "sound.hrtf.profile",
|
|
||||||
"sound.resampler", "sound.limiter", "sound.frequency", "sound.maxsources",
|
|
||||||
"sound.doppler", "sound.efx.lowpass", "sound.efx.airabsorption" })
|
|
||||||
Assert.Null(LineFor(installation, key));
|
|
||||||
Assert.Contains("width 1920\n", saved);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void The_sound_device_options_survive_a_round_trip_with_names_in_quotes()
|
|
||||||
{
|
|
||||||
var installation = WithHome();
|
|
||||||
installation.SettingsStore.Load();
|
|
||||||
var s = installation.SettingsStore.Settings;
|
|
||||||
s.AudioDevice = "OpenAL Soft on Speakers (Realtek(R) Audio)";
|
|
||||||
s.AudioOutputMode = "headphones";
|
|
||||||
s.AudioHrtf = "on";
|
|
||||||
s.AudioHrtfProfile = "Built-In HRTF";
|
|
||||||
s.AudioResampler = "Cubic";
|
|
||||||
s.AudioLimiter = "off";
|
|
||||||
s.AudioFrequency = 48000;
|
|
||||||
s.AudioDoppler = 0.5;
|
|
||||||
s.AudioLowpass = true;
|
|
||||||
s.AudioAirAbsorption = 1.0;
|
|
||||||
|
|
||||||
installation.SettingsStore.Save();
|
|
||||||
|
|
||||||
Assert.Equal("sound.openal.renderer \"OpenAL Soft on Speakers (Realtek(R) Audio)\"",
|
|
||||||
LineFor(installation, "sound.openal.renderer"));
|
|
||||||
Assert.Equal("sound.resampler Cubic", LineFor(installation, "sound.resampler"));
|
|
||||||
Assert.Empty(BareSimulatorKeys(installation));
|
|
||||||
|
|
||||||
var again = WithHome(new InMemoryFileSystem().WithFile(UserIni, installation.Files.ReadAllText(UserIni)));
|
|
||||||
again.SettingsStore.Load();
|
|
||||||
var read = again.SettingsStore.Settings;
|
|
||||||
Assert.Equal(s.AudioDevice, read.AudioDevice);
|
|
||||||
Assert.Equal("headphones", read.AudioOutputMode);
|
|
||||||
Assert.Equal("on", read.AudioHrtf);
|
|
||||||
Assert.Equal("Built-In HRTF", read.AudioHrtfProfile);
|
|
||||||
Assert.Equal("Cubic", read.AudioResampler);
|
|
||||||
Assert.Equal("off", read.AudioLimiter);
|
|
||||||
Assert.Equal(48000, read.AudioFrequency);
|
|
||||||
Assert.Equal(0.5, read.AudioDoppler, 6);
|
|
||||||
Assert.True(read.AudioLowpass);
|
|
||||||
Assert.Equal(1.0, read.AudioAirAbsorption, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void A_sound_name_set_back_to_the_librarys_choice_takes_its_line_out()
|
|
||||||
{
|
|
||||||
var installation = WithHome(new InMemoryFileSystem()
|
|
||||||
.WithFile(UserIni, "sound.openal.renderer \"Old Device\"\nsound.resampler Cubic\n"));
|
|
||||||
installation.SettingsStore.Load();
|
|
||||||
Assert.Equal("Old Device", installation.SettingsStore.Settings.AudioDevice);
|
|
||||||
|
|
||||||
installation.SettingsStore.Settings.AudioDevice = "";
|
|
||||||
installation.SettingsStore.Settings.AudioResampler = "";
|
|
||||||
installation.SettingsStore.Save();
|
|
||||||
|
|
||||||
Assert.Null(LineFor(installation, "sound.openal.renderer"));
|
|
||||||
Assert.Null(LineFor(installation, "sound.resampler"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
54
StarterNG.Tests/SliderStepsTests.cs
Normal file
54
StarterNG.Tests/SliderStepsTests.cs
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
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 = 1 / 300.0 };
|
||||||
|
|
||||||
|
// The simulator's own once in five minutes, shown before the old starter's 1 to 60.
|
||||||
|
Assert.Equal(1 / 300.0, 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.CabShadowRanges) { Clamps = true, Value = 15 };
|
||||||
|
|
||||||
|
Assert.Equal(15, steps.Value);
|
||||||
|
|
||||||
|
steps.Value = -5;
|
||||||
|
Assert.Equal(0, steps.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using StarterNG.Classes;
|
using StarterNG.Classes;
|
||||||
using StarterNG.Domain;
|
using StarterNG.Domain;
|
||||||
|
using StarterNG.Domain.Settings;
|
||||||
using StarterNG.Views;
|
using StarterNG.Views;
|
||||||
|
|
||||||
namespace StarterNG.Tests;
|
namespace StarterNG.Tests;
|
||||||
@@ -58,6 +59,63 @@ public class TrainsetDisplayTests
|
|||||||
Assert.False(TrainsetDisplay.ListedIn(picked, showAi: false, drivableOnly: true, current: picked));
|
Assert.False(TrainsetDisplay.ListedIn(picked, showAi: false, drivableOnly: true, current: picked));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static SimulatorSettings Mode(bool advanced) =>
|
||||||
|
new() { AdvancedSettings = advanced, ShowAiVehicles = true, DrivableOnly = false };
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_standard_mode_lists_every_consist_but_starts_only_in_one_a_player_drives()
|
||||||
|
{
|
||||||
|
var standard = Mode(advanced: false);
|
||||||
|
var decor = new Trainset("trainset a tor 0 0 //$decor\nnode -1 0 v1 dynamic d s m 0 headdriver 3 0 enddynamic\nendtrainset");
|
||||||
|
Assert.True(decor.Decor);
|
||||||
|
|
||||||
|
foreach (var consist in new[] { Consist(), Consist(description: "-ai"), Consist(driver: "nobody"), decor })
|
||||||
|
Assert.True(TrainsetDisplay.ListedIn(consist, standard, current: null));
|
||||||
|
|
||||||
|
Assert.True(TrainsetDisplay.StartableIn(Consist(), standard));
|
||||||
|
Assert.True(TrainsetDisplay.StartableIn(Consist(driver: "nobody"), standard));
|
||||||
|
Assert.False(TrainsetDisplay.StartableIn(Consist(description: "-ai"), standard));
|
||||||
|
Assert.False(TrainsetDisplay.StartableIn(decor, standard));
|
||||||
|
Assert.True(TrainsetDisplay.StartableIn(decor, Mode(advanced: true)));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_filters_work_in_the_advanced_mode()
|
||||||
|
{
|
||||||
|
var settings = Mode(advanced: true);
|
||||||
|
|
||||||
|
settings.ShowAiVehicles = false;
|
||||||
|
Assert.False(TrainsetDisplay.ListedIn(Consist(description: "-ai"), settings, current: null));
|
||||||
|
Assert.True(TrainsetDisplay.ListedIn(Consist(), settings, current: null));
|
||||||
|
|
||||||
|
settings.DrivableOnly = true;
|
||||||
|
Assert.False(TrainsetDisplay.ListedIn(Consist(driver: "nobody"), settings, current: null));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_standard_mode_has_no_filters_and_leaves_out_empty_consists()
|
||||||
|
{
|
||||||
|
var standard = new SimulatorSettings { AdvancedSettings = false, ShowAiVehicles = false, DrivableOnly = true };
|
||||||
|
var empty = new Trainset("trainset a tor 0 0\nendtrainset");
|
||||||
|
|
||||||
|
Assert.True(TrainsetDisplay.ListedIn(Consist(description: "-ai"), standard, current: null));
|
||||||
|
Assert.True(TrainsetDisplay.ListedIn(Consist(driver: "nobody"), standard, current: null));
|
||||||
|
Assert.False(TrainsetDisplay.ListedIn(empty, standard, current: null));
|
||||||
|
Assert.False(TrainsetDisplay.ListedIn(empty, standard, current: empty));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void The_advanced_mode_lists_by_its_own_filters()
|
||||||
|
{
|
||||||
|
var advanced = Mode(advanced: true);
|
||||||
|
|
||||||
|
Assert.True(TrainsetDisplay.ListedIn(Consist(description: "-ai"), advanced, current: null));
|
||||||
|
Assert.True(TrainsetDisplay.ListedIn(Consist(driver: "nobody"), advanced, current: null));
|
||||||
|
|
||||||
|
advanced.ShowAiVehicles = false;
|
||||||
|
Assert.False(TrainsetDisplay.ListedIn(Consist(description: "-ai"), advanced, current: null));
|
||||||
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(eDriverType.Headdriver, 0)]
|
[InlineData(eDriverType.Headdriver, 0)]
|
||||||
[InlineData(eDriverType.Reardriver, 1)]
|
[InlineData(eDriverType.Reardriver, 1)]
|
||||||
|
|||||||
@@ -98,6 +98,23 @@ public class WarehouseEditTests
|
|||||||
Assert.Null(Stored("edit-changed"));
|
Assert.Null(Stored("edit-changed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_write_tells_the_list_the_name_and_the_entry_and_no_write_tells_nothing()
|
||||||
|
{
|
||||||
|
var told = new List<(string Name, string Entry)>();
|
||||||
|
_edit.Saved += (name, entry) => told.Add((name, entry));
|
||||||
|
var trainset = _edit.Open(Preset("edit-told"));
|
||||||
|
|
||||||
|
_edit.Save();
|
||||||
|
Assert.Empty(told);
|
||||||
|
|
||||||
|
trainset.Vehicles.Add(trainset.Vehicles[0].Clone());
|
||||||
|
_edit.Save();
|
||||||
|
|
||||||
|
Assert.Equal([("edit-told", ConsistText.Serialize(trainset))], told);
|
||||||
|
PresetStore.Delete("edit-told");
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Nothing_is_written_with_nothing_open()
|
public void Nothing_is_written_with_nothing_open()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,13 +63,12 @@ public sealed class AppServices
|
|||||||
SceneryFiles = new SceneryFileWatch(files, Sceneries, Library, State);
|
SceneryFiles = new SceneryFileWatch(files, Sceneries, Library, State);
|
||||||
|
|
||||||
Executables = new ExecutableLocator(files, paths, environment, log);
|
Executables = new ExecutableLocator(files, paths, environment, log);
|
||||||
SettingsStore = new SettingsStore(files, clock, log, settingsPaths, new SettingsSerializer(dlssPlatform: !environment.IsMacOS), Executables);
|
SettingsStore = new SettingsStore(files, clock, log, settingsPaths, new SettingsSerializer(), Executables);
|
||||||
MissingVehicleLog = new MissingVehicleLog(SettingsStore.Settings, missingAssets, Library, log);
|
MissingVehicleLog = new MissingVehicleLog(SettingsStore.Settings, missingAssets, Library, log);
|
||||||
Favorites = new FavoriteSceneries(files, log, settingsPaths.FavoritesPath());
|
Favorites = new FavoriteSceneries(files, log, settingsPaths.FavoritesPath());
|
||||||
Tapes = new HaslerTapes(files, paths, log, clock, Timetables, () => State.SimulatorRunning);
|
Tapes = new HaslerTapes(files, paths, log, clock, Timetables, () => State.SimulatorRunning);
|
||||||
Gpus = new LinuxGpus(files, environment);
|
Gpus = new LinuxGpus(files, environment);
|
||||||
GraphicsCards = new GraphicsCards(files, environment, Gpus);
|
GraphicsCards = new GraphicsCards(files, environment, Gpus);
|
||||||
Displays = new Displays(files, environment);
|
|
||||||
StartSimulation = new StartSimulation(State, SettingsStore, Library.Vehicles, Executables,
|
StartSimulation = new StartSimulation(State, SettingsStore, Library.Vehicles, Executables,
|
||||||
files, paths, Processes, random, log, Gpus, environment,
|
files, paths, Processes, random, log, Gpus, environment,
|
||||||
new WineConfigLink(files, environment, settingsPaths, log), Tapes);
|
new WineConfigLink(files, environment, settingsPaths, log), Tapes);
|
||||||
@@ -141,8 +140,6 @@ public sealed class AppServices
|
|||||||
|
|
||||||
public GraphicsCards GraphicsCards { get; }
|
public GraphicsCards GraphicsCards { get; }
|
||||||
|
|
||||||
public Displays Displays { get; }
|
|
||||||
|
|
||||||
public SettingsPaths SettingsPaths { get; }
|
public SettingsPaths SettingsPaths { get; }
|
||||||
|
|
||||||
public MissingVehicleLog MissingVehicleLog { get; }
|
public MissingVehicleLog MissingVehicleLog { get; }
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -75,6 +76,9 @@ public sealed class SettingsStore
|
|||||||
|
|
||||||
public string SavePath => _savePath;
|
public string SavePath => _savePath;
|
||||||
|
|
||||||
|
/// <summary>The last save found eu07.ini changed by something else and kept those changes: what is held was read again.</summary>
|
||||||
|
public bool LastSaveMerged { get; private set; }
|
||||||
|
|
||||||
public void RegisterCapture(ISettingsCapture capture) => _capture = capture;
|
public void RegisterCapture(ISettingsCapture capture) => _capture = capture;
|
||||||
|
|
||||||
public void Load()
|
public void Load()
|
||||||
@@ -92,9 +96,30 @@ public sealed class SettingsStore
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
GraphicsPreset.High.ApplyTo(Settings);
|
GraphicsPreset.High.ApplyTo(Settings);
|
||||||
|
// Nothing of an older starter to bring over: the settings start in the standard mode.
|
||||||
|
Settings.MovedToStandard = true;
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A copy of eu07.ini beside it, the file name and <paramref name="suffix"/>, before
|
||||||
|
/// something changes many keys at once; one already there is left as it is.
|
||||||
|
/// </summary>
|
||||||
|
public void KeepCopy(string suffix)
|
||||||
|
{
|
||||||
|
string path = string.IsNullOrEmpty(_savePath) ? _paths.UserConfigPath() : _savePath;
|
||||||
|
string copy = path + suffix;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_files.FileExists(path) && !_files.FileExists(copy))
|
||||||
|
_files.CopyFile(path, copy, overwrite: false);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_log.Log($"{copy} could not be made: {e.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadFrom(string path)
|
public void LoadFrom(string path)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -160,8 +185,30 @@ public sealed class SettingsStore
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Edited by other hands since it was read or written here: their file is what the changes
|
||||||
|
// go onto, so a key the player left alone keeps what was put there meanwhile.
|
||||||
|
bool merged = false;
|
||||||
|
if (string.Equals(path, _savePath, StringComparison.Ordinal) && IsConfigNewerOnDisk())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_config = ConfigFile.Parse(_files.ReadAllText(path, _encoding));
|
||||||
|
merged = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_log.Log($"re-reading {path} before saving", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ApplyChanges(_config, Changes(Settings));
|
ApplyChanges(_config, Changes(Settings));
|
||||||
|
if (merged)
|
||||||
|
{
|
||||||
|
// What is held follows the file: the player's changes and the others' together.
|
||||||
|
_serializer.Read(Settings, _config);
|
||||||
|
}
|
||||||
_synced = Render(Settings);
|
_synced = Render(Settings);
|
||||||
|
LastSaveMerged = merged;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -188,16 +235,8 @@ public sealed class SettingsStore
|
|||||||
else
|
else
|
||||||
config.Set(change.Key, change.After);
|
config.Set(change.Key, change.After);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each sets the mode as the simulator reads it, so the new one has to come later to count.
|
|
||||||
// Untouched, the two keep their order: moving them would change which one decides.
|
|
||||||
if (changes.Any(change => change.Key is "gfx.antialiasing" or "multisampling"))
|
|
||||||
config.MoveAfter("gfx.antialiasing", "multisampling");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Whether the simulator can have DLSS on this platform at all.</summary>
|
|
||||||
public bool DlssPlatform => _serializer.DlssPlatform;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Takes the settings of another eu07.ini (a backup, a file from another machine)
|
/// Takes the settings of another eu07.ini (a backup, a file from another machine)
|
||||||
/// into the current ones, keeping what belongs to this installation: the chosen
|
/// into the current ones, keeping what belongs to this installation: the chosen
|
||||||
@@ -223,9 +262,6 @@ public sealed class SettingsStore
|
|||||||
var gpu = s.Gpu;
|
var gpu = s.Gpu;
|
||||||
string lastScenery = s.LastScenery;
|
string lastScenery = s.LastScenery;
|
||||||
bool maximized = s.WindowMaximized;
|
bool maximized = s.WindowMaximized;
|
||||||
// Only read for the dependencies and never written, so they stay as this user's file has them.
|
|
||||||
bool cabLampLight = s.CabLampLight;
|
|
||||||
bool depthPrepassScene = s.DepthPrepassScene;
|
|
||||||
|
|
||||||
_serializer.Read(s, imported);
|
_serializer.Read(s, imported);
|
||||||
|
|
||||||
@@ -234,8 +270,6 @@ public sealed class SettingsStore
|
|||||||
s.Gpu = gpu;
|
s.Gpu = gpu;
|
||||||
s.LastScenery = lastScenery;
|
s.LastScenery = lastScenery;
|
||||||
s.WindowMaximized = maximized;
|
s.WindowMaximized = maximized;
|
||||||
s.CabLampLight = cabLampLight;
|
|
||||||
s.DepthPrepassScene = depthPrepassScene;
|
|
||||||
// an ini of before the tapes of the trains goes the same way as a profile
|
// an ini of before the tapes of the trains goes the same way as a profile
|
||||||
SettingsSerializer.MoveToTrainTapes(s);
|
SettingsSerializer.MoveToTrainTapes(s);
|
||||||
return true;
|
return true;
|
||||||
@@ -284,6 +318,86 @@ public sealed class SettingsStore
|
|||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The keys the starter knows that the file gives a value it cannot read, with that value:
|
||||||
|
/// the setting shows its default, while the file keeps its own until the setting is changed.
|
||||||
|
/// A value read another way (tak, 1.0, a clamped number) is no unknown one.
|
||||||
|
/// </summary>
|
||||||
|
public IReadOnlyDictionary<string, string> UnreadableValues()
|
||||||
|
{
|
||||||
|
var unreadable = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
var defaults = Render(WithFile(new ConfigFile()));
|
||||||
|
var read = Render(WithFile(_config));
|
||||||
|
var overCap = SettingsSerializer.OverCapKeys(_config);
|
||||||
|
foreach (var (key, fallback) in defaults)
|
||||||
|
{
|
||||||
|
// Read, only brought down to the cap.
|
||||||
|
if (NotReadAlone.Contains(key) || overCap.Contains(key))
|
||||||
|
continue;
|
||||||
|
if (_config.IsPastEnd(key) || _config.GetRaw(key) is not { Length: > 0 } raw)
|
||||||
|
continue;
|
||||||
|
if (read.TryGetValue(key, out string? shown) && shown == fallback && !SameValue(raw, shown))
|
||||||
|
unreadable[key] = raw;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var key in SimulatorKeys.All)
|
||||||
|
{
|
||||||
|
if (_config.IsPastEnd(key.Key) || _config.GetRaw(key.Key) is not { Length: > 0 } raw)
|
||||||
|
continue;
|
||||||
|
string first = raw.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries)[0];
|
||||||
|
bool readable = key.Kind switch
|
||||||
|
{
|
||||||
|
SimulatorKeyKind.Toggle => Bool(first) is not null,
|
||||||
|
SimulatorKeyKind.Number => double.TryParse(first, NumberStyles.Float, CultureInfo.InvariantCulture, out _),
|
||||||
|
_ => true
|
||||||
|
};
|
||||||
|
if (!readable)
|
||||||
|
unreadable[key.Key] = raw;
|
||||||
|
}
|
||||||
|
return unreadable;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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"
|
||||||
|
};
|
||||||
|
|
||||||
|
private SimulatorSettings WithFile(ConfigFile config)
|
||||||
|
{
|
||||||
|
var s = new SimulatorSettings();
|
||||||
|
_serializer.Read(s, config);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The same value in other words: yes and tak, 45 and 45.0.
|
||||||
|
private static bool SameValue(string raw, string shown)
|
||||||
|
{
|
||||||
|
var a = raw.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
var b = shown.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (a.Length != b.Length)
|
||||||
|
return false;
|
||||||
|
for (int i = 0; i < a.Length; i++)
|
||||||
|
{
|
||||||
|
if (string.Equals(a[i], b[i], StringComparison.OrdinalIgnoreCase))
|
||||||
|
continue;
|
||||||
|
if (double.TryParse(a[i], NumberStyles.Float, CultureInfo.InvariantCulture, out double x) &&
|
||||||
|
double.TryParse(b[i], NumberStyles.Float, CultureInfo.InvariantCulture, out double y) && x == y)
|
||||||
|
continue;
|
||||||
|
if (Bool(a[i]) is { } p && p == Bool(b[i]))
|
||||||
|
continue;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool? Bool(string word) => word.ToLowerInvariant() switch
|
||||||
|
{
|
||||||
|
"yes" or "true" or "1" or "tak" => true,
|
||||||
|
"no" or "false" or "0" or "nie" => false,
|
||||||
|
_ => null
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What saving <paramref name="settings"/> would change in the file: the keys
|
/// What saving <paramref name="settings"/> would change in the file: the keys
|
||||||
/// changed since it was read, those it lacks, and the ones no simulator reads.
|
/// changed since it was read, those it lacks, and the ones no simulator reads.
|
||||||
@@ -296,6 +410,8 @@ public sealed class SettingsStore
|
|||||||
var shown = _capture?.ShownUnlikeSettings ?? new Dictionary<string, ShownValue>();
|
var shown = _capture?.ShownUnlikeSettings ?? new Dictionary<string, ShownValue>();
|
||||||
var changes = new List<IniChange>();
|
var changes = new List<IniChange>();
|
||||||
var listed = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
var listed = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
// Above the starter's caps the file is brought down, though nothing on screen moved.
|
||||||
|
var overCap = SettingsSerializer.OverCapKeys(_config);
|
||||||
|
|
||||||
foreach (string key in SettingsSerializer.ObsoleteKeys)
|
foreach (string key in SettingsSerializer.ObsoleteKeys)
|
||||||
Add(key, null);
|
Add(key, null);
|
||||||
@@ -322,6 +438,14 @@ public sealed class SettingsStore
|
|||||||
return Uart.FeaturesStand(_config.GetRaw(key), value);
|
return Uart.FeaturesStand(_config.GetRaw(key), value);
|
||||||
if (SettingsSerializer.FixedLengthKeys.Contains(key, StringComparer.OrdinalIgnoreCase))
|
if (SettingsSerializer.FixedLengthKeys.Contains(key, StringComparer.OrdinalIgnoreCase))
|
||||||
return _config.GetRaw(key) == value;
|
return _config.GetRaw(key) == value;
|
||||||
|
if (string.Equals(key, "gfxrenderer", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
!SimulatorSettings.KeptRendererWord(_config.GetRaw(key)))
|
||||||
|
return false;
|
||||||
|
if (string.Equals(key, "mousescale", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
!SettingsSerializer.MouseScaleStands(_config.GetRaw(key)))
|
||||||
|
return false;
|
||||||
|
if (overCap.Contains(key))
|
||||||
|
return false;
|
||||||
string? synced = _synced.GetValueOrDefault(key);
|
string? synced = _synced.GetValueOrDefault(key);
|
||||||
if (shown.TryGetValue(key, out var onScreen) && onScreen.Shown == value && onScreen.Held == synced)
|
if (shown.TryGetValue(key, out var onScreen) && onScreen.Shown == value && onScreen.Held == synced)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -58,5 +58,9 @@ public sealed class WarehouseEdit
|
|||||||
|
|
||||||
PresetStore.Save(Name, entry);
|
PresetStore.Save(Name, entry);
|
||||||
_saved = entry;
|
_saved = entry;
|
||||||
|
Saved?.Invoke(Name, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>The consist was written under its name, with this entry - for the list showing it.</summary>
|
||||||
|
public event Action<string, string>? Saved;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ public sealed class ConfigFile
|
|||||||
// Its first line, or -1 when the file runs to its end.
|
// Its first line, or -1 when the file runs to its end.
|
||||||
private int _end = -1;
|
private int _end = -1;
|
||||||
|
|
||||||
|
// While lines are indexed: the one at hand starts inside a block comment.
|
||||||
|
private bool _inBlock;
|
||||||
|
|
||||||
public static ConfigFile Parse(string text)
|
public static ConfigFile Parse(string text)
|
||||||
{
|
{
|
||||||
var cfg = new ConfigFile();
|
var cfg = new ConfigFile();
|
||||||
@@ -37,7 +40,10 @@ public sealed class ConfigFile
|
|||||||
|
|
||||||
private void IndexLine(int line)
|
private void IndexLine(int line)
|
||||||
{
|
{
|
||||||
if (!TryParseKey(_lines[line], out string key))
|
// The simulator skips what /* */ encloses, over as many lines as it runs.
|
||||||
|
bool startsInBlock = _inBlock;
|
||||||
|
_inBlock = EndsInBlock(_lines[line], startsInBlock);
|
||||||
|
if (startsInBlock || !TryParseKey(_lines[line], out string key))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_end < 0 && key.Equals(EndKey, StringComparison.OrdinalIgnoreCase))
|
if (_end < 0 && key.Equals(EndKey, StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -52,6 +58,7 @@ public sealed class ConfigFile
|
|||||||
{
|
{
|
||||||
_index.Clear();
|
_index.Clear();
|
||||||
_end = -1;
|
_end = -1;
|
||||||
|
_inBlock = false;
|
||||||
for (int line = 0; line < _lines.Count; line++)
|
for (int line = 0; line < _lines.Count; line++)
|
||||||
IndexLine(line);
|
IndexLine(line);
|
||||||
}
|
}
|
||||||
@@ -252,17 +259,53 @@ public sealed class ConfigFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Where a comment starts as the simulator's parser sees one: // or /* anywhere, even glued
|
||||||
|
// to a value, but not within quotes, which it keeps whole.
|
||||||
private static int FindCommentStart(string body)
|
private static int FindCommentStart(string body)
|
||||||
{
|
{
|
||||||
for (int i = 0; i + 1 < body.Length; i++)
|
bool quoted = false;
|
||||||
|
for (int i = 0; i < body.Length; i++)
|
||||||
{
|
{
|
||||||
if (body[i] == '/' && body[i + 1] == '/' &&
|
if (body[i] == '"')
|
||||||
(i == 0 || char.IsWhiteSpace(body[i - 1])))
|
quoted = !quoted;
|
||||||
|
else if (!quoted && i + 1 < body.Length && body[i] == '/' && body[i + 1] is '/' or '*')
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whether a block comment is still open at the end of the line.
|
||||||
|
private static bool EndsInBlock(string raw, bool inBlock)
|
||||||
|
{
|
||||||
|
bool quoted = false;
|
||||||
|
for (int i = 0; i < raw.Length; i++)
|
||||||
|
{
|
||||||
|
if (inBlock)
|
||||||
|
{
|
||||||
|
if (raw[i] == '*' && i + 1 < raw.Length && raw[i + 1] == '/')
|
||||||
|
{
|
||||||
|
inBlock = false;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (raw[i] == '"')
|
||||||
|
quoted = !quoted;
|
||||||
|
else if (!quoted && raw[i] == '/' && i + 1 < raw.Length)
|
||||||
|
{
|
||||||
|
if (raw[i + 1] == '/')
|
||||||
|
return false;
|
||||||
|
if (raw[i + 1] == '*')
|
||||||
|
{
|
||||||
|
inBlock = true;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return inBlock;
|
||||||
|
}
|
||||||
|
|
||||||
private static int IndexOfWhitespace(string s)
|
private static int IndexOfWhitespace(string s)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < s.Length; i++)
|
for (int i = 0; i < s.Length; i++)
|
||||||
|
|||||||
@@ -19,11 +19,27 @@ public class SettingRow : ContentControl
|
|||||||
AvaloniaProperty.Register<SettingRow, string?>(nameof(ValueText));
|
AvaloniaProperty.Register<SettingRow, string?>(nameof(ValueText));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Why the simulator to be started would pass this setting over; the row dims
|
/// A setting for those who know what it does: the standard mode leaves it out, as
|
||||||
/// and says so. The input stays usable - the file may serve another build.
|
/// one a player can break the game with or has no need of.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly StyledProperty<string?> IdleNoteProperty =
|
public static readonly StyledProperty<bool> AdvancedProperty =
|
||||||
AvaloniaProperty.Register<SettingRow, string?>(nameof(IdleNote));
|
AvaloniaProperty.Register<SettingRow, bool>(nameof(Advanced));
|
||||||
|
|
||||||
|
public bool Advanced
|
||||||
|
{
|
||||||
|
get => GetValue(AdvancedProperty);
|
||||||
|
set => SetValue(AdvancedProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The value eu07.ini gives the setting that the starter cannot read, said under it; null when there is none.</summary>
|
||||||
|
public static readonly StyledProperty<string?> UnknownValueProperty =
|
||||||
|
AvaloniaProperty.Register<SettingRow, string?>(nameof(UnknownValue));
|
||||||
|
|
||||||
|
public string? UnknownValue
|
||||||
|
{
|
||||||
|
get => GetValue(UnknownValueProperty);
|
||||||
|
set => SetValue(UnknownValueProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public string? Label
|
public string? Label
|
||||||
{
|
{
|
||||||
@@ -49,12 +65,6 @@ public class SettingRow : ContentControl
|
|||||||
set => SetValue(ValueTextProperty, value);
|
set => SetValue(ValueTextProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string? IdleNote
|
|
||||||
{
|
|
||||||
get => GetValue(IdleNoteProperty);
|
|
||||||
set => SetValue(IdleNoteProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SettingRow()
|
public SettingRow()
|
||||||
{
|
{
|
||||||
UpdatePseudoClasses();
|
UpdatePseudoClasses();
|
||||||
@@ -68,22 +78,19 @@ public class SettingRow : ContentControl
|
|||||||
change.Property == DescriptionProperty ||
|
change.Property == DescriptionProperty ||
|
||||||
change.Property == ConfigKeyProperty ||
|
change.Property == ConfigKeyProperty ||
|
||||||
change.Property == ValueTextProperty ||
|
change.Property == ValueTextProperty ||
|
||||||
change.Property == IdleNoteProperty ||
|
change.Property == UnknownValueProperty ||
|
||||||
change.Property == ContentProperty)
|
change.Property == ContentProperty)
|
||||||
UpdatePseudoClasses();
|
UpdatePseudoClasses();
|
||||||
|
|
||||||
if (change.Property == IdleNoteProperty)
|
|
||||||
ToolTip.SetTip(this, string.IsNullOrEmpty(IdleNote) ? null : IdleNote);
|
|
||||||
|
|
||||||
if (change.Property == LabelProperty || change.Property == ContentProperty)
|
if (change.Property == LabelProperty || change.Property == ContentProperty)
|
||||||
ScreenReaderNames.NameInputs(Content, Label);
|
ScreenReaderNames.NameInputs(Content, Label);
|
||||||
|
|
||||||
if (change.Property == ValueTextProperty || change.Property == ContentProperty)
|
if (change.Property == ValueTextProperty || change.Property == ContentProperty)
|
||||||
ScreenReaderNames.TellValue(Content, ValueText);
|
ScreenReaderNames.TellValue(Content, ValueText);
|
||||||
|
|
||||||
if (change.Property == DescriptionProperty || change.Property == IdleNoteProperty ||
|
if (change.Property == DescriptionProperty || change.Property == UnknownValueProperty ||
|
||||||
change.Property == ContentProperty)
|
change.Property == ContentProperty)
|
||||||
ScreenReaderNames.DescribeInputs(Content, Description, IdleNote);
|
ScreenReaderNames.DescribeInputs(Content, Description, UnknownValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Again once in the window: a panel given as content may be filled after it was set.
|
// Again once in the window: a panel given as content may be filled after it was set.
|
||||||
@@ -92,7 +99,7 @@ public class SettingRow : ContentControl
|
|||||||
base.OnLoaded(e);
|
base.OnLoaded(e);
|
||||||
ScreenReaderNames.NameInputs(Content, Label);
|
ScreenReaderNames.NameInputs(Content, Label);
|
||||||
ScreenReaderNames.TellValue(Content, ValueText);
|
ScreenReaderNames.TellValue(Content, ValueText);
|
||||||
ScreenReaderNames.DescribeInputs(Content, Description, IdleNote);
|
ScreenReaderNames.DescribeInputs(Content, Description, UnknownValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePseudoClasses()
|
private void UpdatePseudoClasses()
|
||||||
@@ -102,6 +109,6 @@ public class SettingRow : ContentControl
|
|||||||
PseudoClasses.Set(":no-key", string.IsNullOrEmpty(ConfigKey));
|
PseudoClasses.Set(":no-key", string.IsNullOrEmpty(ConfigKey));
|
||||||
PseudoClasses.Set(":no-value", string.IsNullOrEmpty(ValueText));
|
PseudoClasses.Set(":no-value", string.IsNullOrEmpty(ValueText));
|
||||||
PseudoClasses.Set(":no-content", Content is null);
|
PseudoClasses.Set(":no-content", Content is null);
|
||||||
PseudoClasses.Set(":idle", !string.IsNullOrEmpty(IdleNote));
|
PseudoClasses.Set(":unknown", !string.IsNullOrEmpty(UnknownValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,16 @@ namespace StarterNG.Controls;
|
|||||||
|
|
||||||
public class SettingsSection : HeaderedContentControl
|
public class SettingsSection : HeaderedContentControl
|
||||||
{
|
{
|
||||||
|
/// <summary>Every row of the section is for the advanced mode only.</summary>
|
||||||
|
public static readonly StyledProperty<bool> AdvancedProperty =
|
||||||
|
AvaloniaProperty.Register<SettingsSection, bool>(nameof(Advanced));
|
||||||
|
|
||||||
|
public bool Advanced
|
||||||
|
{
|
||||||
|
get => GetValue(AdvancedProperty);
|
||||||
|
set => SetValue(AdvancedProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public static readonly StyledProperty<object?> ToggleProperty =
|
public static readonly StyledProperty<object?> ToggleProperty =
|
||||||
AvaloniaProperty.Register<SettingsSection, object?>(nameof(Toggle));
|
AvaloniaProperty.Register<SettingsSection, object?>(nameof(Toggle));
|
||||||
|
|
||||||
|
|||||||
42
StarterNG/Domain/ConsistRuns.cs
Normal file
42
StarterNG/Domain/ConsistRuns.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using StarterNG.Classes;
|
||||||
|
|
||||||
|
namespace StarterNG.Domain;
|
||||||
|
|
||||||
|
/// <summary>A stretch of a consist made of vehicles alike, shown as one picture with a count.</summary>
|
||||||
|
public sealed record ConsistRun(Dynamic First, int Count);
|
||||||
|
|
||||||
|
public static class ConsistRuns
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The consist's vehicles in order, those next to each other that look alike taken together.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="keyOf">
|
||||||
|
/// What makes two vehicles alike, given the vehicle and its place in the consist.
|
||||||
|
/// No key keeps the vehicle on its own.
|
||||||
|
/// </param>
|
||||||
|
public static List<ConsistRun> Of(IReadOnlyList<Dynamic> vehicles, Func<Dynamic, int, string?> keyOf)
|
||||||
|
{
|
||||||
|
var runs = new List<ConsistRun>();
|
||||||
|
string? prevKey = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < vehicles.Count; i++)
|
||||||
|
{
|
||||||
|
string? key = keyOf(vehicles[i], i);
|
||||||
|
if (key is not null && prevKey is not null && runs.Count > 0 &&
|
||||||
|
string.Equals(key, prevKey, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var last = runs[^1];
|
||||||
|
runs[^1] = last with { Count = last.Count + 1 };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
runs.Add(new ConsistRun(vehicles[i], 1));
|
||||||
|
}
|
||||||
|
prevKey = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
return runs;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,6 +64,13 @@ public enum SceneryFaultKind
|
|||||||
/// <summary>An include with no <c>end</c>, which swallows what follows it.</summary>
|
/// <summary>An include with no <c>end</c>, which swallows what follows it.</summary>
|
||||||
IncludeNotClosed,
|
IncludeNotClosed,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A vehicle whose <c>.fiz</c> is not in its folder under dynamic: the simulator
|
||||||
|
/// leaves it out, and its trainset runs short. <see cref="SceneryFault.Token"/>
|
||||||
|
/// names the file.
|
||||||
|
/// </summary>
|
||||||
|
VehicleMissing,
|
||||||
|
|
||||||
/// <summary>A trainset the starter could not read, for a reason none of the above names.</summary>
|
/// <summary>A trainset the starter could not read, for a reason none of the above names.</summary>
|
||||||
TrainsetUnreadable,
|
TrainsetUnreadable,
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ namespace StarterNG.Domain.Sceneries;
|
|||||||
/// include, so they are not loaded twice.
|
/// include, so they are not loaded twice.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Only the plain <c>include path end</c> form: an include with parameters needs
|
/// Only the plain <c>include path end</c> form, or <c>include path</c> as the last
|
||||||
/// them put in, and one whose <c>end</c> is not on its line is read by the
|
/// thing in the file, where the simulator runs out of words before it would
|
||||||
/// simulator in ways not worth guessing. One marked <c>$optional</c> stays too:
|
/// look for an <c>end</c>: an include with parameters needs them put in, and one
|
||||||
|
/// whose <c>end</c> is not on its line is read by the simulator in ways not worth guessing. One marked <c>$optional</c> stays too:
|
||||||
/// whether it is loaded is the player's to choose. Each inlined file is wrapped in
|
/// whether it is loaded is the player's to choose. Each inlined file is wrapped in
|
||||||
/// marker comments, which is how a trainset is told to belong to it.
|
/// marker comments, which is how a trainset is told to belong to it.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
@@ -29,7 +30,8 @@ public static class SceneryIncludes
|
|||||||
private static readonly Regex FirstInit = new(@"\bFirstInit\b", RegexOptions.IgnoreCase);
|
private static readonly Regex FirstInit = new(@"\bFirstInit\b", RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
private static readonly Regex Include = new(
|
private static readonly Regex Include = new(
|
||||||
@"^[ \t]*include[ \t]+(\S+)[ \t]+end\b[^\r\n]*", RegexOptions.Multiline | RegexOptions.IgnoreCase);
|
@"^[ \t]*include[ \t]+(\S+?)(?:[ \t]+end\b[^\r\n]*|[ \t]*(?://[^\r\n]*)?\s*\z)",
|
||||||
|
RegexOptions.Multiline | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
private static readonly Regex HasTrainset = new(@"^[ \t]*trainset\b", RegexOptions.Multiline | RegexOptions.IgnoreCase);
|
private static readonly Regex HasTrainset = new(@"^[ \t]*trainset\b", RegexOptions.Multiline | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,18 @@ public static class ScenerySyntax
|
|||||||
/// Whether the simulator opens an include, named as the include names it; null
|
/// Whether the simulator opens an include, named as the include names it; null
|
||||||
/// leaves includes unchecked.
|
/// leaves includes unchecked.
|
||||||
/// </param>
|
/// </param>
|
||||||
public static Result Scan(string text, string file, Func<string, bool>? opensInclude = null)
|
/// <param name="loadsVehicle">
|
||||||
|
/// Whether the simulator finds a vehicle's definition, by its folder under dynamic
|
||||||
|
/// and its .mmd's name, as the scenery writes them; null leaves vehicles unchecked.
|
||||||
|
/// </param>
|
||||||
|
public static Result Scan(string text, string file, Func<string, bool>? opensInclude = null,
|
||||||
|
Func<string, string, bool>? loadsVehicle = null)
|
||||||
{
|
{
|
||||||
string code = SceneryCode.Mask(text, out int unclosed);
|
string code = SceneryCode.Mask(text, out int unclosed);
|
||||||
var tokens = SceneryCode.Tokens(code);
|
var tokens = SceneryCode.Tokens(code);
|
||||||
var lines = new SceneryLines(text, file);
|
var lines = new SceneryLines(text, file);
|
||||||
|
|
||||||
var simulator = new Reading(tokens, lines, opensInclude, asSimulator: true);
|
var simulator = new Reading(tokens, lines, opensInclude, asSimulator: true, loadsVehicle);
|
||||||
simulator.Run();
|
simulator.Run();
|
||||||
var author = new Reading(tokens, lines, null, asSimulator: false);
|
var author = new Reading(tokens, lines, null, asSimulator: false);
|
||||||
author.Run();
|
author.Run();
|
||||||
@@ -110,7 +115,8 @@ public static class ScenerySyntax
|
|||||||
}
|
}
|
||||||
|
|
||||||
private sealed class Reading(
|
private sealed class Reading(
|
||||||
List<SceneryCode.Token> tokens, SceneryLines lines, Func<string, bool>? opensInclude, bool asSimulator)
|
List<SceneryCode.Token> tokens, SceneryLines lines, Func<string, bool>? opensInclude, bool asSimulator,
|
||||||
|
Func<string, string, bool>? loadsVehicle = null)
|
||||||
{
|
{
|
||||||
public readonly List<(int Start, int End, string Name)> Trainsets = new();
|
public readonly List<(int Start, int End, string Name)> Trainsets = new();
|
||||||
public readonly List<(int, int)> Loose = new();
|
public readonly List<(int, int)> Loose = new();
|
||||||
@@ -253,6 +259,9 @@ public static class ScenerySyntax
|
|||||||
return tokens.Count - 1;
|
return tokens.Count - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (complete)
|
||||||
|
Definition(at, name);
|
||||||
|
|
||||||
var (fault, trackless) = CheckFields(at, complete, inTrainset, name);
|
var (fault, trackless) = CheckFields(at, complete, inTrainset, name);
|
||||||
if (fault is null && !closed)
|
if (fault is null && !closed)
|
||||||
fault = SceneryFaultKind.VehicleNotClosed;
|
fault = SceneryFaultKind.VehicleNotClosed;
|
||||||
@@ -267,6 +276,16 @@ public static class ScenerySyntax
|
|||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Without its .fiz the simulator makes nothing of the vehicle, and reads on to the next.
|
||||||
|
private void Definition(int at, string name)
|
||||||
|
{
|
||||||
|
string folder = tokens[at + 5].Text;
|
||||||
|
string mmd = tokens[at + 7].Text;
|
||||||
|
if (loadsVehicle is null || !Plain(folder) || !Plain(mmd) || loadsVehicle(folder, mmd))
|
||||||
|
return;
|
||||||
|
Fault(SceneryFaultKind.VehicleMissing, tokens[at].Index, name, $"{folder}/{mmd}.fiz");
|
||||||
|
}
|
||||||
|
|
||||||
// As the author meant it: there to be listed, whatever is wrong with it.
|
// As the author meant it: there to be listed, whatever is wrong with it.
|
||||||
private int ListVehicle(int at, bool complete, bool closed, int meant)
|
private int ListVehicle(int at, bool complete, bool closed, int meant)
|
||||||
{
|
{
|
||||||
@@ -378,7 +397,8 @@ public static class ScenerySyntax
|
|||||||
while (end < tokens.Count && tokens[end].Text != "end")
|
while (end < tokens.Count && tokens[end].Text != "end")
|
||||||
end++;
|
end++;
|
||||||
int last = Math.Min(end, tokens.Count - 1);
|
int last = Math.Min(end, tokens.Count - 1);
|
||||||
if (Lost(at + 1, last) is not null)
|
// No "end" at all is a mistake too, even where the file runs out before it costs anything.
|
||||||
|
if (end >= tokens.Count || Lost(at + 1, last) is not null)
|
||||||
Fault(SceneryFaultKind.IncludeNotClosed, token.Index, token: name, swallowed: (at + 1, last));
|
Fault(SceneryFaultKind.IncludeNotClosed, token.Index, token: name, swallowed: (at + 1, last));
|
||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace StarterNG.Domain.Settings;
|
namespace StarterNG.Domain.Settings;
|
||||||
@@ -40,176 +39,42 @@ public sealed record GraphicsExtras(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What only Ultra sets, switches and limits with no scale to climb. Not every best is the
|
/// What only Ultra sets, with no scale to climb: the longest shadows, at the bottom of their
|
||||||
/// top of a scale: shadows are longest with the limit at its bottom, the regulator and the
|
/// limit, and the screens drawn. What only the advanced mode shows no level sets.
|
||||||
/// release of textures would only take away, off.
|
|
||||||
/// Left to the player, picture unchanged: separate windows for the screens
|
|
||||||
/// (python.displaywindows, python.vsync), texture streaming, the frame pacing.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ShadowAngleLimit">gfx.shadow.angle.min: how low the sun counts for shadows, so how long they
|
/// <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>
|
/// get: up to 5× the height of what casts them at 0.2, no longer than it at 1 (opengl33renderer.cpp).</param>
|
||||||
/// <param name="TargetFps">targetfps: above 0 the simulator moves the distance factor by itself.</param>
|
/// <param name="Screens">python.enabled.</param>
|
||||||
/// <param name="ScreenWindowFps">python.fpslimit: read only by the screens' separate windows
|
public sealed record GraphicsTop(double ShadowAngleLimit, bool Screens)
|
||||||
/// (pythonscreenviewer.cpp), it does nothing without them.</param>
|
|
||||||
/// <param name="TextureRelease">gfx.textures.releasedistance: above 0 textures of far vehicles leave the card.</param>
|
|
||||||
/// <param name="CompressTextures">compresstex: on saves card memory at a cost to the picture.</param>
|
|
||||||
/// <param name="SkipDecor">starter.ignoreirrelevant: on leaves decorative consists out of the scenario.</param>
|
|
||||||
public sealed record GraphicsTop(
|
|
||||||
double ShadowAngleLimit,
|
|
||||||
double TargetFps,
|
|
||||||
double ScreenWindowFps,
|
|
||||||
double TextureRelease,
|
|
||||||
bool Screens,
|
|
||||||
bool ScreenMipmaps,
|
|
||||||
bool CompressTextures,
|
|
||||||
bool SkipDecor,
|
|
||||||
bool Sky,
|
|
||||||
bool Cab,
|
|
||||||
bool AirCouplers,
|
|
||||||
bool SmoothTraction)
|
|
||||||
{
|
{
|
||||||
public const string TargetFpsKey = "targetfps";
|
|
||||||
public const string ScreenWindowFpsKey = "python.fpslimit";
|
|
||||||
public const string TextureReleaseKey = "gfx.textures.releasedistance";
|
|
||||||
public const string SkyKey = "skyenabled";
|
|
||||||
public const string CabKey = "rendercab";
|
|
||||||
public const string AirCouplersKey = "newaircouplers";
|
|
||||||
public const string SmoothTractionKey = "smoothtraction";
|
|
||||||
|
|
||||||
/// <summary>Those of its keys shown as rows of <see cref="SimulatorKeys"/>.</summary>
|
|
||||||
public static readonly IReadOnlyList<string> RowKeys = new[]
|
|
||||||
{
|
|
||||||
TargetFpsKey, ScreenWindowFpsKey, TextureReleaseKey, SkyKey, CabKey, AirCouplersKey, SmoothTractionKey
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>The eu07.ini keys these values live in.</summary>
|
/// <summary>The eu07.ini keys these values live in.</summary>
|
||||||
public static readonly IReadOnlyList<string> Keys = RowKeys.Concat(new[]
|
public static readonly IReadOnlyList<string> Keys = new[] { "gfx.shadow.angle.min", "python.enabled" };
|
||||||
{
|
|
||||||
"gfx.shadow.angle.min", "python.enabled", "python.mipmaps", "compresstex", "starter.ignoreirrelevant"
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
/// <summary>What they are with nothing set, as <see cref="GraphicsExtras.None"/>.</summary>
|
/// <summary>What they are with nothing set, as <see cref="GraphicsExtras.None"/>.</summary>
|
||||||
public static readonly GraphicsTop None =
|
public static readonly GraphicsTop None = new(0.2, true);
|
||||||
new(0.2, 0, 100, 0, true, true, true, false, true, true, true, true);
|
|
||||||
|
|
||||||
public static GraphicsTop Of(SimulatorSettings s) =>
|
public static GraphicsTop Of(SimulatorSettings s) => new(s.ShadowAngleLimit, s.PythonScreens);
|
||||||
new(s.ShadowAngleLimit, GraphicsPreset.NumberOf(s, TargetFpsKey),
|
|
||||||
GraphicsPreset.NumberOf(s, ScreenWindowFpsKey), GraphicsPreset.NumberOf(s, TextureReleaseKey),
|
|
||||||
s.PythonScreens, s.ScreenMipmaps, s.CompressTextures, s.IgnoreIrrelevantTrains,
|
|
||||||
GraphicsPreset.ToggleOf(s, SkyKey), GraphicsPreset.ToggleOf(s, CabKey),
|
|
||||||
GraphicsPreset.ToggleOf(s, AirCouplersKey), GraphicsPreset.ToggleOf(s, SmoothTractionKey));
|
|
||||||
|
|
||||||
public void ApplyTo(SimulatorSettings s)
|
public void ApplyTo(SimulatorSettings s)
|
||||||
{
|
{
|
||||||
void Number(string key, double value) => s.Extra[key] = value.ToString(CultureInfo.InvariantCulture);
|
|
||||||
void Toggle(string key, bool value) => s.Extra[key] = SimulatorKey.FormatToggle(value);
|
|
||||||
|
|
||||||
s.ShadowAngleLimit = ShadowAngleLimit;
|
s.ShadowAngleLimit = ShadowAngleLimit;
|
||||||
Number(TargetFpsKey, TargetFps);
|
|
||||||
Number(ScreenWindowFpsKey, ScreenWindowFps);
|
|
||||||
Number(TextureReleaseKey, TextureRelease);
|
|
||||||
s.PythonScreens = Screens;
|
s.PythonScreens = Screens;
|
||||||
s.ScreenMipmaps = ScreenMipmaps;
|
|
||||||
s.CompressTextures = CompressTextures;
|
|
||||||
s.IgnoreIrrelevantTrains = SkipDecor;
|
|
||||||
Toggle(SkyKey, Sky);
|
|
||||||
Toggle(CabKey, Cab);
|
|
||||||
Toggle(AirCouplersKey, AirCouplers);
|
|
||||||
Toggle(SmoothTractionKey, SmoothTraction);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// What only the simulators with the OpenGL 4.6 and Vulkan 1.4 renderers read, the others pass it
|
|
||||||
/// over. High is what they do with nothing set. Left to the player: frame generation, Reflex, the
|
|
||||||
/// choice of the card, automatic exposure, the fitted cascades and the bounced light of the cab.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="CabProbeInterval">gfx.cabprobe.interval, in frames: the lower the dearer.</param>
|
|
||||||
/// <param name="RayTracing">gfx.raytracing: the Vulkan renderer's alone, off on OpenGL.</param>
|
|
||||||
public sealed record GraphicsNewRenderer(
|
|
||||||
int LampShadows,
|
|
||||||
int ContactShadows,
|
|
||||||
int Occlusion,
|
|
||||||
int OcclusionSlices,
|
|
||||||
int OcclusionSteps,
|
|
||||||
bool OcclusionLighting,
|
|
||||||
int CabProbe,
|
|
||||||
int CabProbeInterval,
|
|
||||||
bool CabProbeReflections,
|
|
||||||
int ScreenReflections,
|
|
||||||
bool RayTracing,
|
|
||||||
bool VolumetricFog,
|
|
||||||
int FogQuality,
|
|
||||||
int Clouds,
|
|
||||||
bool CloudShadows,
|
|
||||||
bool Grass,
|
|
||||||
int GrassDistance,
|
|
||||||
double GrassDensity,
|
|
||||||
int Precipitation,
|
|
||||||
bool Bloom)
|
|
||||||
{
|
|
||||||
/// <summary>The eu07.ini keys these values live in; the fade of the grass follows its distance.</summary>
|
|
||||||
public static readonly IReadOnlyList<string> Keys = new[]
|
|
||||||
{
|
|
||||||
"gfx.lights.shadows", "gfx.contactshadows", "gfx.postfx.ao", "gfx.postfx.ao.quality", "gfx.postfx.ao.lighting",
|
|
||||||
"gfx.cabprobe", "gfx.cabprobe.interval", "gfx.cabprobe.reflections", "gfx.ssr", "gfx.raytracing",
|
|
||||||
"gfx.fog", "gfx.fog.quality", "gfx.clouds", "gfx.clouds.shadows",
|
|
||||||
"gfx.grass", "gfx.grass.distance", "gfx.grass.fadedistance", "gfx.grass.density",
|
|
||||||
"gfx.precipitation.particles", "gfx.postfx.bloom"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static GraphicsNewRenderer Of(SimulatorSettings s) =>
|
|
||||||
new(s.LightShadows, s.ContactShadows, s.AmbientOcclusion, s.AoSlices, s.AoSteps, s.AoLighting,
|
|
||||||
s.CabProbe, s.CabProbeInterval, s.CabProbeReflections, s.Ssr, s.RayTracing,
|
|
||||||
s.VolumetricFog, s.FogQuality, s.Clouds, s.CloudShadows,
|
|
||||||
s.Grass, s.GrassDistance, s.GrassDensity, s.PrecipitationParticles, s.Bloom);
|
|
||||||
|
|
||||||
/// <summary>This level as it lands on <paramref name="s"/>: ray tracing on Vulkan only.</summary>
|
|
||||||
public GraphicsNewRenderer For(SimulatorSettings s) =>
|
|
||||||
GraphicsRules.RayTracingAllowed(s) ? this : this with { RayTracing = false };
|
|
||||||
|
|
||||||
public void ApplyTo(SimulatorSettings s)
|
|
||||||
{
|
|
||||||
s.LightShadows = LampShadows;
|
|
||||||
s.ContactShadows = ContactShadows;
|
|
||||||
s.AmbientOcclusion = Occlusion;
|
|
||||||
s.AoSlices = OcclusionSlices;
|
|
||||||
s.AoSteps = OcclusionSteps;
|
|
||||||
s.AoLighting = OcclusionLighting;
|
|
||||||
s.CabProbe = CabProbe;
|
|
||||||
s.CabProbeInterval = CabProbeInterval;
|
|
||||||
s.CabProbeReflections = CabProbeReflections;
|
|
||||||
s.Ssr = ScreenReflections;
|
|
||||||
s.RayTracing = RayTracing && GraphicsRules.RayTracingAllowed(s);
|
|
||||||
s.VolumetricFog = VolumetricFog;
|
|
||||||
s.FogQuality = FogQuality;
|
|
||||||
s.Clouds = Clouds;
|
|
||||||
s.CloudShadows = CloudShadows;
|
|
||||||
s.Grass = Grass;
|
|
||||||
s.GrassDistance = GrassDistance;
|
|
||||||
s.GrassDensity = GrassDensity;
|
|
||||||
s.PrecipitationParticles = Precipitation;
|
|
||||||
s.Bloom = Bloom;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A level of detail set in one go: what weighs on the graphics card. Every scale climbs in
|
/// 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
|
/// even steps from <see cref="Minimal"/> to <see cref="Ultra"/>, as far as it has steps for six
|
||||||
/// levels. The screen (resolution, field of view), the frame pacing and the effects that are a
|
/// levels. A level sets only what the standard mode shows, and only to what its sliders offer
|
||||||
/// matter of taste - motion blur, chromatic aberration - stay as they are, except at the
|
/// (<see cref="SliderRanges"/>, the old starter's ranges): never past the old starter. The screen
|
||||||
/// two ends of the scale, which have <see cref="Extras"/>.
|
/// (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"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="NameKey">Its name's translation key.</param>
|
/// <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="CabShadowsRange">gfx.shadows.cab.range, in metres, read only by the legacy renderer.</param>
|
||||||
/// <param name="AntiAliasing">Multisampling, as older simulators read it too. DLSS, once on, stays: no level does better.</param>
|
/// <param name="AntiAliasing">multisampling.</param>
|
||||||
/// <param name="ReflectionsRate">gfx.reflections.framerate, in updates a second.</param>
|
/// <param name="ReflectionsRate">gfx.reflections.framerate, in updates a second, one of the old starter's steps.</param>
|
||||||
/// <param name="DrawRange">basedrawrange, in metres. Below 2000 it changes nothing on screen: the renderer
|
|
||||||
/// keeps at least that for signals and lights (opengl33renderer.cpp).</param>
|
|
||||||
/// <param name="DistanceFactor">heightbase: the only thing that draws less than those 2 km, and draws
|
|
||||||
/// shapes, wires and sections nearer. A regulating targetfps moves it from there.</param>
|
|
||||||
/// <param name="BufferScale">starter.bufferscale, in percent. Above the screen over High: on a 4K one
|
|
||||||
/// Ultra is a picture of 8K, multisampled on top.</param>
|
|
||||||
/// <param name="DrawRangeFactor">gfx.drawrange.factor.max: how far the regulator may stretch the draw range.</param>
|
/// <param name="DrawRangeFactor">gfx.drawrange.factor.max: how far the regulator may stretch the draw range.</param>
|
||||||
public sealed record GraphicsPreset(
|
public sealed record GraphicsPreset(
|
||||||
string NameKey,
|
string NameKey,
|
||||||
@@ -228,122 +93,73 @@ public sealed record GraphicsPreset(
|
|||||||
double ReflectionsRate,
|
double ReflectionsRate,
|
||||||
bool ExtraEffects,
|
bool ExtraEffects,
|
||||||
int SplineFidelity,
|
int SplineFidelity,
|
||||||
double DrawRange,
|
|
||||||
double DistanceFactor,
|
|
||||||
int BufferScale,
|
|
||||||
double SleeperDistance,
|
|
||||||
double DrawRangeFactor,
|
double DrawRangeFactor,
|
||||||
double ReflectedInstances,
|
|
||||||
double ReflectedVehicles,
|
|
||||||
int CabShadowsRange,
|
int CabShadowsRange,
|
||||||
GraphicsNewRenderer NewRenderer,
|
|
||||||
GraphicsExtras? Extras = null,
|
GraphicsExtras? Extras = null,
|
||||||
GraphicsTop? Top = null)
|
GraphicsTop? Top = null)
|
||||||
{
|
{
|
||||||
public const string DrawRangeKey = "basedrawrange";
|
|
||||||
public const string DistanceFactorKey = "heightbase";
|
|
||||||
public const string SleeperKey = "sleeperdistance";
|
|
||||||
public const string ReflectedInstancesKey = "gfx.reflections.range_instances";
|
|
||||||
public const string ReflectedVehiclesKey = "gfx.reflections.range_vehicles";
|
|
||||||
|
|
||||||
/// <summary>Those of its keys shown as rows of <see cref="SimulatorKeys"/>.</summary>
|
|
||||||
public static readonly IReadOnlyList<string> RowKeys = new[]
|
|
||||||
{
|
|
||||||
DrawRangeKey, DistanceFactorKey, SleeperKey, ReflectedInstancesKey, ReflectedVehiclesKey
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>The eu07.ini keys a level sets.</summary>
|
/// <summary>The eu07.ini keys a level sets.</summary>
|
||||||
public static readonly IReadOnlyList<string> Keys = new[]
|
public static readonly IReadOnlyList<string> Keys = new[]
|
||||||
{
|
{
|
||||||
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering", "multisampling", "gfx.antialiasing", "dynamiclights",
|
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering", "multisampling", "dynamiclights",
|
||||||
"gfx.smoke.fidelity", "shadows", "gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff",
|
"gfx.smoke.fidelity", "shadows", "gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff",
|
||||||
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.extraeffects",
|
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate", "gfx.extraeffects",
|
||||||
"splinefidelity", DrawRangeKey, DistanceFactorKey, "starter.bufferscale", "gfx.buffer.percent", SleeperKey,
|
"splinefidelity", "gfx.drawrange.factor.max", "gfx.shadows.cab.range"
|
||||||
"gfx.drawrange.factor.max", ReflectedInstancesKey, ReflectedVehiclesKey, "gfx.shadows.cab.range"
|
};
|
||||||
}.Concat(GraphicsNewRenderer.Keys).ToList();
|
|
||||||
|
|
||||||
/// <summary>The last resort: no shadows, no reflections, no effects, no smoke, a softer picture.</summary>
|
/// <summary>The last resort: no shadows, no reflections, no effects, no smoke.</summary>
|
||||||
public static readonly GraphicsPreset Minimal = new(
|
public static readonly GraphicsPreset Minimal = new(
|
||||||
"PresetMinimal", TextureSize: 512, CabTextureSize: 512, Anisotropy: 1, AntiAliasing: AntiAliasingMode.Off,
|
"PresetMinimal", TextureSize: 512, CabTextureSize: 512, Anisotropy: 1, AntiAliasing: AntiAliasingMode.Off,
|
||||||
DynamicLights: 1, SmokeFidelity: 1, Shadows: false, ShadowMap: 512, ShadowRange: 75, ShadowRank: 1,
|
DynamicLights: 1, SmokeFidelity: 1, Shadows: false, ShadowMap: 1024, ShadowRange: 75, ShadowRank: 1,
|
||||||
EnvMap: false, ReflectionsFidelity: 0, ReflectionsRate: 1 / 300.0, ExtraEffects: false,
|
EnvMap: false, ReflectionsFidelity: 0, ReflectionsRate: 1, ExtraEffects: false,
|
||||||
SplineFidelity: 1, DrawRange: 2000, DistanceFactor: 0.6, BufferScale: 70,
|
SplineFidelity: 1, DrawRangeFactor: 1, CabShadowsRange: 0,
|
||||||
SleeperDistance: 100, DrawRangeFactor: 1, ReflectedInstances: 250, ReflectedVehicles: 50, CabShadowsRange: 0,
|
|
||||||
NewRenderer: new GraphicsNewRenderer(LampShadows: 0, ContactShadows: 0, Occlusion: 0, OcclusionSlices: 2, OcclusionSteps: 3,
|
|
||||||
OcclusionLighting: false, CabProbe: 0, CabProbeInterval: 8, CabProbeReflections: false, ScreenReflections: 0,
|
|
||||||
RayTracing: false, VolumetricFog: false, FogQuality: 1, Clouds: 0, CloudShadows: false, Grass: false,
|
|
||||||
GrassDistance: 30, GrassDensity: 0.25, Precipitation: 16384, Bloom: false),
|
|
||||||
Extras: new GraphicsExtras(MotionBlur: false, ChromaticAberration: false, Smoke: false, PythonUpdateMs: 800));
|
Extras: new GraphicsExtras(MotionBlur: false, ChromaticAberration: false, Smoke: false, PythonUpdateMs: 800));
|
||||||
|
|
||||||
public static readonly GraphicsPreset Low = new(
|
public static readonly GraphicsPreset Low = new(
|
||||||
"PresetLow", TextureSize: 1024, CabTextureSize: 1024, Anisotropy: 2, AntiAliasing: AntiAliasingMode.Off,
|
"PresetLow", TextureSize: 1024, CabTextureSize: 1024, Anisotropy: 2, AntiAliasing: AntiAliasingMode.Off,
|
||||||
DynamicLights: 3, SmokeFidelity: 1, Shadows: true, ShadowMap: 1024, ShadowRange: 125, ShadowRank: 2,
|
DynamicLights: 3, SmokeFidelity: 1, Shadows: true, ShadowMap: 1024, ShadowRange: 125, ShadowRank: 2,
|
||||||
EnvMap: true, ReflectionsFidelity: 0, ReflectionsRate: 1 / 60.0, ExtraEffects: true,
|
EnvMap: true, ReflectionsFidelity: 0, ReflectionsRate: 1, ExtraEffects: true,
|
||||||
SplineFidelity: 1, DrawRange: 2000, DistanceFactor: 0.7, BufferScale: 80,
|
SplineFidelity: 2, DrawRangeFactor: 1, CabShadowsRange: 0);
|
||||||
SleeperDistance: 150, DrawRangeFactor: 1.5, ReflectedInstances: 400, ReflectedVehicles: 100, CabShadowsRange: 0,
|
|
||||||
NewRenderer: new GraphicsNewRenderer(LampShadows: 1, ContactShadows: 0, Occlusion: 1, OcclusionSlices: 2, OcclusionSteps: 3,
|
|
||||||
OcclusionLighting: false, CabProbe: 0, CabProbeInterval: 8, CabProbeReflections: false, ScreenReflections: 1,
|
|
||||||
RayTracing: false, VolumetricFog: true, FogQuality: 1, Clouds: 1, CloudShadows: false, Grass: true,
|
|
||||||
GrassDistance: 40, GrassDensity: 0.5, Precipitation: 32768, Bloom: true));
|
|
||||||
|
|
||||||
public static readonly GraphicsPreset Medium = new(
|
public static readonly GraphicsPreset Medium = new(
|
||||||
"PresetMedium", TextureSize: 2048, CabTextureSize: 2048, Anisotropy: 4, AntiAliasing: AntiAliasingMode.Msaa2,
|
"PresetMedium", TextureSize: 2048, CabTextureSize: 2048, Anisotropy: 4, AntiAliasing: AntiAliasingMode.Msaa2,
|
||||||
DynamicLights: 5, SmokeFidelity: 2, Shadows: true, ShadowMap: 1024, ShadowRange: 175, ShadowRank: 2,
|
DynamicLights: 5, SmokeFidelity: 2, Shadows: true, ShadowMap: 1024, ShadowRange: 175, ShadowRank: 2,
|
||||||
EnvMap: true, ReflectionsFidelity: 1, ReflectionsRate: 1 / 30.0, ExtraEffects: true,
|
EnvMap: true, ReflectionsFidelity: 1, ReflectionsRate: 1, ExtraEffects: true,
|
||||||
SplineFidelity: 2, DrawRange: 2250, DistanceFactor: 0.85, BufferScale: 90,
|
SplineFidelity: 2, DrawRangeFactor: 2, CabShadowsRange: 20);
|
||||||
SleeperDistance: 200, DrawRangeFactor: 2, ReflectedInstances: 550, ReflectedVehicles: 150, CabShadowsRange: 20,
|
|
||||||
NewRenderer: new GraphicsNewRenderer(LampShadows: 1, ContactShadows: 0, Occlusion: 1, OcclusionSlices: 3, OcclusionSteps: 4,
|
|
||||||
OcclusionLighting: false, CabProbe: 1, CabProbeInterval: 8, CabProbeReflections: true, ScreenReflections: 1,
|
|
||||||
RayTracing: false, VolumetricFog: true, FogQuality: 1, Clouds: 1, CloudShadows: true, Grass: true,
|
|
||||||
GrassDistance: 50, GrassDensity: 0.75, Precipitation: 32768, Bloom: true));
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Where a player with no settings of their own starts. The simulator's own values (Globals.h),
|
/// 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
|
/// but for smoke, track curves, reflections and cab shadows: theirs are the bottom of a scale
|
||||||
/// with levels to go under this one.
|
/// with levels to go under this one, or below what the old starter offered.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly GraphicsPreset High = new(
|
public static readonly GraphicsPreset High = new(
|
||||||
"PresetHigh", TextureSize: 4096, CabTextureSize: 4096, Anisotropy: 8, AntiAliasing: AntiAliasingMode.Msaa4,
|
"PresetHigh", TextureSize: 4096, CabTextureSize: 4096, Anisotropy: 8, AntiAliasing: AntiAliasingMode.Msaa4,
|
||||||
DynamicLights: 7, SmokeFidelity: 2, Shadows: true, ShadowMap: 2048, ShadowRange: 250, ShadowRank: 3,
|
DynamicLights: 7, SmokeFidelity: 2, Shadows: true, ShadowMap: 2048, ShadowRange: 250, ShadowRank: 3,
|
||||||
EnvMap: true, ReflectionsFidelity: 1, ReflectionsRate: 0.1, ExtraEffects: true,
|
EnvMap: true, ReflectionsFidelity: 1, ReflectionsRate: 3, ExtraEffects: true,
|
||||||
SplineFidelity: 2, DrawRange: 2500, DistanceFactor: 1, BufferScale: 100,
|
SplineFidelity: 2, DrawRangeFactor: 3, CabShadowsRange: 30);
|
||||||
SleeperDistance: 250, DrawRangeFactor: 3, ReflectedInstances: 750, ReflectedVehicles: 250, CabShadowsRange: 40,
|
|
||||||
NewRenderer: new GraphicsNewRenderer(LampShadows: 2, ContactShadows: 0, Occlusion: 2, OcclusionSlices: 3, OcclusionSteps: 4,
|
|
||||||
OcclusionLighting: true, CabProbe: 2, CabProbeInterval: 4, CabProbeReflections: true, ScreenReflections: 2,
|
|
||||||
RayTracing: false, VolumetricFog: true, FogQuality: 2, Clouds: 2, CloudShadows: true, Grass: true,
|
|
||||||
GrassDistance: 60, GrassDensity: 1, Precipitation: 65536, Bloom: true));
|
|
||||||
|
|
||||||
/// <summary>For a strong card. A map of 4096 doubles the cascades, so the range here reaches 800 m.</summary>
|
|
||||||
public static readonly GraphicsPreset VeryHigh = new(
|
|
||||||
"PresetVeryHigh", TextureSize: 8192, CabTextureSize: 8192, Anisotropy: 16, AntiAliasing: AntiAliasingMode.Msaa8,
|
|
||||||
DynamicLights: 7, SmokeFidelity: 3, Shadows: true, ShadowMap: 4096, ShadowRange: 400, ShadowRank: 3,
|
|
||||||
EnvMap: true, ReflectionsFidelity: 2, ReflectionsRate: 2, ExtraEffects: true,
|
|
||||||
SplineFidelity: 3, DrawRange: 5000, DistanceFactor: 2, BufferScale: 150,
|
|
||||||
SleeperDistance: 2000, DrawRangeFactor: 3, ReflectedInstances: 1500, ReflectedVehicles: 1000, CabShadowsRange: 70,
|
|
||||||
NewRenderer: new GraphicsNewRenderer(LampShadows: 3, ContactShadows: 2, Occlusion: 2, OcclusionSlices: 4, OcclusionSteps: 6,
|
|
||||||
OcclusionLighting: true, CabProbe: 3, CabProbeInterval: 3, CabProbeReflections: true, ScreenReflections: 3,
|
|
||||||
RayTracing: false, VolumetricFog: true, FogQuality: 3, Clouds: 3, CloudShadows: true, Grass: true,
|
|
||||||
GrassDistance: 120, GrassDensity: 1.5, Precipitation: 131072, Bloom: true));
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Every value at the top of what the screen offers. Not the best picture throughout: a map
|
/// For a strong card. A map of 4096 doubles the cascades, so the range here reaches 800 m.
|
||||||
/// of 8192 stretches the cascades fourfold, so shadows reach 2400 m but are coarser up close
|
/// Filtering stays as High's, so the textures tell this level from Ultra.
|
||||||
/// than at <see cref="VeryHigh"/>.
|
/// </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);
|
||||||
|
|
||||||
|
/// <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>
|
/// </summary>
|
||||||
public static readonly GraphicsPreset Ultra = new(
|
public static readonly GraphicsPreset Ultra = new(
|
||||||
"PresetUltra", TextureSize: 8192, CabTextureSize: 8192, Anisotropy: 16, AntiAliasing: AntiAliasingMode.Msaa8,
|
"PresetUltra", TextureSize: 8192, CabTextureSize: 4096, Anisotropy: 16, AntiAliasing: AntiAliasingMode.Msaa8,
|
||||||
DynamicLights: 7, SmokeFidelity: 4, Shadows: true, ShadowMap: 8192, ShadowRange: 600, ShadowRank: 3,
|
DynamicLights: 7, SmokeFidelity: 4, Shadows: true, ShadowMap: 8192, ShadowRange: 400, ShadowRank: 3,
|
||||||
EnvMap: true, ReflectionsFidelity: 2, ReflectionsRate: 60, ExtraEffects: true,
|
EnvMap: true, ReflectionsFidelity: 2, ReflectionsRate: 60, ExtraEffects: true,
|
||||||
SplineFidelity: 4, DrawRange: 10000, DistanceFactor: 3, BufferScale: 200,
|
SplineFidelity: 4, DrawRangeFactor: 3, CabShadowsRange: 100,
|
||||||
SleeperDistance: 5000, DrawRangeFactor: 3, ReflectedInstances: 3000, ReflectedVehicles: 2000, CabShadowsRange: 100,
|
|
||||||
NewRenderer: new GraphicsNewRenderer(LampShadows: 3, ContactShadows: 3, Occlusion: 2, OcclusionSlices: 6, OcclusionSteps: 8,
|
|
||||||
OcclusionLighting: true, CabProbe: 3, CabProbeInterval: 2, CabProbeReflections: true, ScreenReflections: 3,
|
|
||||||
RayTracing: true, VolumetricFog: true, FogQuality: 4, Clouds: 4, CloudShadows: true, Grass: true,
|
|
||||||
GrassDistance: 300, GrassDensity: 2, Precipitation: 262144, Bloom: true),
|
|
||||||
Extras: new GraphicsExtras(MotionBlur: true, ChromaticAberration: true, Smoke: true, PythonUpdateMs: 200),
|
Extras: new GraphicsExtras(MotionBlur: true, ChromaticAberration: true, Smoke: true, PythonUpdateMs: 200),
|
||||||
Top: new GraphicsTop(ShadowAngleLimit: 0.2, TargetFps: 0, ScreenWindowFps: 200, TextureRelease: 0,
|
Top: new GraphicsTop(ShadowAngleLimit: 0.2, Screens: true));
|
||||||
Screens: true, ScreenMipmaps: true, CompressTextures: false, SkipDecor: false,
|
|
||||||
Sky: true, Cab: true, AirCouplers: true, SmoothTraction: true));
|
|
||||||
|
|
||||||
public static readonly IReadOnlyList<GraphicsPreset> All = new[] { Minimal, Low, Medium, High, VeryHigh, Ultra };
|
public static readonly IReadOnlyList<GraphicsPreset> All = new[] { Minimal, Low, Medium, High, VeryHigh, Ultra };
|
||||||
|
|
||||||
@@ -352,8 +168,7 @@ public sealed record GraphicsPreset(
|
|||||||
s.MaxTextureSize = TextureSize;
|
s.MaxTextureSize = TextureSize;
|
||||||
s.MaxCabTextureSize = CabTextureSize;
|
s.MaxCabTextureSize = CabTextureSize;
|
||||||
s.TextureFiltering = Anisotropy;
|
s.TextureFiltering = Anisotropy;
|
||||||
if (!GraphicsRules.IsDlss(s.AntiAliasing))
|
s.AntiAliasing = AntiAliasing;
|
||||||
s.AntiAliasing = AntiAliasing;
|
|
||||||
s.CabShadowsRange = CabShadowsRange;
|
s.CabShadowsRange = CabShadowsRange;
|
||||||
s.DynamicLights = DynamicLights;
|
s.DynamicLights = DynamicLights;
|
||||||
s.SmokeFidelity = SmokeFidelity;
|
s.SmokeFidelity = SmokeFidelity;
|
||||||
@@ -366,14 +181,7 @@ public sealed record GraphicsPreset(
|
|||||||
s.ReflectionsFramerate = ReflectionsRate;
|
s.ReflectionsFramerate = ReflectionsRate;
|
||||||
s.ExtraEffects = ExtraEffects;
|
s.ExtraEffects = ExtraEffects;
|
||||||
s.SplineFidelity = SplineFidelity;
|
s.SplineFidelity = SplineFidelity;
|
||||||
s.Extra[DrawRangeKey] = DrawRange.ToString(CultureInfo.InvariantCulture);
|
|
||||||
s.Extra[DistanceFactorKey] = DistanceFactor.ToString(CultureInfo.InvariantCulture);
|
|
||||||
s.BufferScalePercent = BufferScale;
|
|
||||||
s.Extra[SleeperKey] = SleeperDistance.ToString(CultureInfo.InvariantCulture);
|
|
||||||
s.DrawRangeFactor = DrawRangeFactor;
|
s.DrawRangeFactor = DrawRangeFactor;
|
||||||
s.Extra[ReflectedInstancesKey] = ReflectedInstances.ToString(CultureInfo.InvariantCulture);
|
|
||||||
s.Extra[ReflectedVehiclesKey] = ReflectedVehicles.ToString(CultureInfo.InvariantCulture);
|
|
||||||
NewRenderer.ApplyTo(s);
|
|
||||||
Extras?.ApplyTo(s);
|
Extras?.ApplyTo(s);
|
||||||
Top?.ApplyTo(s);
|
Top?.ApplyTo(s);
|
||||||
}
|
}
|
||||||
@@ -381,20 +189,14 @@ public sealed record GraphicsPreset(
|
|||||||
/// <summary>Whether <paramref name="s"/> is at this level throughout.</summary>
|
/// <summary>Whether <paramref name="s"/> is at this level throughout.</summary>
|
||||||
public bool Matches(SimulatorSettings s) =>
|
public bool Matches(SimulatorSettings s) =>
|
||||||
s.MaxTextureSize == TextureSize && s.MaxCabTextureSize == CabTextureSize &&
|
s.MaxTextureSize == TextureSize && s.MaxCabTextureSize == CabTextureSize &&
|
||||||
Near(s.TextureFiltering, Anisotropy) && (GraphicsRules.IsDlss(s.AntiAliasing) || s.AntiAliasing == AntiAliasing) &&
|
Near(s.TextureFiltering, Anisotropy) && s.AntiAliasing == AntiAliasing &&
|
||||||
s.DynamicLights == DynamicLights && s.SmokeFidelity == SmokeFidelity &&
|
s.DynamicLights == DynamicLights && s.SmokeFidelity == SmokeFidelity &&
|
||||||
s.RenderShadows == Shadows && s.ShadowMapResolution == ShadowMap &&
|
s.RenderShadows == Shadows && s.ShadowMapResolution == ShadowMap &&
|
||||||
s.ShadowProjectionRange == ShadowRange && s.ShadowRankCutoff == ShadowRank &&
|
s.ShadowProjectionRange == ShadowRange && s.ShadowRankCutoff == ShadowRank &&
|
||||||
s.EnvMap == EnvMap && s.ReflectionsFidelity == ReflectionsFidelity &&
|
s.EnvMap == EnvMap && s.ReflectionsFidelity == ReflectionsFidelity &&
|
||||||
Near(s.ReflectionsFramerate, ReflectionsRate) && s.ExtraEffects == ExtraEffects &&
|
Near(s.ReflectionsFramerate, ReflectionsRate) && s.ExtraEffects == ExtraEffects &&
|
||||||
s.SplineFidelity == SplineFidelity && Near(NumberOf(s, DrawRangeKey), DrawRange) &&
|
s.SplineFidelity == SplineFidelity && Near(s.DrawRangeFactor, DrawRangeFactor) &&
|
||||||
Near(NumberOf(s, DistanceFactorKey), DistanceFactor) &&
|
|
||||||
s.BufferScalePercent == BufferScale &&
|
|
||||||
Near(NumberOf(s, SleeperKey), SleeperDistance) && Near(s.DrawRangeFactor, DrawRangeFactor) &&
|
|
||||||
Near(NumberOf(s, ReflectedInstancesKey), ReflectedInstances) &&
|
|
||||||
Near(NumberOf(s, ReflectedVehiclesKey), ReflectedVehicles) &&
|
|
||||||
s.CabShadowsRange == CabShadowsRange &&
|
s.CabShadowsRange == CabShadowsRange &&
|
||||||
GraphicsNewRenderer.Of(s) == NewRenderer.For(s) &&
|
|
||||||
(Extras is null || GraphicsExtras.Of(s) == Extras) &&
|
(Extras is null || GraphicsExtras.Of(s) == Extras) &&
|
||||||
(Top is null || GraphicsTop.Of(s) == Top);
|
(Top is null || GraphicsTop.Of(s) == Top);
|
||||||
|
|
||||||
@@ -407,31 +209,23 @@ public sealed record GraphicsPreset(
|
|||||||
return key.ParseNumber(key.RawIn(s));
|
return key.ParseNumber(key.RawIn(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool ToggleOf(SimulatorSettings s, string name) =>
|
// As the file rounds it.
|
||||||
SimulatorKey.ParseToggle(SimulatorKeys.Named(name).RawIn(s));
|
|
||||||
|
|
||||||
// As the file rounds it: 1/300 comes back as 0.003333.
|
|
||||||
private static bool Near(double value, double target) =>
|
private static bool Near(double value, double target) =>
|
||||||
Math.Abs(value - target) <= Math.Abs(target) * 2e-4 + 1e-9;
|
Math.Abs(value - target) <= Math.Abs(target) * 2e-4 + 1e-9;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A part of the picture with a level of its own, as its section on the screen has it. The rest
|
/// 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 buffer, the anti-aliasing, the post-processing switches, the frame pacing, the sky and the cab - goes only with the whole.
|
/// of a level - the anti-aliasing, the post-processing switches, the dynamic lights and the smoke - goes only with the whole.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Keys">The eu07.ini keys it sets.</param>
|
/// <param name="Keys">The eu07.ini keys it sets.</param>
|
||||||
public sealed record GraphicsGroup(IReadOnlyList<string> Keys)
|
public sealed record GraphicsGroup(IReadOnlyList<string> Keys)
|
||||||
{
|
{
|
||||||
public static readonly GraphicsGroup DrawRange = new(new[]
|
public static readonly GraphicsGroup DrawRange = new(new[] { "splinefidelity", "gfx.drawrange.factor.max" });
|
||||||
{
|
|
||||||
GraphicsPreset.DrawRangeKey, GraphicsPreset.DistanceFactorKey, "splinefidelity",
|
|
||||||
GraphicsPreset.SleeperKey, "gfx.drawrange.factor.max"
|
|
||||||
});
|
|
||||||
|
|
||||||
public static readonly GraphicsGroup Textures = new(new[]
|
public static readonly GraphicsGroup Textures = new(new[]
|
||||||
{
|
{
|
||||||
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering",
|
"maxtexturesize", "maxcabtexturesize", "anisotropicfiltering"
|
||||||
"compresstex", GraphicsTop.TextureReleaseKey
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly GraphicsGroup Shadows = new(new[]
|
public static readonly GraphicsGroup Shadows = new(new[]
|
||||||
@@ -439,39 +233,20 @@ public sealed record GraphicsGroup(IReadOnlyList<string> Keys)
|
|||||||
"shadows", "gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff", "gfx.shadow.angle.min", "gfx.shadows.cab.range"
|
"shadows", "gfx.shadowmap.enabled", "shadowtune", "gfx.shadow.rank.cutoff", "gfx.shadow.angle.min", "gfx.shadows.cab.range"
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly GraphicsGroup Lights = new(new[]
|
|
||||||
{
|
|
||||||
"dynamiclights", "gfx.lights.shadows", "gfx.contactshadows", "gfx.postfx.ao", "gfx.postfx.ao.quality",
|
|
||||||
"gfx.postfx.ao.lighting", "gfx.cabprobe", "gfx.cabprobe.interval", "gfx.cabprobe.reflections"
|
|
||||||
});
|
|
||||||
|
|
||||||
public static readonly GraphicsGroup Reflections = new(new[]
|
public static readonly GraphicsGroup Reflections = new(new[]
|
||||||
{
|
{
|
||||||
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate",
|
"gfx.envmap.enabled", "gfx.reflections.fidelity", "gfx.reflections.framerate"
|
||||||
GraphicsPreset.ReflectedInstancesKey, GraphicsPreset.ReflectedVehiclesKey, "gfx.ssr", "gfx.raytracing"
|
|
||||||
});
|
|
||||||
|
|
||||||
public static readonly GraphicsGroup Atmosphere = new(new[]
|
|
||||||
{
|
|
||||||
"gfx.fog", "gfx.fog.quality", "gfx.clouds", "gfx.clouds.shadows"
|
|
||||||
});
|
|
||||||
|
|
||||||
public static readonly GraphicsGroup Nature = new(new[]
|
|
||||||
{
|
|
||||||
"gfx.grass", "gfx.grass.distance", "gfx.grass.fadedistance", "gfx.grass.density",
|
|
||||||
"gfx.smoke", "gfx.smoke.fidelity", "gfx.precipitation.particles"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly IReadOnlyList<GraphicsGroup> All = new[]
|
public static readonly IReadOnlyList<GraphicsGroup> All = new[]
|
||||||
{
|
{
|
||||||
DrawRange, Textures, Shadows, Lights, Reflections, Atmosphere, Nature
|
DrawRange, Textures, Shadows, Reflections
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>What applying a level touched.</summary>
|
/// <summary>What applying a level touched.</summary>
|
||||||
/// <param name="RowKeys">The keys of <see cref="SimulatorKeys"/> rows to show its values in, in that order.</param>
|
|
||||||
/// <param name="ChosenKeys">The eu07.ini keys it chose as a whole.</param>
|
/// <param name="ChosenKeys">The eu07.ini keys it chose as a whole.</param>
|
||||||
public sealed record PresetApplied(IReadOnlyList<string> RowKeys, IReadOnlyList<string> ChosenKeys);
|
public sealed record PresetApplied(IReadOnlyList<string> ChosenKeys);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remembers what was there before an end of the scale, which comes back with any level
|
/// Remembers what was there before an end of the scale, which comes back with any level
|
||||||
@@ -498,15 +273,11 @@ public sealed class GraphicsPresetMemory
|
|||||||
comingTop?.ApplyTo(settings);
|
comingTop?.ApplyTo(settings);
|
||||||
preset.ApplyTo(settings);
|
preset.ApplyTo(settings);
|
||||||
|
|
||||||
var rows = new List<string>(GraphicsPreset.RowKeys);
|
|
||||||
var chosen = new List<string>(GraphicsPreset.Keys);
|
var chosen = new List<string>(GraphicsPreset.Keys);
|
||||||
if (preset.Extras is not null || coming is not null)
|
if (preset.Extras is not null || coming is not null)
|
||||||
chosen.AddRange(GraphicsExtras.Keys);
|
chosen.AddRange(GraphicsExtras.Keys);
|
||||||
if (preset.Top is not null || comingTop is not null)
|
if (preset.Top is not null || comingTop is not null)
|
||||||
{
|
|
||||||
chosen.AddRange(GraphicsTop.Keys);
|
chosen.AddRange(GraphicsTop.Keys);
|
||||||
rows.AddRange(GraphicsTop.RowKeys);
|
return new PresetApplied(chosen);
|
||||||
}
|
|
||||||
return new PresetApplied(rows, chosen);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,115 +1,32 @@
|
|||||||
namespace StarterNG.Domain.Settings;
|
namespace StarterNG.Domain.Settings;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What the simulator does with combinations of graphics settings, mirrored here so
|
/// What the simulator does with graphics values, mirrored here so the starter writes
|
||||||
/// the starter only offers what takes effect and writes eu07.ini the way the
|
/// eu07.ini the way the simulator will run it (utilities/Globals.cpp), and how far the
|
||||||
/// simulator will run it (utilities/Globals.cpp, rendering/vulkan14, rendering/opengl46).
|
/// starter lets them go: no further than the old starter did (MaSzyna-EU07/Starter).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class GraphicsRules
|
public static class GraphicsRules
|
||||||
{
|
{
|
||||||
public static bool IsDlss(AntiAliasingMode mode) => mode is AntiAliasingMode.Dlss or AntiAliasingMode.Dlaa;
|
/// <summary>maxcabtexturesize: the old starter's list ended at 4096.</summary>
|
||||||
|
public const int MaxCabTextureSize = 4096;
|
||||||
|
|
||||||
public static bool IsTemporal(AntiAliasingMode mode) => mode == AntiAliasingMode.Taa || IsDlss(mode);
|
/// <summary>The projection range of shadowtune: the old starter's list ended at 400.</summary>
|
||||||
|
public const int MaxShadowRange = 400;
|
||||||
public static bool IsVulkan(SimulatorSettings s) => s.Backend == GraphicsBackend.Vulkan;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DLSS is the Vulkan renderer's only (the OpenGL one takes TAA instead), and the
|
/// The frame buffer, in percent of the window. The old starter's choice of buffer
|
||||||
/// DLSS SDK has no macOS libraries.
|
/// (gfx.framebuffer.fidelity) is not read by the simulator, so it always had the window's size.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool DlssAllowed(SimulatorSettings s, bool dlssPlatform) => dlssPlatform && IsVulkan(s);
|
public const int MaxBufferScale = 100;
|
||||||
|
|
||||||
public static bool DlssActive(SimulatorSettings s, bool dlssPlatform) =>
|
/// <summary>Brings the values within the ranges the simulator clamps them to, and the starter's caps.</summary>
|
||||||
DlssAllowed(s, dlssPlatform) && IsDlss(s.AntiAliasing);
|
public static void Normalize(SimulatorSettings s)
|
||||||
|
|
||||||
/// <summary>The frame generation goes with gfx.antialiasing dlss or dlaa, nothing else.</summary>
|
|
||||||
public static bool FrameGenerationAllowed(SimulatorSettings s, bool dlssPlatform) => DlssActive(s, dlssPlatform);
|
|
||||||
|
|
||||||
/// <summary>Reflex (VK_NV_low_latency2) is the Vulkan renderer's only.</summary>
|
|
||||||
public static bool ReflexAllowed(SimulatorSettings s) => IsVulkan(s);
|
|
||||||
|
|
||||||
/// <summary>The frame generation turns Reflex on whatever gfx.reflex says.</summary>
|
|
||||||
public static bool ReflexForced(SimulatorSettings s, bool dlssPlatform) =>
|
|
||||||
FrameGenerationAllowed(s, dlssPlatform) && s.FrameGeneration > 1;
|
|
||||||
|
|
||||||
/// <summary>Ray traced reflections: the Vulkan renderer on a GPU with ray queries.</summary>
|
|
||||||
public static bool RayTracingAllowed(SimulatorSettings s) => IsVulkan(s);
|
|
||||||
|
|
||||||
/// <summary>The render scale is ignored by DLAA, which always draws at the size of the window.</summary>
|
|
||||||
public static bool BufferScaleUsed(SimulatorSettings s, bool dlssPlatform) =>
|
|
||||||
!(DlssActive(s, dlssPlatform) && s.AntiAliasing == AntiAliasingMode.Dlaa);
|
|
||||||
|
|
||||||
/// <summary>TAA and DLSS run in the post-processing which gfx.skippipeline leaves out.</summary>
|
|
||||||
public static bool TemporalWithoutPipeline(SimulatorSettings s) => s.SkipPipeline && IsTemporal(s.AntiAliasing);
|
|
||||||
|
|
||||||
/// <summary>With the clustered lights the headlights come from the clusters; dynamiclights only caps the old path.</summary>
|
|
||||||
public static bool DynamicLightsUsed(SimulatorSettings s) => !s.LightsClustered;
|
|
||||||
|
|
||||||
/// <summary>The ambient occlusion goes into the lighting only with GTAO.</summary>
|
|
||||||
public static bool AoLightingUsed(SimulatorSettings s) => s.AmbientOcclusion == 2;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The AO in the lighting needs the depth of the whole scene drawn before its colour. SSR, contact
|
|
||||||
/// shadows and gfx.depthprepass.scene draw it anyway; without them it is an extra pass (CPU time on OpenGL).
|
|
||||||
/// </summary>
|
|
||||||
public static bool AoLightingAddsDepthPrepass(SimulatorSettings s) =>
|
|
||||||
AoLightingUsed(s) && s.AoLighting && s.Ssr == 0 && s.ContactShadows == 0 && !s.DepthPrepassScene;
|
|
||||||
|
|
||||||
public static bool CabProbeUsed(SimulatorSettings s) => s.CabProbe > 0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The light bounced around the cab comes from the cab lamp as a light, which needs the clustered lights
|
|
||||||
/// and gfx.lights.cab; without them the probe gives the reflections only.
|
|
||||||
/// </summary>
|
|
||||||
public static bool CabProbeLights(SimulatorSettings s) => CabProbeUsed(s) && s.LightsClustered && s.CabLampLight;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Brings the settings to what the simulator would run with: the Vulkan-only
|
|
||||||
/// features off on OpenGL, DLSS falling back to TAA, values within the ranges
|
|
||||||
/// the simulator clamps them to.
|
|
||||||
/// </summary>
|
|
||||||
public static void Normalize(SimulatorSettings s, bool dlssPlatform)
|
|
||||||
{
|
{
|
||||||
if (IsDlss(s.AntiAliasing) && !DlssAllowed(s, dlssPlatform))
|
|
||||||
s.AntiAliasing = AntiAliasingMode.Taa;
|
|
||||||
|
|
||||||
s.FrameGeneration = FrameGenerationAllowed(s, dlssPlatform) ? Clamp(s.FrameGeneration, 1, 4) : 1;
|
|
||||||
s.Reflex = ReflexAllowed(s) ? Clamp(s.Reflex, 0, 2) : 0;
|
|
||||||
if (!RayTracingAllowed(s))
|
|
||||||
s.RayTracing = false;
|
|
||||||
|
|
||||||
if (!IsKnownDlssPreset(s.DlssPreset))
|
|
||||||
s.DlssPreset = "default";
|
|
||||||
|
|
||||||
s.MaxTextureSize = PowerOfTwo(s.MaxTextureSize, 64, 8192);
|
s.MaxTextureSize = PowerOfTwo(s.MaxTextureSize, 64, 8192);
|
||||||
s.MaxCabTextureSize = PowerOfTwo(s.MaxCabTextureSize, 512, 8192);
|
s.MaxCabTextureSize = PowerOfTwo(s.MaxCabTextureSize, 512, MaxCabTextureSize);
|
||||||
s.ShadowMapResolution = PowerOfTwo(s.ShadowMapResolution, 512, 8192);
|
s.ShadowMapResolution = PowerOfTwo(s.ShadowMapResolution, 512, 8192);
|
||||||
s.BufferScalePercent = Clamp(s.BufferScalePercent, 25, 200);
|
s.ShadowProjectionRange = s.ShadowProjectionRange > MaxShadowRange ? MaxShadowRange : s.ShadowProjectionRange;
|
||||||
s.LightShadows = Clamp(s.LightShadows, 0, 3);
|
s.BufferScalePercent = Clamp(s.BufferScalePercent, 25, MaxBufferScale);
|
||||||
s.ContactShadows = Clamp(s.ContactShadows, 0, 3);
|
|
||||||
s.AmbientOcclusion = Clamp(s.AmbientOcclusion, 0, 2);
|
|
||||||
s.AoSlices = Clamp(s.AoSlices, 1, 8);
|
|
||||||
s.AoSteps = Clamp(s.AoSteps, 1, 16);
|
|
||||||
s.CabProbe = Clamp(s.CabProbe, 0, 3);
|
|
||||||
s.CabProbeInterval = Clamp(s.CabProbeInterval, 1, 120);
|
|
||||||
s.CabProbeBounce = s.CabProbeBounce < 0 ? 0 : (s.CabProbeBounce > 4 ? 4 : s.CabProbeBounce);
|
|
||||||
s.Ssr = Clamp(s.Ssr, 0, 3);
|
|
||||||
s.RayTracingRange = Clamp(s.RayTracingRange, 10, 5000);
|
|
||||||
s.FogQuality = Clamp(s.FogQuality, 1, 4);
|
|
||||||
s.Clouds = Clamp(s.Clouds, 0, 4);
|
|
||||||
s.GrassDistance = Clamp(s.GrassDistance, 5, 500);
|
|
||||||
s.GrassDensity = s.GrassDensity < 0 ? 0 : (s.GrassDensity > 4 ? 4 : s.GrassDensity);
|
|
||||||
s.PrecipitationParticles = Clamp(s.PrecipitationParticles, 0, 1 << 20);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly string[] DlssPresets = { "default", "j", "k", "l", "m" };
|
|
||||||
|
|
||||||
public static bool IsKnownDlssPreset(string? preset)
|
|
||||||
{
|
|
||||||
foreach (string known in DlssPresets)
|
|
||||||
if (string.Equals(known, preset, System.StringComparison.OrdinalIgnoreCase))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int Clamp(int v, int lo, int hi) => v < lo ? lo : (v > hi ? hi : v);
|
private static int Clamp(int v, int lo, int hi) => v < lo ? lo : (v > hi ? hi : v);
|
||||||
|
|||||||
14
StarterNG/Domain/Settings/Renderers.cs
Normal file
14
StarterNG/Domain/Settings/Renderers.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
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
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace StarterNG.Domain.Settings;
|
|
||||||
|
|
||||||
/// <summary>Why the simulator about to be started would pass a key over.</summary>
|
|
||||||
public enum IdleReason
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
WindowsBuildOnly,
|
|
||||||
LegacyRendererOnly,
|
|
||||||
/// <summary>Read by the full OpenGL renderer alone.</summary>
|
|
||||||
ModernRendererOnly,
|
|
||||||
/// <summary>Read by the OpenGL renderers, which the experimental one is not.</summary>
|
|
||||||
OpenGlRenderersOnly,
|
|
||||||
NeedsNetworkServer,
|
|
||||||
/// <summary>The draw range is only stretched by the frame rate regulator, which is off.</summary>
|
|
||||||
NeedsFrameRateTarget,
|
|
||||||
/// <summary>fullscreenwindowed takes the monitor's own mode instead.</summary>
|
|
||||||
MonitorModeInstead,
|
|
||||||
VulkanOnly
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>What about the simulator to be started decides which keys it heeds.</summary>
|
|
||||||
/// <param name="WindowsBuild">The executable is a Windows build, under Wine or not.</param>
|
|
||||||
/// <param name="Renderer">The gfxrenderer word, as <see cref="SimulatorSettings.RenderEngines"/> has it.</param>
|
|
||||||
/// <param name="NetworkServer">eu07.ini starts a network.server.</param>
|
|
||||||
/// <param name="TargetFps">targetfps as eu07.ini sets it, or null where it does not.</param>
|
|
||||||
/// <param name="FpsAverage">fpsaverage, the older regulator's target; 0 for none.</param>
|
|
||||||
/// <param name="FullscreenWindowed">fullscreenwindowed is on.</param>
|
|
||||||
public sealed record SimulatorTarget(bool WindowsBuild, string Renderer, bool NetworkServer,
|
|
||||||
double? TargetFps = null, double FpsAverage = 0,
|
|
||||||
bool FullscreenWindowed = false);
|
|
||||||
|
|
||||||
/// <summary>The renderers a gfxrenderer word picks, as application.cpp tells them apart.</summary>
|
|
||||||
public enum RendererKind { Modern, Legacy, Experimental }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Where an eu07.ini key takes effect, from the simulator's sources: a key it
|
|
||||||
/// reads but leaves alone on the platform, render path or setup at hand.
|
|
||||||
/// </summary>
|
|
||||||
public static class SettingReach
|
|
||||||
{
|
|
||||||
// The keyboard lights, LPT and PoKeys behind feedback live in Console.cpp,
|
|
||||||
// which only the Windows build compiles; the system console and ANGLE are
|
|
||||||
// Windows-only in application.cpp.
|
|
||||||
private static readonly HashSet<string> WindowsBuildOnly = new(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
"feedbackmode", "feedbackport", "showsystemconsole", "gfx.angleplatform"
|
|
||||||
};
|
|
||||||
|
|
||||||
// Read by openglrenderer.cpp alone; the modern path forces VBOs on.
|
|
||||||
private static readonly HashSet<string> LegacyRendererOnly = new(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
"smoothtraction", "gfx.shadows.cab.range", "usevbo"
|
|
||||||
};
|
|
||||||
|
|
||||||
// Read by opengl33renderer.cpp and the shaders it builds (glsl_common.cpp) alone.
|
|
||||||
private static readonly HashSet<string> ModernRendererOnly = new(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
"gfx.postfx.chromaticaberration.enabled", "gfx.postfx.motionblur.enabled",
|
|
||||||
"gfx.postfx.motionblur.shutter", "gfx.extraeffects", "gfx.envmap.enabled", "gfx.skippipeline",
|
|
||||||
"rendercab", "sleeperdistance"
|
|
||||||
};
|
|
||||||
|
|
||||||
// Read by both OpenGL renderers but not by the experimental one, which sets its
|
|
||||||
// own anisotropy, draws no smoke and has no frame rate regulator.
|
|
||||||
private static readonly HashSet<string> OpenGlRenderersOnly = new(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
"anisotropicfiltering", "multisampling", "dynamiclights", "gfx.smoke", "gfx.smoke.fidelity",
|
|
||||||
"gfx.reflections.framerate", "gfx.reflections.range_vehicles", "gfx.shadow.angle.min",
|
|
||||||
"scalespeculars", "gfx.drawrange.factor.max"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static readonly HashSet<string> VulkanRendererOnly = new(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
"gfx.dlss.preset", "gfx.framegeneration", "gfx.reflex", "gfx.raytracing", "gfx.raytracing.range", "gfx.vulkan.device"
|
|
||||||
};
|
|
||||||
|
|
||||||
// application.cpp: fullscreenwindowed takes its size from the monitor and always
|
|
||||||
// goes full screen. "width, height" is how the settings screen names that row.
|
|
||||||
private static readonly HashSet<string> OverriddenByMonitorMode = new(StringComparer.OrdinalIgnoreCase)
|
|
||||||
{
|
|
||||||
"width, height", "fullscreen"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static IdleReason Why(string key, SimulatorTarget target)
|
|
||||||
{
|
|
||||||
// The starter's own keys mean nothing to any simulator, and need not.
|
|
||||||
if (key.StartsWith("starter.", StringComparison.OrdinalIgnoreCase))
|
|
||||||
return IdleReason.None;
|
|
||||||
if (WindowsBuildOnly.Contains(key) && !target.WindowsBuild)
|
|
||||||
return IdleReason.WindowsBuildOnly;
|
|
||||||
if (OverriddenByMonitorMode.Contains(key) && target.FullscreenWindowed)
|
|
||||||
return IdleReason.MonitorModeInstead;
|
|
||||||
|
|
||||||
var renderer = KindOf(target.Renderer);
|
|
||||||
if (LegacyRendererOnly.Contains(key) && renderer != RendererKind.Legacy)
|
|
||||||
return IdleReason.LegacyRendererOnly;
|
|
||||||
if (ModernRendererOnly.Contains(key) && renderer != RendererKind.Modern)
|
|
||||||
return IdleReason.ModernRendererOnly;
|
|
||||||
if (OpenGlRenderersOnly.Contains(key) && renderer == RendererKind.Experimental)
|
|
||||||
return IdleReason.OpenGlRenderersOnly;
|
|
||||||
if (VulkanRendererOnly.Contains(key) && !IsVulkan(target.Renderer))
|
|
||||||
return IdleReason.VulkanOnly;
|
|
||||||
|
|
||||||
// on_focus_change pauses only a simulator that serves the network.
|
|
||||||
if (string.Equals(key, "inactivepause", StringComparison.OrdinalIgnoreCase) && !target.NetworkServer)
|
|
||||||
return IdleReason.NeedsNetworkServer;
|
|
||||||
if (string.Equals(key, "gfx.drawrange.factor.max", StringComparison.OrdinalIgnoreCase) &&
|
|
||||||
!DrawRangeRegulated(target))
|
|
||||||
return IdleReason.NeedsFrameRateTarget;
|
|
||||||
return IdleReason.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Whether the renderer moves the draw range with the frame rate - the only use
|
|
||||||
/// of gfx.drawrange.factor.max: targetfps does it, as the older fpsaverage does.
|
|
||||||
/// </summary>
|
|
||||||
private static bool DrawRangeRegulated(SimulatorTarget target) =>
|
|
||||||
target.FpsAverage != 0 || (target.TargetFps ?? 0) != 0;
|
|
||||||
|
|
||||||
/// <summary>"full", its other names and the Vulkan renderer are the modern kind, "experimental" its own; every other word the legacy one.</summary>
|
|
||||||
public static RendererKind KindOf(string renderer) => renderer.ToLowerInvariant() switch
|
|
||||||
{
|
|
||||||
"full" or "default" or "opengl" or "gl46" or "vulkan" or "vulkan14" => RendererKind.Modern,
|
|
||||||
"experimental" => RendererKind.Experimental,
|
|
||||||
_ => RendererKind.Legacy
|
|
||||||
};
|
|
||||||
|
|
||||||
public static bool IsVulkan(string renderer) => renderer.ToLowerInvariant() is "vulkan" or "vulkan14";
|
|
||||||
}
|
|
||||||
@@ -63,6 +63,12 @@ public sealed record SimulatorKey(
|
|||||||
|
|
||||||
public static class SimulatorKeys
|
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.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly IReadOnlySet<string> Standard = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
public const string General = "general";
|
public const string General = "general";
|
||||||
public const string Graphics = "graphics";
|
public const string Graphics = "graphics";
|
||||||
public const string Sound = "sound";
|
public const string Sound = "sound";
|
||||||
@@ -94,13 +100,12 @@ public static class SimulatorKeys
|
|||||||
Toggle("loadinglog", false, General, "IniSectionInterface"),
|
Toggle("loadinglog", false, General, "IniSectionInterface"),
|
||||||
Toggle("captureonstart", true, General, "IniSectionInterface"),
|
Toggle("captureonstart", true, General, "IniSectionInterface"),
|
||||||
Toggle("mousecontrol", true, General, "IniSectionInterface"),
|
Toggle("mousecontrol", true, General, "IniSectionInterface"),
|
||||||
Text("fullscreenmonitor", General, "IniSectionInterface"),
|
|
||||||
Text("screenshotsdir", General, "IniSectionInterface"),
|
Text("screenshotsdir", General, "IniSectionInterface"),
|
||||||
|
|
||||||
Number("basedrawrange", 2500, Graphics, "IniSectionRanges", 500, 10000, 250, " m"),
|
Number("basedrawrange", 2500, Graphics, "IniSectionRanges", 500, 10000, 250, " m"),
|
||||||
Number("heightbase", 1, Graphics, "IniSectionRanges", 0.5, 3, 0.05, "×"),
|
Number("heightbase", 1, Graphics, "IniSectionRanges", 0.5, 3, 0.05, "×"),
|
||||||
Number("targetfps", 0, Graphics, "IniSectionRanges", 0, 240, 5, " FPS", zeroIsOff: true),
|
Number("targetfps", 0, Graphics, "IniSectionRanges", 0, 240, 5, " FPS", zeroIsOff: true),
|
||||||
Number("sleeperdistance", 250, Graphics, "IniSectionRanges", 0, 5000, 50, " m", 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_instances", 750, Graphics, "IniSectionRanges", 0, 3000, 50, " m"),
|
||||||
Number("gfx.reflections.range_vehicles", 250, Graphics, "IniSectionRanges", 0, 2000, 50, " m"),
|
Number("gfx.reflections.range_vehicles", 250, Graphics, "IniSectionRanges", 0, 2000, 50, " m"),
|
||||||
Toggle("gfx.textures.streaming", false, Graphics, "IniSectionRanges"),
|
Toggle("gfx.textures.streaming", false, Graphics, "IniSectionRanges"),
|
||||||
|
|||||||
@@ -8,11 +8,8 @@ public enum ConsistReadyOverride { Scenery = 0, AlwaysCold = 1, AlwaysReady = 2
|
|||||||
|
|
||||||
public enum ExeProblem { None, NotFound, NotExecutable, WrongPlatform, NotAProgram }
|
public enum ExeProblem { None, NotFound, NotExecutable, WrongPlatform, NotAProgram }
|
||||||
|
|
||||||
// gfxrenderer: the OpenGL renderer ("full", read by every build) or the Vulkan 1.4 one.
|
// multisampling: 0 off, then 2, 4 and 8 samples.
|
||||||
public enum GraphicsBackend { OpenGL = 0, Vulkan = 1 }
|
public enum AntiAliasingMode { Off, Msaa2, Msaa4, Msaa8 }
|
||||||
|
|
||||||
// gfx.antialiasing. Dlss and Dlaa are the Vulkan renderer's only; the simulator falls back to TAA elsewhere.
|
|
||||||
public enum AntiAliasingMode { Off, Msaa2, Msaa4, Msaa8, Taa, Dlss, Dlaa }
|
|
||||||
|
|
||||||
public sealed class SimulatorSettings
|
public sealed class SimulatorSettings
|
||||||
{
|
{
|
||||||
@@ -34,7 +31,8 @@ public sealed class SimulatorSettings
|
|||||||
public bool InvertMouseHorizontal;
|
public bool InvertMouseHorizontal;
|
||||||
public bool InvertMouseVertical;
|
public bool InvertMouseVertical;
|
||||||
|
|
||||||
public bool IgnoreGamepad;
|
/// <summary>input.gamepad no: the recommended setting, so the starter's default, though the simulator's own is yes.</summary>
|
||||||
|
public bool IgnoreGamepad = true;
|
||||||
public int FeedbackMode = 1;
|
public int FeedbackMode = 1;
|
||||||
public int FeedbackPort = 888;
|
public int FeedbackPort = 888;
|
||||||
public bool UartEnabled;
|
public bool UartEnabled;
|
||||||
@@ -55,8 +53,6 @@ public sealed class SimulatorSettings
|
|||||||
public bool LogMissingVehicleFiles;
|
public bool LogMissingVehicleFiles;
|
||||||
|
|
||||||
public int RenderEngine;
|
public int RenderEngine;
|
||||||
public GraphicsBackend Backend => RenderEngine == VulkanEngine ? GraphicsBackend.Vulkan : GraphicsBackend.OpenGL;
|
|
||||||
public string VulkanDevice = "";
|
|
||||||
public int Width = 1280;
|
public int Width = 1280;
|
||||||
public int Height = 720;
|
public int Height = 720;
|
||||||
public int BufferScalePercent = 100;
|
public int BufferScalePercent = 100;
|
||||||
@@ -64,9 +60,6 @@ public sealed class SimulatorSettings
|
|||||||
public int MaxCabTextureSize = 4096;
|
public int MaxCabTextureSize = 4096;
|
||||||
public double TextureFiltering = 8;
|
public double TextureFiltering = 8;
|
||||||
public AntiAliasingMode AntiAliasing = AntiAliasingMode.Msaa4;
|
public AntiAliasingMode AntiAliasing = AntiAliasingMode.Msaa4;
|
||||||
public string DlssPreset = "default";
|
|
||||||
public int FrameGeneration = 1;
|
|
||||||
public int Reflex;
|
|
||||||
public int DynamicLights = 7;
|
public int DynamicLights = 7;
|
||||||
public double DrawRangeFactor = 3.0;
|
public double DrawRangeFactor = 3.0;
|
||||||
public bool VSync;
|
public bool VSync;
|
||||||
@@ -77,37 +70,8 @@ public sealed class SimulatorSettings
|
|||||||
public bool ExtraEffects = true;
|
public bool ExtraEffects = true;
|
||||||
public bool EnvMap = true;
|
public bool EnvMap = true;
|
||||||
public bool RenderShadows = true;
|
public bool RenderShadows = true;
|
||||||
public bool ShadowSdsm;
|
|
||||||
public int LightShadows = 2;
|
|
||||||
public int ContactShadows;
|
|
||||||
public bool LightsClustered = true;
|
|
||||||
public int AmbientOcclusion = 2;
|
|
||||||
public int AoSlices = 3;
|
|
||||||
public int AoSteps = 4;
|
|
||||||
public bool AoLighting = true;
|
|
||||||
public int CabProbe = 2;
|
|
||||||
public int CabProbeInterval = 4;
|
|
||||||
public double CabProbeBounce = 1.0;
|
|
||||||
public bool CabProbeReflections = true;
|
|
||||||
|
|
||||||
// Read from eu07.ini only, for the dependencies shown: the starter offers no switch for them.
|
// Only the legacy renderer, or only Windows builds, read these.
|
||||||
public bool CabLampLight { get; internal set; } = true;
|
|
||||||
public bool DepthPrepassScene { get; internal set; }
|
|
||||||
public int Ssr = 2;
|
|
||||||
public bool RayTracing;
|
|
||||||
public int RayTracingRange = 500;
|
|
||||||
public bool VolumetricFog = true;
|
|
||||||
public int FogQuality = 2;
|
|
||||||
public int Clouds = 2;
|
|
||||||
public bool CloudShadows = true;
|
|
||||||
public bool Grass = true;
|
|
||||||
public int GrassDistance = 60;
|
|
||||||
public double GrassDensity = 1.0;
|
|
||||||
public int PrecipitationParticles = 65536;
|
|
||||||
public bool Bloom = true;
|
|
||||||
public bool AutoExposure = true;
|
|
||||||
|
|
||||||
// Only the older simulators read these.
|
|
||||||
public bool UseVbo = true;
|
public bool UseVbo = true;
|
||||||
public bool RenderAngleVulkan;
|
public bool RenderAngleVulkan;
|
||||||
public bool UseGLES;
|
public bool UseGLES;
|
||||||
@@ -127,6 +91,8 @@ public sealed class SimulatorSettings
|
|||||||
public double FpsLimit = 30;
|
public double FpsLimit = 30;
|
||||||
public double ShadowAngleLimit = 0.2;
|
public double ShadowAngleLimit = 0.2;
|
||||||
public bool FullscreenWindowed;
|
public bool FullscreenWindowed;
|
||||||
|
/// <summary>fullscreenmonitor: the monitor a full screen opens on, as "name:x,y"; empty for the primary one.</summary>
|
||||||
|
public string FullscreenMonitor = "";
|
||||||
|
|
||||||
public int SplineFidelity = 1;
|
public int SplineFidelity = 1;
|
||||||
public bool FullPhysics = true;
|
public bool FullPhysics = true;
|
||||||
@@ -161,29 +127,6 @@ public sealed class SimulatorSettings
|
|||||||
public int VehiclesVolume = 100;
|
public int VehiclesVolume = 100;
|
||||||
public int PositionalVolume = 100;
|
public int PositionalVolume = 100;
|
||||||
public int AmbientVolume = 100;
|
public int AmbientVolume = 100;
|
||||||
|
|
||||||
// OpenAL Soft options of the simulator; the defaults leave the choice to the library, as the
|
|
||||||
// simulator did before it had these keys.
|
|
||||||
/// <summary>sound.openal.renderer: the output device, empty for the system's default.</summary>
|
|
||||||
public string AudioDevice = "";
|
|
||||||
/// <summary>sound.outputmode: auto, mono, stereo, stereo-basic, uhj, headphones, quad, 5.1, 6.1, 7.1.</summary>
|
|
||||||
public string AudioOutputMode = "auto";
|
|
||||||
/// <summary>sound.hrtf: auto, on, off.</summary>
|
|
||||||
public string AudioHrtf = "auto";
|
|
||||||
/// <summary>sound.hrtf.profile: the HRTF data set, empty for the library's choice.</summary>
|
|
||||||
public string AudioHrtfProfile = "";
|
|
||||||
/// <summary>sound.resampler: empty for the library's default.</summary>
|
|
||||||
public string AudioResampler = "";
|
|
||||||
/// <summary>sound.limiter: auto, on, off.</summary>
|
|
||||||
public string AudioLimiter = "auto";
|
|
||||||
/// <summary>sound.frequency: the mixing rate in Hz, 0 for the device's.</summary>
|
|
||||||
public int AudioFrequency;
|
|
||||||
/// <summary>sound.doppler: the strength of the Doppler effect.</summary>
|
|
||||||
public double AudioDoppler = 0.25;
|
|
||||||
/// <summary>sound.efx.lowpass: soundproofing also muffles the high frequencies.</summary>
|
|
||||||
public bool AudioLowpass;
|
|
||||||
/// <summary>sound.efx.airabsorption: 0-10, the high frequencies fade with distance.</summary>
|
|
||||||
public double AudioAirAbsorption;
|
|
||||||
public bool SkipPipeline;
|
public bool SkipPipeline;
|
||||||
public int PythonScreenUpdateRate = 200;
|
public int PythonScreenUpdateRate = 200;
|
||||||
public bool DebugLogVisible;
|
public bool DebugLogVisible;
|
||||||
@@ -203,6 +146,18 @@ public sealed class SimulatorSettings
|
|||||||
public bool LargeThumbnails;
|
public bool LargeThumbnails;
|
||||||
public bool AutoExpandSceneryTree;
|
public bool AutoExpandSceneryTree;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Every setting on show, the ones a player can break the game with too. Off, the standard
|
||||||
|
/// mode keeps the settings, the consists and the scenario to what a driver needs.
|
||||||
|
/// </summary>
|
||||||
|
public bool AdvancedSettings;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The settings were brought into the standard mode once, on the first start of this
|
||||||
|
/// starter: the advanced ones to their defaults, the sliders into their ranges.
|
||||||
|
/// </summary>
|
||||||
|
public bool MovedToStandard;
|
||||||
|
|
||||||
/// <summary>Warn at start when the processor cannot run the official simulator builds.</summary>
|
/// <summary>Warn at start when the processor cannot run the official simulator builds.</summary>
|
||||||
public bool CpuNotice = true;
|
public bool CpuNotice = true;
|
||||||
|
|
||||||
@@ -235,25 +190,26 @@ public sealed class SimulatorSettings
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The gfxrenderer words the simulator tells apart (application.cpp): every
|
/// The gfxrenderer words the starter offers. "default" is the full renderer, the one to use
|
||||||
/// other word - the "simpleshader" and "off" older starters offered among them -
|
/// wherever it runs; the other two draw with the legacy one. The experimental renderer is
|
||||||
/// gets the legacy renderer. A simulator with the OpenGL 4.6 and Vulkan 1.4
|
/// not offered: the simulator a player has is built without it.
|
||||||
/// renderers runs everything but "vulkan" as the first, and "vulkan" too when
|
|
||||||
/// it was built without it or the card cannot run it.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string[] RenderEngines = { "full", "legacy", "simple", "experimental", "vulkan" };
|
public static readonly string[] RenderEngines = { "default", "legacy", "simple" };
|
||||||
|
|
||||||
/// <summary>Where "vulkan" stands among <see cref="RenderEngines"/>.</summary>
|
/// <summary>
|
||||||
public const int VulkanEngine = 4;
|
/// The words of the file that stay as they are while the choice stands: those application.cpp
|
||||||
|
/// on master knows, but "experimental". Any other word starts the full renderer with a line in
|
||||||
|
/// the log, so a save puts "default" in its place.
|
||||||
|
/// </summary>
|
||||||
|
public static bool KeptRendererWord(string? word) =>
|
||||||
|
word?.Trim().ToLowerInvariant() is "default" or "legacy" or "simple" or "simpleshader" or "off";
|
||||||
|
|
||||||
/// <summary>Where <paramref name="word"/> stands among <see cref="RenderEngines"/>, as the simulator reads it.</summary>
|
/// <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
|
public static int RenderEngineOf(string word) => word.Trim().ToLowerInvariant() switch
|
||||||
{
|
{
|
||||||
"full" or "default" or "opengl" or "gl46" => 0,
|
"legacy" or "simpleshader" or "off" => 1,
|
||||||
"simple" => 2,
|
"simple" => 2,
|
||||||
"experimental" => 3,
|
_ => 0
|
||||||
"vulkan" or "vulkan14" => 4,
|
|
||||||
_ => 1
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -279,7 +235,12 @@ public sealed class SimulatorSettings
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal double MouseScaleXMagnitude { get; set; } = 2;
|
internal double MouseScaleXMagnitude { get; set; } = 2;
|
||||||
|
|
||||||
internal double MouseScaleYMagnitude { get; set; } = 0.2;
|
/// <summary>
|
||||||
|
/// The second mousescale number, as the old starter always wrote it: 0.5, or
|
||||||
|
/// -0.5 with <see cref="InvertMouseVertical"/>. Whatever else the file has there
|
||||||
|
/// goes on the next save.
|
||||||
|
/// </summary>
|
||||||
|
internal const double MouseScaleY = 0.5;
|
||||||
|
|
||||||
/// <summary>The numbers of shadowtune the simulator skips, kept as the file has them.</summary>
|
/// <summary>The numbers of shadowtune the simulator skips, kept as the file has them.</summary>
|
||||||
internal string[] ShadowTuneUnused { get; set; } = { "250", "300" };
|
internal string[] ShadowTuneUnused { get; set; } = { "250", "300" };
|
||||||
|
|||||||
34
StarterNG/Domain/Settings/SliderRanges.cs
Normal file
34
StarterNG/Domain/Settings/SliderRanges.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
namespace StarterNG.Domain.Settings;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// What the sliders offer, in either mode: the old starter's ranges (MaSzyna-EU07/Starter,
|
||||||
|
/// src/uMain.dfm), the tops of which <see cref="GraphicsRules"/> holds to. A value the file
|
||||||
|
/// has below these is shown as it is, so opening and saving the settings never moves it.
|
||||||
|
/// </summary>
|
||||||
|
public static class SliderRanges
|
||||||
|
{
|
||||||
|
/// <summary>maxtexturesize: its list began at 512.</summary>
|
||||||
|
public const int MinTextureSize = 512;
|
||||||
|
|
||||||
|
/// <summary>The map size of shadowtune: its list began at 1024.</summary>
|
||||||
|
public const int MinShadowMap = 1024;
|
||||||
|
|
||||||
|
/// <summary>dynamiclights: 1 to 7.</summary>
|
||||||
|
public const int MinDynamicLights = 1;
|
||||||
|
|
||||||
|
/// <summary>The cursor's speed: its fastest was a mousescale of 3.2.</summary>
|
||||||
|
public const int MaxCursorSensitivity = 3;
|
||||||
|
|
||||||
|
/// <summary>gfx.reflections.framerate, in updates a second.</summary>
|
||||||
|
public static readonly double[] ReflectionUpdates = { 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 };
|
||||||
|
}
|
||||||
@@ -199,23 +199,8 @@ public sealed class TexRandomizer
|
|||||||
VehicleTexture? current)
|
VehicleTexture? current)
|
||||||
{
|
{
|
||||||
var result = new List<VehicleTexture>();
|
var result = new List<VehicleTexture>();
|
||||||
foreach (var t in _db.Textures)
|
foreach (var t in ByMini(minis))
|
||||||
{
|
{
|
||||||
if (t.Wreck) continue;
|
|
||||||
if (WithoutArchival && t.ResolvedArchived) continue;
|
|
||||||
if (_db.IsSetFollower(t)) continue;
|
|
||||||
|
|
||||||
string candidateMini = t.ResolvedClass;
|
|
||||||
if (string.IsNullOrEmpty(candidateMini))
|
|
||||||
candidateMini = _db.ResolveMiniName(t) ?? "";
|
|
||||||
if (string.IsNullOrEmpty(candidateMini)) continue;
|
|
||||||
|
|
||||||
bool miniOk = minis.Any(m =>
|
|
||||||
string.Equals(m, candidateMini, StringComparison.OrdinalIgnoreCase) ||
|
|
||||||
string.Equals(m, t.TextureMini, StringComparison.OrdinalIgnoreCase) ||
|
|
||||||
string.Equals(m, t.MiniRef, StringComparison.OrdinalIgnoreCase));
|
|
||||||
if (!miniOk) continue;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(owner) &&
|
if (!string.IsNullOrEmpty(owner) &&
|
||||||
!string.Equals(owner, t.Meta?.Operator, StringComparison.OrdinalIgnoreCase))
|
!string.Equals(owner, t.Meta?.Operator, StringComparison.OrdinalIgnoreCase))
|
||||||
continue;
|
continue;
|
||||||
@@ -236,6 +221,49 @@ public sealed class TexRandomizer
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The textures that can be drawn, by every mini name they answer to, in the catalogue's
|
||||||
|
// order. Made once: a scenery's worth of consists looks them up hundreds of times.
|
||||||
|
private Dictionary<string, List<(int Order, VehicleTexture Texture)>>? _byMini;
|
||||||
|
|
||||||
|
/// <summary>The textures that can be drawn under any of <paramref name="minis"/>, each once, in the catalogue's order.</summary>
|
||||||
|
private IEnumerable<VehicleTexture> ByMini(IReadOnlyList<string> minis)
|
||||||
|
{
|
||||||
|
_byMini ??= IndexByMini();
|
||||||
|
var found = new List<(int Order, VehicleTexture Texture)>();
|
||||||
|
foreach (string mini in minis)
|
||||||
|
if (!string.IsNullOrEmpty(mini) && _byMini.TryGetValue(mini, out var textures))
|
||||||
|
found.AddRange(textures);
|
||||||
|
return found.Distinct().OrderBy(entry => entry.Order).Select(entry => entry.Texture);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<string, List<(int Order, VehicleTexture Texture)>> IndexByMini()
|
||||||
|
{
|
||||||
|
var index = new Dictionary<string, List<(int, VehicleTexture)>>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
int order = 0;
|
||||||
|
foreach (var t in _db.Textures)
|
||||||
|
{
|
||||||
|
order++;
|
||||||
|
if (t.Wreck) continue;
|
||||||
|
if (WithoutArchival && t.ResolvedArchived) continue;
|
||||||
|
if (_db.IsSetFollower(t)) continue;
|
||||||
|
|
||||||
|
string candidateMini = t.ResolvedClass;
|
||||||
|
if (string.IsNullOrEmpty(candidateMini))
|
||||||
|
candidateMini = _db.ResolveMiniName(t) ?? "";
|
||||||
|
if (string.IsNullOrEmpty(candidateMini)) continue;
|
||||||
|
|
||||||
|
foreach (string? name in new[] { candidateMini, t.TextureMini, t.MiniRef }
|
||||||
|
.Distinct(StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(name)) continue;
|
||||||
|
if (!index.TryGetValue(name, out var list))
|
||||||
|
index[name] = list = new List<(int, VehicleTexture)>();
|
||||||
|
list.Add((order, t));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
public static int? ParseRevisionYear(string? revision)
|
public static int? ParseRevisionYear(string? revision)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(revision)) return null;
|
if (string.IsNullOrWhiteSpace(revision)) return null;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using StarterNG.Classes;
|
|||||||
using StarterNG.Domain.Sceneries;
|
using StarterNG.Domain.Sceneries;
|
||||||
using StarterNG.Domain.Vehicles;
|
using StarterNG.Domain.Vehicles;
|
||||||
using StarterNG.Application;
|
using StarterNG.Application;
|
||||||
|
using StarterNG.Domain.Settings;
|
||||||
|
|
||||||
namespace StarterNG.Domain;
|
namespace StarterNG.Domain;
|
||||||
|
|
||||||
@@ -30,10 +31,27 @@ public static class TrainsetDisplay
|
|||||||
!string.IsNullOrEmpty(trainset.Description) &&
|
!string.IsNullOrEmpty(trainset.Description) &&
|
||||||
trainset.Description.TrimStart().StartsWith("-", StringComparison.Ordinal);
|
trainset.Description.TrimStart().StartsWith("-", StringComparison.Ordinal);
|
||||||
|
|
||||||
/// <summary>Whether a list of the scenery's consists shows it, under the two filters those lists have.</summary>
|
/// <summary>Whether a list of the scenery's consists shows it, under the filters those lists have.</summary>
|
||||||
public static bool ListedIn(Trainset trainset, bool showAi, bool drivableOnly, Trainset? current) =>
|
public static bool ListedIn(Trainset trainset, bool showAi, bool drivableOnly, Trainset? current) =>
|
||||||
(showAi || !IsAi(trainset)) && (!drivableOnly || ListedAsDrivable(trainset, current));
|
(showAi || !IsAi(trainset)) && (!drivableOnly || ListedAsDrivable(trainset, current));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a list of the scenery's consists shows it: in the advanced mode under the filters
|
||||||
|
/// the settings hold; in the standard mode, which has no filters, every consist with vehicles
|
||||||
|
/// on it, and one emptied here, so it can be filled again or saved.
|
||||||
|
/// </summary>
|
||||||
|
public static bool ListedIn(Trainset trainset, SimulatorSettings settings, Trainset? current) =>
|
||||||
|
settings.AdvancedSettings
|
||||||
|
? ListedIn(trainset, settings.ShowAiVehicles, settings.DrivableOnly, current)
|
||||||
|
: !IsEmpty(trainset) || SceneryTrainsetText.IsModified(trainset);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the simulator may start with the player in it: in the standard mode not in one
|
||||||
|
/// the simulator drives itself nor in a decoration, which the scenario keeps as they are.
|
||||||
|
/// </summary>
|
||||||
|
public static bool StartableIn(Trainset trainset, SimulatorSettings settings) =>
|
||||||
|
settings.AdvancedSettings || (!IsAi(trainset) && !trainset.Decor);
|
||||||
|
|
||||||
/// <summary>The consist's row in those lists: what it is made of, or the track of one with nothing on it.</summary>
|
/// <summary>The consist's row in those lists: what it is made of, or the track of one with nothing on it.</summary>
|
||||||
public static string ListLabel(Trainset trainset) =>
|
public static string ListLabel(Trainset trainset) =>
|
||||||
CompositionText(trainset) ?? string.Format(App.Loc["EmptyTrainset"], trainset.Track ?? "");
|
CompositionText(trainset) ?? string.Format(App.Loc["EmptyTrainset"], trainset.Track ?? "");
|
||||||
|
|||||||
@@ -1,188 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using StarterNG.Application.Abstractions;
|
|
||||||
|
|
||||||
namespace StarterNG.Infrastructure;
|
|
||||||
|
|
||||||
/// <summary>A screen, and the fastest it refreshes.</summary>
|
|
||||||
/// <param name="Name">The connector on Linux (eDP-1, HDMI-A-1); empty for the primary screen on Windows.</param>
|
|
||||||
public sealed record Display(string Name, int RefreshRate);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The screens attached, for a frame rate limit to match: on Linux from the EDID
|
|
||||||
/// each connected connector of /sys/class/drm passes on - the most the panel can
|
|
||||||
/// do, which the desktop may not be using - and on Windows the primary screen's
|
|
||||||
/// current mode.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class Displays
|
|
||||||
{
|
|
||||||
private const string DrmClass = "/sys/class/drm";
|
|
||||||
|
|
||||||
private static readonly Regex Connector = new(@"^card\d+-(.+)$", RegexOptions.CultureInvariant);
|
|
||||||
|
|
||||||
private readonly IFileSystem _files;
|
|
||||||
private readonly IEnvironment _environment;
|
|
||||||
|
|
||||||
public Displays(IFileSystem files, IEnvironment environment)
|
|
||||||
{
|
|
||||||
_files = files;
|
|
||||||
_environment = environment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Every screen whose refresh rate could be read; empty where none could.</summary>
|
|
||||||
public IReadOnlyList<Display> List()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (_environment.IsLinux)
|
|
||||||
return FromDrm();
|
|
||||||
if (_environment.IsWindows && OperatingSystem.IsWindows())
|
|
||||||
return PrimaryOnWindows() is { } rate ? new[] { new Display(string.Empty, rate) } : Array.Empty<Display>();
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// A screen we cannot read leaves the limit to the player, as before.
|
|
||||||
}
|
|
||||||
|
|
||||||
return Array.Empty<Display>();
|
|
||||||
}
|
|
||||||
|
|
||||||
private IReadOnlyList<Display> FromDrm()
|
|
||||||
{
|
|
||||||
var displays = new List<Display>();
|
|
||||||
foreach (string directory in _files.GetDirectories(DrmClass))
|
|
||||||
{
|
|
||||||
var match = Connector.Match(Path.GetFileName(directory));
|
|
||||||
if (!match.Success || match.Groups[1].Value.StartsWith("Writeback", StringComparison.Ordinal))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string status = Path.Combine(directory, "status");
|
|
||||||
if (!_files.FileExists(status) || _files.ReadAllText(status).Trim() != "connected")
|
|
||||||
continue;
|
|
||||||
int rate = Edid.HighestRefreshRate(_files.ReadAllBytes(Path.Combine(directory, "edid")));
|
|
||||||
if (rate > 0)
|
|
||||||
displays.Add(new Display(match.Groups[1].Value, rate));
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// One connector we cannot read says nothing of the others.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return displays;
|
|
||||||
}
|
|
||||||
|
|
||||||
// DEVMODEW: dmSize at 68, dmDisplayFrequency at 184, 220 bytes with no driver data.
|
|
||||||
private const int DevModeSize = 220;
|
|
||||||
private const int DevModeSizeOffset = 68;
|
|
||||||
private const int DisplayFrequencyOffset = 184;
|
|
||||||
private const int CurrentSettings = -1;
|
|
||||||
|
|
||||||
[DllImport("user32.dll", ExactSpelling = true)]
|
|
||||||
private static extern int EnumDisplaySettingsW(IntPtr deviceName, int modeNum, IntPtr devMode);
|
|
||||||
|
|
||||||
private static int? PrimaryOnWindows()
|
|
||||||
{
|
|
||||||
IntPtr mode = Marshal.AllocHGlobal(DevModeSize);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 0; i < DevModeSize; i++)
|
|
||||||
Marshal.WriteByte(mode, i, 0);
|
|
||||||
Marshal.WriteInt16(mode, DevModeSizeOffset, DevModeSize);
|
|
||||||
if (EnumDisplaySettingsW(IntPtr.Zero, CurrentSettings, mode) == 0)
|
|
||||||
return null;
|
|
||||||
int rate = Marshal.ReadInt32(mode, DisplayFrequencyOffset);
|
|
||||||
// 0 and 1 stand for the hardware's default rate.
|
|
||||||
return rate > 1 ? rate : null;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Marshal.FreeHGlobal(mode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>The timings an EDID lists, as far as a refresh rate goes.</summary>
|
|
||||||
public static class Edid
|
|
||||||
{
|
|
||||||
/// <summary>The fastest refresh rate among the detailed timings, rounded; 0 for none.</summary>
|
|
||||||
public static int HighestRefreshRate(byte[] edid)
|
|
||||||
{
|
|
||||||
if (edid.Length < 128)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// The base block's four descriptors.
|
|
||||||
double best = 0;
|
|
||||||
for (int at = 54; at + 18 <= 126; at += 18)
|
|
||||||
best = Math.Max(best, DetailedTiming(edid, at));
|
|
||||||
|
|
||||||
for (int block = 128; block + 128 <= edid.Length; block += 128)
|
|
||||||
{
|
|
||||||
switch (edid[block])
|
|
||||||
{
|
|
||||||
// CTA-861: detailed timings from the offset in its third byte on.
|
|
||||||
case 0x02 when edid[block + 2] >= 4:
|
|
||||||
for (int at = block + edid[block + 2]; at + 18 <= block + 127; at += 18)
|
|
||||||
best = Math.Max(best, DetailedTiming(edid, at));
|
|
||||||
break;
|
|
||||||
// DisplayID, where a panel faster than 60 Hz often keeps its only fast mode.
|
|
||||||
case 0x70:
|
|
||||||
best = Math.Max(best, DisplayId(edid, block));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int)Math.Round(best);
|
|
||||||
}
|
|
||||||
|
|
||||||
// An 18-byte detailed timing; a pixel clock of zero marks some other descriptor.
|
|
||||||
private static double DetailedTiming(byte[] e, int at)
|
|
||||||
{
|
|
||||||
int clock = e[at] | e[at + 1] << 8;
|
|
||||||
if (clock == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
int hActive = e[at + 2] | (e[at + 4] & 0xF0) << 4, hBlank = e[at + 3] | (e[at + 4] & 0x0F) << 8;
|
|
||||||
int vActive = e[at + 5] | (e[at + 7] & 0xF0) << 4, vBlank = e[at + 6] | (e[at + 7] & 0x0F) << 8;
|
|
||||||
return Rate(clock * 10_000.0, hActive + hBlank, vActive + vBlank);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Data blocks from the sixth byte on; type I timings (DisplayID 1.3) count the
|
|
||||||
// pixel clock in 10 kHz, type VII (2.0) in kHz, and both store each size less one.
|
|
||||||
private static double DisplayId(byte[] e, int block)
|
|
||||||
{
|
|
||||||
double best = 0;
|
|
||||||
int end = Math.Min(block + 5 + e[block + 2], block + 127);
|
|
||||||
for (int at = block + 5; at + 3 <= end;)
|
|
||||||
{
|
|
||||||
int tag = e[at], length = e[at + 2];
|
|
||||||
if (tag == 0 && length == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
int payload = at + 3;
|
|
||||||
if (tag is 0x03 or 0x22)
|
|
||||||
{
|
|
||||||
for (int t = payload; t + 20 <= Math.Min(payload + length, end); t += 20)
|
|
||||||
{
|
|
||||||
double clock = (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + 1;
|
|
||||||
clock *= tag == 0x03 ? 10_000 : 1_000;
|
|
||||||
int hTotal = (e[t + 4] | e[t + 5] << 8) + 1 + (e[t + 6] | e[t + 7] << 8) + 1;
|
|
||||||
int vTotal = (e[t + 12] | e[t + 13] << 8) + 1 + (e[t + 14] | e[t + 15] << 8) + 1;
|
|
||||||
best = Math.Max(best, Rate(clock, hTotal, vTotal));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
at = payload + length;
|
|
||||||
}
|
|
||||||
|
|
||||||
return best;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static double Rate(double pixelClock, int hTotal, int vTotal) =>
|
|
||||||
hTotal > 0 && vTotal > 0 ? pixelClock / ((double)hTotal * vTotal) : 0;
|
|
||||||
}
|
|
||||||
195
StarterNG/Infrastructure/Monitors.cs
Normal file
195
StarterNG/Infrastructure/Monitors.cs
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using StarterNG.Application.Abstractions;
|
||||||
|
|
||||||
|
namespace StarterNG.Infrastructure;
|
||||||
|
|
||||||
|
/// <summary>A monitor as the simulator names it for fullscreenmonitor.</summary>
|
||||||
|
/// <param name="Id">"name:x,y" - GLFW's name with spaces as underscores, and the monitor's place on the desktop (application.cpp).</param>
|
||||||
|
/// <param name="RefreshRate">The current mode's rate in Hz, which a full screen of the simulator keeps; 0 where unknown.</param>
|
||||||
|
public sealed record DisplayMonitor(string Id, string Name, int Width, int Height, bool Primary, int RefreshRate = 0);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The monitors the simulator can start on, named as GLFW names them: on Windows the
|
||||||
|
/// monitor's device string under its adapter, on Linux the RandR output that xrandr lists.
|
||||||
|
/// </summary>
|
||||||
|
public static class Monitors
|
||||||
|
{
|
||||||
|
public static IReadOnlyList<DisplayMonitor> List(IEnvironment environment)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (environment.IsWindows && OperatingSystem.IsWindows())
|
||||||
|
return OnWindows();
|
||||||
|
if (environment.IsLinux)
|
||||||
|
return FromXrandr();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// Without the list the player still has the primary monitor.
|
||||||
|
}
|
||||||
|
|
||||||
|
return Array.Empty<DisplayMonitor>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The id GLFW gives a monitor: its name with spaces as underscores, then where it starts.</summary>
|
||||||
|
public static string IdOf(string name, int x, int y) => $"{name.Replace(' ', '_')}:{x},{y}";
|
||||||
|
|
||||||
|
// ── Windows: as win32_monitor.c of GLFW walks them ───────────────────────
|
||||||
|
|
||||||
|
// DISPLAY_DEVICEW: cb, DeviceName[32], DeviceString[128], StateFlags, DeviceID[128], DeviceKey[128].
|
||||||
|
private const int DisplayDeviceSize = 840;
|
||||||
|
private const int DeviceNameOffset = 4;
|
||||||
|
private const int DeviceStringOffset = 68;
|
||||||
|
private const int StateFlagsOffset = 324;
|
||||||
|
private const int Active = 0x1;
|
||||||
|
private const int PrimaryDevice = 0x4;
|
||||||
|
|
||||||
|
// DEVMODEW: dmSize at 68, dmPosition at 76, dmPelsWidth and dmPelsHeight at 172 and 176,
|
||||||
|
// dmDisplayFrequency at 184.
|
||||||
|
private const int DevModeSize = 220;
|
||||||
|
private const int DevModeSizeOffset = 68;
|
||||||
|
private const int PositionOffset = 76;
|
||||||
|
private const int WidthOffset = 172;
|
||||||
|
private const int HeightOffset = 176;
|
||||||
|
private const int DisplayFrequencyOffset = 184;
|
||||||
|
private const int CurrentSettings = -1;
|
||||||
|
private const int RotatedMode = 0x4;
|
||||||
|
|
||||||
|
[DllImport("user32.dll", ExactSpelling = true)]
|
||||||
|
private static extern int EnumDisplayDevicesW(IntPtr device, int index, IntPtr displayDevice, int flags);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", ExactSpelling = true)]
|
||||||
|
private static extern int EnumDisplaySettingsExW(IntPtr deviceName, int modeNum, IntPtr devMode, int flags);
|
||||||
|
|
||||||
|
private static IReadOnlyList<DisplayMonitor> OnWindows()
|
||||||
|
{
|
||||||
|
var monitors = new List<DisplayMonitor>();
|
||||||
|
IntPtr adapter = Blank(DisplayDeviceSize, 0, DisplayDeviceSize);
|
||||||
|
IntPtr display = Blank(DisplayDeviceSize, 0, DisplayDeviceSize);
|
||||||
|
IntPtr mode = Blank(DevModeSize, DevModeSizeOffset, DevModeSize);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (int a = 0; EnumDisplayDevicesW(IntPtr.Zero, a, adapter, 0) != 0; a++)
|
||||||
|
{
|
||||||
|
if ((Marshal.ReadInt32(adapter, StateFlagsOffset) & Active) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
IntPtr adapterName = adapter + DeviceNameOffset;
|
||||||
|
Clear(mode, DevModeSize, DevModeSizeOffset);
|
||||||
|
if (EnumDisplaySettingsExW(adapterName, CurrentSettings, mode, RotatedMode) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int x = Marshal.ReadInt32(mode, PositionOffset), y = Marshal.ReadInt32(mode, PositionOffset + 4);
|
||||||
|
int width = Marshal.ReadInt32(mode, WidthOffset), height = Marshal.ReadInt32(mode, HeightOffset);
|
||||||
|
bool primary = (Marshal.ReadInt32(adapter, StateFlagsOffset) & PrimaryDevice) != 0;
|
||||||
|
// 0 and 1 stand for the hardware's default rate.
|
||||||
|
int rate = Marshal.ReadInt32(mode, DisplayFrequencyOffset);
|
||||||
|
|
||||||
|
// A monitor under the adapter gives its own name; with none, the adapter's stands.
|
||||||
|
string name = Marshal.PtrToStringUni(adapter + DeviceStringOffset) ?? string.Empty;
|
||||||
|
Clear(display, DisplayDeviceSize, 0);
|
||||||
|
Marshal.WriteInt32(display, 0, DisplayDeviceSize);
|
||||||
|
for (int d = 0; EnumDisplayDevicesW(adapterName, d, display, 0) != 0; d++)
|
||||||
|
{
|
||||||
|
if ((Marshal.ReadInt32(display, StateFlagsOffset) & Active) == 0)
|
||||||
|
continue;
|
||||||
|
name = Marshal.PtrToStringUni(display + DeviceStringOffset) ?? name;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
monitors.Add(new DisplayMonitor(IdOf(name, x, y), name, width, height, primary, rate > 1 ? rate : 0));
|
||||||
|
Clear(adapter, DisplayDeviceSize, 0);
|
||||||
|
Marshal.WriteInt32(adapter, 0, DisplayDeviceSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Marshal.FreeHGlobal(adapter);
|
||||||
|
Marshal.FreeHGlobal(display);
|
||||||
|
Marshal.FreeHGlobal(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monitors;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IntPtr Blank(int size, int sizeOffset, int sizeValue)
|
||||||
|
{
|
||||||
|
IntPtr block = Marshal.AllocHGlobal(size);
|
||||||
|
Clear(block, size, sizeOffset);
|
||||||
|
if (sizeOffset == 0)
|
||||||
|
Marshal.WriteInt32(block, 0, sizeValue);
|
||||||
|
else
|
||||||
|
Marshal.WriteInt16(block, sizeOffset, (short)sizeValue);
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Clear(IntPtr block, int size, int sizeOffset)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
Marshal.WriteByte(block, i, 0);
|
||||||
|
if (sizeOffset > 0)
|
||||||
|
Marshal.WriteInt16(block, sizeOffset, (short)size);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Linux: the connected RandR outputs, as x11_monitor.c of GLFW names them ──
|
||||||
|
|
||||||
|
private static readonly Regex Output = new(
|
||||||
|
@"^(\S+) connected (primary )?(\d+)x(\d+)\+(\d+)\+(\d+)", RegexOptions.CultureInvariant);
|
||||||
|
|
||||||
|
// A mode line under an output: the rate in use is the one marked with a star.
|
||||||
|
private static readonly Regex CurrentRate = new(@"^\s+\S+.*?\s(\d+(?:\.\d+)?)\*", RegexOptions.CultureInvariant);
|
||||||
|
|
||||||
|
private static IReadOnlyList<DisplayMonitor> FromXrandr()
|
||||||
|
{
|
||||||
|
using var process = Process.Start(new ProcessStartInfo("xrandr", "--query")
|
||||||
|
{
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true,
|
||||||
|
UseShellExecute = false
|
||||||
|
});
|
||||||
|
if (process is null)
|
||||||
|
return Array.Empty<DisplayMonitor>();
|
||||||
|
string text = process.StandardOutput.ReadToEnd();
|
||||||
|
process.WaitForExit(2000);
|
||||||
|
return Parse(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The monitors of xrandr's report, each with the rate its mode in use runs at.</summary>
|
||||||
|
public static IReadOnlyList<DisplayMonitor> Parse(string xrandr)
|
||||||
|
{
|
||||||
|
var monitors = new List<DisplayMonitor>();
|
||||||
|
bool underConnected = false;
|
||||||
|
foreach (string line in xrandr.Split('\n'))
|
||||||
|
{
|
||||||
|
var m = Output.Match(line);
|
||||||
|
if (m.Success)
|
||||||
|
{
|
||||||
|
string name = m.Groups[1].Value;
|
||||||
|
int width = int.Parse(m.Groups[3].Value), height = int.Parse(m.Groups[4].Value);
|
||||||
|
int x = int.Parse(m.Groups[5].Value), y = int.Parse(m.Groups[6].Value);
|
||||||
|
monitors.Add(new DisplayMonitor(IdOf(name, x, y), name, width, height, m.Groups[2].Success));
|
||||||
|
underConnected = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (line.Length > 0 && !char.IsWhiteSpace(line[0]))
|
||||||
|
{
|
||||||
|
// Another output, connected without a place on the desktop or not at all.
|
||||||
|
underConnected = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rate = CurrentRate.Match(line);
|
||||||
|
if (underConnected && rate.Success && monitors[^1].RefreshRate == 0)
|
||||||
|
monitors[^1] = monitors[^1] with
|
||||||
|
{
|
||||||
|
RefreshRate = (int)Math.Round(double.Parse(rate.Groups[1].Value, CultureInfo.InvariantCulture))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return monitors;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace StarterNG.Infrastructure;
|
|
||||||
|
|
||||||
/// <summary>What the simulator's OpenAL library offers for its sound settings.</summary>
|
|
||||||
public sealed record AudioChoices(IReadOnlyList<string> Devices, IReadOnlyList<string> HrtfProfiles, IReadOnlyList<string> Resamplers)
|
|
||||||
{
|
|
||||||
public static AudioChoices None { get; } = new(Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Asks the OpenAL library beside the simulator, the one it plays through, for the output devices,
|
|
||||||
/// the HRTF data sets and the resamplers. The data sets and the resamplers are known only with a
|
|
||||||
/// device open, so the default one is opened for a moment. An older library (OpenAL Soft before
|
|
||||||
/// 1.19 lists no resamplers), or none at all, gives what it can and empty lists for the rest.
|
|
||||||
/// </summary>
|
|
||||||
public static unsafe class OpenAlProbe
|
|
||||||
{
|
|
||||||
private const int AlcDeviceSpecifier = 0x1005;
|
|
||||||
private const int AlcAllDevicesSpecifier = 0x1013;
|
|
||||||
private const int AlcNumHrtfSpecifiers = 0x1994;
|
|
||||||
private const int AlcHrtfSpecifier = 0x1995;
|
|
||||||
private const int AlNumResamplers = 0x1210;
|
|
||||||
private const int AlResamplerName = 0x1213;
|
|
||||||
|
|
||||||
/// <summary>The file of the library in the simulator's folder.</summary>
|
|
||||||
public static string LibraryFile => OperatingSystem.IsWindows() ? "OpenAL32.dll" : "libopenal.so.1";
|
|
||||||
|
|
||||||
public static AudioChoices Read(string gameFolder)
|
|
||||||
{
|
|
||||||
// The library stays loaded: OpenAL Soft keeps threads of its own, unloading it under them is not safe.
|
|
||||||
if (!NativeLibrary.TryLoad(Path.Combine(gameFolder, LibraryFile), out IntPtr library))
|
|
||||||
return AudioChoices.None;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return new Api(library).Read();
|
|
||||||
}
|
|
||||||
catch (EntryPointNotFoundException)
|
|
||||||
{
|
|
||||||
return AudioChoices.None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>The entry points of one library; the extension ones are null where it lacks them.</summary>
|
|
||||||
private sealed class Api
|
|
||||||
{
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, byte*, byte> _alcIsExtensionPresent;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, int, byte*> _alcGetString;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<byte*, IntPtr> _alcOpenDevice;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, byte> _alcCloseDevice;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, int*, IntPtr> _alcCreateContext;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, byte> _alcMakeContextCurrent;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, void> _alcDestroyContext;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, int, int, int*, void> _alcGetIntegerv;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<int, int> _alGetInteger;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<IntPtr, int, int, byte*> _alcGetStringiSOFT;
|
|
||||||
private readonly delegate* unmanaged[Cdecl]<int, int, byte*> _alGetStringiSOFT;
|
|
||||||
|
|
||||||
public Api(IntPtr library)
|
|
||||||
{
|
|
||||||
_alcIsExtensionPresent = (delegate* unmanaged[Cdecl]<IntPtr, byte*, byte>)NativeLibrary.GetExport(library, "alcIsExtensionPresent");
|
|
||||||
_alcGetString = (delegate* unmanaged[Cdecl]<IntPtr, int, byte*>)NativeLibrary.GetExport(library, "alcGetString");
|
|
||||||
_alcOpenDevice = (delegate* unmanaged[Cdecl]<byte*, IntPtr>)NativeLibrary.GetExport(library, "alcOpenDevice");
|
|
||||||
_alcCloseDevice = (delegate* unmanaged[Cdecl]<IntPtr, byte>)NativeLibrary.GetExport(library, "alcCloseDevice");
|
|
||||||
_alcCreateContext = (delegate* unmanaged[Cdecl]<IntPtr, int*, IntPtr>)NativeLibrary.GetExport(library, "alcCreateContext");
|
|
||||||
_alcMakeContextCurrent = (delegate* unmanaged[Cdecl]<IntPtr, byte>)NativeLibrary.GetExport(library, "alcMakeContextCurrent");
|
|
||||||
_alcDestroyContext = (delegate* unmanaged[Cdecl]<IntPtr, void>)NativeLibrary.GetExport(library, "alcDestroyContext");
|
|
||||||
_alcGetIntegerv = (delegate* unmanaged[Cdecl]<IntPtr, int, int, int*, void>)NativeLibrary.GetExport(library, "alcGetIntegerv");
|
|
||||||
_alGetInteger = (delegate* unmanaged[Cdecl]<int, int>)NativeLibrary.GetExport(library, "alGetInteger");
|
|
||||||
// OpenAL Soft exports its extension functions too; a library without them leaves these null.
|
|
||||||
NativeLibrary.TryGetExport(library, "alcGetStringiSOFT", out IntPtr getStringi);
|
|
||||||
_alcGetStringiSOFT = (delegate* unmanaged[Cdecl]<IntPtr, int, int, byte*>)getStringi;
|
|
||||||
NativeLibrary.TryGetExport(library, "alGetStringiSOFT", out IntPtr alGetStringi);
|
|
||||||
_alGetStringiSOFT = (delegate* unmanaged[Cdecl]<int, int, byte*>)alGetStringi;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AudioChoices Read()
|
|
||||||
{
|
|
||||||
int deviceList = HasExtension("ALC_ENUMERATE_ALL_EXT\0"u8) ? AlcAllDevicesSpecifier : AlcDeviceSpecifier;
|
|
||||||
List<string> devices = NameList(_alcGetString(IntPtr.Zero, deviceList));
|
|
||||||
|
|
||||||
IntPtr device = _alcOpenDevice(null);
|
|
||||||
if (device == IntPtr.Zero)
|
|
||||||
return new AudioChoices(devices, Array.Empty<string>(), Array.Empty<string>());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return new AudioChoices(devices, HrtfProfiles(device), Resamplers(device));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_alcCloseDevice(device);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool HasExtension(ReadOnlySpan<byte> name)
|
|
||||||
{
|
|
||||||
fixed (byte* text = name)
|
|
||||||
return _alcIsExtensionPresent(IntPtr.Zero, text) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<string> HrtfProfiles(IntPtr device)
|
|
||||||
{
|
|
||||||
var names = new List<string>();
|
|
||||||
if (_alcGetStringiSOFT == null)
|
|
||||||
return names;
|
|
||||||
int count = 0;
|
|
||||||
_alcGetIntegerv(device, AlcNumHrtfSpecifiers, 1, &count);
|
|
||||||
for (int index = 0; index < count; index++)
|
|
||||||
names.Add(Utf8(_alcGetStringiSOFT(device, AlcHrtfSpecifier, index)));
|
|
||||||
return names;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<string> Resamplers(IntPtr device)
|
|
||||||
{
|
|
||||||
var names = new List<string>();
|
|
||||||
if (_alGetStringiSOFT == null)
|
|
||||||
return names;
|
|
||||||
IntPtr context = _alcCreateContext(device, null);
|
|
||||||
if (context == IntPtr.Zero)
|
|
||||||
return names;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_alcMakeContextCurrent(context);
|
|
||||||
int count = _alGetInteger(AlNumResamplers);
|
|
||||||
for (int index = 0; index < count; index++)
|
|
||||||
names.Add(Utf8(_alGetStringiSOFT(AlResamplerName, index)));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_alcMakeContextCurrent(IntPtr.Zero);
|
|
||||||
_alcDestroyContext(context);
|
|
||||||
}
|
|
||||||
return names;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string Utf8(byte* text) => text == null ? "" : Marshal.PtrToStringUTF8((IntPtr)text) ?? "";
|
|
||||||
|
|
||||||
/// <summary>A list of null-terminated names ending with an empty one, as OpenAL gives the devices.</summary>
|
|
||||||
private static List<string> NameList(byte* list)
|
|
||||||
{
|
|
||||||
var names = new List<string>();
|
|
||||||
if (list == null)
|
|
||||||
return names;
|
|
||||||
while (*list != 0)
|
|
||||||
{
|
|
||||||
int length = 0;
|
|
||||||
while (list[length] != 0)
|
|
||||||
length++;
|
|
||||||
names.Add(Encoding.UTF8.GetString(list, length));
|
|
||||||
list += length + 1;
|
|
||||||
}
|
|
||||||
return names;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,12 @@ public sealed class SceneryParser
|
|||||||
/// Whether the simulator opens an include, as the include names it; null leaves
|
/// Whether the simulator opens an include, as the include names it; null leaves
|
||||||
/// includes unchecked.
|
/// includes unchecked.
|
||||||
/// </param>
|
/// </param>
|
||||||
public Scenery Parse(string path, string content, Func<string, bool>? opensInclude = null)
|
/// <param name="loadsVehicle">
|
||||||
|
/// Whether the simulator finds a vehicle's .fiz, by its folder and .mmd name as
|
||||||
|
/// written; null leaves vehicles unchecked.
|
||||||
|
/// </param>
|
||||||
|
public Scenery Parse(string path, string content, Func<string, bool>? opensInclude = null,
|
||||||
|
Func<string, string, bool>? loadsVehicle = null)
|
||||||
{
|
{
|
||||||
string original = content;
|
string original = content;
|
||||||
|
|
||||||
@@ -38,7 +43,7 @@ public sealed class SceneryParser
|
|||||||
|
|
||||||
// Read from the text with its optional includes blanked, which keeps every
|
// Read from the text with its optional includes blanked, which keeps every
|
||||||
// place where it was, so a fault's line is the line in the file.
|
// place where it was, so a fault's line is the line in the file.
|
||||||
var syntax = ScenerySyntax.Scan(content, System.IO.Path.GetFileName(path), opensInclude);
|
var syntax = ScenerySyntax.Scan(content, System.IO.Path.GetFileName(path), opensInclude, loadsVehicle);
|
||||||
var faults = syntax.Faults.ToList();
|
var faults = syntax.Faults.ToList();
|
||||||
var inlined = SceneryIncludes.Ranges(content);
|
var inlined = SceneryIncludes.Ranges(content);
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public sealed class SceneryRepository : ISceneryRepository
|
|||||||
|
|
||||||
string own = LegacyText.Decode(_files.ReadAllBytes(path), out var ownEncoding);
|
string own = LegacyText.Decode(_files.ReadAllBytes(path), out var ownEncoding);
|
||||||
string text = SceneryIncludes.Inline(own, ReadInclude);
|
string text = SceneryIncludes.Inline(own, ReadInclude);
|
||||||
var scenery = _parser.Parse(path, text, OpensInclude);
|
var scenery = _parser.Parse(path, text, OpensInclude, LoadsVehicle);
|
||||||
scenery.HasCompanionTimetable = binaryTerrain;
|
scenery.HasCompanionTimetable = binaryTerrain;
|
||||||
scenery.Sources = sources;
|
scenery.Sources = sources;
|
||||||
scenery.TextEncoding = ownEncoding;
|
scenery.TextEncoding = ownEncoding;
|
||||||
@@ -119,6 +119,15 @@ public sealed class SceneryRepository : ISceneryRepository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool Opens(string name) => ResolveInclude(name) is not null;
|
private bool Opens(string name) => ResolveInclude(name) is not null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the simulator finds a vehicle's definition - its .fiz, named after its
|
||||||
|
/// .mmd, in its folder under dynamic - whatever the case of the letters. Without
|
||||||
|
/// it the simulator leaves the vehicle out; a folder there all the same, empty,
|
||||||
|
/// makes no difference.
|
||||||
|
/// </summary>
|
||||||
|
private bool LoadsVehicle(string folder, string mmd) =>
|
||||||
|
_names.Resolve(_paths.Dynamic, $"{folder}/{mmd}.fiz") is not null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An include's file as it is named on disk, from the scenery folder, whatever
|
/// An include's file as it is named on disk, from the scenery folder, whatever
|
||||||
/// the case of its letters - as Windows, or Wine, finds it: whose consists the
|
/// the case of its letters - as Windows, or Wine, finds it: whose consists the
|
||||||
|
|||||||
@@ -302,33 +302,6 @@ public sealed class ExecutableLocator
|
|||||||
return extension.Length == 0 || extension is ".exe" or ".x86_64" or ".run" or ".appimage";
|
return extension.Length == 0 || extension is ".exe" or ".x86_64" or ".run" or ".appimage";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Whether the DLSS and frame generation libraries lie next to the simulator: without them it cannot use either.</summary>
|
|
||||||
public (bool Dlss, bool FrameGeneration) DlssLibraries(string executable)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Resolve hands back either a path of its own search or the bare name of the pick.
|
|
||||||
string full = _files.FileExists(executable) ? executable : FullPath(executable);
|
|
||||||
string? directory = Path.GetDirectoryName(full);
|
|
||||||
if (string.IsNullOrEmpty(directory) || !_files.DirectoryExists(directory))
|
|
||||||
return (false, false);
|
|
||||||
|
|
||||||
bool windowsBuild = _files.FileExists(full)
|
|
||||||
? Format(full) == BinaryFormat.PortableExecutable
|
|
||||||
: _environment.IsWindows;
|
|
||||||
|
|
||||||
return windowsBuild
|
|
||||||
? (Has(directory, "nvngx_dlss.dll"), Has(directory, "nvngx_dlssg.dll"))
|
|
||||||
: (Has(directory, "libnvidia-ngx-dlss.so*"), Has(directory, "libnvidia-ngx-dlssg.so*"));
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
return (false, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool Has(string directory, string pattern) => _files.GetFiles(directory, pattern).Count > 0;
|
|
||||||
|
|
||||||
/// <summary>A path as <see cref="Resolve"/> gives it, which may be relative to the installation, made whole.</summary>
|
/// <summary>A path as <see cref="Resolve"/> gives it, which may be relative to the installation, made whole.</summary>
|
||||||
public string FullPath(string path) =>
|
public string FullPath(string path) =>
|
||||||
Path.IsPathRooted(path) ? path : Path.Combine(_paths.Root, path);
|
Path.IsPathRooted(path) ? path : Path.Combine(_paths.Root, path);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -24,16 +25,6 @@ public sealed class SettingsSerializer
|
|||||||
s.PhysicsLog = false;
|
s.PhysicsLog = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly bool _dlssPlatform;
|
|
||||||
|
|
||||||
/// <param name="dlssPlatform">Whether the simulator can have DLSS here at all (not on macOS).</param>
|
|
||||||
public SettingsSerializer(bool dlssPlatform = true)
|
|
||||||
{
|
|
||||||
_dlssPlatform = dlssPlatform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool DlssPlatform => _dlssPlatform;
|
|
||||||
|
|
||||||
public void Read(SimulatorSettings s, ConfigFile c)
|
public void Read(SimulatorSettings s, ConfigFile c)
|
||||||
{
|
{
|
||||||
s.LanguageWasSet = c.Has("lang");
|
s.LanguageWasSet = c.Has("lang");
|
||||||
@@ -45,20 +36,21 @@ public sealed class SettingsSerializer
|
|||||||
s.FpsAverage = c.GetDouble("fpsaverage", 0);
|
s.FpsAverage = c.GetDouble("fpsaverage", 0);
|
||||||
s.PauseOnStart = c.GetBool("pause", false);
|
s.PauseOnStart = c.GetBool("pause", false);
|
||||||
|
|
||||||
|
// A zero (or NaN/Infinity) scale locks that axis in the simulator: the
|
||||||
|
// camera then turns only one way. Nothing in the starter writes such a
|
||||||
|
// number on purpose, so X takes the default. Of Y only the sign is read:
|
||||||
|
// it is written 0.5 or -0.5, as the old starter always wrote it.
|
||||||
var mouse = c.GetTokens("mousescale");
|
var mouse = c.GetTokens("mousescale");
|
||||||
if (mouse.Length >= 1 && double.TryParse(mouse[0], NumberStyles.Float, CultureInfo.InvariantCulture, out double mx))
|
if (mouse.Length >= 1 && TryParseMouseScale(mouse[0], out double mx))
|
||||||
{
|
{
|
||||||
s.InvertMouseHorizontal = mx < 0;
|
s.InvertMouseHorizontal = mx < 0;
|
||||||
s.MouseScaleXMagnitude = Math.Abs(mx);
|
s.MouseScaleXMagnitude = Math.Abs(mx);
|
||||||
s.CursorSensitivity = SensitivityStep(mx);
|
s.CursorSensitivity = SensitivityStep(mx);
|
||||||
}
|
}
|
||||||
if (mouse.Length >= 2 && double.TryParse(mouse[1], NumberStyles.Float, CultureInfo.InvariantCulture, out double my))
|
if (mouse.Length >= 1)
|
||||||
{
|
s.InvertMouseVertical = mouse.Length >= 2 && TryParseMouseScale(mouse[1], out double my) && my < 0;
|
||||||
s.InvertMouseVertical = my < 0;
|
|
||||||
s.MouseScaleYMagnitude = Math.Abs(my);
|
|
||||||
}
|
|
||||||
|
|
||||||
s.IgnoreGamepad = !c.GetBool("input.gamepad", true);
|
s.IgnoreGamepad = !c.GetBool("input.gamepad", false);
|
||||||
s.FeedbackMode = Clamp(c.GetInt("feedbackmode", 1), 0, 5);
|
s.FeedbackMode = Clamp(c.GetInt("feedbackmode", 1), 0, 5);
|
||||||
s.FeedbackPort = c.GetInt("feedbackport", 888);
|
s.FeedbackPort = c.GetInt("feedbackport", 888);
|
||||||
s.UartEnabled = c.Has("uart");
|
s.UartEnabled = c.Has("uart");
|
||||||
@@ -91,8 +83,7 @@ public sealed class SettingsSerializer
|
|||||||
s.VirtualShunting = c.GetBool("ai.trainman", true);
|
s.VirtualShunting = c.GetBool("ai.trainman", true);
|
||||||
s.LogMissingVehicleFiles = c.GetBool("starter.logmissingvehicles", false);
|
s.LogMissingVehicleFiles = c.GetBool("starter.logmissingvehicles", false);
|
||||||
|
|
||||||
s.RenderEngine = SimulatorSettings.RenderEngineOf(c.GetString("gfxrenderer", "full"));
|
s.RenderEngine = SimulatorSettings.RenderEngineOf(c.GetString("gfxrenderer", "default"));
|
||||||
s.VulkanDevice = c.GetString("gfx.vulkan.device", "");
|
|
||||||
s.Width = c.GetInt("width", 1280);
|
s.Width = c.GetInt("width", 1280);
|
||||||
s.Height = c.GetInt("height", 720);
|
s.Height = c.GetInt("height", 720);
|
||||||
s.BufferScalePercent = ReadBufferScale(c);
|
s.BufferScalePercent = ReadBufferScale(c);
|
||||||
@@ -100,9 +91,6 @@ public sealed class SettingsSerializer
|
|||||||
s.MaxCabTextureSize = c.GetInt("maxcabtexturesize", 4096);
|
s.MaxCabTextureSize = c.GetInt("maxcabtexturesize", 4096);
|
||||||
s.TextureFiltering = Math.Max(1, c.GetDouble("anisotropicfiltering", 8));
|
s.TextureFiltering = Math.Max(1, c.GetDouble("anisotropicfiltering", 8));
|
||||||
s.AntiAliasing = ReadAntiAliasing(c);
|
s.AntiAliasing = ReadAntiAliasing(c);
|
||||||
s.DlssPreset = c.GetString("gfx.dlss.preset", "default").ToLowerInvariant();
|
|
||||||
s.FrameGeneration = ParseFrameGeneration(FirstToken(c, "gfx.framegeneration"));
|
|
||||||
s.Reflex = ParseReflex(FirstToken(c, "gfx.reflex"));
|
|
||||||
s.DynamicLights = Clamp(c.GetInt("dynamiclights", 7), 0, 7);
|
s.DynamicLights = Clamp(c.GetInt("dynamiclights", 7), 0, 7);
|
||||||
s.DrawRangeFactor = c.GetDouble("gfx.drawrange.factor.max", 3.0);
|
s.DrawRangeFactor = c.GetDouble("gfx.drawrange.factor.max", 3.0);
|
||||||
s.VSync = c.GetBool("vsync", false);
|
s.VSync = c.GetBool("vsync", false);
|
||||||
@@ -114,34 +102,6 @@ public sealed class SettingsSerializer
|
|||||||
s.EnvMap = c.GetBool("gfx.envmap.enabled", true);
|
s.EnvMap = c.GetBool("gfx.envmap.enabled", true);
|
||||||
s.UseVbo = c.GetBool("usevbo", true);
|
s.UseVbo = c.GetBool("usevbo", true);
|
||||||
s.RenderShadows = c.GetBool("shadows", true);
|
s.RenderShadows = c.GetBool("shadows", true);
|
||||||
s.ShadowSdsm = c.GetBool("gfx.shadow.sdsm", false);
|
|
||||||
s.LightShadows = ParseLevel(FirstToken(c, "gfx.lights.shadows"), 2, 3);
|
|
||||||
s.ContactShadows = ParseLevel(FirstToken(c, "gfx.contactshadows"), 0, 3);
|
|
||||||
s.LightsClustered = c.GetBool("gfx.lights.clustered", true);
|
|
||||||
s.AmbientOcclusion = ParseAmbientOcclusion(FirstToken(c, "gfx.postfx.ao"));
|
|
||||||
var aoQuality = c.GetTokens("gfx.postfx.ao.quality");
|
|
||||||
s.AoSlices = aoQuality.Length >= 1 ? ParseInt(aoQuality[0], 3) : 3;
|
|
||||||
s.AoSteps = aoQuality.Length >= 2 ? ParseInt(aoQuality[1], 4) : 4;
|
|
||||||
s.AoLighting = c.GetBool("gfx.postfx.ao.lighting", true);
|
|
||||||
s.CabProbe = ParseCabProbe(FirstToken(c, "gfx.cabprobe"));
|
|
||||||
s.CabProbeInterval = c.GetInt("gfx.cabprobe.interval", 4);
|
|
||||||
s.CabProbeBounce = c.GetDouble("gfx.cabprobe.bounce", 1.0);
|
|
||||||
s.CabProbeReflections = c.GetBool("gfx.cabprobe.reflections", true);
|
|
||||||
s.CabLampLight = c.GetBool("gfx.lights.cab", true);
|
|
||||||
s.DepthPrepassScene = c.GetBool("gfx.depthprepass.scene", false);
|
|
||||||
s.Ssr = ParseLevel(FirstToken(c, "gfx.ssr"), 2, 3);
|
|
||||||
s.RayTracing = c.GetBool("gfx.raytracing", false);
|
|
||||||
s.RayTracingRange = (int)Math.Round(c.GetDouble("gfx.raytracing.range", 500));
|
|
||||||
s.VolumetricFog = ParseVolumetricFog(FirstToken(c, "gfx.fog"));
|
|
||||||
s.FogQuality = ParseFogQuality(FirstToken(c, "gfx.fog.quality"));
|
|
||||||
s.Clouds = ParseLevel(FirstToken(c, "gfx.clouds"), 2, 4);
|
|
||||||
s.CloudShadows = c.GetBool("gfx.clouds.shadows", true);
|
|
||||||
s.Grass = c.GetBool("gfx.grass", true);
|
|
||||||
s.GrassDistance = (int)Math.Round(c.GetDouble("gfx.grass.distance", 60));
|
|
||||||
s.GrassDensity = c.GetDouble("gfx.grass.density", 1.0);
|
|
||||||
s.PrecipitationParticles = c.GetInt("gfx.precipitation.particles", 65536);
|
|
||||||
s.Bloom = c.GetBool("gfx.postfx.bloom", true);
|
|
||||||
s.AutoExposure = c.GetBool("gfx.postfx.autoexposure", true);
|
|
||||||
// A negative rate counts as its size; none at all, as never.
|
// A negative rate counts as its size; none at all, as never.
|
||||||
double reflections = Math.Abs(c.GetDouble("gfx.reflections.framerate", 1 / 300.0));
|
double reflections = Math.Abs(c.GetDouble("gfx.reflections.framerate", 1 / 300.0));
|
||||||
s.ReflectionsFramerate = reflections > 0 ? reflections : 1 / 300.0;
|
s.ReflectionsFramerate = reflections > 0 ? reflections : 1 / 300.0;
|
||||||
@@ -165,6 +125,7 @@ public sealed class SettingsSerializer
|
|||||||
if (s.FpsLimitEnabled) s.FpsLimit = fpsLimit;
|
if (s.FpsLimitEnabled) s.FpsLimit = fpsLimit;
|
||||||
s.ShadowAngleLimit = c.GetDouble("gfx.shadow.angle.min", 0.2);
|
s.ShadowAngleLimit = c.GetDouble("gfx.shadow.angle.min", 0.2);
|
||||||
s.FullscreenWindowed = c.GetBool("fullscreenwindowed", false);
|
s.FullscreenWindowed = c.GetBool("fullscreenwindowed", false);
|
||||||
|
s.FullscreenMonitor = c.GetString("fullscreenmonitor", "").Trim();
|
||||||
s.RenderAngleVulkan = string.Equals(c.GetString("gfx.angleplatform", ""), "vulkan", StringComparison.OrdinalIgnoreCase);
|
s.RenderAngleVulkan = string.Equals(c.GetString("gfx.angleplatform", ""), "vulkan", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
s.SplineFidelity = Clamp(c.GetInt("splinefidelity", 1), 1, 4);
|
s.SplineFidelity = Clamp(c.GetInt("splinefidelity", 1), 1, 4);
|
||||||
@@ -194,7 +155,6 @@ public sealed class SettingsSerializer
|
|||||||
s.VehiclesVolume = Clamp((int)Math.Round(c.GetDouble("sound.volume.vehicle", 1.0) * 100), 0, 100);
|
s.VehiclesVolume = Clamp((int)Math.Round(c.GetDouble("sound.volume.vehicle", 1.0) * 100), 0, 100);
|
||||||
s.PositionalVolume = Clamp((int)Math.Round(c.GetDouble("sound.volume.positional", 1.0) * 100), 0, 100);
|
s.PositionalVolume = Clamp((int)Math.Round(c.GetDouble("sound.volume.positional", 1.0) * 100), 0, 100);
|
||||||
s.AmbientVolume = Clamp((int)Math.Round(c.GetDouble("sound.volume.ambient", 1.0) * 100), 0, 100);
|
s.AmbientVolume = Clamp((int)Math.Round(c.GetDouble("sound.volume.ambient", 1.0) * 100), 0, 100);
|
||||||
ReadAudioDevice(c, s);
|
|
||||||
s.SkipPipeline = c.GetBool("gfx.skippipeline", false);
|
s.SkipPipeline = c.GetBool("gfx.skippipeline", false);
|
||||||
s.PythonScreenUpdateRate = c.Has("python.updatetime")
|
s.PythonScreenUpdateRate = c.Has("python.updatetime")
|
||||||
? Clamp(c.GetInt("python.updatetime", 200), 0, 10000)
|
? Clamp(c.GetInt("python.updatetime", 200), 0, 10000)
|
||||||
@@ -214,6 +174,8 @@ public sealed class SettingsSerializer
|
|||||||
s.AutoCloseStarter = c.GetBool("starter.autoclose", false);
|
s.AutoCloseStarter = c.GetBool("starter.autoclose", false);
|
||||||
s.LargeThumbnails = c.GetBool("starter.largethumbnails", false);
|
s.LargeThumbnails = c.GetBool("starter.largethumbnails", false);
|
||||||
s.AutoExpandSceneryTree = c.GetBool("starter.expandtree", false);
|
s.AutoExpandSceneryTree = c.GetBool("starter.expandtree", false);
|
||||||
|
s.AdvancedSettings = c.GetBool("starter.settings.advanced", false);
|
||||||
|
s.MovedToStandard = c.GetBool("starter.settings.standard", false);
|
||||||
s.CpuNotice = c.GetBool("starter.cpunotice", true);
|
s.CpuNotice = c.GetBool("starter.cpunotice", true);
|
||||||
s.Gpu = string.Equals(c.GetString("starter.gpu", "discrete"), "system", StringComparison.OrdinalIgnoreCase)
|
s.Gpu = string.Equals(c.GetString("starter.gpu", "discrete"), "system", StringComparison.OrdinalIgnoreCase)
|
||||||
? GpuPreference.System
|
? GpuPreference.System
|
||||||
@@ -238,7 +200,7 @@ public sealed class SettingsSerializer
|
|||||||
if (c.Has(key.Key))
|
if (c.Has(key.Key))
|
||||||
s.Extra[key.Key] = c.GetRaw(key.Key) ?? string.Empty;
|
s.Extra[key.Key] = c.GetRaw(key.Key) ?? string.Empty;
|
||||||
|
|
||||||
GraphicsRules.Normalize(s, _dlssPlatform);
|
GraphicsRules.Normalize(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -249,13 +211,20 @@ public sealed class SettingsSerializer
|
|||||||
public static readonly string[] FixedLengthKeys = { "uart", "uarttune", "uartfeature" };
|
public static readonly string[] FixedLengthKeys = { "uart", "uarttune", "uartfeature" };
|
||||||
|
|
||||||
/// <summary>Keys written only when they say something, besides those of <see cref="SimulatorKeys"/>.</summary>
|
/// <summary>Keys written only when they say something, besides those of <see cref="SimulatorKeys"/>.</summary>
|
||||||
public static readonly string[] OptionalKeys = { "fpslimit", "gfx.angleplatform", "gfx.vulkan.device" };
|
public static readonly string[] OptionalKeys = { "fpslimit", "gfx.angleplatform", "fullscreenmonitor" };
|
||||||
|
|
||||||
/// <summary>Keys no simulator reads any more, taken out of the file on a save.</summary>
|
/// <summary>Keys no simulator reads any more, taken out of the file on a save.</summary>
|
||||||
public static readonly string[] ObsoleteKeys =
|
public static readonly string[] ObsoleteKeys =
|
||||||
{
|
{
|
||||||
"gfx.postfx.tonemapping",
|
"gfx.postfx.tonemapping",
|
||||||
"starter.developertools",
|
"starter.developertools",
|
||||||
|
// The OpenGL 4.6 and Vulkan renderers', which the simulator's master does not have.
|
||||||
|
"gfx.antialiasing", "gfx.buffer.percent", "gfx.vulkan.device", "gfx.dlss.preset", "gfx.framegeneration",
|
||||||
|
"gfx.reflex", "gfx.raytracing", "gfx.raytracing.range", "gfx.ssr", "gfx.lights.clustered", "gfx.lights.shadows",
|
||||||
|
"gfx.contactshadows", "gfx.shadow.sdsm", "gfx.postfx.ao", "gfx.postfx.ao.lighting", "gfx.postfx.ao.quality",
|
||||||
|
"gfx.cabprobe", "gfx.cabprobe.interval", "gfx.cabprobe.bounce", "gfx.cabprobe.reflections", "gfx.fog",
|
||||||
|
"gfx.fog.quality", "gfx.clouds", "gfx.clouds.shadows", "gfx.postfx.bloom", "gfx.postfx.autoexposure",
|
||||||
|
"gfx.grass", "gfx.grass.distance", "gfx.grass.fadedistance", "gfx.grass.density", "gfx.precipitation.particles",
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -265,7 +234,7 @@ public sealed class SettingsSerializer
|
|||||||
public void Write(SimulatorSettings settings, ConfigFile c)
|
public void Write(SimulatorSettings settings, ConfigFile c)
|
||||||
{
|
{
|
||||||
var s = settings.Copy();
|
var s = settings.Copy();
|
||||||
GraphicsRules.Normalize(s, _dlssPlatform);
|
GraphicsRules.Normalize(s);
|
||||||
|
|
||||||
c.Set("lang", string.IsNullOrWhiteSpace(s.LanguageCode)
|
c.Set("lang", string.IsNullOrWhiteSpace(s.LanguageCode)
|
||||||
? "en"
|
? "en"
|
||||||
@@ -278,7 +247,7 @@ public sealed class SettingsSerializer
|
|||||||
? s.MouseScaleXMagnitude
|
? s.MouseScaleXMagnitude
|
||||||
: s.CursorSensitivity;
|
: s.CursorSensitivity;
|
||||||
double mx = magnitude * (s.InvertMouseHorizontal ? -1 : 1);
|
double mx = magnitude * (s.InvertMouseHorizontal ? -1 : 1);
|
||||||
double my = s.MouseScaleYMagnitude * (s.InvertMouseVertical ? -1 : 1);
|
double my = SimulatorSettings.MouseScaleY * (s.InvertMouseVertical ? -1 : 1);
|
||||||
c.Set("mousescale",
|
c.Set("mousescale",
|
||||||
$"{mx.ToString("R", CultureInfo.InvariantCulture)} " +
|
$"{mx.ToString("R", CultureInfo.InvariantCulture)} " +
|
||||||
$"{my.ToString("R", CultureInfo.InvariantCulture)}");
|
$"{my.ToString("R", CultureInfo.InvariantCulture)}");
|
||||||
@@ -313,26 +282,16 @@ public sealed class SettingsSerializer
|
|||||||
c.SetBool("starter.logmissingvehicles", s.LogMissingVehicleFiles);
|
c.SetBool("starter.logmissingvehicles", s.LogMissingVehicleFiles);
|
||||||
|
|
||||||
c.Set("gfxrenderer", SimulatorSettings.RenderEngines[Clamp(s.RenderEngine, 0, SimulatorSettings.RenderEngines.Length - 1)]);
|
c.Set("gfxrenderer", SimulatorSettings.RenderEngines[Clamp(s.RenderEngine, 0, SimulatorSettings.RenderEngines.Length - 1)]);
|
||||||
if (!string.IsNullOrWhiteSpace(s.VulkanDevice)) c.Set("gfx.vulkan.device", s.VulkanDevice.Trim());
|
|
||||||
c.SetInt("width", s.Width);
|
c.SetInt("width", s.Width);
|
||||||
c.SetInt("height", s.Height);
|
c.SetInt("height", s.Height);
|
||||||
c.SetInt("starter.bufferscale", s.BufferScalePercent);
|
c.SetInt("starter.bufferscale", s.BufferScalePercent);
|
||||||
int fbw = (int)Math.Round(s.Width * s.BufferScalePercent / 100.0);
|
// The simulator draws into a buffer of this size and stretches it to the window.
|
||||||
int fbh = (int)Math.Round(s.Height * s.BufferScalePercent / 100.0);
|
c.SetInt("gfx.framebuffer.width", (int)Math.Round(s.Width * s.BufferScalePercent / 100.0));
|
||||||
// The size for the simulators before gfx.buffer.percent, which pass that one over and the other way round.
|
c.SetInt("gfx.framebuffer.height", (int)Math.Round(s.Height * s.BufferScalePercent / 100.0));
|
||||||
c.SetInt("gfx.framebuffer.width", fbw);
|
|
||||||
c.SetInt("gfx.framebuffer.height", fbh);
|
|
||||||
c.SetInt("gfx.buffer.percent", s.BufferScalePercent);
|
|
||||||
c.SetInt("maxtexturesize", s.MaxTextureSize);
|
c.SetInt("maxtexturesize", s.MaxTextureSize);
|
||||||
c.SetInt("maxcabtexturesize", s.MaxCabTextureSize);
|
c.SetInt("maxcabtexturesize", s.MaxCabTextureSize);
|
||||||
c.SetDouble("anisotropicfiltering", s.TextureFiltering);
|
c.SetDouble("anisotropicfiltering", s.TextureFiltering);
|
||||||
// multisampling is what older simulators read; gfx.antialiasing overrides it in the new ones, but only from
|
|
||||||
// a later line, since each key sets the mode as it is read.
|
|
||||||
c.SetInt("multisampling", MultisamplingLevel(s.AntiAliasing));
|
c.SetInt("multisampling", MultisamplingLevel(s.AntiAliasing));
|
||||||
c.Set("gfx.antialiasing", AntiAliasingToken(s.AntiAliasing));
|
|
||||||
c.Set("gfx.dlss.preset", s.DlssPreset);
|
|
||||||
c.Set("gfx.framegeneration", s.FrameGeneration > 1 ? $"x{s.FrameGeneration}" : "off");
|
|
||||||
c.Set("gfx.reflex", s.Reflex switch { 1 => "on", 2 => "boost", _ => "off" });
|
|
||||||
c.SetInt("dynamiclights", s.DynamicLights);
|
c.SetInt("dynamiclights", s.DynamicLights);
|
||||||
c.SetDouble("gfx.drawrange.factor.max", s.DrawRangeFactor);
|
c.SetDouble("gfx.drawrange.factor.max", s.DrawRangeFactor);
|
||||||
c.SetBool("vsync", s.VSync);
|
c.SetBool("vsync", s.VSync);
|
||||||
@@ -345,32 +304,6 @@ public sealed class SettingsSerializer
|
|||||||
c.SetBool("usevbo", s.UseVbo);
|
c.SetBool("usevbo", s.UseVbo);
|
||||||
c.SetBool("shadows", s.RenderShadows);
|
c.SetBool("shadows", s.RenderShadows);
|
||||||
c.SetBool("gfx.shadowmap.enabled", s.RenderShadows);
|
c.SetBool("gfx.shadowmap.enabled", s.RenderShadows);
|
||||||
c.SetBool("gfx.shadow.sdsm", s.ShadowSdsm);
|
|
||||||
c.Set("gfx.lights.shadows", LevelToken(s.LightShadows));
|
|
||||||
c.Set("gfx.contactshadows", LevelToken(s.ContactShadows));
|
|
||||||
c.SetBool("gfx.lights.clustered", s.LightsClustered);
|
|
||||||
c.Set("gfx.postfx.ao", s.AmbientOcclusion switch { 1 => "ssao", 2 => "gtao", _ => "no" });
|
|
||||||
c.Set("gfx.postfx.ao.quality", $"{s.AoSlices} {s.AoSteps}");
|
|
||||||
c.SetBool("gfx.postfx.ao.lighting", s.AoLighting);
|
|
||||||
c.Set("gfx.cabprobe", LevelToken(s.CabProbe));
|
|
||||||
c.SetInt("gfx.cabprobe.interval", s.CabProbeInterval);
|
|
||||||
c.SetDouble("gfx.cabprobe.bounce", s.CabProbeBounce);
|
|
||||||
c.SetBool("gfx.cabprobe.reflections", s.CabProbeReflections);
|
|
||||||
c.Set("gfx.ssr", LevelToken(s.Ssr));
|
|
||||||
c.SetBool("gfx.raytracing", s.RayTracing);
|
|
||||||
c.SetInt("gfx.raytracing.range", s.RayTracingRange);
|
|
||||||
c.Set("gfx.fog", s.VolumetricFog ? "yes" : "analytic");
|
|
||||||
c.Set("gfx.fog.quality", LevelToken(s.FogQuality));
|
|
||||||
c.Set("gfx.clouds", LevelToken(s.Clouds));
|
|
||||||
c.SetBool("gfx.clouds.shadows", s.CloudShadows);
|
|
||||||
c.SetBool("gfx.grass", s.Grass);
|
|
||||||
c.SetInt("gfx.grass.distance", s.GrassDistance);
|
|
||||||
// The grass thins out past its distance; the simulator's own default keeps a sixth of it for that.
|
|
||||||
c.SetInt("gfx.grass.fadedistance", Math.Min(600, s.GrassDistance + Math.Max(10, s.GrassDistance / 6)));
|
|
||||||
c.SetDouble("gfx.grass.density", s.GrassDensity);
|
|
||||||
c.SetInt("gfx.precipitation.particles", s.PrecipitationParticles);
|
|
||||||
c.SetBool("gfx.postfx.bloom", s.Bloom);
|
|
||||||
c.SetBool("gfx.postfx.autoexposure", s.AutoExposure);
|
|
||||||
c.Set("gfx.reflections.framerate", s.ReflectionsFramerate.ToString("0.######", CultureInfo.InvariantCulture));
|
c.Set("gfx.reflections.framerate", s.ReflectionsFramerate.ToString("0.######", CultureInfo.InvariantCulture));
|
||||||
c.Set("shadowtune",
|
c.Set("shadowtune",
|
||||||
$"{s.ShadowMapResolution} {s.ShadowTuneUnused[0]} " +
|
$"{s.ShadowMapResolution} {s.ShadowTuneUnused[0]} " +
|
||||||
@@ -384,6 +317,7 @@ public sealed class SettingsSerializer
|
|||||||
if (s.FpsLimitEnabled) c.SetDouble("fpslimit", s.FpsLimit);
|
if (s.FpsLimitEnabled) c.SetDouble("fpslimit", s.FpsLimit);
|
||||||
c.SetDouble("gfx.shadow.angle.min", s.ShadowAngleLimit);
|
c.SetDouble("gfx.shadow.angle.min", s.ShadowAngleLimit);
|
||||||
c.SetBool("fullscreenwindowed", s.FullscreenWindowed);
|
c.SetBool("fullscreenwindowed", s.FullscreenWindowed);
|
||||||
|
if (!string.IsNullOrWhiteSpace(s.FullscreenMonitor)) c.Set("fullscreenmonitor", s.FullscreenMonitor.Trim());
|
||||||
if (s.RenderAngleVulkan) c.Set("gfx.angleplatform", "vulkan");
|
if (s.RenderAngleVulkan) c.Set("gfx.angleplatform", "vulkan");
|
||||||
|
|
||||||
c.SetInt("splinefidelity", s.SplineFidelity);
|
c.SetInt("splinefidelity", s.SplineFidelity);
|
||||||
@@ -413,7 +347,6 @@ public sealed class SettingsSerializer
|
|||||||
c.SetDouble("sound.volume.vehicle", s.VehiclesVolume / 100.0);
|
c.SetDouble("sound.volume.vehicle", s.VehiclesVolume / 100.0);
|
||||||
c.SetDouble("sound.volume.positional", s.PositionalVolume / 100.0);
|
c.SetDouble("sound.volume.positional", s.PositionalVolume / 100.0);
|
||||||
c.SetDouble("sound.volume.ambient", s.AmbientVolume / 100.0);
|
c.SetDouble("sound.volume.ambient", s.AmbientVolume / 100.0);
|
||||||
WriteAudioDevice(c, s);
|
|
||||||
c.SetBool("gfx.skippipeline", s.SkipPipeline);
|
c.SetBool("gfx.skippipeline", s.SkipPipeline);
|
||||||
c.SetInt("python.updatetime", s.PythonScreenUpdateRate);
|
c.SetInt("python.updatetime", s.PythonScreenUpdateRate);
|
||||||
|
|
||||||
@@ -431,6 +364,8 @@ public sealed class SettingsSerializer
|
|||||||
c.SetBool("starter.autoclose", s.AutoCloseStarter);
|
c.SetBool("starter.autoclose", s.AutoCloseStarter);
|
||||||
c.SetBool("starter.largethumbnails", s.LargeThumbnails);
|
c.SetBool("starter.largethumbnails", s.LargeThumbnails);
|
||||||
c.SetBool("starter.expandtree", s.AutoExpandSceneryTree);
|
c.SetBool("starter.expandtree", s.AutoExpandSceneryTree);
|
||||||
|
c.SetBool("starter.settings.advanced", s.AdvancedSettings);
|
||||||
|
c.SetBool("starter.settings.standard", s.MovedToStandard);
|
||||||
c.SetBool("starter.cpunotice", s.CpuNotice);
|
c.SetBool("starter.cpunotice", s.CpuNotice);
|
||||||
c.Set("starter.gpu", s.Gpu == GpuPreference.System ? "system" : "discrete");
|
c.Set("starter.gpu", s.Gpu == GpuPreference.System ? "system" : "discrete");
|
||||||
c.SetInt("starter.batterydefault", (int)s.ReadyOverride);
|
c.SetInt("starter.batterydefault", (int)s.ReadyOverride);
|
||||||
@@ -449,119 +384,42 @@ public sealed class SettingsSerializer
|
|||||||
c.Set(key.Key, value.Trim());
|
c.Set(key.Key, value.Trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
// What the simulator goes by: up to 4 a part of the window, above it percents.
|
private static int ReadBufferScale(ConfigFile c) =>
|
||||||
private static int ReadBufferScale(ConfigFile c)
|
Clamp(BufferScaleIn(c), 25, GraphicsRules.MaxBufferScale);
|
||||||
{
|
|
||||||
if (!c.Has("gfx.buffer.percent"))
|
|
||||||
return Clamp(c.GetInt("starter.bufferscale", 100), 25, 200);
|
|
||||||
|
|
||||||
double value = c.GetDouble("gfx.buffer.percent", 100);
|
// The starter's own percent, or the framebuffer the file sets against its window.
|
||||||
return Clamp((int)Math.Round(value > 4 ? value : value * 100), 25, 200);
|
private static int BufferScaleIn(ConfigFile c)
|
||||||
|
{
|
||||||
|
if (c.Has("starter.bufferscale"))
|
||||||
|
return c.GetInt("starter.bufferscale", 100);
|
||||||
|
int width = c.GetInt("width", 0);
|
||||||
|
int framebuffer = c.GetInt("gfx.framebuffer.width", 0);
|
||||||
|
return width > 0 && framebuffer > 0 ? (int)Math.Round(framebuffer * 100.0 / width) : 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The OpenAL Soft options. The names (devices, HRTF data sets, resamplers) can hold spaces, so
|
/// <summary>
|
||||||
// the simulator takes them in quotes.
|
/// The keys of <paramref name="c"/> set above what the starter lets them go to
|
||||||
private static void ReadAudioDevice(ConfigFile c, SimulatorSettings s)
|
/// (<see cref="GraphicsRules"/>): the next save brings them down.
|
||||||
|
/// </summary>
|
||||||
|
public static IReadOnlySet<string> OverCapKeys(ConfigFile c)
|
||||||
{
|
{
|
||||||
s.AudioDevice = Unquoted(c.GetString("sound.openal.renderer", ""));
|
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
s.AudioOutputMode = FirstTokenOr(c, "sound.outputmode", "auto");
|
if (c.GetInt("maxcabtexturesize", 0) > GraphicsRules.MaxCabTextureSize)
|
||||||
s.AudioHrtf = FirstTokenOr(c, "sound.hrtf", "auto");
|
keys.Add("maxcabtexturesize");
|
||||||
s.AudioHrtfProfile = Unquoted(c.GetString("sound.hrtf.profile", ""));
|
var shadowTune = c.GetTokens("shadowtune");
|
||||||
s.AudioResampler = Unquoted(c.GetString("sound.resampler", ""));
|
if (shadowTune.Length >= 3 && ParseDouble(shadowTune[2], 0) > GraphicsRules.MaxShadowRange)
|
||||||
s.AudioLimiter = FirstTokenOr(c, "sound.limiter", "auto");
|
keys.Add("shadowtune");
|
||||||
s.AudioFrequency = Clamp(c.GetInt("sound.frequency", 0), 0, 192000);
|
if (BufferScaleIn(c) > GraphicsRules.MaxBufferScale)
|
||||||
s.AudioDoppler = Math.Clamp(c.GetDouble("sound.doppler", 0.25), 0.0, 10.0);
|
keys.UnionWith(new[] { "starter.bufferscale", "gfx.framebuffer.width", "gfx.framebuffer.height" });
|
||||||
s.AudioLowpass = c.GetBool("sound.efx.lowpass", false);
|
return keys;
|
||||||
s.AudioAirAbsorption = Math.Clamp(c.GetDouble("sound.efx.airabsorption", 0.0), 0.0, 10.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A key the file lacks is written only when the value differs from the simulator's default, so
|
private static AntiAliasingMode ReadAntiAliasing(ConfigFile c) => c.GetInt("multisampling", 2) switch
|
||||||
// saving with these left alone adds nothing an older simulator would not know.
|
|
||||||
private static void WriteAudioDevice(ConfigFile c, SimulatorSettings s)
|
|
||||||
{
|
{
|
||||||
SetName(c, "sound.openal.renderer", s.AudioDevice);
|
<= 0 => AntiAliasingMode.Off,
|
||||||
SetUnlessDefault(c, "sound.outputmode", s.AudioOutputMode, "auto");
|
1 => AntiAliasingMode.Msaa2,
|
||||||
SetUnlessDefault(c, "sound.hrtf", s.AudioHrtf, "auto");
|
2 => AntiAliasingMode.Msaa4,
|
||||||
SetName(c, "sound.hrtf.profile", s.AudioHrtfProfile);
|
_ => AntiAliasingMode.Msaa8
|
||||||
SetName(c, "sound.resampler", s.AudioResampler);
|
|
||||||
SetUnlessDefault(c, "sound.limiter", s.AudioLimiter, "auto");
|
|
||||||
if (c.Has("sound.frequency") || s.AudioFrequency != 0) c.SetInt("sound.frequency", s.AudioFrequency);
|
|
||||||
if (c.Has("sound.doppler") || Math.Abs(s.AudioDoppler - 0.25) > 1e-9) c.SetDouble("sound.doppler", s.AudioDoppler);
|
|
||||||
if (c.Has("sound.efx.lowpass") || s.AudioLowpass) c.SetBool("sound.efx.lowpass", s.AudioLowpass);
|
|
||||||
if (c.Has("sound.efx.airabsorption") || s.AudioAirAbsorption != 0.0) c.SetDouble("sound.efx.airabsorption", s.AudioAirAbsorption);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetUnlessDefault(ConfigFile c, string key, string value, string fallback)
|
|
||||||
{
|
|
||||||
if (c.Has(key) || value != fallback)
|
|
||||||
c.Set(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// An empty name is the library's choice: the line goes, rather than staying with a name in it.
|
|
||||||
private static void SetName(ConfigFile c, string key, string name)
|
|
||||||
{
|
|
||||||
if (name.Length > 0)
|
|
||||||
c.Set(key, name.Contains(' ') ? $"\"{name}\"" : name);
|
|
||||||
else if (c.Has(key))
|
|
||||||
c.Remove(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string Unquoted(string value)
|
|
||||||
{
|
|
||||||
value = value.Trim();
|
|
||||||
return value.Length >= 2 && value[0] == '"' && value[^1] == '"' ? value[1..^1] : value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string FirstTokenOr(ConfigFile c, string key, string fallback)
|
|
||||||
{
|
|
||||||
string token = FirstToken(c, key);
|
|
||||||
return token.Length > 0 ? token : fallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string FirstToken(ConfigFile c, string key)
|
|
||||||
{
|
|
||||||
var tokens = c.GetTokens(key);
|
|
||||||
return tokens.Length > 0 ? tokens[0].ToLowerInvariant() : string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The names the simulator takes for Vulkan; every other word is OpenGL to the screen, and stays in the file until changed.
|
|
||||||
// Whichever of the two keys comes later in the file decides, as each sets the mode when the simulator reads it.
|
|
||||||
private static AntiAliasingMode ReadAntiAliasing(ConfigFile c)
|
|
||||||
{
|
|
||||||
var fromMultisampling = c.GetInt("multisampling", 2) switch
|
|
||||||
{
|
|
||||||
<= 0 => AntiAliasingMode.Off,
|
|
||||||
1 => AntiAliasingMode.Msaa2,
|
|
||||||
2 => AntiAliasingMode.Msaa4,
|
|
||||||
_ => AntiAliasingMode.Msaa8
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!c.Has("gfx.antialiasing") ||
|
|
||||||
(c.Has("multisampling") && c.LineOf("multisampling") > c.LineOf("gfx.antialiasing")))
|
|
||||||
return fromMultisampling;
|
|
||||||
|
|
||||||
return FirstToken(c, "gfx.antialiasing") switch
|
|
||||||
{
|
|
||||||
"off" or "no" or "none" or "0" => AntiAliasingMode.Off,
|
|
||||||
"msaax2" => AntiAliasingMode.Msaa2,
|
|
||||||
"msaax4" => AntiAliasingMode.Msaa4,
|
|
||||||
"msaax8" or "msaax16" => AntiAliasingMode.Msaa8,
|
|
||||||
"taa" => AntiAliasingMode.Taa,
|
|
||||||
"dlss" => AntiAliasingMode.Dlss,
|
|
||||||
"dlaa" => AntiAliasingMode.Dlaa,
|
|
||||||
_ => fromMultisampling
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string AntiAliasingToken(AntiAliasingMode mode) => mode switch
|
|
||||||
{
|
|
||||||
AntiAliasingMode.Msaa2 => "msaax2",
|
|
||||||
AntiAliasingMode.Msaa4 => "msaax4",
|
|
||||||
AntiAliasingMode.Msaa8 => "msaax8",
|
|
||||||
AntiAliasingMode.Taa => "taa",
|
|
||||||
AntiAliasingMode.Dlss => "dlss",
|
|
||||||
AntiAliasingMode.Dlaa => "dlaa",
|
|
||||||
_ => "off"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int MultisamplingLevel(AntiAliasingMode mode) => mode switch
|
private static int MultisamplingLevel(AntiAliasingMode mode) => mode switch
|
||||||
@@ -572,79 +430,28 @@ public sealed class SettingsSerializer
|
|||||||
_ => 0
|
_ => 0
|
||||||
};
|
};
|
||||||
|
|
||||||
private static int ParseFrameGeneration(string value) => value switch
|
private static int Clamp(int v, int lo, int hi) => v < lo ? lo : (v > hi ? hi : v);
|
||||||
{
|
|
||||||
"x2" or "on" or "yes" or "2" => 2,
|
|
||||||
"x3" or "3" => 3,
|
|
||||||
"x4" or "4" => 4,
|
|
||||||
_ => 1
|
|
||||||
};
|
|
||||||
|
|
||||||
private static int ParseReflex(string value) => value switch
|
/// <summary>
|
||||||
|
/// Whether the file's own mousescale can stay as it is: a first number neither
|
||||||
|
/// zero nor NaN/Infinity, and 0.5 or -0.5 after it. Otherwise a save writes the
|
||||||
|
/// one the starter holds.
|
||||||
|
/// </summary>
|
||||||
|
public static bool MouseScaleStands(string? raw)
|
||||||
{
|
{
|
||||||
"on" or "yes" or "1" => 1,
|
string[] tokens = (raw ?? "").Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);
|
||||||
"boost" or "2" => 2,
|
return tokens.Length >= 2 &&
|
||||||
_ => 0
|
TryParseMouseScale(tokens[0], out _) &&
|
||||||
};
|
TryParseMouseScale(tokens[1], out double y) &&
|
||||||
|
Math.Abs(y) == SimulatorSettings.MouseScaleY;
|
||||||
// no/low/medium/high(/ultra) or the number of the level; an absent key keeps the simulator's default.
|
|
||||||
private static int ParseLevel(string value, int fallback, int max)
|
|
||||||
{
|
|
||||||
if (value.Length == 0)
|
|
||||||
return fallback;
|
|
||||||
int level = value switch
|
|
||||||
{
|
|
||||||
"low" or "1" => 1,
|
|
||||||
"medium" or "yes" or "true" or "2" => 2,
|
|
||||||
"high" or "3" => 3,
|
|
||||||
"ultra" or "4" => 4,
|
|
||||||
_ => 0
|
|
||||||
};
|
|
||||||
return Math.Min(level, max);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string LevelToken(int level) => level switch
|
private static bool TryParseMouseScale(string token, out double scale) =>
|
||||||
{
|
double.TryParse(token, NumberStyles.Float, CultureInfo.InvariantCulture, out scale) &&
|
||||||
1 => "low",
|
double.IsFinite(scale) && scale != 0;
|
||||||
2 => "medium",
|
|
||||||
3 => "high",
|
|
||||||
4 => "ultra",
|
|
||||||
_ => "no"
|
|
||||||
};
|
|
||||||
|
|
||||||
// As the simulator reads it, but a value it does not know keeps its default (medium) rather than turning the probe off.
|
|
||||||
private static int ParseCabProbe(string value) => value switch
|
|
||||||
{
|
|
||||||
"no" or "false" or "off" or "0" => 0,
|
|
||||||
"low" or "1" => 1,
|
|
||||||
"high" or "3" => 3,
|
|
||||||
_ => 2
|
|
||||||
};
|
|
||||||
|
|
||||||
private static int ParseAmbientOcclusion(string value) => value switch
|
|
||||||
{
|
|
||||||
"" => 2,
|
|
||||||
"yes" or "true" or "1" or "gtao" => 2,
|
|
||||||
"ssao" => 1,
|
|
||||||
_ => 0
|
|
||||||
};
|
|
||||||
|
|
||||||
private static bool ParseVolumetricFog(string value) =>
|
|
||||||
value is not ("analytic" or "old" or "no" or "false" or "0");
|
|
||||||
|
|
||||||
private static int ParseFogQuality(string value) => value switch
|
|
||||||
{
|
|
||||||
"low" or "1" => 1,
|
|
||||||
"high" or "3" => 3,
|
|
||||||
"ultra" or "4" => 4,
|
|
||||||
_ => 2
|
|
||||||
};
|
|
||||||
|
|
||||||
private static int Clamp(int v, int lo, int hi) => v < lo ? lo : (v > hi ? hi : v);
|
|
||||||
|
|
||||||
private static int SensitivityStep(double mouseScale) =>
|
private static int SensitivityStep(double mouseScale) =>
|
||||||
(int)Math.Clamp(Math.Round(Math.Abs(mouseScale)), 1, 5);
|
(int)Math.Clamp(Math.Round(Math.Abs(mouseScale)), 1, 5);
|
||||||
|
|
||||||
private static double ParseDouble(string s, double fallback) =>
|
private static double ParseDouble(string s, double fallback) =>
|
||||||
double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out double d) ? d : fallback;
|
double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out double d) ? d : fallback;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using StarterNG.Infrastructure;
|
|||||||
using StarterNG.Views;
|
using StarterNG.Views;
|
||||||
using StarterNG.Application;
|
using StarterNG.Application;
|
||||||
using StarterNG.Application.Abstractions;
|
using StarterNG.Application.Abstractions;
|
||||||
|
using StarterNG.Domain;
|
||||||
using StarterNG.Domain.Settings;
|
using StarterNG.Domain.Settings;
|
||||||
|
|
||||||
namespace StarterNG;
|
namespace StarterNG;
|
||||||
@@ -103,6 +104,9 @@ public partial class MainWindow : Window
|
|||||||
AddHandler(KeyDownEvent, OnTabWithNothingFocused, RoutingStrategies.Tunnel);
|
AddHandler(KeyDownEvent, OnTabWithNothingFocused, RoutingStrategies.Tunnel);
|
||||||
|
|
||||||
AppServices.Current.State.Changed += UpdateStartButton;
|
AppServices.Current.State.Changed += UpdateStartButton;
|
||||||
|
Views.Settings.AdvancedModeChanged += UpdateStartButton;
|
||||||
|
// Settings an older starter left are brought into the standard mode, once.
|
||||||
|
SettingsView.MoveToStandardOnce();
|
||||||
Opened += (_, _) =>
|
Opened += (_, _) =>
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -507,6 +511,15 @@ public partial class MainWindow : Window
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The standard mode edits every consist but starts only in one the player drives.
|
||||||
|
if (!TrainsetDisplay.StartableIn(trainset, AppServices.Current.Settings))
|
||||||
|
{
|
||||||
|
startButton.Content = App.Loc[trainset.Decor ? "StartDecor" : "StartAi"];
|
||||||
|
ToolTip.SetTip(startButton, null);
|
||||||
|
startButton.IsEnabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool staffed = HasStartableVehicle(trainset);
|
bool staffed = HasStartableVehicle(trainset);
|
||||||
startButton.Content = staffed ? App.Loc["Start"] : App.Loc["StartNoStaff"];
|
startButton.Content = staffed ? App.Loc["Start"] : App.Loc["StartNoStaff"];
|
||||||
ToolTip.SetTip(startButton, staffed ? null : App.Loc["StartNoStaffConfirm"]);
|
ToolTip.SetTip(startButton, staffed ? null : App.Loc["StartNoStaffConfirm"]);
|
||||||
@@ -633,6 +646,9 @@ public partial class MainWindow : Window
|
|||||||
// would start a second simulator.
|
// would start a second simulator.
|
||||||
if (_starting || DateTime.UtcNow - _startedUtc < StartCooldown)
|
if (_starting || DateTime.UtcNow - _startedUtc < StartCooldown)
|
||||||
return;
|
return;
|
||||||
|
// A shortcut starts the same way the button does, and only where the button may.
|
||||||
|
if (!freeFly && !startButton.IsEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
_starting = true;
|
_starting = true;
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
<IsAotCompatible>true</IsAotCompatible>
|
<IsAotCompatible>true</IsAotCompatible>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<!-- function pointers into the OpenAL library of the simulator (Infrastructure/OpenAlProbe.cs) -->
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<ApplicationIcon>Assets\starter.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\starter.ico</ApplicationIcon>
|
||||||
|
|||||||
@@ -81,15 +81,13 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="0,3,0,0" />
|
Margin="0,3,0,0" />
|
||||||
|
|
||||||
<!-- Why the chosen simulator would ignore the setting. Under
|
<!-- A value of eu07.ini the starter cannot read: amber, as the other warnings. -->
|
||||||
the explanation, at full strength while the rest dims. -->
|
<TextBlock Name="PART_Unknown"
|
||||||
<TextBlock Name="PART_IdleNote"
|
|
||||||
Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
Text="{TemplateBinding IdleNote}"
|
Text="{TemplateBinding UnknownValue}"
|
||||||
IsVisible="False"
|
IsVisible="False"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
FontStyle="Italic"
|
Foreground="#D9A43A"
|
||||||
Foreground="{StaticResource CarbonFg}"
|
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="0,3,0,0" />
|
Margin="0,3,0,0" />
|
||||||
|
|
||||||
@@ -103,6 +101,13 @@
|
|||||||
<Style Selector="^:no-key /template/ SelectableTextBlock#PART_ConfigKey">
|
<Style Selector="^:no-key /template/ SelectableTextBlock#PART_ConfigKey">
|
||||||
<Setter Property="IsVisible" Value="False" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<!-- The standard mode: the eu07.ini key means nothing to a player. -->
|
||||||
|
<Style Selector="^.HideKey /template/ SelectableTextBlock#PART_ConfigKey">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:unknown /template/ TextBlock#PART_Unknown">
|
||||||
|
<Setter Property="IsVisible" Value="True" />
|
||||||
|
</Style>
|
||||||
<Style Selector="^:no-value /template/ TextBlock#PART_Value">
|
<Style Selector="^:no-value /template/ TextBlock#PART_Value">
|
||||||
<Setter Property="IsVisible" Value="False" />
|
<Setter Property="IsVisible" Value="False" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -113,24 +118,6 @@
|
|||||||
<Setter Property="Grid.Column" Value="1" />
|
<Setter Property="Grid.Column" Value="1" />
|
||||||
<Setter Property="Grid.ColumnSpan" Value="2" />
|
<Setter Property="Grid.ColumnSpan" Value="2" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:idle /template/ TextBlock#PART_IdleNote">
|
|
||||||
<Setter Property="IsVisible" Value="True" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:idle /template/ TextBlock#PART_Label">
|
|
||||||
<Setter Property="Opacity" Value="0.45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:idle /template/ ContentPresenter#PART_Content">
|
|
||||||
<Setter Property="Opacity" Value="0.45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:idle /template/ TextBlock#PART_Value">
|
|
||||||
<Setter Property="Opacity" Value="0.45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:idle /template/ TextBlock#PART_Description">
|
|
||||||
<Setter Property="Opacity" Value="0.45" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:idle /template/ SelectableTextBlock#PART_ConfigKey">
|
|
||||||
<Setter Property="Opacity" Value="0.45" />
|
|
||||||
</Style>
|
|
||||||
<!-- A checkbox is its own label, so let it take the label column too.
|
<!-- A checkbox is its own label, so let it take the label column too.
|
||||||
Alignment stays Stretch: a bare slider in a labelless row still
|
Alignment stays Stretch: a bare slider in a labelless row still
|
||||||
wants the full width. -->
|
wants the full width. -->
|
||||||
|
|||||||
@@ -137,7 +137,8 @@
|
|||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
Click="AddToWarehouseButton_OnClick"
|
Click="AddToWarehouseButton_OnClick"
|
||||||
Content="{Binding [AddToWarehouse], Source={x:Static starterNg:App.Loc}}" />
|
Content="{Binding [AddToWarehouse], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Spacing="16"
|
<!-- The advanced mode's own: the standard mode lists every consist with vehicles. -->
|
||||||
|
<StackPanel Name="consistFilters" DockPanel.Dock="Bottom" Orientation="Horizontal" Spacing="16"
|
||||||
Margin="2,6,0,0">
|
Margin="2,6,0,0">
|
||||||
<CheckBox Name="depotDrivableOnlyCheck" FontSize="12"
|
<CheckBox Name="depotDrivableOnlyCheck" FontSize="12"
|
||||||
IsCheckedChanged="ConsistFilter_OnChanged"
|
IsCheckedChanged="ConsistFilter_OnChanged"
|
||||||
|
|||||||
@@ -69,6 +69,13 @@ public partial class Depot : UserControl
|
|||||||
if (Design.IsDesignMode)
|
if (Design.IsDesignMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// The standard mode lists other consists and leaves the crew alone.
|
||||||
|
Settings.AdvancedModeChanged += () =>
|
||||||
|
{
|
||||||
|
PopulateSceneryConsists();
|
||||||
|
RebuildConsist();
|
||||||
|
};
|
||||||
|
|
||||||
_warehouse = new Warehouse(warehouseList, removeFromWarehouseButton, _hand,
|
_warehouse = new Warehouse(warehouseList, removeFromWarehouseButton, _hand,
|
||||||
() => AppServices.Current.State.CurrentTrainset, ApplyFromWarehouse);
|
() => AppServices.Current.State.CurrentTrainset, ApplyFromWarehouse);
|
||||||
_warehouse.SelectionChanged += () =>
|
_warehouse.SelectionChanged += () =>
|
||||||
@@ -77,6 +84,7 @@ public partial class Depot : UserControl
|
|||||||
EditWarehouseSelection();
|
EditWarehouseSelection();
|
||||||
};
|
};
|
||||||
_warehouse.Renamed += _warehouseEdit.Renamed;
|
_warehouse.Renamed += _warehouseEdit.Renamed;
|
||||||
|
_warehouseEdit.Saved += _warehouse.RefreshEntry;
|
||||||
|
|
||||||
_browser = new VehicleBrowser(categoryCombo, classCombo, vehicleListBox, searchBox,
|
_browser = new VehicleBrowser(categoryCombo, classCombo, vehicleListBox, searchBox,
|
||||||
hideArchivalCheck, miniPreview, addVehicleButton, _db, _minis, OpenVehicleBase)
|
hideArchivalCheck, miniPreview, addVehicleButton, _db, _minis, OpenVehicleBase)
|
||||||
@@ -597,6 +605,7 @@ public partial class Depot : UserControl
|
|||||||
|
|
||||||
depotShowAiCheck.IsChecked = AppServices.Current.Settings.ShowAiVehicles;
|
depotShowAiCheck.IsChecked = AppServices.Current.Settings.ShowAiVehicles;
|
||||||
depotDrivableOnlyCheck.IsChecked = AppServices.Current.Settings.DrivableOnly;
|
depotDrivableOnlyCheck.IsChecked = AppServices.Current.Settings.DrivableOnly;
|
||||||
|
consistFilters.IsVisible = AppServices.Current.Settings.AdvancedSettings;
|
||||||
|
|
||||||
_listScenery = AppServices.Current.State.CurrentScenery ?? _sceneries.FirstOrDefault();
|
_listScenery = AppServices.Current.State.CurrentScenery ?? _sceneries.FirstOrDefault();
|
||||||
sceneryConsistsTab.Header = App.Loc["SceneryConsists"];
|
sceneryConsistsTab.Header = App.Loc["SceneryConsists"];
|
||||||
@@ -605,12 +614,11 @@ public partial class Depot : UserControl
|
|||||||
|
|
||||||
if (_listScenery != null)
|
if (_listScenery != null)
|
||||||
{
|
{
|
||||||
bool showAi = AppServices.Current.Settings.ShowAiVehicles;
|
var settings = AppServices.Current.Settings;
|
||||||
bool drivableOnly = AppServices.Current.Settings.DrivableOnly;
|
|
||||||
|
|
||||||
foreach (var trainset in _listScenery.Trainsets)
|
foreach (var trainset in _listScenery.Trainsets)
|
||||||
{
|
{
|
||||||
if (!TrainsetDisplay.ListedIn(trainset, showAi, drivableOnly, AppServices.Current.State.CurrentTrainset))
|
if (!TrainsetDisplay.ListedIn(trainset, settings, AppServices.Current.State.CurrentTrainset))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var entry = new ListBoxItem
|
var entry = new ListBoxItem
|
||||||
@@ -754,17 +762,29 @@ public partial class Depot : UserControl
|
|||||||
if (scenery.Trainsets.Count == 0) return;
|
if (scenery.Trainsets.Count == 0) return;
|
||||||
if (await AskTextureRandomizerOpts() is not { } opts) return;
|
if (await AskTextureRandomizerOpts() is not { } opts) return;
|
||||||
|
|
||||||
var editing = _consist.EditingTrainset;
|
// Each consist goes through a consist of its own, off the screen: the strip and the
|
||||||
|
// list are drawn again once at the end, not for every consist on the way, and one
|
||||||
|
// randomizer looks the candidates up for all of them.
|
||||||
|
var work = new Consist(_db, _info);
|
||||||
|
var rnd = TextureRandomizer(opts);
|
||||||
|
var changed = new HashSet<Trainset>(ReferenceEqualityComparer.Instance);
|
||||||
foreach (var trainset in scenery.Trainsets)
|
foreach (var trainset in scenery.Trainsets)
|
||||||
{
|
{
|
||||||
_consist.LoadFrom(trainset);
|
work.LoadFrom(trainset);
|
||||||
if (ApplyTextureRandomizer(opts))
|
if (work.Count == 0 || rnd.Apply(work, texture => work.MakeDynamic(texture, scenery)) <= 0)
|
||||||
WriteBackToScenery();
|
continue;
|
||||||
|
work.AutoConnectAll();
|
||||||
|
trainset.Vehicles = work.Flatten();
|
||||||
|
changed.Add(trainset);
|
||||||
}
|
}
|
||||||
|
if (changed.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (editing != null)
|
if (_consist.EditingTrainset is { } editing && changed.Contains(editing))
|
||||||
_consist.LoadFrom(editing);
|
_consist.LoadFrom(editing);
|
||||||
RebuildConsist();
|
RefreshConsistListLabels();
|
||||||
|
if (AppServices.Current.State.CurrentTrainset is { } current && changed.Contains(current))
|
||||||
|
AppServices.Current.State.NotifyChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<TextureRandomizerDialog.Options?> AskTextureRandomizerOpts() =>
|
private async Task<TextureRandomizerDialog.Options?> AskTextureRandomizerOpts() =>
|
||||||
@@ -776,19 +796,21 @@ public partial class Depot : UserControl
|
|||||||
{
|
{
|
||||||
if (_consist.Count == 0) return false;
|
if (_consist.Count == 0) return false;
|
||||||
|
|
||||||
var rnd = new TexRandomizer(_db, _rng)
|
if (TextureRandomizer(opts).Apply(_consist, NewVehicle) <= 0)
|
||||||
{
|
|
||||||
WithoutArchival = opts.WithoutArchival,
|
|
||||||
RevisionTolerance = opts.RevisionTolerance,
|
|
||||||
RevYear = opts.RevYear
|
|
||||||
};
|
|
||||||
if (rnd.Apply(_consist, NewVehicle) <= 0)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_consist.AutoConnectAll();
|
_consist.AutoConnectAll();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TexRandomizer TextureRandomizer(TextureRandomizerDialog.Options opts) =>
|
||||||
|
new(_db, _rng)
|
||||||
|
{
|
||||||
|
WithoutArchival = opts.WithoutArchival,
|
||||||
|
RevisionTolerance = opts.RevisionTolerance,
|
||||||
|
RevYear = opts.RevYear
|
||||||
|
};
|
||||||
|
|
||||||
private void RandomOrderButton_OnClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e) =>
|
private void RandomOrderButton_OnClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e) =>
|
||||||
_consist.RandomizeOrder(_rng);
|
_consist.RandomizeOrder(_rng);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Automation;
|
using Avalonia.Automation;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Controls.Documents;
|
||||||
using Avalonia.Controls.Templates;
|
using Avalonia.Controls.Templates;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Layout;
|
using Avalonia.Layout;
|
||||||
@@ -536,8 +537,21 @@ public sealed class VehicleBrowser
|
|||||||
// mostly by who runs them.
|
// mostly by who runs them.
|
||||||
private static Control BrowserLabel(VehicleTexture texture, IReadOnlyList<VehicleTexture>? set)
|
private static Control BrowserLabel(VehicleTexture texture, IReadOnlyList<VehicleTexture>? set)
|
||||||
{
|
{
|
||||||
// Clear of the scroll bar, which lies over the right edge of the list.
|
// Clear of the scroll bar, which lies over the right edge of the list. The name comes
|
||||||
var row = new DockPanel { Margin = new Thickness(0, 0, 10, 0) };
|
// first: a long operator is cut short to a width of its own, and either ends in "…"
|
||||||
|
// rather than running into the other.
|
||||||
|
var row = new Grid { Margin = new Thickness(0, 0, 10, 0), ColumnDefinitions = new ColumnDefinitions("*,Auto") };
|
||||||
|
|
||||||
|
var name = new TextBlock { TextTrimming = TextTrimming.CharacterEllipsis };
|
||||||
|
name.Inlines!.Add(new Run(BrowserName(texture)));
|
||||||
|
if (set is { Count: > 1 })
|
||||||
|
{
|
||||||
|
var count = new Run($" ×{set.Count}");
|
||||||
|
if (Avalonia.Application.Current?.TryGetResource("CarbonFgDim", null, out var dim) == true && dim is IBrush brush)
|
||||||
|
count.Foreground = brush;
|
||||||
|
name.Inlines.Add(count);
|
||||||
|
}
|
||||||
|
row.Children.Add(name);
|
||||||
|
|
||||||
string? op = texture.Meta?.Operator;
|
string? op = texture.Meta?.Operator;
|
||||||
if (!string.IsNullOrWhiteSpace(op) && op != "?")
|
if (!string.IsNullOrWhiteSpace(op) && op != "?")
|
||||||
@@ -546,19 +560,14 @@ public sealed class VehicleBrowser
|
|||||||
{
|
{
|
||||||
Text = op,
|
Text = op,
|
||||||
Opacity = 0.55,
|
Opacity = 0.55,
|
||||||
|
MaxWidth = 110,
|
||||||
Margin = new Thickness(8, 0, 0, 0),
|
Margin = new Thickness(8, 0, 0, 0),
|
||||||
TextTrimming = TextTrimming.CharacterEllipsis
|
TextTrimming = TextTrimming.CharacterEllipsis
|
||||||
};
|
};
|
||||||
DockPanel.SetDock(operatorText, Dock.Right);
|
Grid.SetColumn(operatorText, 1);
|
||||||
row.Children.Add(operatorText);
|
row.Children.Add(operatorText);
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6 };
|
|
||||||
name.Children.Add(new TextBlock { Text = BrowserName(texture) });
|
|
||||||
if (set is { Count: > 1 })
|
|
||||||
name.Children.Add(new TextBlock { Text = $"×{set.Count}", Opacity = 0.55 });
|
|
||||||
row.Children.Add(name);
|
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using StarterNG.Application;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
@@ -116,7 +117,9 @@ public sealed class VehicleCards
|
|||||||
HorizontalAlignment = HorizontalAlignment.Center,
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
Margin = new Thickness(0, 1, 0, 2)
|
Margin = new Thickness(0, 1, 0, 2)
|
||||||
};
|
};
|
||||||
controls.Children.Add(DriverButton(item));
|
// Who sits in the cab - the player, the simulator, a passenger or nobody - is for the advanced mode.
|
||||||
|
if (AppServices.Current.Settings.AdvancedSettings)
|
||||||
|
controls.Children.Add(DriverButton(item));
|
||||||
controls.Children.Add(FlipButton(item));
|
controls.Children.Add(FlipButton(item));
|
||||||
|
|
||||||
if (item.Grouped && item.Cars.Count > 1)
|
if (item.Grouped && item.Cars.Count > 1)
|
||||||
@@ -692,10 +695,13 @@ public sealed class VehicleCards
|
|||||||
else if (_consist.CanJoin(item, index))
|
else if (_consist.CanJoin(item, index))
|
||||||
menu.AddItem(App.Loc["TipJoin"], () => _consist.Join(item));
|
menu.AddItem(App.Loc["TipJoin"], () => _consist.Join(item));
|
||||||
|
|
||||||
var crew = new MenuItem { Header = App.Loc["CrewLabel"] };
|
if (AppServices.Current.Settings.AdvancedSettings)
|
||||||
foreach (var (type, key) in CrewChoices.All)
|
{
|
||||||
crew.Items.Add(MenuItems.Choice(App.Loc[key], item.Driver == type, () => _consist.SetCrew(item, type)));
|
var crew = new MenuItem { Header = App.Loc["CrewLabel"] };
|
||||||
menu.Items.Add(crew);
|
foreach (var (type, key) in CrewChoices.All)
|
||||||
|
crew.Items.Add(MenuItems.Choice(App.Loc[key], item.Driver == type, () => _consist.SetCrew(item, type)));
|
||||||
|
menu.Items.Add(crew);
|
||||||
|
}
|
||||||
|
|
||||||
// The member the panels show, not always the first car of a unit.
|
// The member the panels show, not always the first car of a unit.
|
||||||
menu.AddItem(App.Loc["WagonNumber"] + "…",
|
menu.AddItem(App.Loc["WagonNumber"] + "…",
|
||||||
|
|||||||
@@ -280,6 +280,8 @@ public sealed class VehicleDetails
|
|||||||
};
|
};
|
||||||
driver.MinWidth = 0;
|
driver.MinWidth = 0;
|
||||||
driver.HorizontalAlignment = HorizontalAlignment.Stretch;
|
driver.HorizontalAlignment = HorizontalAlignment.Stretch;
|
||||||
|
// Shown but not changed in the standard mode: who drives is for the advanced one.
|
||||||
|
driver.IsEnabled = AppServices.Current.Settings.AdvancedSettings;
|
||||||
|
|
||||||
var rows = new StackPanel();
|
var rows = new StackPanel();
|
||||||
rows.Children.Add(Row(App.Loc["CrewLabel"], driver));
|
rows.Children.Add(Row(App.Loc["CrewLabel"], driver));
|
||||||
|
|||||||
@@ -62,11 +62,7 @@ public sealed class Warehouse
|
|||||||
var entry = new ListBoxItem
|
var entry = new ListBoxItem
|
||||||
{
|
{
|
||||||
Tag = preset.Name,
|
Tag = preset.Name,
|
||||||
Content = new TextBlock
|
Content = EntryContent(preset.Name, preset.Entry)
|
||||||
{
|
|
||||||
Text = preset.Name,
|
|
||||||
TextTrimming = TextTrimming.CharacterEllipsis
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
_list.Items.Add(entry);
|
_list.Items.Add(entry);
|
||||||
if (current is not null && string.Equals(current, preset.Name, StringComparison.Ordinal))
|
if (current is not null && string.Equals(current, preset.Name, StringComparison.Ordinal))
|
||||||
@@ -81,6 +77,48 @@ public sealed class Warehouse
|
|||||||
SelectionChanged?.Invoke();
|
SelectionChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The consist's name, and under it its vehicles as minis - as the scenery's consists
|
||||||
|
/// are listed - so one is told from another without opening it.
|
||||||
|
/// </summary>
|
||||||
|
private static Control EntryContent(string presetName, string entry)
|
||||||
|
{
|
||||||
|
var name = new TextBlock
|
||||||
|
{
|
||||||
|
Text = presetName,
|
||||||
|
TextTrimming = TextTrimming.CharacterEllipsis
|
||||||
|
};
|
||||||
|
if (ConsistText.VehiclesFrom(entry) is not { } vehicles)
|
||||||
|
return name;
|
||||||
|
|
||||||
|
var content = new StackPanel
|
||||||
|
{
|
||||||
|
Spacing = 2,
|
||||||
|
Margin = new Thickness(0, 3),
|
||||||
|
Children = { name, TrainsetRow.ScrollingStrip(vehicles) }
|
||||||
|
};
|
||||||
|
// Read by its name, not by every caption under it.
|
||||||
|
Avalonia.Automation.AutomationProperties.SetName(content, presetName);
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Redraws one consist's entry after it was edited and saved, so its minis follow the
|
||||||
|
/// edit at once - the rest of the list, its selection and where it is scrolled stay.
|
||||||
|
/// </summary>
|
||||||
|
public void RefreshEntry(string name, string entry)
|
||||||
|
{
|
||||||
|
foreach (var obj in _list.Items)
|
||||||
|
{
|
||||||
|
if (obj is ListBoxItem { Tag: string tag } item &&
|
||||||
|
string.Equals(tag, name, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
item.Content = EntryContent(tag, entry);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string? SelectedName() => (_list.SelectedItem as ListBoxItem)?.Tag as string;
|
private string? SelectedName() => (_list.SelectedItem as ListBoxItem)?.Tag as string;
|
||||||
|
|
||||||
public TrainsetPreset? SelectedPreset() => SelectedName() is { } name ? PresetNamed(name) : null;
|
public TrainsetPreset? SelectedPreset() => SelectedName() is { } name ? PresetNamed(name) : null;
|
||||||
|
|||||||
@@ -50,6 +50,69 @@ public static class MessageBox
|
|||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A warning to read before saying yes: the yes button counts down and only then
|
||||||
|
/// takes a click. Enter and Esc both decline, so nothing is agreed to by habit.
|
||||||
|
/// </summary>
|
||||||
|
public static async Task<bool> ShowDelayed(Window owner, string message, string title, string yesText,
|
||||||
|
int seconds)
|
||||||
|
{
|
||||||
|
var win = FixedDialog(title, 520);
|
||||||
|
|
||||||
|
bool yes = false;
|
||||||
|
var yesBtn = DialogButton($"{yesText} ({seconds})", "Accent", 120, () => { yes = true; win.Close(); });
|
||||||
|
var noBtn = DialogButton(App.Loc["Cancel"], "Flat", 80, () => win.Close());
|
||||||
|
yesBtn.IsEnabled = false;
|
||||||
|
noBtn.IsDefault = true;
|
||||||
|
noBtn.IsCancel = true;
|
||||||
|
ReadMessage(win, noBtn, message);
|
||||||
|
|
||||||
|
int left = seconds;
|
||||||
|
var timer = new Avalonia.Threading.DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
|
||||||
|
timer.Tick += (_, _) =>
|
||||||
|
{
|
||||||
|
// Only time spent with the warning in front of the player counts: the window active and all of it on a screen.
|
||||||
|
if (!win.IsActive || win.WindowState == WindowState.Minimized || !WhollyOnScreen(win))
|
||||||
|
return;
|
||||||
|
left--;
|
||||||
|
if (left > 0)
|
||||||
|
{
|
||||||
|
yesBtn.Content = $"{yesText} ({left})";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
timer.Stop();
|
||||||
|
yesBtn.Content = yesText;
|
||||||
|
yesBtn.IsEnabled = true;
|
||||||
|
};
|
||||||
|
win.Closed += (_, _) => timer.Stop();
|
||||||
|
|
||||||
|
win.Content = new StackPanel
|
||||||
|
{
|
||||||
|
Margin = new Avalonia.Thickness(16),
|
||||||
|
Spacing = 16,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new SelectableTextBlock { Text = message, TextWrapping = TextWrapping.Wrap },
|
||||||
|
ButtonRow(yesBtn, noBtn)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
timer.Start();
|
||||||
|
await win.ShowDialog(owner);
|
||||||
|
return yes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Whether the whole window, frame and all, lies within the working area of one screen.</summary>
|
||||||
|
internal static bool WhollyOnScreen(Window win)
|
||||||
|
{
|
||||||
|
var size = win.FrameSize ?? win.ClientSize;
|
||||||
|
var rect = new Avalonia.PixelRect(win.Position, Avalonia.PixelSize.FromSize(size, win.RenderScaling));
|
||||||
|
foreach (var screen in win.Screens.All)
|
||||||
|
if (screen.WorkingArea.Contains(rect))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A question with two answers and a way back: true for the first, false for the second, null when cancelled
|
/// A question with two answers and a way back: true for the first, false for the second, null when cancelled
|
||||||
/// or the window is closed - closing it never picks one of the answers.
|
/// or the window is closed - closing it never picks one of the answers.
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public partial class Scenarios : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SyncConsistRowHeight();
|
SyncConsistRowHeight();
|
||||||
|
Settings.AdvancedModeChanged += OnAdvancedModeChanged;
|
||||||
|
|
||||||
Sceneries = AppServices.Current.Library.Sceneries;
|
Sceneries = AppServices.Current.Library.Sceneries;
|
||||||
|
|
||||||
@@ -86,6 +87,43 @@ public partial class Scenarios : UserControl
|
|||||||
state.StartingVehicleName = vehicle;
|
state.StartingVehicleName = vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnAdvancedModeChanged()
|
||||||
|
{
|
||||||
|
RefreshVehicleList();
|
||||||
|
RefreshFaultMarks(sceneryList.Items);
|
||||||
|
if (SelectedScenery is { } scenery)
|
||||||
|
PopulateFaults(scenery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The scenery files' mistakes - written wrong, or vehicles the simulator will not
|
||||||
|
/// find - are for those who mend sceneries: shown in the advanced mode only.
|
||||||
|
/// </summary>
|
||||||
|
private static bool ShowsFaults => AppServices.Current.Settings.AdvancedSettings;
|
||||||
|
|
||||||
|
// The tree's marks put on or taken off where they stand, the selection and what is
|
||||||
|
// unfolded kept.
|
||||||
|
private void RefreshFaultMarks(ItemCollection items)
|
||||||
|
{
|
||||||
|
foreach (var obj in items)
|
||||||
|
{
|
||||||
|
if (obj is not TreeViewItem node)
|
||||||
|
continue;
|
||||||
|
if (node.Tag is int index && index < Sceneries.Count)
|
||||||
|
{
|
||||||
|
string? label = node.Header switch
|
||||||
|
{
|
||||||
|
string text => text,
|
||||||
|
StackPanel { Children: [TextBlock name, ..] } => name.Text,
|
||||||
|
_ => null
|
||||||
|
};
|
||||||
|
if (label is not null)
|
||||||
|
node.Header = SceneryHeader(label, Sceneries[index]);
|
||||||
|
}
|
||||||
|
RefreshFaultMarks(node.Items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void BuildSceneryTree()
|
private void BuildSceneryTree()
|
||||||
{
|
{
|
||||||
sceneryList.Items.Clear();
|
sceneryList.Items.Clear();
|
||||||
@@ -119,7 +157,7 @@ public partial class Scenarios : UserControl
|
|||||||
/// <summary>The scenery's name, marked when its files hold mistakes.</summary>
|
/// <summary>The scenery's name, marked when its files hold mistakes.</summary>
|
||||||
private object SceneryHeader(string label, Scenery scenery)
|
private object SceneryHeader(string label, Scenery scenery)
|
||||||
{
|
{
|
||||||
if (scenery.Faults.Count == 0)
|
if (!ShowsFaults || scenery.Faults.Count == 0)
|
||||||
return label;
|
return label;
|
||||||
|
|
||||||
var mark = new Material.Icons.Avalonia.MaterialIcon
|
var mark = new Material.Icons.Avalonia.MaterialIcon
|
||||||
@@ -257,20 +295,13 @@ public partial class Scenarios : UserControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>A consist's label in a list of them, here and on the depot page.</summary>
|
/// <summary>A consist's label in a list of them, here and on the depot page.</summary>
|
||||||
internal static TextBlock TrainsetListContent(Trainset trainset) =>
|
internal static Control TrainsetListContent(Trainset trainset) => TrainsetRow.Build(trainset);
|
||||||
new Avalonia.Controls.TextBlock
|
|
||||||
{
|
|
||||||
Text = TrainsetDisplay.ListLabel(trainset),
|
|
||||||
TextTrimming = Avalonia.Media.TextTrimming.CharacterEllipsis,
|
|
||||||
TextWrapping = Avalonia.Media.TextWrapping.NoWrap
|
|
||||||
};
|
|
||||||
|
|
||||||
private void PopulateVehicleList(Scenery scn)
|
private void PopulateVehicleList(Scenery scn)
|
||||||
{
|
{
|
||||||
vehicleList.Items.Clear();
|
vehicleList.Items.Clear();
|
||||||
|
|
||||||
bool showAi = AppServices.Current.Settings.ShowAiVehicles;
|
var settings = AppServices.Current.Settings;
|
||||||
bool drivableOnly = AppServices.Current.Settings.DrivableOnly;
|
|
||||||
var current = AppServices.Current.State.CurrentTrainset;
|
var current = AppServices.Current.State.CurrentTrainset;
|
||||||
ListBoxItem? currentRow = null;
|
ListBoxItem? currentRow = null;
|
||||||
|
|
||||||
@@ -278,7 +309,7 @@ public partial class Scenarios : UserControl
|
|||||||
{
|
{
|
||||||
var trainset = scn.Trainsets[i];
|
var trainset = scn.Trainsets[i];
|
||||||
|
|
||||||
if (!TrainsetDisplay.ListedIn(trainset, showAi, drivableOnly, current)) continue;
|
if (!TrainsetDisplay.ListedIn(trainset, settings, current)) continue;
|
||||||
|
|
||||||
var listItem = new ListBoxItem
|
var listItem = new ListBoxItem
|
||||||
{
|
{
|
||||||
@@ -441,8 +472,9 @@ public partial class Scenarios : UserControl
|
|||||||
private void PopulateFaults(Scenery scenery)
|
private void PopulateFaults(Scenery scenery)
|
||||||
{
|
{
|
||||||
var faults = scenery.Faults;
|
var faults = scenery.Faults;
|
||||||
faultsTab.IsVisible = faults.Count > 0;
|
bool shown = ShowsFaults && faults.Count > 0;
|
||||||
if (faults.Count == 0)
|
faultsTab.IsVisible = shown;
|
||||||
|
if (!shown)
|
||||||
{
|
{
|
||||||
if (infoTabs.SelectedItem == faultsTab)
|
if (infoTabs.SelectedItem == faultsTab)
|
||||||
infoTabs.SelectedIndex = 0;
|
infoTabs.SelectedIndex = 0;
|
||||||
@@ -1015,6 +1047,11 @@ public partial class Scenarios : UserControl
|
|||||||
});
|
});
|
||||||
|
|
||||||
var db = AppServices.Current.Library.Vehicles;
|
var db = AppServices.Current.Library.Vehicles;
|
||||||
|
// The start goes by the vehicle's name, so of several named alike only the first is the one marked.
|
||||||
|
string? picked = AppServices.Current.State.StartingVehicleName;
|
||||||
|
var pickedVehicle = string.IsNullOrEmpty(picked)
|
||||||
|
? null
|
||||||
|
: trainset.Vehicles.FirstOrDefault(v => string.Equals(v.Name, picked, StringComparison.OrdinalIgnoreCase));
|
||||||
foreach (var train in trainset.Vehicles)
|
foreach (var train in trainset.Vehicles)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1036,9 +1073,7 @@ public partial class Scenarios : UserControl
|
|||||||
})
|
})
|
||||||
: MiniTextures.MissingVisual(train.SkinFile, thumbH);
|
: MiniTextures.MissingVisual(train.SkinFile, thumbH);
|
||||||
|
|
||||||
bool selected = !string.IsNullOrEmpty(train.Name) &&
|
bool selected = ReferenceEquals(train, pickedVehicle);
|
||||||
string.Equals(train.Name, AppServices.Current.State.StartingVehicleName,
|
|
||||||
StringComparison.OrdinalIgnoreCase);
|
|
||||||
// The vehicle started in gets a frame over its picture as well as the lines above and below:
|
// The vehicle started in gets a frame over its picture as well as the lines above and below:
|
||||||
// two thin lines alone were hard to see. Drawn over the picture, it moves no vehicle aside.
|
// two thin lines alone were hard to see. Drawn over the picture, it moves no vehicle aside.
|
||||||
if (selected)
|
if (selected)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using StarterNG.Domain.Settings;
|
using StarterNG.Domain.Settings;
|
||||||
|
|
||||||
@@ -29,49 +28,11 @@ internal static class SettingTexts
|
|||||||
AntiAliasingMode.Msaa2 => "MSAA x2",
|
AntiAliasingMode.Msaa2 => "MSAA x2",
|
||||||
AntiAliasingMode.Msaa4 => "MSAA x4",
|
AntiAliasingMode.Msaa4 => "MSAA x4",
|
||||||
AntiAliasingMode.Msaa8 => "MSAA x8",
|
AntiAliasingMode.Msaa8 => "MSAA x8",
|
||||||
AntiAliasingMode.Taa => App.Loc["AaTaa"],
|
|
||||||
AntiAliasingMode.Dlss => App.Loc["AaDlss"],
|
|
||||||
AntiAliasingMode.Dlaa => App.Loc["AaDlaa"],
|
|
||||||
_ => App.Loc["MsaaNone"]
|
_ => App.Loc["MsaaNone"]
|
||||||
};
|
};
|
||||||
|
|
||||||
private static string Level(int level) => App.Loc[level switch
|
|
||||||
{
|
|
||||||
1 => "LevelLow",
|
|
||||||
2 => "LevelMedium",
|
|
||||||
3 => "LevelHigh",
|
|
||||||
4 => "LevelUltra",
|
|
||||||
_ => "LevelOff"
|
|
||||||
}];
|
|
||||||
|
|
||||||
public static string TwoDecimals(double value) => value.ToString("0.00", CultureInfo.CurrentCulture);
|
public static string TwoDecimals(double value) => value.ToString("0.00", CultureInfo.CurrentCulture);
|
||||||
|
|
||||||
public static string ShadowMapWord(int pixels) => pixels switch
|
|
||||||
{
|
|
||||||
<= 512 => App.Loc["QualityVeryLow"],
|
|
||||||
<= 1024 => App.Loc["QualityLow"],
|
|
||||||
<= 2048 => App.Loc["QualityModerate"],
|
|
||||||
<= 4096 => App.Loc["QualityHigh"],
|
|
||||||
_ => App.Loc["QualityVeryHigh"]
|
|
||||||
};
|
|
||||||
|
|
||||||
public static string ShadowRangeWord(int metres) => metres switch
|
|
||||||
{
|
|
||||||
<= 100 => App.Loc["RangeLow"],
|
|
||||||
<= 150 => App.Loc["RangeModerate"],
|
|
||||||
<= 250 => App.Loc["RangeHigh"],
|
|
||||||
_ => App.Loc["RangeVeryHigh"]
|
|
||||||
};
|
|
||||||
|
|
||||||
public static string CabShadowRangeWord(int metres) => metres switch
|
|
||||||
{
|
|
||||||
<= 10 => App.Loc["RangeVeryLow"],
|
|
||||||
<= 20 => App.Loc["RangeLow"],
|
|
||||||
<= 30 => App.Loc["RangeStandard"],
|
|
||||||
<= 50 => App.Loc["RangeHigh"],
|
|
||||||
_ => App.Loc["RangeVeryHigh"]
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>A rate below one a second reads better as the time between updates.</summary>
|
/// <summary>A rate below one a second reads better as the time between updates.</summary>
|
||||||
public static string ReflectionsInterval(double perSecond)
|
public static string ReflectionsInterval(double perSecond)
|
||||||
{
|
{
|
||||||
@@ -82,72 +43,4 @@ internal static class SettingTexts
|
|||||||
? string.Format(App.Loc["EveryMinutes"], (seconds / 60).ToString("0.#", CultureInfo.CurrentCulture))
|
? string.Format(App.Loc["EveryMinutes"], (seconds / 60).ToString("0.#", CultureInfo.CurrentCulture))
|
||||||
: string.Format(App.Loc["EverySeconds"], seconds.ToString("0.#", CultureInfo.CurrentCulture));
|
: string.Format(App.Loc["EverySeconds"], seconds.ToString("0.#", CultureInfo.CurrentCulture));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>What a level sets, in the words and the units of the rows it sets.</summary>
|
|
||||||
public static string PresetSummary(GraphicsPreset p)
|
|
||||||
{
|
|
||||||
var lines = new List<string>();
|
|
||||||
void Add(string label, string value) => lines.Add(App.Loc[label] + ": " + value);
|
|
||||||
string YesNo(bool on) => App.Loc[on ? "Yes" : "No"];
|
|
||||||
string Whole(double value) => value.ToString("0.#", CultureInfo.CurrentCulture);
|
|
||||||
|
|
||||||
Add("MaxTexResolution", p.TextureSize + " px");
|
|
||||||
Add("MaxTexCabResolution", p.CabTextureSize + " px");
|
|
||||||
Add("TexFilteringQuality", Anisotropy(p.Anisotropy));
|
|
||||||
Add("AntiAliasing", AntiAliasing(p.AntiAliasing));
|
|
||||||
Add("DynamicLights", p.DynamicLights.ToString(CultureInfo.CurrentCulture));
|
|
||||||
Add("SmokeParticlesMultiplier", Fidelity(p.SmokeFidelity));
|
|
||||||
Add("RenderShadows", YesNo(p.Shadows));
|
|
||||||
if (p.Shadows)
|
|
||||||
{
|
|
||||||
Add("ShadowsResolution", p.ShadowMap + " px");
|
|
||||||
Add("ShaderRange", SimulatorSettings.ShadowReach(p.ShadowRange, p.ShadowMap, legacyRenderer: false) + " m");
|
|
||||||
Add("ShadowDisplay", App.Loc[p.ShadowRank switch { 1 => "CSROnlyImportant", 2 => "CSRLimited", _ => "CSRAll" }]);
|
|
||||||
}
|
|
||||||
Add("ReflectionsCubeMap", YesNo(p.EnvMap));
|
|
||||||
if (p.EnvMap)
|
|
||||||
{
|
|
||||||
Add("ReflectionsDetails", App.Loc[p.ReflectionsFidelity switch { 0 => "RDTerrain", 1 => "RDTerrainModels", _ => "RDTerrainModelsVehicles" }]);
|
|
||||||
Add("ReflectionsFramerate", ReflectionsInterval(p.ReflectionsRate));
|
|
||||||
}
|
|
||||||
Add("AdditionalShadersEffects", YesNo(p.ExtraEffects));
|
|
||||||
Add("TrackCurvesQuality", Fidelity(p.SplineFidelity));
|
|
||||||
Add("Ini.basedrawrange", Whole(p.DrawRange) + " m");
|
|
||||||
Add("Ini.heightbase", "×" + p.DistanceFactor.ToString("0.##", CultureInfo.CurrentCulture));
|
|
||||||
Add("BufforResolution", p.BufferScale + "%");
|
|
||||||
Add("Ini." + GraphicsPreset.SleeperKey, Whole(p.SleeperDistance) + " m");
|
|
||||||
Add("RenderRange", "×" + Whole(p.DrawRangeFactor));
|
|
||||||
Add("Ini." + GraphicsPreset.ReflectedInstancesKey, Whole(p.ReflectedInstances) + " m");
|
|
||||||
Add("Ini." + GraphicsPreset.ReflectedVehiclesKey, Whole(p.ReflectedVehicles) + " m");
|
|
||||||
|
|
||||||
var renderer = p.NewRenderer;
|
|
||||||
Add("LightShadows", Level(renderer.LampShadows));
|
|
||||||
Add("ContactShadows", Level(renderer.ContactShadows));
|
|
||||||
Add("AmbientOcclusion", renderer.Occlusion switch { 1 => "SSAO", 2 => "GTAO", _ => App.Loc["LevelOff"] });
|
|
||||||
Add("CabProbe", Level(renderer.CabProbe));
|
|
||||||
Add("Ssr", Level(renderer.ScreenReflections));
|
|
||||||
Add("RayTracing", YesNo(renderer.RayTracing));
|
|
||||||
Add("VolumetricFog", renderer.VolumetricFog ? Level(renderer.FogQuality) : App.Loc["No"]);
|
|
||||||
Add("Clouds", Level(renderer.Clouds));
|
|
||||||
Add("Grass", renderer.Grass ? renderer.GrassDistance + " m" : App.Loc["No"]);
|
|
||||||
Add("Bloom", YesNo(renderer.Bloom));
|
|
||||||
|
|
||||||
if (p.Extras is { } extras)
|
|
||||||
{
|
|
||||||
Add("MotionBlur", YesNo(extras.MotionBlur));
|
|
||||||
Add("ChromaticAberration", YesNo(extras.ChromaticAberration));
|
|
||||||
Add("SmokeDisplay", YesNo(extras.Smoke));
|
|
||||||
Add("PyScreenPriority", App.Loc[extras.PythonUpdateMs <= 200 ? "PyPriorityNormal" : "PyPriorityLowest"]);
|
|
||||||
}
|
|
||||||
if (p.Top is { } top)
|
|
||||||
{
|
|
||||||
lines.Insert(0, App.Loc["PresetUltraNote"]);
|
|
||||||
Add("ShadowAngleLimit", TwoDecimals(top.ShadowAngleLimit));
|
|
||||||
Add("Ini." + GraphicsTop.TargetFpsKey, YesNo(top.TargetFps > 0));
|
|
||||||
Add("Ini." + GraphicsTop.TextureReleaseKey, YesNo(top.TextureRelease > 0));
|
|
||||||
Add("CompressTextures", YesNo(top.CompressTextures));
|
|
||||||
Add("IgnoreIrrelevantTrains", YesNo(top.SkipDecor));
|
|
||||||
}
|
|
||||||
return string.Join("\n", lines);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,17 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using StarterNG.Application;
|
using StarterNG.Application;
|
||||||
using StarterNG.Domain.Settings;
|
using StarterNG.Domain.Settings;
|
||||||
|
using StarterNG.Infrastructure;
|
||||||
|
|
||||||
namespace StarterNG.Views;
|
namespace StarterNG.Views;
|
||||||
|
|
||||||
// What the graphics and effects categories add to the screen: the controls of the settings the
|
// What the graphics and effects categories add to the screen: the renderer and the
|
||||||
// new renderers read, the dependencies between them (what the simulator only does on Vulkan,
|
// anti-aliasing, and the import and export of eu07.ini.
|
||||||
// with DLSS, ...), and the import and export of eu07.ini.
|
|
||||||
public partial class Settings
|
public partial class Settings
|
||||||
{
|
{
|
||||||
private static readonly CultureInfo Invariant = CultureInfo.InvariantCulture;
|
private static readonly CultureInfo Invariant = CultureInfo.InvariantCulture;
|
||||||
@@ -24,264 +23,113 @@ public partial class Settings
|
|||||||
new("*") { Patterns = new[] { "*" } }
|
new("*") { Patterns = new[] { "*" } }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>Set while the dependencies are brought in line, so the changes they make do not recurse.</summary>
|
|
||||||
private bool _updatingGraphics;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// What only Vulkan has, as it was when OpenGL got chosen, so that going back to
|
|
||||||
/// Vulkan brings it back instead of leaving it switched off.
|
|
||||||
/// </summary>
|
|
||||||
private (AntiAliasingMode AntiAliasing, int FrameGeneration, int Reflex, bool RayTracing)? _vulkanChoices;
|
|
||||||
|
|
||||||
private string? _dlssProbedFor;
|
|
||||||
private (bool Dlss, bool FrameGeneration) _dlssProbe;
|
|
||||||
|
|
||||||
private static bool DlssPlatform => AppServices.Current.SettingsStore.DlssPlatform;
|
|
||||||
|
|
||||||
private void InitGraphics()
|
|
||||||
{
|
|
||||||
// The notes are worked out here, not bound, so they follow a change of language by hand.
|
|
||||||
App.Loc.LanguageChanged += UpdateGraphicsState;
|
|
||||||
SelectExeCb.SelectionChanged += (_, _) => UpdateGraphicsState();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowGraphics(SimulatorSettings s)
|
private void ShowGraphics(SimulatorSettings s)
|
||||||
{
|
{
|
||||||
RenderEngineCb.SelectedIndex = s.RenderEngine;
|
RenderEngineCb.SelectedIndex = s.RenderEngine;
|
||||||
VulkanDeviceTb.Text = s.VulkanDevice;
|
|
||||||
SelectTag(AntiAliasingCb, AntiAliasingTag(s.AntiAliasing));
|
SelectTag(AntiAliasingCb, AntiAliasingTag(s.AntiAliasing));
|
||||||
SelectTag(DlssPresetCb, s.DlssPreset);
|
_fullscreenAsRead = s.Fullscreen;
|
||||||
SelectTag(FrameGenerationCb, s.FrameGeneration.ToString(Invariant));
|
SelectTag(DisplayModeCb, DisplayModeOf(s.Fullscreen, s.FullscreenWindowed));
|
||||||
SelectTag(ReflexCb, s.Reflex.ToString(Invariant));
|
ShowMonitor(s.FullscreenMonitor);
|
||||||
|
UpdateDisplayRows();
|
||||||
ShadowSdsmCb.IsChecked = s.ShadowSdsm;
|
|
||||||
LightsClusteredCb.IsChecked = s.LightsClustered;
|
|
||||||
SelectTag(LightShadowsCb, s.LightShadows.ToString(Invariant));
|
|
||||||
SelectTag(ContactShadowsCb, s.ContactShadows.ToString(Invariant));
|
|
||||||
SelectTag(AmbientOcclusionCb, s.AmbientOcclusion.ToString(Invariant));
|
|
||||||
SelectOrAddTag(AoQualityCb, $"{s.AoSlices} {s.AoSteps}", $"{s.AoSlices} / {s.AoSteps}");
|
|
||||||
AoLightingCb.IsChecked = s.AoLighting;
|
|
||||||
SelectTag(CabProbeCb, s.CabProbe.ToString(Invariant));
|
|
||||||
CabProbeIntervalNud.Value = s.CabProbeInterval;
|
|
||||||
CabProbeBounceSlider.Value = s.CabProbeBounce;
|
|
||||||
CabProbeReflectionsCb.IsChecked = s.CabProbeReflections;
|
|
||||||
|
|
||||||
SelectTag(SsrCb, s.Ssr.ToString(Invariant));
|
|
||||||
RayTracingCb.IsChecked = s.RayTracing;
|
|
||||||
RayTracingRangeSlider.Value = s.RayTracingRange;
|
|
||||||
|
|
||||||
VolumetricFogCb.IsChecked = s.VolumetricFog;
|
|
||||||
SelectTag(FogQualityCb, s.FogQuality.ToString(Invariant));
|
|
||||||
SelectTag(CloudsCb, s.Clouds.ToString(Invariant));
|
|
||||||
CloudShadowsCb.IsChecked = s.CloudShadows;
|
|
||||||
|
|
||||||
BloomCb.IsChecked = s.Bloom;
|
|
||||||
AutoExposureCb.IsChecked = s.AutoExposure;
|
|
||||||
|
|
||||||
GrassCb.IsChecked = s.Grass;
|
|
||||||
GrassDistanceSlider.Value = s.GrassDistance;
|
|
||||||
GrassDensitySlider.Value = s.GrassDensity;
|
|
||||||
string particles = s.PrecipitationParticles.ToString(Invariant);
|
|
||||||
SelectOrAddTag(PrecipitationCb, particles, particles);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CaptureGraphics(SimulatorSettings s)
|
private void CaptureGraphics(SimulatorSettings s)
|
||||||
{
|
{
|
||||||
s.RenderEngine = Math.Max(0, RenderEngineCb.SelectedIndex);
|
s.RenderEngine = Math.Max(0, RenderEngineCb.SelectedIndex);
|
||||||
s.VulkanDevice = VulkanDeviceTb.Text?.Trim() ?? "";
|
|
||||||
s.AntiAliasing = AntiAliasingFromTag(SelectedTag(AntiAliasingCb));
|
s.AntiAliasing = AntiAliasingFromTag(SelectedTag(AntiAliasingCb));
|
||||||
s.DlssPreset = SelectedTag(DlssPresetCb) ?? "default";
|
s.FullscreenMonitor = SelectedTag(MonitorCb) ?? string.Empty;
|
||||||
s.FrameGeneration = TagInt(FrameGenerationCb, 1);
|
|
||||||
s.Reflex = TagInt(ReflexCb, 0);
|
|
||||||
|
|
||||||
s.ShadowSdsm = IsChecked(ShadowSdsmCb);
|
string mode = SelectedTag(DisplayModeCb) ?? FullscreenMode;
|
||||||
s.LightsClustered = IsChecked(LightsClusteredCb);
|
s.FullscreenWindowed = mode == BorderlessMode;
|
||||||
s.LightShadows = TagInt(LightShadowsCb, 2);
|
// Borderless overrides fullscreen in the simulator, so the file's own word for it stays.
|
||||||
s.ContactShadows = TagInt(ContactShadowsCb, 0);
|
s.Fullscreen = mode == BorderlessMode ? _fullscreenAsRead : mode == FullscreenMode;
|
||||||
s.AmbientOcclusion = TagInt(AmbientOcclusionCb, 2);
|
|
||||||
var ao = (SelectedTag(AoQualityCb) ?? "3 4").Split(' ');
|
|
||||||
s.AoSlices = ao.Length > 0 && int.TryParse(ao[0], NumberStyles.Integer, Invariant, out int slices) ? slices : 3;
|
|
||||||
s.AoSteps = ao.Length > 1 && int.TryParse(ao[1], NumberStyles.Integer, Invariant, out int steps) ? steps : 4;
|
|
||||||
s.AoLighting = IsChecked(AoLightingCb);
|
|
||||||
s.CabProbe = TagInt(CabProbeCb, 2);
|
|
||||||
s.CabProbeInterval = (int)(CabProbeIntervalNud.Value ?? 4);
|
|
||||||
s.CabProbeBounce = CabProbeBounceSlider.Value;
|
|
||||||
s.CabProbeReflections = IsChecked(CabProbeReflectionsCb);
|
|
||||||
|
|
||||||
s.Ssr = TagInt(SsrCb, 2);
|
|
||||||
s.RayTracing = IsChecked(RayTracingCb);
|
|
||||||
s.RayTracingRange = (int)RayTracingRangeSlider.Value;
|
|
||||||
|
|
||||||
s.VolumetricFog = IsChecked(VolumetricFogCb);
|
|
||||||
s.FogQuality = TagInt(FogQualityCb, 2);
|
|
||||||
s.Clouds = TagInt(CloudsCb, 2);
|
|
||||||
s.CloudShadows = IsChecked(CloudShadowsCb);
|
|
||||||
|
|
||||||
s.Bloom = IsChecked(BloomCb);
|
|
||||||
s.AutoExposure = IsChecked(AutoExposureCb);
|
|
||||||
|
|
||||||
s.Grass = IsChecked(GrassCb);
|
|
||||||
s.GrassDistance = (int)GrassDistanceSlider.Value;
|
|
||||||
s.GrassDensity = GrassDensitySlider.Value;
|
|
||||||
s.PrecipitationParticles = TagInt(PrecipitationCb, 65536);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBackendChanged()
|
// ── How the simulator shows: full screen, borderless or in a window ──────
|
||||||
|
|
||||||
|
private const string FullscreenMode = "fullscreen";
|
||||||
|
private const string BorderlessMode = "borderless";
|
||||||
|
private const string WindowMode = "window";
|
||||||
|
|
||||||
|
/// <summary>fullscreen as the file has it, kept where borderless makes it of no account.</summary>
|
||||||
|
private bool _fullscreenAsRead;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The mode the two keys make (application.cpp): fullscreenwindowed takes the monitor's
|
||||||
|
/// own size and turns full screen on whatever fullscreen says.
|
||||||
|
/// </summary>
|
||||||
|
private static string DisplayModeOf(bool fullscreen, bool windowed) =>
|
||||||
|
windowed ? BorderlessMode : fullscreen ? FullscreenMode : WindowMode;
|
||||||
|
|
||||||
|
/// <summary>A borderless screen takes the monitor's size; a window can't be put on a monitor.</summary>
|
||||||
|
private void UpdateDisplayRows()
|
||||||
{
|
{
|
||||||
if (_loading || _updatingGraphics)
|
string mode = SelectedTag(DisplayModeCb) ?? FullscreenMode;
|
||||||
return;
|
Dim(ResolutionRow, mode == BorderlessMode);
|
||||||
|
Dim(MonitorRow, mode == WindowMode);
|
||||||
|
}
|
||||||
|
|
||||||
_updatingGraphics = true;
|
/// <summary>The whole row greyed out, its label and description too, as a disabled check box is.</summary>
|
||||||
try
|
private static void Dim(Control row, bool off)
|
||||||
{
|
{
|
||||||
if (!SettingReach.IsVulkan(SelectedRenderer()))
|
row.IsEnabled = !off;
|
||||||
{
|
row.Opacity = off ? 0.45 : 1;
|
||||||
var s = Trial();
|
}
|
||||||
_vulkanChoices ??= (s.AntiAliasing, s.FrameGeneration, s.Reflex, s.RayTracing);
|
|
||||||
if (GraphicsRules.IsDlss(s.AntiAliasing))
|
|
||||||
SelectTag(AntiAliasingCb, "taa");
|
|
||||||
FrameGenerationCb.SelectedIndex = 0;
|
|
||||||
ReflexCb.SelectedIndex = 0;
|
|
||||||
RayTracingCb.IsChecked = false;
|
|
||||||
}
|
|
||||||
else if (_vulkanChoices is { } kept)
|
|
||||||
{
|
|
||||||
if (GraphicsRules.IsDlss(kept.AntiAliasing) && DlssPlatform && SelectedTag(AntiAliasingCb) == "taa")
|
|
||||||
SelectTag(AntiAliasingCb, AntiAliasingTag(kept.AntiAliasing));
|
|
||||||
SelectTag(FrameGenerationCb, kept.FrameGeneration.ToString(Invariant));
|
|
||||||
SelectTag(ReflexCb, kept.Reflex.ToString(Invariant));
|
|
||||||
RayTracingCb.IsChecked = kept.RayTracing;
|
|
||||||
_vulkanChoices = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_updatingGraphics = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateGraphicsState();
|
private ComboBoxItem? _primaryMonitorItem;
|
||||||
|
|
||||||
|
private IReadOnlyList<DisplayMonitor>? _monitors;
|
||||||
|
|
||||||
|
/// <summary>The monitors attached, read once.</summary>
|
||||||
|
private IReadOnlyList<DisplayMonitor> MonitorList => _monitors ??= Monitors.List(AppServices.Current.Environment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The monitor the simulator will show on (application.cpp): a full screen, borderless or
|
||||||
|
/// not, goes to the one chosen, or the primary one when that is not connected; a window
|
||||||
|
/// opens where the system puts it, as a rule the primary one. Null where no monitor could be read.
|
||||||
|
/// </summary>
|
||||||
|
private DisplayMonitor? SimulatorMonitor()
|
||||||
|
{
|
||||||
|
string? chosen = SelectedTag(DisplayModeCb) == WindowMode ? null : SelectedTag(MonitorCb);
|
||||||
|
DisplayMonitor? primary = null;
|
||||||
|
foreach (var m in MonitorList)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(chosen) && m.Id == chosen)
|
||||||
|
return m;
|
||||||
|
if (m.Primary)
|
||||||
|
primary ??= m;
|
||||||
|
}
|
||||||
|
return primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Brings the graphics controls in line with one another the way the simulator
|
/// The monitors found, listed once, with the primary one first; a monitor the file names
|
||||||
/// treats them, and says why something is off.
|
/// that is not connected now stays on the list under its own name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateGraphicsState()
|
private void ShowMonitor(string id)
|
||||||
{
|
{
|
||||||
if (!_built || _loading || _updatingGraphics)
|
if (_primaryMonitorItem is null)
|
||||||
return;
|
|
||||||
|
|
||||||
_updatingGraphics = true;
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var s = Trial();
|
_primaryMonitorItem = new ComboBoxItem { Tag = string.Empty, Content = App.Loc["MonitorPrimary"] };
|
||||||
bool vulkan = GraphicsRules.IsVulkan(s);
|
App.Loc.LanguageChanged += () => _primaryMonitorItem.Content = App.Loc["MonitorPrimary"];
|
||||||
bool dlssAllowed = GraphicsRules.DlssAllowed(s, DlssPlatform);
|
MonitorCb.Items.Add(_primaryMonitorItem);
|
||||||
|
var monitors = MonitorList;
|
||||||
foreach (var item in AntiAliasingCb.Items.OfType<ComboBoxItem>())
|
for (int i = 0; i < monitors.Count; i++)
|
||||||
if (item.Tag is "dlss" or "dlaa")
|
|
||||||
item.IsEnabled = dlssAllowed;
|
|
||||||
if (GraphicsRules.IsDlss(s.AntiAliasing) && !dlssAllowed)
|
|
||||||
SelectTag(AntiAliasingCb, "taa");
|
|
||||||
|
|
||||||
s = Trial();
|
|
||||||
bool dlss = GraphicsRules.DlssActive(s, DlssPlatform);
|
|
||||||
DlssPresetRow.IsEnabled = dlss;
|
|
||||||
FrameGenerationRow.IsEnabled = dlss;
|
|
||||||
if (!dlss && FrameGenerationCb.SelectedIndex > 0)
|
|
||||||
FrameGenerationCb.SelectedIndex = 0;
|
|
||||||
ReflexRow.IsEnabled = vulkan;
|
|
||||||
if (!vulkan && ReflexCb.SelectedIndex > 0)
|
|
||||||
ReflexCb.SelectedIndex = 0;
|
|
||||||
VulkanDeviceRow.IsEnabled = vulkan;
|
|
||||||
RayTracingRow.IsEnabled = vulkan;
|
|
||||||
if (!vulkan)
|
|
||||||
RayTracingCb.IsChecked = false;
|
|
||||||
|
|
||||||
s = Trial();
|
|
||||||
BufferScaleRow.IsEnabled = GraphicsRules.BufferScaleUsed(s, DlssPlatform);
|
|
||||||
RayTracingRangeRow.IsEnabled = vulkan && s.RayTracing;
|
|
||||||
DynamicLightsRow.IsEnabled = GraphicsRules.DynamicLightsUsed(s);
|
|
||||||
AoQualityRow.IsEnabled = s.AmbientOcclusion > 0;
|
|
||||||
AoLightingRow.IsEnabled = GraphicsRules.AoLightingUsed(s);
|
|
||||||
bool probe = GraphicsRules.CabProbeUsed(s);
|
|
||||||
CabProbeIntervalRow.IsEnabled = probe;
|
|
||||||
CabProbeReflectionsRow.IsEnabled = probe;
|
|
||||||
CabProbeBounceRow.IsEnabled = GraphicsRules.CabProbeLights(s);
|
|
||||||
FogQualityRow.IsEnabled = s.VolumetricFog;
|
|
||||||
CloudShadowsRow.IsEnabled = s.Clouds > 0;
|
|
||||||
GrassDistanceRow.IsEnabled = s.Grass;
|
|
||||||
GrassDensityRow.IsEnabled = s.Grass;
|
|
||||||
|
|
||||||
DlssPresetInfo.Text = App.Loc[(SelectedTag(DlssPresetCb) ?? "default") switch
|
|
||||||
{
|
{
|
||||||
"k" => "DlssPresetInfoK",
|
var m = monitors[i];
|
||||||
"j" => "DlssPresetInfoJ",
|
MonitorCb.Items.Add(new ComboBoxItem
|
||||||
"m" => "DlssPresetInfoM",
|
{
|
||||||
"l" => "DlssPresetInfoL",
|
Tag = m.Id,
|
||||||
_ => "DlssPresetInfoDefault"
|
Content = $"{i + 1}. {m.Name} – {m.Width}×{m.Height}"
|
||||||
}];
|
});
|
||||||
SetNote(RenderEngineNote, App.Loc[vulkan ? "REVulkanNote" : "REOpenGLNote"]);
|
}
|
||||||
SetNote(AntiAliasingNote, AntiAliasingRemark(s, dlss));
|
|
||||||
SetNote(FrameGenerationNote, FrameGenerationRemark(s, dlss));
|
|
||||||
SetNote(ReflexNote, GraphicsRules.ReflexForced(s, DlssPlatform) ? App.Loc["ReflexForcedNote"] : "");
|
|
||||||
SetNote(AoLightingNote, AoLightingRemark(s));
|
|
||||||
SetNote(CabProbeNote, GraphicsRules.CabProbeUsed(s) && !GraphicsRules.CabProbeLights(s) ? App.Loc["CabProbeReflectionsOnlyNote"] : "");
|
|
||||||
SetNote(SkipPipelineNote, GraphicsRules.TemporalWithoutPipeline(s) ? App.Loc["TemporalNeedsPipelineNote"] : "");
|
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
_updatingGraphics = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string AntiAliasingRemark(SimulatorSettings s, bool dlss)
|
if (IndexOfTag(MonitorCb, id) < 0)
|
||||||
{
|
MonitorCb.Items.Add(new ComboBoxItem { Tag = id, Content = id });
|
||||||
if (!DlssPlatform && GraphicsRules.IsVulkan(s))
|
SelectTag(MonitorCb, id);
|
||||||
return App.Loc["DlssNoPlatformNote"];
|
|
||||||
if (GraphicsRules.TemporalWithoutPipeline(s))
|
|
||||||
return App.Loc["TemporalNeedsPipelineNote"];
|
|
||||||
if (dlss && !DlssLibraries(s).Dlss)
|
|
||||||
return string.Format(App.Loc["DlssMissingLibraryNote"], DlssLibraryName(frameGeneration: false));
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string AoLightingRemark(SimulatorSettings s)
|
|
||||||
{
|
|
||||||
if (!GraphicsRules.AoLightingUsed(s) || !s.AoLighting)
|
|
||||||
return "";
|
|
||||||
if (s.SkipPipeline)
|
|
||||||
return App.Loc["AoNeedsPipelineNote"];
|
|
||||||
return GraphicsRules.AoLightingAddsDepthPrepass(s) ? App.Loc["AoLightingPrepassNote"] : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
private string FrameGenerationRemark(SimulatorSettings s, bool dlss)
|
|
||||||
{
|
|
||||||
if (!dlss)
|
|
||||||
return GraphicsRules.IsVulkan(s) ? App.Loc["FrameGenerationNeedsDlssNote"] : "";
|
|
||||||
if (s.FrameGeneration > 1 && !DlssLibraries(s).FrameGeneration)
|
|
||||||
return string.Format(App.Loc["DlssMissingLibraryNote"], DlssLibraryName(frameGeneration: true));
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Looked up once per simulator picked: the search for it reads the installation's directory.</summary>
|
|
||||||
private (bool Dlss, bool FrameGeneration) DlssLibraries(SimulatorSettings s)
|
|
||||||
{
|
|
||||||
string key = s.SelectExeAutomatically ? "\u0001auto" : s.ExecutablePath;
|
|
||||||
if (_dlssProbedFor != key)
|
|
||||||
{
|
|
||||||
var executables = AppServices.Current.Executables;
|
|
||||||
_dlssProbe = executables.DlssLibraries(executables.Resolve(s, out _));
|
|
||||||
_dlssProbedFor = key;
|
|
||||||
}
|
|
||||||
return _dlssProbe;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string DlssLibraryName(bool frameGeneration) =>
|
|
||||||
AppServices.Current.Environment.IsWindows
|
|
||||||
? (frameGeneration ? "nvngx_dlssg.dll" : "nvngx_dlss.dll")
|
|
||||||
: (frameGeneration ? "libnvidia-ngx-dlssg.so" : "libnvidia-ngx-dlss.so");
|
|
||||||
|
|
||||||
private async void ImportIniButton_OnClick(object? sender, RoutedEventArgs e)
|
private async void ImportIniButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (TopLevel.GetTopLevel(this) is not Window owner)
|
if (TopLevel.GetTopLevel(this) is not Window owner)
|
||||||
@@ -303,7 +151,6 @@ public partial class Settings
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_vulkanChoices = null;
|
|
||||||
ApplyToUi();
|
ApplyToUi();
|
||||||
// What came from the other file is a choice to save, not a value the screen could not show.
|
// What came from the other file is a choice to save, not a value the screen could not show.
|
||||||
_shownUnlikeSettings = new Dictionary<string, ShownValue>();
|
_shownUnlikeSettings = new Dictionary<string, ShownValue>();
|
||||||
@@ -337,7 +184,6 @@ public partial class Settings
|
|||||||
}
|
}
|
||||||
|
|
||||||
SaveStatus.Text = string.Format(App.Loc["ExportIniDone"], Path.GetFileName(path));
|
SaveStatus.Text = string.Format(App.Loc["ExportIniDone"], Path.GetFileName(path));
|
||||||
ToolTip.SetTip(SaveStatus, path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetNote(TextBlock note, string text)
|
private static void SetNote(TextBlock note, string text)
|
||||||
@@ -375,9 +221,6 @@ public partial class Settings
|
|||||||
AntiAliasingMode.Msaa2 => "msaax2",
|
AntiAliasingMode.Msaa2 => "msaax2",
|
||||||
AntiAliasingMode.Msaa4 => "msaax4",
|
AntiAliasingMode.Msaa4 => "msaax4",
|
||||||
AntiAliasingMode.Msaa8 => "msaax8",
|
AntiAliasingMode.Msaa8 => "msaax8",
|
||||||
AntiAliasingMode.Taa => "taa",
|
|
||||||
AntiAliasingMode.Dlss => "dlss",
|
|
||||||
AntiAliasingMode.Dlaa => "dlaa",
|
|
||||||
_ => "off"
|
_ => "off"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -386,9 +229,6 @@ public partial class Settings
|
|||||||
"msaax2" => AntiAliasingMode.Msaa2,
|
"msaax2" => AntiAliasingMode.Msaa2,
|
||||||
"msaax4" => AntiAliasingMode.Msaa4,
|
"msaax4" => AntiAliasingMode.Msaa4,
|
||||||
"msaax8" => AntiAliasingMode.Msaa8,
|
"msaax8" => AntiAliasingMode.Msaa8,
|
||||||
"taa" => AntiAliasingMode.Taa,
|
|
||||||
"dlss" => AntiAliasingMode.Dlss,
|
|
||||||
"dlaa" => AntiAliasingMode.Dlaa,
|
|
||||||
_ => AntiAliasingMode.Off
|
_ => AntiAliasingMode.Off
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using StarterNG.Application;
|
|
||||||
using StarterNG.Domain.Settings;
|
|
||||||
using StarterNG.Infrastructure;
|
|
||||||
using StarterNG.Infrastructure.Adapters;
|
|
||||||
|
|
||||||
namespace StarterNG.Views;
|
|
||||||
|
|
||||||
// The OpenAL Soft options of the sound category. The lists of devices, HRTF data sets and
|
|
||||||
// resamplers come from the simulator's own OpenAL library, read in the background; until then,
|
|
||||||
// and where the library cannot say, a list holds the library's choice and the value of the file.
|
|
||||||
public partial class Settings
|
|
||||||
{
|
|
||||||
// eu07.ini is written in code page 1250: a name it cannot hold (a device named in Cyrillic, say)
|
|
||||||
// would reach the simulator as question marks, so such a name is not offered.
|
|
||||||
private static readonly Encoding StrictCodePage1250 =
|
|
||||||
Encoding.GetEncoding(LegacyText.CodePage1250.CodePage, EncoderFallback.ExceptionFallback, DecoderFallback.ExceptionFallback);
|
|
||||||
|
|
||||||
private async void ReadAudioChoices()
|
|
||||||
{
|
|
||||||
string root = AppServices.Current.Paths.Root;
|
|
||||||
AudioChoices choices = await Task.Run(() => OpenAlProbe.Read(root));
|
|
||||||
// Adding items leaves the selection alone, so this marks nothing as changed.
|
|
||||||
AddNames(AudioDeviceCb, choices.Devices, FitsTheFile);
|
|
||||||
// The simulator finds a device named in code page 1250 too, but an HRTF data set or a
|
|
||||||
// resampler only by the library's own spelling, so of those only plain ASCII is offered.
|
|
||||||
AddNames(AudioHrtfProfileCb, choices.HrtfProfiles, PlainAscii);
|
|
||||||
AddNames(AudioResamplerCb, choices.Resamplers, PlainAscii);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void AddNames(ComboBox cb, IReadOnlyList<string> names, Func<string, bool> offered)
|
|
||||||
{
|
|
||||||
foreach (string name in names)
|
|
||||||
if (name.Length > 0 && offered(name) && IndexOfTag(cb, name) < 0)
|
|
||||||
cb.Items.Add(new ComboBoxItem { Tag = name, Content = name });
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool PlainAscii(string name) => Ascii.IsValid(name);
|
|
||||||
|
|
||||||
private static bool FitsTheFile(string name)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
StrictCodePage1250.GetByteCount(name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (EncoderFallbackException)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowSound(SimulatorSettings s)
|
|
||||||
{
|
|
||||||
SelectOrAddTag(AudioDeviceCb, s.AudioDevice, s.AudioDevice);
|
|
||||||
SelectOrAddTag(AudioOutputModeCb, s.AudioOutputMode, s.AudioOutputMode);
|
|
||||||
SelectOrAddTag(AudioHrtfCb, s.AudioHrtf, s.AudioHrtf);
|
|
||||||
SelectOrAddTag(AudioHrtfProfileCb, s.AudioHrtfProfile, s.AudioHrtfProfile);
|
|
||||||
SelectOrAddTag(AudioResamplerCb, s.AudioResampler, s.AudioResampler);
|
|
||||||
SelectOrAddTag(AudioLimiterCb, s.AudioLimiter, s.AudioLimiter);
|
|
||||||
string frequency = s.AudioFrequency.ToString(Invariant);
|
|
||||||
SelectOrAddTag(AudioFrequencyCb, frequency, frequency + " Hz");
|
|
||||||
AudioDopplerSlider.Value = s.AudioDoppler;
|
|
||||||
AudioLowpassCb.IsChecked = s.AudioLowpass;
|
|
||||||
AudioAirAbsorptionSlider.Value = s.AudioAirAbsorption;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CaptureSound(SimulatorSettings s)
|
|
||||||
{
|
|
||||||
s.AudioDevice = SelectedTag(AudioDeviceCb) ?? "";
|
|
||||||
s.AudioOutputMode = SelectedTag(AudioOutputModeCb) ?? "auto";
|
|
||||||
s.AudioHrtf = SelectedTag(AudioHrtfCb) ?? "auto";
|
|
||||||
s.AudioHrtfProfile = SelectedTag(AudioHrtfProfileCb) ?? "";
|
|
||||||
s.AudioResampler = SelectedTag(AudioResamplerCb) ?? "";
|
|
||||||
s.AudioLimiter = SelectedTag(AudioLimiterCb) ?? "auto";
|
|
||||||
s.AudioFrequency = TagInt(AudioFrequencyCb, 0);
|
|
||||||
// A value the slider can't show (past its end, between its ticks) is kept by the
|
|
||||||
// shown-unlike bookkeeping of the page until the slider is moved.
|
|
||||||
s.AudioDoppler = AudioDopplerSlider.Value;
|
|
||||||
s.AudioLowpass = IsChecked(AudioLowpassCb);
|
|
||||||
s.AudioAirAbsorption = AudioAirAbsorptionSlider.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,6 +25,8 @@
|
|||||||
<TextBlock x:Name="SaveStatus" ctl:Announcer.Changes="True" VerticalAlignment="Center" Opacity="0.8" Text="" />
|
<TextBlock x:Name="SaveStatus" ctl:Announcer.Changes="True" VerticalAlignment="Center" Opacity="0.8" Text="" />
|
||||||
<Button x:Name="ChangesButton" Classes="Flat" Click="ChangesButton_OnClick"
|
<Button x:Name="ChangesButton" Classes="Flat" Click="ChangesButton_OnClick"
|
||||||
Content="{Binding [IniChangesButton], Source={x:Static starterNg:App.Loc}}" />
|
Content="{Binding [IniChangesButton], Source={x:Static starterNg:App.Loc}}" />
|
||||||
|
<Button x:Name="DefaultsButton" Classes="Flat" Click="DefaultsButton_OnClick"
|
||||||
|
Content="{Binding [RestoreDefaults], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<Button x:Name="ResetButton" Classes="Flat" Click="ResetButton_OnClick"
|
<Button x:Name="ResetButton" Classes="Flat" Click="ResetButton_OnClick"
|
||||||
Content="{Binding [Reset], Source={x:Static starterNg:App.Loc}}" />
|
Content="{Binding [Reset], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<Button x:Name="SaveButton" Classes="Flat" Click="SaveButton_OnClick"
|
<Button x:Name="SaveButton" Classes="Flat" Click="SaveButton_OnClick"
|
||||||
@@ -44,7 +46,7 @@
|
|||||||
PlaceholderText="{Binding [Search], Source={x:Static starterNg:App.Loc}}"
|
PlaceholderText="{Binding [Search], Source={x:Static starterNg:App.Loc}}"
|
||||||
TextChanged="SettingsSearch_OnTextChanged" />
|
TextChanged="SettingsSearch_OnTextChanged" />
|
||||||
|
|
||||||
<StackPanel DockPanel.Dock="Bottom" Spacing="6" Margin="0,14,0,0">
|
<StackPanel x:Name="ProfilePanel" DockPanel.Dock="Bottom" Spacing="6" Margin="0,14,0,0">
|
||||||
<TextBlock Classes="FieldLabel"
|
<TextBlock Classes="FieldLabel"
|
||||||
Text="{Binding [SettingsProfile], Source={x:Static starterNg:App.Loc}}" />
|
Text="{Binding [SettingsProfile], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<ComboBox x:Name="ProfileCb" HorizontalAlignment="Stretch"
|
<ComboBox x:Name="ProfileCb" HorizontalAlignment="Stretch"
|
||||||
@@ -67,6 +69,10 @@
|
|||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
Content="{Binding [ExportIni], Source={x:Static starterNg:App.Loc}}"
|
Content="{Binding [ExportIni], Source={x:Static starterNg:App.Loc}}"
|
||||||
Click="ExportIniButton_OnClick" />
|
Click="ExportIniButton_OnClick" />
|
||||||
|
<!-- Kept out of the way on purpose: turning it on asks first, at length. -->
|
||||||
|
<Button x:Name="AdvancedModeBtn" Classes="Flat" HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Center" Margin="0,14,0,0" FontSize="11" Opacity="0.7"
|
||||||
|
Click="AdvancedModeBtn_OnClick" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<ListBox x:Name="CategoryList" AutomationProperties.LandmarkType="Navigation" AutomationProperties.Name="{Binding [SettingsCategories], Source={x:Static starterNg:App.Loc}}" Classes="SettingsNav" SelectedIndex="0"
|
<ListBox x:Name="CategoryList" AutomationProperties.LandmarkType="Navigation" AutomationProperties.Name="{Binding [SettingsCategories], Source={x:Static starterNg:App.Loc}}" Classes="SettingsNav" SelectedIndex="0"
|
||||||
@@ -131,9 +137,6 @@
|
|||||||
<ComboBox x:Name="ChangeLanguageCb"
|
<ComboBox x:Name="ChangeLanguageCb"
|
||||||
SelectionChanged="LanguageComboBox_OnSelectionChanged" />
|
SelectionChanged="LanguageComboBox_OnSelectionChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="fullscreen">
|
|
||||||
<CheckBox x:Name="FullscreenCb" Content="{Binding [Fullscreen], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="inactivepause">
|
<ctl:SettingRow ConfigKey="inactivepause">
|
||||||
<CheckBox x:Name="PauseInactiveCb" Content="{Binding [PauseSimInactive], Source={x:Static starterNg:App.Loc}}" />
|
<CheckBox x:Name="PauseInactiveCb" Content="{Binding [PauseSimInactive], Source={x:Static starterNg:App.Loc}}" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
@@ -142,7 +145,7 @@
|
|||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="mousescale" x:Name="CursorSensitivityRow"
|
<ctl:SettingRow ConfigKey="mousescale" x:Name="CursorSensitivityRow"
|
||||||
Label="{Binding [CursorSensitivity], Source={x:Static starterNg:App.Loc}}">
|
Label="{Binding [CursorSensitivity], Source={x:Static starterNg:App.Loc}}">
|
||||||
<ctl:ReadableSlider x:Name="CursorSensitivitySlider" Minimum="1" Maximum="5" TickFrequency="1"
|
<ctl:ReadableSlider x:Name="CursorSensitivitySlider" Minimum="1" Maximum="3" TickFrequency="1"
|
||||||
IsSnapToTickEnabled="True" Value="3"
|
IsSnapToTickEnabled="True" Value="3"
|
||||||
ValueChanged="QualitySlider_OnValueChanged" />
|
ValueChanged="QualitySlider_OnValueChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
@@ -208,17 +211,10 @@
|
|||||||
<ComboBoxItem Content="{Binding [REFull], Source={x:Static starterNg:App.Loc}}" />
|
<ComboBoxItem Content="{Binding [REFull], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<ComboBoxItem Content="{Binding [REOld], 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}}" />
|
<ComboBoxItem Content="{Binding [RESimp], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<ComboBoxItem Content="{Binding [REExperimental], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Content="{Binding [REVulkan], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<TextBlock x:Name="RenderEngineNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
<!-- Amber like the UART warnings: this one stops the simulator. -->
|
|
||||||
<TextBlock x:Name="RenderEngineWarning" IsVisible="False" TextWrapping="Wrap"
|
|
||||||
Foreground="{StaticResource CarbonAccentBright}"
|
|
||||||
Text="{Binding [REExperimentalWarning], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow x:Name="GpuRow" ConfigKey="starter.gpu" Label="{Binding [GpuChoice], Source={x:Static starterNg:App.Loc}}">
|
<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"
|
<ComboBox x:Name="GpuCb" Classes="Localized" SelectedIndex="0"
|
||||||
SelectionChanged="GpuCb_OnSelectionChanged">
|
SelectionChanged="GpuCb_OnSelectionChanged">
|
||||||
<ComboBoxItem Content="{Binding [GpuDiscrete], Source={x:Static starterNg:App.Loc}}" />
|
<ComboBoxItem Content="{Binding [GpuDiscrete], Source={x:Static starterNg:App.Loc}}" />
|
||||||
@@ -231,10 +227,9 @@
|
|||||||
<ctl:SettingRow ConfigKey="gfx.extraeffects">
|
<ctl:SettingRow ConfigKey="gfx.extraeffects">
|
||||||
<CheckBox x:Name="AdditionalShadersCb" Content="{Binding [AdditionalShadersEffects], Source={x:Static starterNg:App.Loc}}" />
|
<CheckBox x:Name="AdditionalShadersCb" Content="{Binding [AdditionalShadersEffects], Source={x:Static starterNg:App.Loc}}" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="gfx.skippipeline" Description="{Binding [SkipPipelineDesc], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingRow ConfigKey="gfx.skippipeline" Advanced="True" Description="{Binding [SkipPipelineDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel Spacing="6">
|
<StackPanel Spacing="6">
|
||||||
<CheckBox x:Name="SkipPipelineCb" Content="{Binding [SkipPipeline], Source={x:Static starterNg:App.Loc}}" />
|
<CheckBox x:Name="SkipPipelineCb" Content="{Binding [SkipPipeline], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<TextBlock x:Name="SkipPipelineNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="usevbo" Description="{Binding [RenderVBODesc], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingRow ConfigKey="usevbo" Description="{Binding [RenderVBODesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
@@ -249,17 +244,27 @@
|
|||||||
|
|
||||||
<ctl:SettingsSection Header="{Binding [GfxColImage], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingsSection Header="{Binding [GfxColImage], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctl:SettingRow ConfigKey="width, height" Label="{Binding [Resolution], Source={x:Static starterNg:App.Loc}}">
|
<!-- fullscreen and fullscreenwindowed as the simulator reads them together; see DisplayModeOf. -->
|
||||||
|
<ctl:SettingRow ConfigKey="fullscreen, fullscreenwindowed" Label="{Binding [DisplayMode], Source={x:Static starterNg:App.Loc}}"
|
||||||
|
Description="{Binding [DisplayModeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
|
<ComboBox x:Name="DisplayModeCb" Classes="Localized" SelectedIndex="0">
|
||||||
|
<ComboBoxItem Tag="fullscreen" Content="{Binding [DisplayModeFullscreen], Source={x:Static starterNg:App.Loc}}" />
|
||||||
|
<ComboBoxItem Tag="borderless" Content="{Binding [DisplayModeBorderless], Source={x:Static starterNg:App.Loc}}" />
|
||||||
|
<ComboBoxItem Tag="window" Content="{Binding [DisplayModeWindow], Source={x:Static starterNg:App.Loc}}" />
|
||||||
|
</ComboBox>
|
||||||
|
</ctl:SettingRow>
|
||||||
|
<ctl:SettingRow x:Name="MonitorRow" ConfigKey="fullscreenmonitor" Label="{Binding [FullscreenMonitor], Source={x:Static starterNg:App.Loc}}"
|
||||||
|
Description="{Binding [FullscreenMonitorDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
|
<ComboBox x:Name="MonitorCb" />
|
||||||
|
</ctl:SettingRow>
|
||||||
|
<ctl:SettingRow x:Name="ResolutionRow" ConfigKey="width, height" Label="{Binding [Resolution], Source={x:Static starterNg:App.Loc}}">
|
||||||
<ComboBox x:Name="ResolutionCb" />
|
<ComboBox x:Name="ResolutionCb" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="fullscreenwindowed">
|
<ctl:SettingRow x:Name="BufferScaleRow" Advanced="True" ConfigKey="gfx.framebuffer.width, gfx.framebuffer.height"
|
||||||
<CheckBox x:Name="FullscreenWindowedCb" Content="{Binding [FullscreenWindowed], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="BufferScaleRow" ConfigKey="gfx.buffer.percent, starter.bufferscale"
|
|
||||||
Label="{Binding [BufforResolution], Source={x:Static starterNg:App.Loc}}"
|
Label="{Binding [BufforResolution], Source={x:Static starterNg:App.Loc}}"
|
||||||
Description="{Binding [BufforResolutionDesc], Source={x:Static starterNg:App.Loc}}"
|
Description="{Binding [BufforResolutionDesc], Source={x:Static starterNg:App.Loc}}"
|
||||||
ValueText="{Binding #bufferScale.Value, StringFormat='{}{0:0}%'}">
|
ValueText="{Binding #bufferScale.Value, StringFormat='{}{0:0}%'}">
|
||||||
<ctl:ReadableSlider Name="bufferScale" Minimum="25" Maximum="200" TickFrequency="1"
|
<ctl:ReadableSlider Name="bufferScale" Minimum="25" Maximum="100" TickFrequency="1"
|
||||||
IsSnapToTickEnabled="True" Value="100" />
|
IsSnapToTickEnabled="True" Value="100" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="fieldofview" Label="{Binding [FieldOfView], Source={x:Static starterNg:App.Loc}}"
|
<ctl:SettingRow ConfigKey="fieldofview" Label="{Binding [FieldOfView], Source={x:Static starterNg:App.Loc}}"
|
||||||
@@ -268,7 +273,7 @@
|
|||||||
<ctl:ReadableSlider Name="fovSlider" Minimum="10" Maximum="75" TickFrequency="5"
|
<ctl:ReadableSlider Name="fovSlider" Minimum="10" Maximum="75" TickFrequency="5"
|
||||||
IsSnapToTickEnabled="True" Value="45" />
|
IsSnapToTickEnabled="True" Value="45" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="gfx.antialiasing, multisampling"
|
<ctl:SettingRow ConfigKey="multisampling"
|
||||||
Label="{Binding [AntiAliasing], Source={x:Static starterNg:App.Loc}}"
|
Label="{Binding [AntiAliasing], Source={x:Static starterNg:App.Loc}}"
|
||||||
Description="{Binding [AntiAliasingDesc], Source={x:Static starterNg:App.Loc}}">
|
Description="{Binding [AntiAliasingDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel Spacing="6">
|
<StackPanel Spacing="6">
|
||||||
@@ -277,18 +282,9 @@
|
|||||||
<ComboBoxItem Tag="msaax2" Content="MSAA x2" />
|
<ComboBoxItem Tag="msaax2" Content="MSAA x2" />
|
||||||
<ComboBoxItem Tag="msaax4" Content="MSAA x4" />
|
<ComboBoxItem Tag="msaax4" Content="MSAA x4" />
|
||||||
<ComboBoxItem Tag="msaax8" Content="MSAA x8" />
|
<ComboBoxItem Tag="msaax8" Content="MSAA x8" />
|
||||||
<ComboBoxItem Tag="taa" Content="{Binding [AaTaa], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<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>
|
</ComboBox>
|
||||||
<TextBlock x:Name="AntiAliasingNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingsSection>
|
|
||||||
|
|
||||||
<ctl:SettingsSection Header="{Binding [GfxColSmoothness], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel>
|
|
||||||
<ctl:SettingRow ConfigKey="vsync" Description="{Binding [VSyncDesc], Source={x:Static starterNg:App.Loc}}">
|
<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}}" />
|
<CheckBox x:Name="VSyncCb" Content="{Binding [VSync], Source={x:Static starterNg:App.Loc}}" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
@@ -296,10 +292,13 @@
|
|||||||
Label="{Binding [FpsLimit], Source={x:Static starterNg:App.Loc}}"
|
Label="{Binding [FpsLimit], Source={x:Static starterNg:App.Loc}}"
|
||||||
Description="{Binding [FpsLimitDesc], Source={x:Static starterNg:App.Loc}}">
|
Description="{Binding [FpsLimitDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel Spacing="4">
|
<StackPanel Spacing="4">
|
||||||
<!-- Moves through no limit and Steps.FrameRateLimits; see SliderSteps. -->
|
<!-- Moves through no limit and SliderRanges.FrameRateLimits; see SliderSteps. -->
|
||||||
<ctl:ReadableSlider x:Name="FpsLimitSlider" ValueChanged="QualitySlider_OnValueChanged" />
|
<ctl:ReadableSlider x:Name="FpsLimitSlider" ValueChanged="QualitySlider_OnValueChanged" />
|
||||||
<!-- The screens found, each with a button to match the limit to it. -->
|
<!-- The screens found, each with a button to match the limit to it. -->
|
||||||
<WrapPanel x:Name="MonitorRates" IsVisible="False" />
|
<WrapPanel x:Name="MonitorRates" IsVisible="False" />
|
||||||
|
<!-- Shown with VSync on: the limit and VSync together, see UpdateMonitorRates. -->
|
||||||
|
<TextBlock x:Name="FpsVSyncNote" Classes="FieldHint" TextWrapping="Wrap" IsVisible="False"
|
||||||
|
Text="{Binding [FpsVSyncNote], Source={x:Static starterNg:App.Loc}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -331,13 +330,13 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctl:SettingRow ConfigKey="maxtexturesize" x:Name="TexResolutionRow"
|
<ctl:SettingRow ConfigKey="maxtexturesize" x:Name="TexResolutionRow"
|
||||||
Label="{Binding [MaxTexResolution], Source={x:Static starterNg:App.Loc}}">
|
Label="{Binding [MaxTexResolution], Source={x:Static starterNg:App.Loc}}">
|
||||||
<ctl:ReadableSlider Name="textureResolutionSlider" Minimum="6" Maximum="13" TickFrequency="1"
|
<ctl:ReadableSlider Name="textureResolutionSlider" Minimum="9" Maximum="13" TickFrequency="1"
|
||||||
IsSnapToTickEnabled="True" Value="12"
|
IsSnapToTickEnabled="True" Value="12"
|
||||||
ValueChanged="TextureResolutionSlider_OnValueChanged" />
|
ValueChanged="TextureResolutionSlider_OnValueChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="maxcabtexturesize" x:Name="CabTexResolutionRow"
|
<ctl:SettingRow ConfigKey="maxcabtexturesize" x:Name="CabTexResolutionRow"
|
||||||
Label="{Binding [MaxTexCabResolution], Source={x:Static starterNg:App.Loc}}">
|
Label="{Binding [MaxTexCabResolution], Source={x:Static starterNg:App.Loc}}">
|
||||||
<ctl:ReadableSlider Name="cabTextureResolutionSlider" Minimum="9" Maximum="13" TickFrequency="1"
|
<ctl:ReadableSlider Name="cabTextureResolutionSlider" Minimum="9" Maximum="12" TickFrequency="1"
|
||||||
IsSnapToTickEnabled="True" Value="12"
|
IsSnapToTickEnabled="True" Value="12"
|
||||||
ValueChanged="CabTextureResolutionSlider_OnValueChanged" />
|
ValueChanged="CabTextureResolutionSlider_OnValueChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
@@ -398,7 +397,7 @@
|
|||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="shadowtune" x:Name="ShadowResolutionRow"
|
<ctl:SettingRow ConfigKey="shadowtune" x:Name="ShadowResolutionRow"
|
||||||
Label="{Binding [ShadowsResolution], Source={x:Static starterNg:App.Loc}}">
|
Label="{Binding [ShadowsResolution], Source={x:Static starterNg:App.Loc}}">
|
||||||
<ctl:ReadableSlider Name="shaderResolutionSlider" Minimum="9" Maximum="13" TickFrequency="1"
|
<ctl:ReadableSlider Name="shaderResolutionSlider" Minimum="10" Maximum="13" TickFrequency="1"
|
||||||
IsSnapToTickEnabled="True" Value="12"
|
IsSnapToTickEnabled="True" Value="12"
|
||||||
ValueChanged="shaderResolutionSlider_OnValueChanged" />
|
ValueChanged="shaderResolutionSlider_OnValueChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
@@ -406,15 +405,15 @@
|
|||||||
Label="{Binding [ShaderRange], Source={x:Static starterNg:App.Loc}}"
|
Label="{Binding [ShaderRange], Source={x:Static starterNg:App.Loc}}"
|
||||||
Description="{Binding [ShaderRangeDesc], 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. -->
|
<!-- The simulator's floor follows the map size: see shaderResolutionSlider_OnValueChanged. -->
|
||||||
<ctl:ReadableSlider Name="shaderRange" Minimum="75" Maximum="600" TickFrequency="5"
|
<ctl:ReadableSlider Name="shaderRange" Minimum="75" Maximum="400" TickFrequency="5"
|
||||||
IsSnapToTickEnabled="True" Value="150"
|
IsSnapToTickEnabled="True" Value="150"
|
||||||
ValueChanged="QualitySlider_OnValueChanged" />
|
ValueChanged="QualitySlider_OnValueChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="gfx.shadows.cab.range" x:Name="CabShadowRangeRow"
|
<ctl:SettingRow ConfigKey="gfx.shadows.cab.range" x:Name="CabShadowRangeRow"
|
||||||
Label="{Binding [CabShadowsRange], Source={x:Static starterNg:App.Loc}}"
|
Label="{Binding [CabShadowsRange], Source={x:Static starterNg:App.Loc}}"
|
||||||
Description="{Binding [CabShadowsRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
Description="{Binding [CabShadowsRangeDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
<ctl:ReadableSlider Name="cabShaderSourceRange" Minimum="0" Maximum="100" TickFrequency="10"
|
<!-- Moves through SliderRanges.CabShadowRanges; see SliderSteps. -->
|
||||||
IsSnapToTickEnabled="True" Value="30"
|
<ctl:ReadableSlider Name="cabShaderSourceRange"
|
||||||
ValueChanged="QualitySlider_OnValueChanged" />
|
ValueChanged="QualitySlider_OnValueChanged" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
<ctl:SettingRow ConfigKey="gfx.shadow.angle.min" x:Name="ShadowAngleLimitRow"
|
<ctl:SettingRow ConfigKey="gfx.shadow.angle.min" x:Name="ShadowAngleLimitRow"
|
||||||
@@ -422,7 +421,7 @@
|
|||||||
Description="{Binding [ShadowAngleLimitDesc], Source={x:Static starterNg:App.Loc}}">
|
Description="{Binding [ShadowAngleLimitDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctl:ReadableSlider x:Name="ShadowAngleLimitSlider" Minimum="0.2" Maximum="1.0"
|
<ctl:ReadableSlider x:Name="ShadowAngleLimitSlider" Minimum="0.2" Maximum="1.0"
|
||||||
TickFrequency="0.05" IsSnapToTickEnabled="True" Value="0.2" HorizontalAlignment="Stretch"
|
TickFrequency="0.1" IsSnapToTickEnabled="True" Value="0.2" HorizontalAlignment="Stretch"
|
||||||
ValueChanged="QualitySlider_OnValueChanged" />
|
ValueChanged="QualitySlider_OnValueChanged" />
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock DockPanel.Dock="Right" Classes="FieldHint"
|
<TextBlock DockPanel.Dock="Right" Classes="FieldHint"
|
||||||
@@ -435,11 +434,11 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingsSection>
|
</ctl:SettingsSection>
|
||||||
|
|
||||||
<ctl:SettingsSection x:Name="LightsSection" Header="{Binding [GfxColLights], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingsSection Header="{Binding [GfxColLights], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel>
|
<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}}"
|
<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}'}">
|
ValueText="{Binding #DynamicLightsSlider.Value, StringFormat='{}{0:0}'}">
|
||||||
<ctl:ReadableSlider x:Name="DynamicLightsSlider" Minimum="0" Maximum="7" TickFrequency="1"
|
<ctl:ReadableSlider x:Name="DynamicLightsSlider" Minimum="1" Maximum="7" TickFrequency="1"
|
||||||
IsSnapToTickEnabled="True" Value="7" />
|
IsSnapToTickEnabled="True" Value="7" />
|
||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -484,7 +483,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingsSection>
|
</ctl:SettingsSection>
|
||||||
|
|
||||||
<ctl:SettingsSection x:Name="NatureSection" Header="{Binding [GfxColNature], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingsSection Header="{Binding [GfxColNature], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctl:SettingRow ConfigKey="gfx.smoke" Margin="0,0,0,4">
|
<ctl:SettingRow ConfigKey="gfx.smoke" Margin="0,0,0,4">
|
||||||
<CheckBox x:Name="SmokeDisplayCb" Content="{Binding [SmokeDisplay], Source={x:Static starterNg:App.Loc}}" />
|
<CheckBox x:Name="SmokeDisplayCb" Content="{Binding [SmokeDisplay], Source={x:Static starterNg:App.Loc}}" />
|
||||||
@@ -537,86 +536,6 @@
|
|||||||
</ctl:SettingRow>
|
</ctl:SettingRow>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingsSection>
|
</ctl:SettingsSection>
|
||||||
<ctl:SettingsSection Header="{Binding [SoundDevice], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel IsEnabled="{Binding #EnableSoundsCb.IsChecked}">
|
|
||||||
<ctl:SettingRow ConfigKey="sound.openal.renderer" Label="{Binding [SoundOutputDevice], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundOutputDeviceDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioDeviceCb" HorizontalAlignment="Stretch">
|
|
||||||
<ComboBoxItem Tag="" Content="{Binding [SoundSystemDefault], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.outputmode" Label="{Binding [SoundOutputMode], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundOutputModeDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioOutputModeCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="auto" Content="{Binding [SoundAutomatic], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="mono" Content="Mono" />
|
|
||||||
<ComboBoxItem Tag="stereo" Content="Stereo" />
|
|
||||||
<ComboBoxItem Tag="stereo-basic" Content="{Binding [SoundStereoBasic], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="uhj" Content="{Binding [SoundStereoUhj], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="headphones" Content="{Binding [SoundHeadphones], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="quad" Content="Quad" />
|
|
||||||
<ComboBoxItem Tag="5.1" Content="5.1" />
|
|
||||||
<ComboBoxItem Tag="6.1" Content="6.1" />
|
|
||||||
<ComboBoxItem Tag="7.1" Content="7.1" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.hrtf" Label="HRTF"
|
|
||||||
Description="{Binding [SoundHrtfDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioHrtfCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="auto" Content="{Binding [SoundAutomatic], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="on" Content="{Binding [SoundOn], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="off" Content="{Binding [SoundOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.hrtf.profile" Label="{Binding [SoundHrtfProfile], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundHrtfProfileDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioHrtfProfileCb" HorizontalAlignment="Stretch">
|
|
||||||
<ComboBoxItem Tag="" Content="{Binding [SoundLibraryChoice], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.resampler" Label="{Binding [SoundResampler], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundResamplerDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioResamplerCb" HorizontalAlignment="Stretch">
|
|
||||||
<ComboBoxItem Tag="" Content="{Binding [SoundLibraryDefault], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.limiter" Label="{Binding [SoundLimiter], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundLimiterDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioLimiterCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="auto" Content="{Binding [SoundAutomatic], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="on" Content="{Binding [SoundOn], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="off" Content="{Binding [SoundOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.frequency" Label="{Binding [SoundFrequency], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundFrequencyDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AudioFrequencyCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [SoundDeviceRate], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="22050" Content="22050 Hz" />
|
|
||||||
<ComboBoxItem Tag="32000" Content="32000 Hz" />
|
|
||||||
<ComboBoxItem Tag="44100" Content="44100 Hz" />
|
|
||||||
<ComboBoxItem Tag="48000" Content="48000 Hz" />
|
|
||||||
<ComboBoxItem Tag="96000" Content="96000 Hz" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.doppler" Label="{Binding [SoundDoppler], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundDopplerDesc], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
ValueText="{Binding #AudioDopplerSlider.Value, StringFormat='{}{0:0.00}'}">
|
|
||||||
<ctl:ReadableSlider x:Name="AudioDopplerSlider" Minimum="0" Maximum="1" TickFrequency="0.05"
|
|
||||||
IsSnapToTickEnabled="True" Value="0.25" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.efx.lowpass" Label="{Binding [SoundLowpass], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundLowpassDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="AudioLowpassCb" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="sound.efx.airabsorption" Label="{Binding [SoundAirAbsorption], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SoundAirAbsorptionDesc], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
ValueText="{Binding #AudioAirAbsorptionSlider.Value, StringFormat='{}{0:0.0}'}">
|
|
||||||
<ctl:ReadableSlider x:Name="AudioAirAbsorptionSlider" Minimum="0" Maximum="10" TickFrequency="0.5"
|
|
||||||
IsSnapToTickEnabled="True" Value="0" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingsSection>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- ============================ PHYSICS ============================ -->
|
<!-- ============================ PHYSICS ============================ -->
|
||||||
@@ -757,7 +676,7 @@
|
|||||||
<StackPanel Tag="advanced" IsVisible="False">
|
<StackPanel Tag="advanced" IsVisible="False">
|
||||||
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
<TextBlock Classes="CategoryCaption" IsVisible="False"
|
||||||
Text="{Binding [Advanced], Source={x:Static starterNg:App.Loc}}" />
|
Text="{Binding [Advanced], Source={x:Static starterNg:App.Loc}}" />
|
||||||
<ctl:SettingsSection Header="{Binding [AdvancedResources], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingsSection Advanced="True" Header="{Binding [AdvancedResources], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctl:SettingRow ConfigKey="compresstex" Description="{Binding [CompressTexturesDesc], Source={x:Static starterNg:App.Loc}}">
|
<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}}" />
|
<CheckBox x:Name="CompressTexCb" Content="{Binding [CompressTextures], Source={x:Static starterNg:App.Loc}}" />
|
||||||
@@ -795,7 +714,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingsSection>
|
</ctl:SettingsSection>
|
||||||
|
|
||||||
<ctl:SettingsSection Header="{Binding [AdvancedLogTools], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingsSection Advanced="True" Header="{Binding [AdvancedLogTools], Source={x:Static starterNg:App.Loc}}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctl:SettingRow Description="{Binding [OpenLogToolsDesc], Source={x:Static starterNg:App.Loc}}">
|
<ctl:SettingRow Description="{Binding [OpenLogToolsDesc], Source={x:Static starterNg:App.Loc}}">
|
||||||
<Button x:Name="OpenLogToolsButton" Classes="Flat" Cursor="Hand"
|
<Button x:Name="OpenLogToolsButton" Classes="Flat" Cursor="Hand"
|
||||||
@@ -806,198 +725,6 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ctl:SettingsSection>
|
</ctl:SettingsSection>
|
||||||
|
|
||||||
<!-- What only the new simulator reads; an older one passes over these keys. -->
|
|
||||||
<ctl:SettingsSection Header="{Binding [GfxColNewRenderer], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Classes="SettingNote" Margin="0,0,0,11"
|
|
||||||
Text="{Binding [GfxNewRendererNote], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ctl:SettingRow x:Name="VulkanDeviceRow" ConfigKey="gfx.vulkan.device"
|
|
||||||
Label="{Binding [VulkanDevice], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [VulkanDeviceDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<TextBox x:Name="VulkanDeviceTb" PlaceholderText="{Binding [VulkanDeviceAuto], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="DlssPresetRow" ConfigKey="gfx.dlss.preset"
|
|
||||||
Label="{Binding [DlssPreset], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [DlssPresetDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<ComboBox x:Name="DlssPresetCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="default" Content="{Binding [DlssPresetDefault], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="k" Content="{Binding [DlssPresetK], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="j" Content="{Binding [DlssPresetJ], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="m" Content="{Binding [DlssPresetM], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="l" Content="{Binding [DlssPresetL], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
<TextBlock x:Name="DlssPresetInfo" Classes="FieldHint" TextWrapping="Wrap" />
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="FrameGenerationRow" ConfigKey="gfx.framegeneration"
|
|
||||||
Label="{Binding [FrameGeneration], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [FrameGenerationDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<ComboBox x:Name="FrameGenerationCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="x2" />
|
|
||||||
<ComboBoxItem Tag="3" Content="x3" />
|
|
||||||
<ComboBoxItem Tag="4" Content="x4" />
|
|
||||||
</ComboBox>
|
|
||||||
<TextBlock x:Name="FrameGenerationNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="ReflexRow" ConfigKey="gfx.reflex"
|
|
||||||
Label="{Binding [Reflex], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [ReflexDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<ComboBox x:Name="ReflexCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [ReflexOn], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [ReflexBoost], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
<TextBlock x:Name="ReflexNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="RayTracingRow" ConfigKey="gfx.raytracing" Description="{Binding [RayTracingDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="RayTracingCb" Content="{Binding [RayTracing], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="RayTracingRangeRow" ConfigKey="gfx.raytracing.range"
|
|
||||||
Label="{Binding [RayTracingRange], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
ValueText="{Binding #RayTracingRangeSlider.Value, StringFormat='{}{0:0} m'}">
|
|
||||||
<ctl:ReadableSlider x:Name="RayTracingRangeSlider" Minimum="50" Maximum="2000" TickFrequency="50" IsSnapToTickEnabled="True" Value="500" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.ssr" Label="{Binding [Ssr], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [SsrDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="SsrCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [LevelMedium], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3" Content="{Binding [LevelHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.lights.clustered" Description="{Binding [LightsClusteredDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="LightsClusteredCb" Content="{Binding [LightsClustered], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.lights.shadows" Label="{Binding [LightShadows], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [LightShadowsDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="LightShadowsCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [LevelMedium], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3" Content="{Binding [LevelHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.contactshadows" Label="{Binding [ContactShadows], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [ContactShadowsDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="ContactShadowsCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [LevelMedium], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3" Content="{Binding [LevelHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.shadow.sdsm" Description="{Binding [ShadowSdsmDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="ShadowSdsmCb" Content="{Binding [ShadowSdsm], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.postfx.ao" Label="{Binding [AmbientOcclusion], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [AmbientOcclusionDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AmbientOcclusionCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="SSAO" />
|
|
||||||
<ComboBoxItem Tag="2" Content="GTAO" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="AoLightingRow" ConfigKey="gfx.postfx.ao.lighting" Description="{Binding [AoLightingDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<CheckBox x:Name="AoLightingCb" Content="{Binding [AoLighting], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<TextBlock x:Name="AoLightingNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="AoQualityRow" ConfigKey="gfx.postfx.ao.quality" Label="{Binding [AmbientOcclusionQuality], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="AoQualityCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="2 3" Content="{Binding [QualityLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3 4" Content="{Binding [QualityNormal], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="4 6" Content="{Binding [QualityHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="6 8" Content="{Binding [QualityVeryHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.cabprobe" Label="{Binding [CabProbe], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [CabProbeDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<ComboBox x:Name="CabProbeCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [LevelMedium], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3" Content="{Binding [LevelHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
<TextBlock x:Name="CabProbeNote" Classes="SettingNote" IsVisible="False" />
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="CabProbeIntervalRow" ConfigKey="gfx.cabprobe.interval"
|
|
||||||
Label="{Binding [CabProbeInterval], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<NumericUpDown x:Name="CabProbeIntervalNud" Minimum="1" Maximum="120" Value="4" Increment="1" FormatString="0" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="CabProbeBounceRow" ConfigKey="gfx.cabprobe.bounce"
|
|
||||||
Label="{Binding [CabProbeBounce], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [CabProbeBounceDesc], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
ValueText="{Binding #CabProbeBounceSlider.Value, StringFormat='{}{0:0.0}'}">
|
|
||||||
<ctl:ReadableSlider x:Name="CabProbeBounceSlider" Minimum="0" Maximum="4" TickFrequency="0.1" IsSnapToTickEnabled="True" Value="1" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="CabProbeReflectionsRow" ConfigKey="gfx.cabprobe.reflections" Description="{Binding [CabProbeReflectionsDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="CabProbeReflectionsCb" Content="{Binding [CabProbeReflections], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.fog" Description="{Binding [VolumetricFogDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="VolumetricFogCb" Content="{Binding [VolumetricFog], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="FogQualityRow" ConfigKey="gfx.fog.quality" Label="{Binding [FogQuality], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="FogQualityCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [LevelMedium], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3" Content="{Binding [LevelHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="4" Content="{Binding [LevelUltra], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.clouds" Label="{Binding [Clouds], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [CloudsDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="CloudsCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="0" Content="{Binding [LevelOff], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="1" Content="{Binding [LevelLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="2" Content="{Binding [LevelMedium], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="3" Content="{Binding [LevelHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="4" Content="{Binding [LevelUltra], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="CloudShadowsRow" ConfigKey="gfx.clouds.shadows">
|
|
||||||
<CheckBox x:Name="CloudShadowsCb" Content="{Binding [CloudShadows], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.postfx.bloom">
|
|
||||||
<CheckBox x:Name="BloomCb" Content="{Binding [Bloom], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.postfx.autoexposure" Description="{Binding [AutoExposureDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<CheckBox x:Name="AutoExposureCb" Content="{Binding [AutoExposure], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.grass" Margin="0,0,0,4">
|
|
||||||
<CheckBox x:Name="GrassCb" Content="{Binding [Grass], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="GrassDistanceRow" ConfigKey="gfx.grass.distance, gfx.grass.fadedistance"
|
|
||||||
Label="{Binding [GrassDistance], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
ValueText="{Binding #GrassDistanceSlider.Value, StringFormat='{}{0:0} m'}">
|
|
||||||
<ctl:ReadableSlider x:Name="GrassDistanceSlider" Minimum="20" Maximum="300" TickFrequency="10" IsSnapToTickEnabled="True" Value="60" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow x:Name="GrassDensityRow" ConfigKey="gfx.grass.density"
|
|
||||||
Label="{Binding [GrassDensity], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
ValueText="{Binding #GrassDensitySlider.Value, StringFormat='{}{0:0.00}'}">
|
|
||||||
<ctl:ReadableSlider x:Name="GrassDensitySlider" Minimum="0.25" Maximum="2.0" TickFrequency="0.25" IsSnapToTickEnabled="True" Value="1.0" />
|
|
||||||
</ctl:SettingRow>
|
|
||||||
<ctl:SettingRow ConfigKey="gfx.precipitation.particles" Label="{Binding [Precipitation], Source={x:Static starterNg:App.Loc}}"
|
|
||||||
Description="{Binding [PrecipitationDesc], Source={x:Static starterNg:App.Loc}}">
|
|
||||||
<ComboBox x:Name="PrecipitationCb" Classes="Localized" SelectedIndex="0">
|
|
||||||
<ComboBoxItem Tag="16384" Content="{Binding [QualityVeryLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="32768" Content="{Binding [QualityLow], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="65536" Content="{Binding [QualityNormal], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="131072" Content="{Binding [QualityHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
<ComboBoxItem Tag="262144" Content="{Binding [QualityVeryHigh], Source={x:Static starterNg:App.Loc}}" />
|
|
||||||
</ComboBox>
|
|
||||||
</ctl:SettingRow>
|
|
||||||
</StackPanel>
|
|
||||||
</ctl:SettingsSection>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
private readonly SliderSteps _anisotropy;
|
private readonly SliderSteps _anisotropy;
|
||||||
|
|
||||||
private readonly SliderSteps _drawRangeFactor;
|
private readonly SliderSteps _drawRangeFactor;
|
||||||
|
private readonly SliderSteps _cabShadows;
|
||||||
|
|
||||||
// False while the layout loads: the handlers it names fire as it sets their controls'
|
// 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.
|
// values, before the fields of the controls are there, and do nothing until this is set.
|
||||||
@@ -50,6 +51,9 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action? ThumbnailSizeChanged;
|
public event Action? ThumbnailSizeChanged;
|
||||||
|
|
||||||
|
/// <summary>The standard or the advanced mode was chosen; the scenario screen follows it.</summary>
|
||||||
|
public static event Action? AdvancedModeChanged;
|
||||||
|
|
||||||
/// <summary>Thumbnail size the other tabs were last drawn at.</summary>
|
/// <summary>Thumbnail size the other tabs were last drawn at.</summary>
|
||||||
private bool _drawnThumbs = AppServices.Current.Settings.LargeThumbnails;
|
private bool _drawnThumbs = AppServices.Current.Settings.LargeThumbnails;
|
||||||
|
|
||||||
@@ -57,14 +61,14 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
_fpsLimit = new SliderSteps(FpsLimitSlider, Steps.FrameRateLimits);
|
_fpsLimit = new SliderSteps(FpsLimitSlider, SliderRanges.FrameRateLimits);
|
||||||
_reflections = new SliderSteps(reflectionsFramerate, Steps.ReflectionUpdates);
|
_reflections = new SliderSteps(reflectionsFramerate, SliderRanges.ReflectionUpdates);
|
||||||
_anisotropy = new SliderSteps(TexFilteringSlider, Steps.Anisotropy);
|
_anisotropy = new SliderSteps(TexFilteringSlider, Steps.Anisotropy);
|
||||||
_drawRangeFactor = new SliderSteps(RenderRangeSlider, Steps.DrawRangeFactors);
|
_drawRangeFactor = new SliderSteps(RenderRangeSlider, SliderRanges.DrawRangeFactors);
|
||||||
|
_cabShadows = new SliderSteps(cabShaderSourceRange, SliderRanges.CabShadowRanges);
|
||||||
_built = true;
|
_built = true;
|
||||||
|
|
||||||
SettingsPathText.Text = AppServices.Current.SettingsStore.LoadedFrom;
|
SettingsPathText.Text = AppServices.Current.SettingsStore.LoadedFrom;
|
||||||
ToolTip.SetTip(SettingsPathText, AppServices.Current.SettingsStore.LoadedFrom);
|
|
||||||
|
|
||||||
this.AttachedToVisualTree += (_, _) =>
|
this.AttachedToVisualTree += (_, _) =>
|
||||||
{
|
{
|
||||||
@@ -100,12 +104,32 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
BuildPresetButtons();
|
BuildPresetButtons();
|
||||||
BuildMonitorRates();
|
BuildMonitorRates();
|
||||||
ReadGraphicsCards();
|
ReadGraphicsCards();
|
||||||
ReadAudioChoices();
|
|
||||||
App.Loc.LanguageChanged += UpdateCardText;
|
App.Loc.LanguageChanged += UpdateCardText;
|
||||||
App.Loc.LanguageChanged += _keyRows.UpdateTexts;
|
App.Loc.LanguageChanged += _keyRows.UpdateTexts;
|
||||||
|
|
||||||
FeedbackCb.SelectionChanged += FeedbackCb_OnSelectionChanged;
|
FeedbackCb.SelectionChanged += FeedbackCb_OnSelectionChanged;
|
||||||
SelectExeCb.SelectionChanged += (_, _) => UpdateIdleNotes();
|
// What decides whether the simulator starts and draws at all is changed only on purpose.
|
||||||
|
AskBeforeChange(RenderAngleVulkanCb);
|
||||||
|
AskBeforeChange(AdditionalShadersCb);
|
||||||
|
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 (_, _) =>
|
||||||
|
{
|
||||||
|
if (!AsksFirst || IsChecked(GamepadIgnoreCb) || TopLevel.GetTopLevel(this) is not Window owner)
|
||||||
|
return;
|
||||||
|
if (!await MessageBox.Show(owner, App.Loc["ConfirmGamepadUse"], App.Loc["GamepadSignalIgnore"],
|
||||||
|
MessageBoxButtons.YesNo))
|
||||||
|
Revert(() => GamepadIgnoreCb.IsChecked = true);
|
||||||
|
};
|
||||||
|
RenderEngineCb.SelectionChanged += async (_, e) =>
|
||||||
|
{
|
||||||
|
if (!AsksFirst || e.RemovedItems.Count == 0)
|
||||||
|
return;
|
||||||
|
object? previous = e.RemovedItems[0];
|
||||||
|
if (!await ConfirmRenderingChange(App.Loc["RenderEngine"]))
|
||||||
|
Revert(() => RenderEngineCb.SelectedItem = previous);
|
||||||
|
};
|
||||||
// Coming to the page or to the list is when a new build is looked for.
|
// Coming to the page or to the list is when a new build is looked for.
|
||||||
SelectExeCb.GotFocus += (_, _) => RefreshExecutables();
|
SelectExeCb.GotFocus += (_, _) => RefreshExecutables();
|
||||||
PropertyChanged += (_, e) =>
|
PropertyChanged += (_, e) =>
|
||||||
@@ -113,16 +137,9 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
if (e.Property == IsVisibleProperty && IsVisible)
|
if (e.Property == IsVisibleProperty && IsVisible)
|
||||||
RefreshExecutables();
|
RefreshExecutables();
|
||||||
};
|
};
|
||||||
FullscreenWindowedCb.IsCheckedChanged += (_, _) => UpdateIdleNotes();
|
|
||||||
App.Loc.LanguageChanged += UpdateIdleNotes;
|
|
||||||
App.Loc.LanguageChanged += UpdateGpuNote;
|
App.Loc.LanguageChanged += UpdateGpuNote;
|
||||||
// targetfps decides whether the draw range factor does anything.
|
App.Loc.LanguageChanged += UpdateAdvancedModeButton;
|
||||||
_keyRows.Moved += key =>
|
App.Loc.LanguageChanged += UpdateUnknownValues;
|
||||||
{
|
|
||||||
if (string.Equals(key.Key, "targetfps", StringComparison.OrdinalIgnoreCase))
|
|
||||||
UpdateIdleNotes();
|
|
||||||
};
|
|
||||||
InitGraphics();
|
|
||||||
MotionBlurCb.IsCheckedChanged += (_, _) => UpdateDependentRows();
|
MotionBlurCb.IsCheckedChanged += (_, _) => UpdateDependentRows();
|
||||||
ReflectionsCubeMapCb.IsCheckedChanged += (_, _) => UpdateDependentRows();
|
ReflectionsCubeMapCb.IsCheckedChanged += (_, _) => UpdateDependentRows();
|
||||||
|
|
||||||
@@ -399,9 +416,9 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
|
|
||||||
// A reloaded file may name another simulator, or start a server.
|
// A reloaded file may name another simulator, or start a server.
|
||||||
RefreshDerivedRows();
|
RefreshDerivedRows();
|
||||||
|
UpdateUnknownValues();
|
||||||
UpdateGpuNote();
|
UpdateGpuNote();
|
||||||
NoteShownValues();
|
NoteShownValues();
|
||||||
UpdateGraphicsState();
|
|
||||||
UpdatePresetMarks();
|
UpdatePresetMarks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +428,8 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void ShowValues(SimulatorSettings s)
|
private void ShowValues(SimulatorSettings s)
|
||||||
{
|
{
|
||||||
FullscreenCb.IsChecked = s.Fullscreen;
|
// First, or a value outside the standard ranges would be moved into them on the way in.
|
||||||
|
ApplyRanges(s);
|
||||||
PauseInactiveCb.IsChecked = s.PauseWhenInactive;
|
PauseInactiveCb.IsChecked = s.PauseWhenInactive;
|
||||||
PauseStartCb.IsChecked = s.PauseOnStart;
|
PauseStartCb.IsChecked = s.PauseOnStart;
|
||||||
CursorSensitivitySlider.Value = s.CursorSensitivity;
|
CursorSensitivitySlider.Value = s.CursorSensitivity;
|
||||||
@@ -437,7 +455,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
LogMissingVehicleFilesCb.IsChecked = s.LogMissingVehicleFiles;
|
LogMissingVehicleFilesCb.IsChecked = s.LogMissingVehicleFiles;
|
||||||
|
|
||||||
ShowGraphics(s);
|
ShowGraphics(s);
|
||||||
ShowSound(s);
|
|
||||||
GpuCb.SelectedIndex = s.Gpu == GpuPreference.System ? 1 : 0;
|
GpuCb.SelectedIndex = s.Gpu == GpuPreference.System ? 1 : 0;
|
||||||
SelectResolution(s.Width, s.Height);
|
SelectResolution(s.Width, s.Height);
|
||||||
bufferScale.Value = s.BufferScalePercent;
|
bufferScale.Value = s.BufferScalePercent;
|
||||||
@@ -458,7 +475,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
_reflections.Value = s.ReflectionsFramerate;
|
_reflections.Value = s.ReflectionsFramerate;
|
||||||
shaderResolutionSlider.Value = Log2(s.ShadowMapResolution, 12);
|
shaderResolutionSlider.Value = Log2(s.ShadowMapResolution, 12);
|
||||||
shaderRange.Value = s.ShadowProjectionRange;
|
shaderRange.Value = s.ShadowProjectionRange;
|
||||||
cabShaderSourceRange.Value = s.CabShadowsRange;
|
_cabShadows.Value = s.CabShadowsRange;
|
||||||
ShadowDisplayCb.SelectedIndex = Math.Clamp(s.ShadowRankCutoff - 1, 0, 2);
|
ShadowDisplayCb.SelectedIndex = Math.Clamp(s.ShadowRankCutoff - 1, 0, 2);
|
||||||
ReflectionsDetailsCb.SelectedIndex = s.ReflectionsFidelity;
|
ReflectionsDetailsCb.SelectedIndex = s.ReflectionsFidelity;
|
||||||
fovSlider.Value = s.FieldOfView;
|
fovSlider.Value = s.FieldOfView;
|
||||||
@@ -466,7 +483,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
RenderScreensThreadCb.IsChecked = s.PythonThreadedUpload;
|
RenderScreensThreadCb.IsChecked = s.PythonThreadedUpload;
|
||||||
_fpsLimit.Value = s.FpsLimitEnabled ? s.FpsLimit : 0;
|
_fpsLimit.Value = s.FpsLimitEnabled ? s.FpsLimit : 0;
|
||||||
ShadowAngleLimitSlider.Value = s.ShadowAngleLimit;
|
ShadowAngleLimitSlider.Value = s.ShadowAngleLimit;
|
||||||
FullscreenWindowedCb.IsChecked = s.FullscreenWindowed;
|
|
||||||
RenderAngleVulkanCb.IsChecked = s.RenderAngleVulkan;
|
RenderAngleVulkanCb.IsChecked = s.RenderAngleVulkan;
|
||||||
|
|
||||||
TrackCurvesSlider.Value = s.SplineFidelity;
|
TrackCurvesSlider.Value = s.SplineFidelity;
|
||||||
@@ -497,6 +513,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
AutoCloseStarterCb.IsChecked = s.AutoCloseStarter;
|
AutoCloseStarterCb.IsChecked = s.AutoCloseStarter;
|
||||||
LargeThumbnailsCb.IsChecked = s.LargeThumbnails;
|
LargeThumbnailsCb.IsChecked = s.LargeThumbnails;
|
||||||
AutoExpandTreeCb.IsChecked = s.AutoExpandSceneryTree;
|
AutoExpandTreeCb.IsChecked = s.AutoExpandSceneryTree;
|
||||||
|
UpdateAdvancedModeButton();
|
||||||
ReadyOverrideCb.SelectedIndex = (int)s.ReadyOverride;
|
ReadyOverrideCb.SelectedIndex = (int)s.ReadyOverride;
|
||||||
|
|
||||||
CompressTexCb.IsChecked = s.CompressTextures;
|
CompressTexCb.IsChecked = s.CompressTextures;
|
||||||
@@ -518,7 +535,15 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void ShowAsEdits(SimulatorSettings s)
|
private void ShowAsEdits(SimulatorSettings s)
|
||||||
{
|
{
|
||||||
ShowValues(s);
|
_showingEdits = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowValues(s);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_showingEdits = false;
|
||||||
|
}
|
||||||
RefreshDerivedRows();
|
RefreshDerivedRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,9 +551,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
private void RefreshDerivedRows()
|
private void RefreshDerivedRows()
|
||||||
{
|
{
|
||||||
UpdateQualityCaptions();
|
UpdateQualityCaptions();
|
||||||
UpdateIdleNotes();
|
|
||||||
UpdateDependentRows();
|
UpdateDependentRows();
|
||||||
UpdateGraphicsState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Levels of detail ─────────────────────────────────────────────────────
|
// ── Levels of detail ─────────────────────────────────────────────────────
|
||||||
@@ -551,8 +574,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
foreach (var (section, group) in new[]
|
foreach (var (section, group) in new[]
|
||||||
{
|
{
|
||||||
(DrawRangeSection, GraphicsGroup.DrawRange), (TexturesSection, GraphicsGroup.Textures),
|
(DrawRangeSection, GraphicsGroup.DrawRange), (TexturesSection, GraphicsGroup.Textures),
|
||||||
(ShadowsSection, GraphicsGroup.Shadows), (LightsSection, GraphicsGroup.Lights),
|
(ShadowsSection, GraphicsGroup.Shadows), (ReflectionsSection, GraphicsGroup.Reflections)
|
||||||
(ReflectionsSection, GraphicsGroup.Reflections), (NatureSection, GraphicsGroup.Nature)
|
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
var levels = new ComboBox();
|
var levels = new ComboBox();
|
||||||
@@ -575,7 +597,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
foreach (var (preset, button) in _presetButtons)
|
foreach (var (preset, button) in _presetButtons)
|
||||||
{
|
{
|
||||||
button.Content = App.Loc[preset.NameKey];
|
button.Content = App.Loc[preset.NameKey];
|
||||||
ToolTip.SetTip(button, SettingTexts.PresetSummary(preset));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_markingLevels = true;
|
_markingLevels = true;
|
||||||
@@ -585,7 +606,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
foreach (var level in GraphicsPreset.All)
|
foreach (var level in GraphicsPreset.All)
|
||||||
levels.Items.Add(new ComboBoxItem { Content = App.Loc[level.NameKey], Tag = level });
|
levels.Items.Add(new ComboBoxItem { Content = App.Loc[level.NameKey], Tag = level });
|
||||||
levels.PlaceholderText = App.Loc["PresetCustom"];
|
levels.PlaceholderText = App.Loc["PresetCustom"];
|
||||||
ToolTip.SetTip(levels, App.Loc["GfxGroupLevelTip"]);
|
|
||||||
}
|
}
|
||||||
_markingLevels = false;
|
_markingLevels = false;
|
||||||
|
|
||||||
@@ -609,8 +629,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
var trial = Trial();
|
var trial = Trial();
|
||||||
var applied = _presetMemory.Apply(preset, trial);
|
var applied = _presetMemory.Apply(preset, trial);
|
||||||
ShowAsEdits(trial);
|
ShowAsEdits(trial);
|
||||||
foreach (string key in applied.RowKeys)
|
|
||||||
_keyRows.Show(key, trial.Extra[key]);
|
|
||||||
|
|
||||||
// Chosen as a whole, its values are choices, not ones the screen could not show.
|
// Chosen as a whole, its values are choices, not ones the screen could not show.
|
||||||
ForgetShown(applied.ChosenKeys);
|
ForgetShown(applied.ChosenKeys);
|
||||||
@@ -684,8 +702,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
if (_cards.Count == 0)
|
if (_cards.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CardText.Text = CardLine(_cards[0]);
|
CardText.Text = string.Join(Environment.NewLine, _cards.Select(CardLine));
|
||||||
ToolTip.SetTip(CardText, string.Join(Environment.NewLine, _cards.Select(CardLine)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── The screens' refresh rates, for the frame rate limit ─────────────────
|
// ── The screens' refresh rates, for the frame rate limit ─────────────────
|
||||||
@@ -694,38 +711,51 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
|
|
||||||
private void BuildMonitorRates()
|
private void BuildMonitorRates()
|
||||||
{
|
{
|
||||||
var displays = AppServices.Current.Displays.List();
|
VSyncCb.IsCheckedChanged += (_, _) => UpdateMonitorRates();
|
||||||
if (displays.Count == 0)
|
DisplayModeCb.SelectionChanged += (_, _) =>
|
||||||
return;
|
{
|
||||||
|
UpdateDisplayRows();
|
||||||
MonitorRates.IsVisible = true;
|
UpdateMonitorRates();
|
||||||
UpdateMonitorRates(displays);
|
};
|
||||||
App.Loc.LanguageChanged += () => UpdateMonitorRates(displays);
|
MonitorCb.SelectionChanged += (_, _) => UpdateMonitorRates();
|
||||||
|
App.Loc.LanguageChanged += UpdateMonitorRates;
|
||||||
|
UpdateMonitorRates();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateMonitorRates(IReadOnlyList<Display> displays)
|
/// <summary>
|
||||||
|
/// The rate of the monitor the simulator will show on, with a button to match the limit
|
||||||
|
/// to it. VSync already holds the frames to that rate, so with it on there is no button:
|
||||||
|
/// fpslimit paces frames by its own clock (framepacer.h), not the refresh, so no limit
|
||||||
|
/// of it lines up with the monitor.
|
||||||
|
/// </summary>
|
||||||
|
private void UpdateMonitorRates()
|
||||||
{
|
{
|
||||||
|
bool vsync = IsChecked(VSyncCb);
|
||||||
|
FpsVSyncNote.IsVisible = vsync;
|
||||||
MonitorRates.Children.Clear();
|
MonitorRates.Children.Clear();
|
||||||
foreach (var display in displays)
|
|
||||||
|
int hz = SimulatorMonitor()?.RefreshRate ?? 0;
|
||||||
|
MonitorRates.IsVisible = hz > 0;
|
||||||
|
if (hz == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MonitorRates.Children.Add(new TextBlock
|
||||||
{
|
{
|
||||||
string screen = string.IsNullOrEmpty(display.Name)
|
Text = string.Format(App.Loc["MonitorRate"], hz),
|
||||||
? string.Format(App.Loc["MonitorRate"], display.RefreshRate)
|
FontSize = 11, Foreground = FgDimBrush, VerticalAlignment = VerticalAlignment.Center
|
||||||
: string.Format(App.Loc["MonitorRateNamed"], display.Name, display.RefreshRate);
|
});
|
||||||
MonitorRates.Children.Add(new TextBlock
|
if (vsync)
|
||||||
{
|
return;
|
||||||
Text = screen, FontSize = 11, Foreground = FgDimBrush, VerticalAlignment = VerticalAlignment.Center
|
|
||||||
});
|
var match = new Button
|
||||||
var match = new Button
|
{
|
||||||
{
|
Content = string.Format(App.Loc["MonitorRateUse"], hz),
|
||||||
Content = string.Format(App.Loc["MonitorRateUse"], display.RefreshRate),
|
Margin = new Thickness(4, 0, 14, 0)
|
||||||
Margin = new Thickness(4, 0, 14, 0)
|
};
|
||||||
};
|
match.Classes.Add("Outline");
|
||||||
match.Classes.Add("Outline");
|
match.Classes.Add("SectionReset");
|
||||||
match.Classes.Add("SectionReset");
|
match.Click += (_, _) => _fpsLimit.Value = hz;
|
||||||
int rate = display.RefreshRate;
|
MonitorRates.Children.Add(match);
|
||||||
match.Click += (_, _) => _fpsLimit.Value = rate;
|
|
||||||
MonitorRates.Children.Add(match);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Sections back to the simulator's own values ──────────────────────────
|
// ── Sections back to the simulator's own values ──────────────────────────
|
||||||
@@ -776,13 +806,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
/// <summary>Puts the section's rows at the simulator's own values, as edits waiting for Save.</summary>
|
/// <summary>Puts the section's rows at the simulator's own values, as edits waiting for Save.</summary>
|
||||||
private void ResetSection(SettingsSection section)
|
private void ResetSection(SettingsSection section)
|
||||||
{
|
{
|
||||||
var keys = ResettableKeys(section);
|
ShowDefaults(ResettableKeys(section));
|
||||||
ShowAsEdits(AppServices.Current.SettingsStore.WithDefaults(Trial(), keys));
|
|
||||||
foreach (string key in keys)
|
|
||||||
_keyRows.ShowDefault(key);
|
|
||||||
|
|
||||||
// Put back by hand, a value is a choice like any other.
|
|
||||||
ForgetShown(keys);
|
|
||||||
Announcer.Say(this, ScreenReaderNames.PickerText(ScreenReaderNames.TextOf(section.Header), App.Loc["DefaultsRestored"]));
|
Announcer.Say(this, ScreenReaderNames.PickerText(ScreenReaderNames.TextOf(section.Header), App.Loc["DefaultsRestored"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -833,7 +857,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
private string SelectedRenderer() =>
|
private string SelectedRenderer() =>
|
||||||
SimulatorSettings.RenderEngines.ElementAtOrDefault(RenderEngineCb.SelectedIndex) ?? "full";
|
SimulatorSettings.RenderEngines.ElementAtOrDefault(RenderEngineCb.SelectedIndex) ?? "full";
|
||||||
|
|
||||||
private RendererKind SelectedRendererKind() => SettingReach.KindOf(SelectedRenderer());
|
private RendererKind SelectedRendererKind() => Renderers.KindOf(SelectedRenderer());
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes the pending edits on this screen into the settings, so a save from
|
/// Writes the pending edits on this screen into the settings, so a save from
|
||||||
@@ -851,7 +875,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
var language = ChangeLanguageCb.SelectedItem as ComboBoxItem;
|
var language = ChangeLanguageCb.SelectedItem as ComboBoxItem;
|
||||||
s.Language = language?.Content?.ToString() ?? App.Loc.CurrentLanguage;
|
s.Language = language?.Content?.ToString() ?? App.Loc.CurrentLanguage;
|
||||||
s.LanguageCode = language?.Tag as string ?? App.Loc.CurrentLangCode;
|
s.LanguageCode = language?.Tag as string ?? App.Loc.CurrentLangCode;
|
||||||
s.Fullscreen = IsChecked(FullscreenCb);
|
|
||||||
s.PauseWhenInactive = IsChecked(PauseInactiveCb);
|
s.PauseWhenInactive = IsChecked(PauseInactiveCb);
|
||||||
s.PauseOnStart = IsChecked(PauseStartCb);
|
s.PauseOnStart = IsChecked(PauseStartCb);
|
||||||
s.CursorSensitivity = (int)CursorSensitivitySlider.Value;
|
s.CursorSensitivity = (int)CursorSensitivitySlider.Value;
|
||||||
@@ -871,7 +894,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
s.LogMissingVehicleFiles = IsChecked(LogMissingVehicleFilesCb);
|
s.LogMissingVehicleFiles = IsChecked(LogMissingVehicleFilesCb);
|
||||||
|
|
||||||
CaptureGraphics(s);
|
CaptureGraphics(s);
|
||||||
CaptureSound(s);
|
|
||||||
s.Gpu = SelectedGpu();
|
s.Gpu = SelectedGpu();
|
||||||
ReadResolution(s);
|
ReadResolution(s);
|
||||||
s.BufferScalePercent = (int)bufferScale.Value;
|
s.BufferScalePercent = (int)bufferScale.Value;
|
||||||
@@ -892,7 +914,7 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
s.ReflectionsFramerate = _reflections.Value;
|
s.ReflectionsFramerate = _reflections.Value;
|
||||||
s.ShadowMapResolution = 1 << (int)shaderResolutionSlider.Value;
|
s.ShadowMapResolution = 1 << (int)shaderResolutionSlider.Value;
|
||||||
s.ShadowProjectionRange = (int)shaderRange.Value;
|
s.ShadowProjectionRange = (int)shaderRange.Value;
|
||||||
s.CabShadowsRange = (int)cabShaderSourceRange.Value;
|
s.CabShadowsRange = (int)_cabShadows.Value;
|
||||||
s.ShadowRankCutoff = Math.Max(0, ShadowDisplayCb.SelectedIndex) + 1;
|
s.ShadowRankCutoff = Math.Max(0, ShadowDisplayCb.SelectedIndex) + 1;
|
||||||
s.ReflectionsFidelity = Math.Max(0, ReflectionsDetailsCb.SelectedIndex);
|
s.ReflectionsFidelity = Math.Max(0, ReflectionsDetailsCb.SelectedIndex);
|
||||||
s.FieldOfView = Math.Clamp((int)fovSlider.Value, 10, 75);
|
s.FieldOfView = Math.Clamp((int)fovSlider.Value, 10, 75);
|
||||||
@@ -904,7 +926,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
if (fpsLimit > 0)
|
if (fpsLimit > 0)
|
||||||
s.FpsLimit = fpsLimit;
|
s.FpsLimit = fpsLimit;
|
||||||
s.ShadowAngleLimit = ShadowAngleLimitSlider.Value;
|
s.ShadowAngleLimit = ShadowAngleLimitSlider.Value;
|
||||||
s.FullscreenWindowed = IsChecked(FullscreenWindowedCb);
|
|
||||||
s.RenderAngleVulkan = IsChecked(RenderAngleVulkanCb);
|
s.RenderAngleVulkan = IsChecked(RenderAngleVulkanCb);
|
||||||
|
|
||||||
s.SplineFidelity = (int)TrackCurvesSlider.Value;
|
s.SplineFidelity = (int)TrackCurvesSlider.Value;
|
||||||
@@ -1063,6 +1084,10 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
CaptureInto(AppServices.Current.Settings);
|
CaptureInto(AppServices.Current.Settings);
|
||||||
var store = AppServices.Current.SettingsStore;
|
var store = AppServices.Current.SettingsStore;
|
||||||
store.Save();
|
store.Save();
|
||||||
|
// The file had changes from elsewhere, kept with these: show them.
|
||||||
|
if (store.LastSaveMerged)
|
||||||
|
ApplyToUi();
|
||||||
|
UpdateUnknownValues();
|
||||||
KeyboardConfig.Instance.Save();
|
KeyboardConfig.Instance.Save();
|
||||||
RedrawThumbnailsIfNeeded();
|
RedrawThumbnailsIfNeeded();
|
||||||
// Not saved, it is still there to be saved.
|
// Not saved, it is still there to be saved.
|
||||||
@@ -1071,12 +1096,51 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
SaveStatus.Text = App.Loc[store.LastSaveFailed ? "SettingsNotSaved" : "SettingsSaved"];
|
SaveStatus.Text = App.Loc[store.LastSaveFailed ? "SettingsNotSaved" : "SettingsSaved"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Rendering changes, each confirmed ──────────────────────────────────
|
||||||
|
|
||||||
|
/// <summary>Set while a preset, a reset or a profile puts values on the screen: those are not clicks to confirm.</summary>
|
||||||
|
private bool _showingEdits;
|
||||||
|
|
||||||
|
/// <summary>Set while a refused change is put back, which is no change to ask about.</summary>
|
||||||
|
private bool _reverting;
|
||||||
|
|
||||||
|
private bool AsksFirst => _built && !_loading && !_showingEdits && !_reverting;
|
||||||
|
|
||||||
|
private void AskBeforeChange(CheckBox box) =>
|
||||||
|
box.IsCheckedChanged += async (_, _) =>
|
||||||
|
{
|
||||||
|
if (!AsksFirst)
|
||||||
|
return;
|
||||||
|
if (!await ConfirmRenderingChange(ScreenReaderNames.TextOf(box.Content)))
|
||||||
|
Revert(() => box.IsChecked = !box.IsChecked);
|
||||||
|
};
|
||||||
|
|
||||||
|
private async Task<bool> ConfirmRenderingChange(string? setting)
|
||||||
|
{
|
||||||
|
if (TopLevel.GetTopLevel(this) is not Window owner)
|
||||||
|
return true;
|
||||||
|
return await MessageBox.Show(owner, string.Format(App.Loc["ConfirmRenderingChange"], setting),
|
||||||
|
App.Loc["GfxColRendering"], MessageBoxButtons.YesNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Revert(Action putBack)
|
||||||
|
{
|
||||||
|
_reverting = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
putBack();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_reverting = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void RenderEngineCb_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
private void RenderEngineCb_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!_built)
|
if (!_built)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OnBackendChanged();
|
|
||||||
RefreshDerivedRows();
|
RefreshDerivedRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1132,43 +1196,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
return exes.FullPath(exes.Resolve(pick, out _));
|
return exes.FullPath(exes.Resolve(pick, out _));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Dims the rows the simulator to be started would ignore and says why. Follows
|
|
||||||
/// the simulator and renderer picked here, before they are saved.
|
|
||||||
/// </summary>
|
|
||||||
private void UpdateIdleNotes()
|
|
||||||
{
|
|
||||||
string exe = TargetExecutable();
|
|
||||||
var settings = AppServices.Current.Settings;
|
|
||||||
var target = new SimulatorTarget(
|
|
||||||
AppServices.Current.Executables.IsWindowsBuild(exe),
|
|
||||||
SelectedRenderer(),
|
|
||||||
settings.NetworkServer,
|
|
||||||
_keyRows.NumberIfSet("targetfps", settings),
|
|
||||||
settings.FpsAverage,
|
|
||||||
IsChecked(FullscreenWindowedCb));
|
|
||||||
|
|
||||||
foreach (var row in SettingsStack.GetLogicalDescendants().OfType<SettingRow>())
|
|
||||||
row.IdleNote = string.IsNullOrEmpty(row.ConfigKey)
|
|
||||||
? null
|
|
||||||
: IdleText(SettingReach.Why(row.ConfigKey, target));
|
|
||||||
|
|
||||||
RenderEngineWarning.IsVisible = SelectedRendererKind() == RendererKind.Experimental;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string? IdleText(IdleReason reason) => reason switch
|
|
||||||
{
|
|
||||||
IdleReason.WindowsBuildOnly => App.Loc["IdleWindowsBuildOnly"],
|
|
||||||
IdleReason.LegacyRendererOnly => App.Loc["IdleLegacyRendererOnly"],
|
|
||||||
IdleReason.ModernRendererOnly => App.Loc["IdleModernRendererOnly"],
|
|
||||||
IdleReason.OpenGlRenderersOnly => App.Loc["IdleOpenGlRenderersOnly"],
|
|
||||||
IdleReason.NeedsNetworkServer => App.Loc["IdleNeedsNetworkServer"],
|
|
||||||
IdleReason.NeedsFrameRateTarget => App.Loc["IdleNeedsFrameRateTarget"],
|
|
||||||
IdleReason.MonitorModeInstead => App.Loc["IdleMonitorMode"],
|
|
||||||
IdleReason.VulkanOnly => App.Loc["IdleVulkanOnly"],
|
|
||||||
_ => null
|
|
||||||
};
|
|
||||||
|
|
||||||
private void RedrawThumbnailsIfNeeded()
|
private void RedrawThumbnailsIfNeeded()
|
||||||
{
|
{
|
||||||
bool large = AppServices.Current.Settings.LargeThumbnails;
|
bool large = AppServices.Current.Settings.LargeThumbnails;
|
||||||
@@ -1288,7 +1315,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
private void UpdateShadowResolution()
|
private void UpdateShadowResolution()
|
||||||
{
|
{
|
||||||
int resolution = ShowPixels(ShadowResolutionRow, shaderResolutionSlider);
|
int resolution = ShowPixels(ShadowResolutionRow, shaderResolutionSlider);
|
||||||
ToolTip.SetTip(shaderResolutionSlider, SettingTexts.ShadowMapWord(resolution));
|
|
||||||
|
|
||||||
// Below this the simulator would raise the range anyway.
|
// Below this the simulator would raise the range anyway.
|
||||||
shaderRange.Minimum = SimulatorSettings.ShadowRangeFloor(resolution);
|
shaderRange.Minimum = SimulatorSettings.ShadowRangeFloor(resolution);
|
||||||
@@ -1343,6 +1369,158 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateFeedbackDetailVisibility() => ApplyFilter();
|
private void UpdateFeedbackDetailVisibility() => ApplyFilter();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The mode is the player's way of using the starter, not a setting of the simulator: it is
|
||||||
|
/// kept straight away, as the language is, and the scenario screen follows it.
|
||||||
|
/// </summary>
|
||||||
|
private async void AdvancedModeBtn_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (TopLevel.GetTopLevel(this) is not Window owner)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var settings = AppServices.Current.Settings;
|
||||||
|
if (!settings.AdvancedSettings)
|
||||||
|
{
|
||||||
|
if (!await MessageBox.ShowDelayed(owner, App.Loc["AdvancedModeWarning"], App.Loc["AdvancedMode"],
|
||||||
|
App.Loc["AdvancedModeOn"], 20))
|
||||||
|
return;
|
||||||
|
|
||||||
|
settings.AdvancedSettings = true;
|
||||||
|
AppServices.Current.SettingsStore.Save();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!await MessageBox.Show(owner, App.Loc["AdvancedModeOffConfirm"], App.Loc["AdvancedMode"],
|
||||||
|
MessageBoxButtons.YesNo))
|
||||||
|
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());
|
||||||
|
settings.AdvancedSettings = false;
|
||||||
|
Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
AdvancedModeChanged?.Invoke();
|
||||||
|
UpdateAdvancedModeButton();
|
||||||
|
ApplyFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <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.
|
||||||
|
/// </summary>
|
||||||
|
public void MoveToStandardOnce()
|
||||||
|
{
|
||||||
|
var settings = AppServices.Current.Settings;
|
||||||
|
var store = AppServices.Current.SettingsStore;
|
||||||
|
if (settings.MovedToStandard || store.LoadFailed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
store.KeepCopy(".before-standard");
|
||||||
|
_clamping = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowDefaults(AdvancedKeys());
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
settings.MovedToStandard = true;
|
||||||
|
Save();
|
||||||
|
|
||||||
|
if (wasAdvanced)
|
||||||
|
AdvancedModeChanged?.Invoke();
|
||||||
|
UpdateAdvancedModeButton();
|
||||||
|
ApplyFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Puts <paramref name="keys"/> at the simulator's own values, as edits waiting for Save.</summary>
|
||||||
|
private void ShowDefaults(IReadOnlyCollection<string> keys)
|
||||||
|
{
|
||||||
|
ShowAsEdits(AppServices.Current.SettingsStore.WithDefaults(Trial(), keys));
|
||||||
|
foreach (string key in keys)
|
||||||
|
_keyRows.ShowDefault(key);
|
||||||
|
// Put back by hand, a value is a choice like any other.
|
||||||
|
ForgetShown(keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The keys of the rows set with a slider.</summary>
|
||||||
|
private HashSet<string> SliderKeys()
|
||||||
|
{
|
||||||
|
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
foreach (var row in SettingsStack.GetLogicalDescendants().OfType<SettingRow>())
|
||||||
|
if (row.GetLogicalDescendants().OfType<Slider>().Any())
|
||||||
|
foreach (string key in (row.ConfigKey ?? string.Empty)
|
||||||
|
.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
|
||||||
|
keys.Add(key);
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Every setting of the page at the simulator's own values, the ones only the advanced mode
|
||||||
|
/// shows too, as edits waiting for Save; the key bindings have a button of their own.
|
||||||
|
/// </summary>
|
||||||
|
private async void DefaultsButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (TopLevel.GetTopLevel(this) is not Window owner)
|
||||||
|
return;
|
||||||
|
if (!await MessageBox.Show(owner, App.Loc["AllDefaultsConfirm"], App.Loc["RestoreDefaults"],
|
||||||
|
MessageBoxButtons.YesNo))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
foreach (var section in SettingsStack.GetLogicalDescendants().OfType<SettingsSection>())
|
||||||
|
keys.UnionWith(ResettableKeys(section));
|
||||||
|
ShowDefaults(keys);
|
||||||
|
SaveStatus.Text = App.Loc["DefaultsRestored"];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>The keys of every row only the advanced mode shows.</summary>
|
||||||
|
private HashSet<string> AdvancedKeys()
|
||||||
|
{
|
||||||
|
var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
foreach (var section in SettingsStack.GetLogicalDescendants().OfType<SettingsSection>())
|
||||||
|
{
|
||||||
|
if (section.Advanced && !string.IsNullOrEmpty(section.ToggleKey))
|
||||||
|
keys.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);
|
||||||
|
}
|
||||||
|
keys.ExceptWith(KeptOnReset);
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool Advanced => AppServices.Current.Settings.AdvancedSettings;
|
||||||
|
|
||||||
|
/// <summary>Under each setting, the value of eu07.ini for it the starter cannot read, as the file has it.</summary>
|
||||||
|
private void UpdateUnknownValues()
|
||||||
|
{
|
||||||
|
var unreadable = AppServices.Current.SettingsStore.UnreadableValues();
|
||||||
|
foreach (var row in SettingsStack.GetLogicalDescendants().OfType<SettingRow>())
|
||||||
|
{
|
||||||
|
var keys = (row.ConfigKey ?? string.Empty)
|
||||||
|
.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||||
|
var found = keys.Where(unreadable.ContainsKey)
|
||||||
|
.Select(key => keys.Length > 1 ? key + " " + unreadable[key] : unreadable[key])
|
||||||
|
.ToList();
|
||||||
|
row.UnknownValue = found.Count > 0 ? string.Format(App.Loc["UnknownIniValue"], string.Join(", ", found)) : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateAdvancedModeButton() =>
|
||||||
|
AdvancedModeBtn.Content = App.Loc[Advanced ? "AdvancedModeOff" : "AdvancedModeMenu"];
|
||||||
|
|
||||||
private bool ConditionAllows(SettingRow row)
|
private bool ConditionAllows(SettingRow row)
|
||||||
{
|
{
|
||||||
if (ReferenceEquals(row, GpuRow))
|
if (ReferenceEquals(row, GpuRow))
|
||||||
@@ -1404,6 +1582,11 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
SettingsScroll.IsVisible = !bindings;
|
SettingsScroll.IsVisible = !bindings;
|
||||||
PresetBar.IsVisible = category is "graphics" or "effects" && !searching;
|
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.
|
||||||
|
bool advanced = Advanced;
|
||||||
|
bool everything = advanced || searching;
|
||||||
|
|
||||||
if (bindings)
|
if (bindings)
|
||||||
{
|
{
|
||||||
_keyBindings.RebuildList();
|
_keyBindings.RebuildList();
|
||||||
@@ -1421,12 +1604,17 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
foreach (var section in panel.GetLogicalDescendants().OfType<SettingsSection>())
|
foreach (var section in panel.GetLogicalDescendants().OfType<SettingsSection>())
|
||||||
{
|
{
|
||||||
bool anyInSection = false;
|
bool anyInSection = false;
|
||||||
|
if (section.Level is Control level)
|
||||||
|
level.IsVisible = advanced;
|
||||||
|
|
||||||
foreach (var row in section.GetLogicalDescendants().OfType<SettingRow>())
|
foreach (var row in section.GetLogicalDescendants().OfType<SettingRow>())
|
||||||
{
|
{
|
||||||
bool visible = ConditionAllows(row) &&
|
// 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) &&
|
||||||
(!searching || TextMatch.Contains(RowSearchText(row), query));
|
(!searching || TextMatch.Contains(RowSearchText(row), query));
|
||||||
row.IsVisible = visible;
|
row.IsVisible = visible;
|
||||||
|
row.Classes.Set("HideKey", !advanced);
|
||||||
anyInSection |= visible;
|
anyInSection |= visible;
|
||||||
if (visible && searching)
|
if (visible && searching)
|
||||||
_shownCount++;
|
_shownCount++;
|
||||||
@@ -1444,11 +1632,17 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
caption.IsVisible = searching;
|
caption.IsVisible = searching;
|
||||||
|
|
||||||
if (CategoryItem(tag) is { } item)
|
if (CategoryItem(tag) is { } item)
|
||||||
|
{
|
||||||
item.Classes.Set("NoHits", searching && !anyRow);
|
item.Classes.Set("NoHits", searching && !anyRow);
|
||||||
|
// A category with nothing for the standard mode leaves the list.
|
||||||
|
item.IsVisible = everything || anyRow;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searching)
|
if (searching)
|
||||||
SettingsScroll.Offset = new Vector(0, 0);
|
SettingsScroll.Offset = new Vector(0, 0);
|
||||||
|
else if (CategoryList.SelectedItem is ListBoxItem { IsVisible: false })
|
||||||
|
CategoryList.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ListBoxItem? CategoryItem(string tag) =>
|
private ListBoxItem? CategoryItem(string tag) =>
|
||||||
@@ -1513,9 +1707,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
case NumericUpDown nud:
|
case NumericUpDown nud:
|
||||||
nud.ValueChanged += (_, _) => OnControlChanged();
|
nud.ValueChanged += (_, _) => OnControlChanged();
|
||||||
break;
|
break;
|
||||||
case TextBox box when ReferenceEquals(box, VulkanDeviceTb):
|
|
||||||
box.TextChanged += (_, _) => OnControlChanged();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1528,7 +1719,6 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
{
|
{
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
QueuePresetMarks();
|
QueuePresetMarks();
|
||||||
UpdateGraphicsState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MarkDirty()
|
private void MarkDirty()
|
||||||
@@ -1559,6 +1749,31 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
return 200;
|
return 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The old starter's ranges (<see cref="SliderRanges"/>), in either mode, with the value
|
||||||
|
/// <paramref name="s"/> has along with them: one from the file or a level outside them is
|
||||||
|
/// shown as it is, so opening and saving the settings never moves it - as SliderSteps does.
|
||||||
|
/// </summary>
|
||||||
|
private void ApplyRanges(SimulatorSettings s)
|
||||||
|
{
|
||||||
|
// Clamping, the ranges stay as they are and a value past them is moved in.
|
||||||
|
bool widen = !_clamping;
|
||||||
|
int minTexture = Log2(SliderRanges.MinTextureSize, 9), minShadow = Log2(SliderRanges.MinShadowMap, 10);
|
||||||
|
textureResolutionSlider.Minimum = widen ? Math.Min(minTexture, Log2(s.MaxTextureSize, 12)) : minTexture;
|
||||||
|
shaderResolutionSlider.Minimum = widen ? Math.Min(minShadow, Log2(s.ShadowMapResolution, 12)) : minShadow;
|
||||||
|
DynamicLightsSlider.Minimum = widen
|
||||||
|
? Math.Min(SliderRanges.MinDynamicLights, s.DynamicLights)
|
||||||
|
: SliderRanges.MinDynamicLights;
|
||||||
|
CursorSensitivitySlider.Maximum = widen
|
||||||
|
? Math.Max(SliderRanges.MaxCursorSensitivity, s.CursorSensitivity)
|
||||||
|
: SliderRanges.MaxCursorSensitivity;
|
||||||
|
foreach (var steps in new[] { _fpsLimit, _reflections, _anisotropy, _drawRangeFactor, _cabShadows })
|
||||||
|
steps.Clamps = _clamping;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Set while values are put on the screen moved into the sliders' ranges, not widening them.</summary>
|
||||||
|
private bool _clamping;
|
||||||
|
|
||||||
private static int Log2(int value, int fallback)
|
private static int Log2(int value, int fallback)
|
||||||
{
|
{
|
||||||
if (value <= 0) return fallback;
|
if (value <= 0) return fallback;
|
||||||
@@ -1598,11 +1813,9 @@ public partial class Settings : UserControl, ISettingsCapture
|
|||||||
int reach = SimulatorSettings.ShadowReach(metres, 1 << (int)shaderResolutionSlider.Value,
|
int reach = SimulatorSettings.ShadowReach(metres, 1 << (int)shaderResolutionSlider.Value,
|
||||||
SelectedRendererKind() != RendererKind.Modern);
|
SelectedRendererKind() != RendererKind.Modern);
|
||||||
ShadowRangeRow.ValueText = reach == metres ? $"{metres} m" : $"{metres} m → {reach} m";
|
ShadowRangeRow.ValueText = reach == metres ? $"{metres} m" : $"{metres} m → {reach} m";
|
||||||
ToolTip.SetTip(shaderRange, SettingTexts.ShadowRangeWord(reach));
|
|
||||||
|
|
||||||
int cabMetres = (int)cabShaderSourceRange.Value;
|
int cabMetres = (int)_cabShadows.Value;
|
||||||
CabShadowRangeRow.ValueText = cabMetres <= 0 ? App.Loc["RangeDisabled"] : $"{cabMetres} m";
|
CabShadowRangeRow.ValueText = cabMetres <= 0 ? App.Loc["RangeDisabled"] : $"{cabMetres} m";
|
||||||
ToolTip.SetTip(cabShaderSourceRange, SettingTexts.CabShadowRangeWord(cabMetres));
|
|
||||||
|
|
||||||
ReflectionsFramerateRow.ValueText = SettingTexts.ReflectionsInterval(_reflections.Value);
|
ReflectionsFramerateRow.ValueText = SettingTexts.ReflectionsInterval(_reflections.Value);
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ internal sealed class SimulatorKeyRows
|
|||||||
// Marks the input as one of these rows, which tell about their own changes.
|
// Marks the input as one of these rows, which tell about their own changes.
|
||||||
input.Tag = key;
|
input.Tag = key;
|
||||||
|
|
||||||
var setting = new SettingRow { ConfigKey = key.Key, Content = input };
|
var setting = new SettingRow { ConfigKey = key.Key, Content = input, Advanced = !SimulatorKeys.Standard.Contains(key.Key) };
|
||||||
var row = new Row(key, setting, input);
|
var row = new Row(key, setting, input);
|
||||||
_rows.Add(row);
|
_rows.Add(row);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using StarterNG.Domain.Settings;
|
using StarterNG.Domain.Settings;
|
||||||
|
|
||||||
@@ -28,11 +29,16 @@ internal sealed class SliderSteps
|
|||||||
slider.Maximum = steps.Count - 1;
|
slider.Maximum = steps.Count - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>A value past either end of the list is put at that end, not added to it.</summary>
|
||||||
|
public bool Clamps { get; set; }
|
||||||
|
|
||||||
public double Value
|
public double Value
|
||||||
{
|
{
|
||||||
get => _shown[Math.Clamp((int)Math.Round(_slider.Value), 0, _shown.Count - 1)];
|
get => _shown[Math.Clamp((int)Math.Round(_slider.Value), 0, _shown.Count - 1)];
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (Clamps)
|
||||||
|
value = Math.Clamp(value, _steps.Min(), _steps.Max());
|
||||||
_shown = Steps.With(_steps, value);
|
_shown = Steps.With(_steps, value);
|
||||||
_slider.Maximum = _shown.Count - 1;
|
_slider.Maximum = _shown.Count - 1;
|
||||||
int at = Steps.IndexOf(_shown, value);
|
int at = Steps.IndexOf(_shown, value);
|
||||||
|
|||||||
188
StarterNG/Views/TrainsetRow.cs
Normal file
188
StarterNG/Views/TrainsetRow.cs
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Automation;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Layout;
|
||||||
|
using Avalonia.Media;
|
||||||
|
using StarterNG.Application;
|
||||||
|
using StarterNG.Classes;
|
||||||
|
using StarterNG.Domain;
|
||||||
|
|
||||||
|
namespace StarterNG.Views;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A consist's row in a list of them: its vehicles as minis, each stretch of vehicles
|
||||||
|
/// alike as one picture with its name and count under it, so the consist reads at a glance.
|
||||||
|
/// </summary>
|
||||||
|
internal static class TrainsetRow
|
||||||
|
{
|
||||||
|
/// <summary>The height the minis are made at: shown at it they stay sharp.</summary>
|
||||||
|
private const int MiniHeight = 30;
|
||||||
|
|
||||||
|
private static readonly MiniTextures Minis = new();
|
||||||
|
|
||||||
|
/// <summary>Room under the captions for the scroll bar of a consist wider than the list.</summary>
|
||||||
|
private const double ScrollBarLane = 10;
|
||||||
|
|
||||||
|
private static readonly IBrush AiTagBack = new SolidColorBrush(Color.Parse("#9098A0"));
|
||||||
|
private static readonly IBrush AiTagText = new SolidColorBrush(Color.Parse("#15171B"));
|
||||||
|
|
||||||
|
public static Control Build(Trainset trainset)
|
||||||
|
{
|
||||||
|
string label = TrainsetDisplay.ListLabel(trainset);
|
||||||
|
|
||||||
|
Control row;
|
||||||
|
if (TrainsetDisplay.IsEmpty(trainset))
|
||||||
|
{
|
||||||
|
row = new TextBlock
|
||||||
|
{
|
||||||
|
Text = label,
|
||||||
|
FontStyle = FontStyle.Italic,
|
||||||
|
Opacity = 0.7,
|
||||||
|
TextTrimming = TextTrimming.CharacterEllipsis,
|
||||||
|
TextWrapping = TextWrapping.NoWrap,
|
||||||
|
VerticalAlignment = VerticalAlignment.Center
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool ai = TrainsetDisplay.IsAi(trainset);
|
||||||
|
var panel = new DockPanel { Margin = new Thickness(0, 3), LastChildFill = true };
|
||||||
|
if (ai)
|
||||||
|
{
|
||||||
|
var tag = AiTag();
|
||||||
|
tag.Margin = new Thickness(8, 0, 0, 0);
|
||||||
|
DockPanel.SetDock(tag, Dock.Right);
|
||||||
|
panel.Children.Add(tag);
|
||||||
|
}
|
||||||
|
// A consist longer than the list is wide scrolls sideways in its own row. The wheel
|
||||||
|
// still scrolls the list: only shift with the wheel, or a touchpad, moves the strip.
|
||||||
|
panel.Children.Add(ScrollingStrip(trainset.Vehicles, ai));
|
||||||
|
row = panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolTip.SetTip(row, label);
|
||||||
|
AutomationProperties.SetName(row, label);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The vehicles' minis with their captions, scrolling sideways when wider than the room
|
||||||
|
/// they get - here and for the warehouse's consists.
|
||||||
|
/// </summary>
|
||||||
|
public static Control ScrollingStrip(IReadOnlyList<Dynamic> vehicles, bool dimmed = false)
|
||||||
|
{
|
||||||
|
var strip = Strip(vehicles, dimmed);
|
||||||
|
var scroller = new ScrollViewer
|
||||||
|
{
|
||||||
|
HorizontalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Auto,
|
||||||
|
VerticalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled,
|
||||||
|
Content = strip
|
||||||
|
};
|
||||||
|
// The bar lies over the content; a consist that scrolls gets a lane under its
|
||||||
|
// captions for it, so the bar does not cross them. One that fits stays as low as it was.
|
||||||
|
scroller.ScrollChanged += (_, _) =>
|
||||||
|
{
|
||||||
|
double below = scroller.Extent.Width > scroller.Viewport.Width + 0.5 ? ScrollBarLane : 0;
|
||||||
|
if (strip.Margin.Bottom != below)
|
||||||
|
strip.Margin = new Thickness(0, 0, 0, below);
|
||||||
|
};
|
||||||
|
return scroller;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The minis, one next to the other with nothing between, as the vehicles stand coupled.
|
||||||
|
/// </summary>
|
||||||
|
private static Control Strip(IReadOnlyList<Dynamic> vehicles, bool dimmed)
|
||||||
|
{
|
||||||
|
var strip = new StackPanel { Orientation = Orientation.Horizontal, Opacity = dimmed ? 0.6 : 1 };
|
||||||
|
|
||||||
|
var runs = ConsistRuns.Of(vehicles, (v, i) => $"{MiniName(v)}|{Caption(v, i)}");
|
||||||
|
int place = 0;
|
||||||
|
foreach (var run in runs)
|
||||||
|
{
|
||||||
|
strip.Children.Add(RunView(run, place));
|
||||||
|
place += run.Count;
|
||||||
|
}
|
||||||
|
return strip;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Control RunView(ConsistRun run, int place)
|
||||||
|
{
|
||||||
|
var v = run.First;
|
||||||
|
var bmp = Minis.Get(MiniName(v), MiniHeight);
|
||||||
|
|
||||||
|
Control picture;
|
||||||
|
double width;
|
||||||
|
if (bmp is not null)
|
||||||
|
{
|
||||||
|
width = bmp.Size.Height > 0 ? bmp.Size.Width * MiniHeight / bmp.Size.Height : MiniHeight;
|
||||||
|
// Fill at a width worked out here, not Uniform: rounding at a scale such as 125 %
|
||||||
|
// left a line of the background between two vehicles.
|
||||||
|
picture = MiniTextures.Sharp(new Image
|
||||||
|
{
|
||||||
|
Source = bmp,
|
||||||
|
Width = width,
|
||||||
|
Height = MiniHeight,
|
||||||
|
Stretch = Stretch.Fill
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
picture = MiniTextures.MissingVisual(v.SkinFile, MiniHeight);
|
||||||
|
width = picture.Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
string caption = Caption(v, place);
|
||||||
|
if (run.Count > 1)
|
||||||
|
caption += $" ×{run.Count}";
|
||||||
|
|
||||||
|
return new StackPanel
|
||||||
|
{
|
||||||
|
Orientation = Orientation.Vertical,
|
||||||
|
Spacing = 2,
|
||||||
|
Width = width,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
picture,
|
||||||
|
new TextBlock
|
||||||
|
{
|
||||||
|
Text = caption,
|
||||||
|
FontSize = 11,
|
||||||
|
Padding = new Thickness(3, 0),
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
|
TextTrimming = TextTrimming.CharacterEllipsis,
|
||||||
|
TextWrapping = TextWrapping.NoWrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Control AiTag() =>
|
||||||
|
new Border
|
||||||
|
{
|
||||||
|
Background = AiTagBack,
|
||||||
|
Padding = new Thickness(4, 0),
|
||||||
|
VerticalAlignment = VerticalAlignment.Center,
|
||||||
|
Child = new TextBlock
|
||||||
|
{
|
||||||
|
Text = "AI",
|
||||||
|
FontSize = 10,
|
||||||
|
FontWeight = FontWeight.Bold,
|
||||||
|
Foreground = AiTagText
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>A vehicle leading the consist under its own name, the rest under their class - as the composition text has them.</summary>
|
||||||
|
private static string Caption(Dynamic v, int place) =>
|
||||||
|
TrainsetDisplay.VehicleLabel(v, head: place == 0 && TrainsetDisplay.IsPowered(v));
|
||||||
|
|
||||||
|
/// <summary>The mini the consist strip shows for the vehicle.</summary>
|
||||||
|
private static string? MiniName(Dynamic v)
|
||||||
|
{
|
||||||
|
string? mini = AppServices.Current.Library.Vehicles.MiniFor(v.DataFolder, v.SkinFile, v.MmdFile) ?? v.SkinFile;
|
||||||
|
if (!AppServices.Current.MiniTextures.Has(mini) && AppServices.Current.MiniTextures.Has(v.SkinFile))
|
||||||
|
mini = v.SkinFile;
|
||||||
|
return mini;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -61,6 +61,8 @@
|
|||||||
<String key="StartNoScenery">Vyberte scenérii</String>
|
<String key="StartNoScenery">Vyberte scenérii</String>
|
||||||
<String key="StartNoTrain">Vyberte soupravu</String>
|
<String key="StartNoTrain">Vyberte soupravu</String>
|
||||||
<String key="StartNoStaff">Bez osádky / cestujícího</String>
|
<String key="StartNoStaff">Bez osádky / cestujícího</String>
|
||||||
|
<String key="StartDecor">Dekorační souprava</String>
|
||||||
|
<String key="StartAi">Souprava AI</String>
|
||||||
<String key="StartNoStaffTitle">Souprava bez osádky</String>
|
<String key="StartNoStaffTitle">Souprava bez osádky</String>
|
||||||
<String key="StartNoStaffConfirm">Tato souprava nemá osádku ani cestujícího — nebude co řídit. Přesto spustit?</String>
|
<String key="StartNoStaffConfirm">Tato souprava nemá osádku ani cestujícího — nebude co řídit. Přesto spustit?</String>
|
||||||
<String key="RestoreWeather">Obnovit počasí</String>
|
<String key="RestoreWeather">Obnovit počasí</String>
|
||||||
@@ -355,8 +357,8 @@
|
|||||||
<String key="General">Obecné</String>
|
<String key="General">Obecné</String>
|
||||||
|
|
||||||
<String key="Language">Jazyk</String>
|
<String key="Language">Jazyk</String>
|
||||||
|
<String key="UnknownIniValue">Neznámá hodnota v eu07.ini: „{0}“. Zůstane v souboru, dokud ji nezměníte.</String>
|
||||||
<String key="LanguageSimMissing">Simulátor nemá překlad do tohoto jazyka a poběží v angličtině.</String>
|
<String key="LanguageSimMissing">Simulátor nemá překlad do tohoto jazyka a poběží v angličtině.</String>
|
||||||
<String key="Fullscreen">Celá obrazovka</String>
|
|
||||||
<String key="PauseSimInactive">Pozastavit simulaci při neaktivním okně</String>
|
<String key="PauseSimInactive">Pozastavit simulaci při neaktivním okně</String>
|
||||||
<String key="PauseSimStart">Pozastavit po spuštění</String>
|
<String key="PauseSimStart">Pozastavit po spuštění</String>
|
||||||
<String key="CursorSensitivity">Citlivost kurzoru</String>
|
<String key="CursorSensitivity">Citlivost kurzoru</String>
|
||||||
@@ -366,6 +368,7 @@
|
|||||||
<String key="Communication">Komunikace</String>
|
<String key="Communication">Komunikace</String>
|
||||||
|
|
||||||
<String key="GamepadSignalIgnore">Ignorovat vstup z gamepadu</String>
|
<String key="GamepadSignalIgnore">Ignorovat vstup z gamepadu</String>
|
||||||
|
<String key="ConfirmGamepadUse">Doporučené a výchozí je gamepad ignorovat. Zapnutí jeho podpory bývá zdrojem potíží s ovládáním. Měňte jen tehdy, když opravdu ovládáte gamepadem. Změnit?</String>
|
||||||
|
|
||||||
<String key="Feedback">Zpětná vazba</String>
|
<String key="Feedback">Zpětná vazba</String>
|
||||||
<String key="FeedbackOff">Vypnuto</String>
|
<String key="FeedbackOff">Vypnuto</String>
|
||||||
@@ -407,8 +410,8 @@
|
|||||||
|
|
||||||
<String key="Graphic">Grafika</String>
|
<String key="Graphic">Grafika</String>
|
||||||
<String key="RenderEngine">Vykreslovací engine</String>
|
<String key="RenderEngine">Vykreslovací engine</String>
|
||||||
<String key="RenderEngineDesc">Plný funguje s každým exe. Starý, Zjednodušený a Experimentální jen se staršími, nový místo nich spustí Plný.</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="REExperimentalWarning">Upozornění: experimentální renderer může být nestabilní, nezobrazovat části scény nebo se na některých grafických kartách nespustit. Pokud se simulátor nespustí nebo vypadá špatně, vraťte se k rendereru „Plný“.</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>
|
<String key="GpuChoice">Grafická karta (Linux)</String>
|
||||||
<String key="GpuDiscrete">Výkonnější (dedikovaná)</String>
|
<String key="GpuDiscrete">Výkonnější (dedikovaná)</String>
|
||||||
<String key="GpuSystem">Podle systému</String>
|
<String key="GpuSystem">Podle systému</String>
|
||||||
@@ -418,16 +421,9 @@
|
|||||||
<String key="GpuNotePlayer">Nalezeno: {0}. Kartu vybírají proměnné prostředí ({1}); starter je nemění.</String>
|
<String key="GpuNotePlayer">Nalezeno: {0}. Kartu vybírají proměnné prostředí ({1}); starter je nemění.</String>
|
||||||
<String key="GpuNoteOne">Jedna karta: {0} – není mezi čím vybírat.</String>
|
<String key="GpuNoteOne">Jedna karta: {0} – není mezi čím vybírat.</String>
|
||||||
<String key="GpuNoteUnread">Grafické karty se nepodařilo načíst z /sys/class/drm.</String>
|
<String key="GpuNoteUnread">Grafické karty se nepodařilo načíst z /sys/class/drm.</String>
|
||||||
<String key="IdleWindowsBuildOnly">Funguje jen ve verzi simulátoru pro Windows.</String>
|
|
||||||
<String key="IdleLegacyRendererOnly">Čte to jen renderer legacy, ale zvolen je jiný.</String>
|
|
||||||
<String key="IdleNeedsFrameRateTarget">Funguje jen s cílovým počtem snímků (targetfps).</String>
|
|
||||||
<String key="IdleOpenGlRenderersOnly">Experimentální renderer to nečte.</String>
|
|
||||||
<String key="IdleModernRendererOnly">Čte to jen plný renderer, ale zvolen je jiný.</String>
|
|
||||||
<String key="IdleNeedsNetworkServer">Pauza na pozadí vyžaduje síťový server (network.server).</String>
|
|
||||||
|
|
||||||
<String key="Resolution">Rozlišení</String>
|
<String key="Resolution">Rozlišení</String>
|
||||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||||
<String key="IdleMonitorMode">Při automatickém rozlišení nefunguje.</String>
|
|
||||||
<String key="BufforResolution">Rozlišení bufferu</String>
|
<String key="BufforResolution">Rozlišení bufferu</String>
|
||||||
<String key="MaxTexResolution">Maximální rozlišení textur</String>
|
<String key="MaxTexResolution">Maximální rozlišení textur</String>
|
||||||
<String key="MaxTexCabResolution">Maximální rozlišení textur kabiny</String>
|
<String key="MaxTexCabResolution">Maximální rozlišení textur kabiny</String>
|
||||||
@@ -456,7 +452,14 @@
|
|||||||
<String key="FpsLimitDesc">Méně snímků: chladnější a tišší počítač. S V-Sync limit nad obnovovací frekvencí nic nedělá.</String>
|
<String key="FpsLimitDesc">Méně snímků: chladnější a tišší počítač. S V-Sync limit nad obnovovací frekvencí nic nedělá.</String>
|
||||||
<String key="ShadowAngleLimit">Omezení délky stínů</String>
|
<String key="ShadowAngleLimit">Omezení délky stínů</String>
|
||||||
<String key="ShadowLimitShort">Zkrácené</String>
|
<String key="ShadowLimitShort">Zkrácené</String>
|
||||||
<String key="FullscreenWindowed">Automatické rozlišení (celá obrazovka bez okrajů)</String>
|
<String key="DisplayMode">Režim zobrazení</String>
|
||||||
|
<String key="DisplayModeFullscreen">Celá obrazovka</String>
|
||||||
|
<String key="DisplayModeBorderless">Celá obrazovka bez okrajů</String>
|
||||||
|
<String key="DisplayModeWindow">Okno</String>
|
||||||
|
<String key="DisplayModeDesc">Celá obrazovka bez okrajů bere rozlišení monitoru a rychleji přepíná do jiných programů.</String>
|
||||||
|
<String key="FullscreenMonitor">Monitor</String>
|
||||||
|
<String key="FullscreenMonitorDesc">Na kterém monitoru se simulátor otevře v režimu celé obrazovky.</String>
|
||||||
|
<String key="MonitorPrimary">Hlavní</String>
|
||||||
<String key="VSync">VSync</String>
|
<String key="VSync">VSync</String>
|
||||||
<String key="SmokeDisplay">Zobrazení kouře</String>
|
<String key="SmokeDisplay">Zobrazení kouře</String>
|
||||||
<String key="SmokeParticlesMultiplier">Násobitel částic kouře</String>
|
<String key="SmokeParticlesMultiplier">Násobitel částic kouře</String>
|
||||||
@@ -518,28 +521,14 @@
|
|||||||
<String key="VehiclesVolume">Hlasitost vozidel</String>
|
<String key="VehiclesVolume">Hlasitost vozidel</String>
|
||||||
<String key="PositionedSoundsVolume">Hlasitost prostorových zvuků</String>
|
<String key="PositionedSoundsVolume">Hlasitost prostorových zvuků</String>
|
||||||
<String key="AmbientVolume">Hlasitost okolí</String>
|
<String key="AmbientVolume">Hlasitost okolí</String>
|
||||||
<String key="SoundDevice">Zvukové zařízení a efekty</String>
|
|
||||||
<String key="SoundOutputDevice">Výstupní zařízení</String>
|
|
||||||
<String key="SoundSystemDefault">Výchozí systémové</String>
|
|
||||||
<String key="SoundOutputMode">Rozložení reproduktorů</String>
|
|
||||||
<String key="SoundAutomatic">Automaticky</String>
|
|
||||||
<String key="SoundStereoBasic">Stereo (jednoduché panorama)</String>
|
|
||||||
<String key="SoundStereoUhj">Stereo (UHJ, širší)</String>
|
|
||||||
<String key="SoundHeadphones">Sluchátka (HRTF)</String>
|
|
||||||
<String key="SoundOn">Zapnuto</String>
|
|
||||||
<String key="SoundOff">Vypnuto</String>
|
|
||||||
<String key="SoundHrtfProfile">Sada dat HRTF</String>
|
|
||||||
<String key="SoundLibraryChoice">Volba knihovny</String>
|
|
||||||
<String key="SoundResampler">Převzorkování</String>
|
|
||||||
<String key="SoundLibraryDefault">Výchozí knihovny</String>
|
|
||||||
<String key="SoundLimiter">Omezovač výstupu</String>
|
|
||||||
<String key="SoundFrequency">Vzorkovací frekvence mixu</String>
|
|
||||||
<String key="SoundDeviceRate">Frekvence zařízení</String>
|
|
||||||
<String key="SoundDoppler">Dopplerův jev</String>
|
|
||||||
<String key="SoundLowpass">Tlumené zvuky mimo kabinu</String>
|
|
||||||
<String key="SoundAirAbsorption">Pohlcování vzduchem</String>
|
|
||||||
|
|
||||||
<String key="Advanced">Pokročilé</String>
|
<String key="Advanced">Pokročilé</String>
|
||||||
|
<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="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="CompressTextures">Komprimovat textury TGA</String>
|
<String key="CompressTextures">Komprimovat textury TGA</String>
|
||||||
<String key="ScaleSpeculars">Škálovat odlesky (kompatibilita starých modelů)</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>
|
<String key="ScaleSpecularsDesc">Zeslabuje lesk modelů dělaných pro starší renderery.</String>
|
||||||
@@ -589,6 +578,7 @@
|
|||||||
<String key="Reset">Obnovit</String>
|
<String key="Reset">Obnovit</String>
|
||||||
<String key="SettingsSaved">Nastavení uloženo</String>
|
<String key="SettingsSaved">Nastavení uloženo</String>
|
||||||
<String key="DefaultsRestored">Výchozí hodnoty obnoveny</String>
|
<String key="DefaultsRestored">Výchozí hodnoty obnoveny</String>
|
||||||
|
<String key="AllDefaultsConfirm">Všechna nastavení se vrátí na výchozí. Zůstane: jazyk, vybraný simulátor, port UART a klávesy ovládání. Změny je ještě třeba uložit.</String>
|
||||||
<String key="SettingsRestored">Uložené nastavení obnoveno</String>
|
<String key="SettingsRestored">Uložené nastavení obnoveno</String>
|
||||||
<String key="TreeExpanded">rozbaleno</String>
|
<String key="TreeExpanded">rozbaleno</String>
|
||||||
<String key="TreeCollapsed">sbaleno</String>
|
<String key="TreeCollapsed">sbaleno</String>
|
||||||
@@ -816,6 +806,7 @@
|
|||||||
<String key="SyntaxIncludeNotClosed">include {1} bez end</String>
|
<String key="SyntaxIncludeNotClosed">include {1} bez end</String>
|
||||||
<String key="SyntaxTrainsetUnreadable">Soupravu {0} se nepodařilo načíst</String>
|
<String key="SyntaxTrainsetUnreadable">Soupravu {0} se nepodařilo načíst</String>
|
||||||
<String key="SyntaxVehicleUnreadable">Vozidlo {0} se nepodařilo načíst</String>
|
<String key="SyntaxVehicleUnreadable">Vozidlo {0} se nepodařilo načíst</String>
|
||||||
|
<String key="SyntaxVehicleMissing">Vozidlo {0} chybí: soubor dynamic/{1} nenalezen - simulátor ho vynechá, souprava bude kratší</String>
|
||||||
<String key="WarehouseUseInScenery">Vložit do vybrané soupravy scenérie</String>
|
<String key="WarehouseUseInScenery">Vložit do vybrané soupravy scenérie</String>
|
||||||
<String key="WarehouseAppendToScenery">Připojit k vybrané soupravě scenérie</String>
|
<String key="WarehouseAppendToScenery">Připojit k vybrané soupravě scenérie</String>
|
||||||
<String key="ShortcutUndo">Vrátit změnu soupravy</String>
|
<String key="ShortcutUndo">Vrátit změnu soupravy</String>
|
||||||
@@ -830,7 +821,6 @@
|
|||||||
<String key="Ini.loadinglog">Zobrazit protokol při načítání</String>
|
<String key="Ini.loadinglog">Zobrazit protokol při načítání</String>
|
||||||
<String key="Ini.captureonstart">Po startu myš otáčí kamerou</String>
|
<String key="Ini.captureonstart">Po startu myš otáčí kamerou</String>
|
||||||
<String key="Ini.mousecontrol">Ovládání prvků v kabině myší</String>
|
<String key="Ini.mousecontrol">Ovládání prvků v kabině myší</String>
|
||||||
<String key="Ini.fullscreenmonitor">Monitor pro celou obrazovku</String>
|
|
||||||
<String key="Ini.screenshotsdir">Složka snímků obrazovky</String>
|
<String key="Ini.screenshotsdir">Složka snímků obrazovky</String>
|
||||||
<String key="Ini.basedrawrange">Základní dohled vykreslování</String>
|
<String key="Ini.basedrawrange">Základní dohled vykreslování</String>
|
||||||
<String key="Ini.targetfps">Cílová snímková frekvence</String>
|
<String key="Ini.targetfps">Cílová snímková frekvence</String>
|
||||||
@@ -869,8 +859,8 @@
|
|||||||
<String key="PresetHigh">Vysoká</String>
|
<String key="PresetHigh">Vysoká</String>
|
||||||
<String key="PresetCustom">Vlastní</String>
|
<String key="PresetCustom">Vlastní</String>
|
||||||
<String key="MonitorRate">Monitor: {0} Hz</String>
|
<String key="MonitorRate">Monitor: {0} Hz</String>
|
||||||
<String key="MonitorRateNamed">Obrazovka {0}: až {1} Hz</String>
|
|
||||||
<String key="MonitorRateUse">Nastavit {0} FPS</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">Najetím na úroveň zobrazíte hodnoty.</String>
|
||||||
<String key="TextureBaseDateHint">RRRR-MM-DD</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="LanguageStarterMissing">Starter nemá překlad: zůstane anglicky. Simulátor dostane tento jazyk.</String>
|
||||||
@@ -928,73 +918,12 @@
|
|||||||
<String key="WarehouseSaved">Ve skladu: {0}</String>
|
<String key="WarehouseSaved">Ve skladu: {0}</String>
|
||||||
<String key="WarehouseNothingToAdd">Vyberte soupravu s vozidly</String>
|
<String key="WarehouseNothingToAdd">Vyberte soupravu s vozidly</String>
|
||||||
<String key="GfxGroupLevelTip">Úroveň jen pro tuto část grafiky</String>
|
<String key="GfxGroupLevelTip">Úroveň jen pro tuto část grafiky</String>
|
||||||
<String key="REVulkan">Vulkan 1.4</String>
|
|
||||||
<String key="IdleVulkanOnly">Funguje jen s Vulkanem.</String>
|
|
||||||
<String key="DlssPreset">Předvolba DLSS</String>
|
|
||||||
<String key="FrameGeneration">Generování snímků</String>
|
|
||||||
<String key="Reflex">NVIDIA Reflex</String>
|
|
||||||
<String key="RayTracing">Odrazy ray tracing</String>
|
|
||||||
<String key="RayTracingRange">Dosah ray tracingu</String>
|
|
||||||
<String key="VulkanDevice">Grafická karta (Vulkan)</String>
|
|
||||||
<String key="Ssr">Odrazy v prostoru obrazovky (SSR)</String>
|
|
||||||
<String key="AmbientOcclusion">Okolní zastínění</String>
|
|
||||||
<String key="AmbientOcclusionQuality">Kvalita zastínění</String>
|
|
||||||
<String key="AoLighting">Zastínění v okolním světle</String>
|
|
||||||
<String key="LightsClustered">Klastrové osvětlení</String>
|
|
||||||
<String key="LightShadows">Stíny lamp a reflektorů</String>
|
|
||||||
<String key="ContactShadows">Kontaktní stíny</String>
|
|
||||||
<String key="ShadowSdsm">Kaskády stínů podle scény (SDSM)</String>
|
|
||||||
<String key="CabProbe">Sonda kabiny</String>
|
|
||||||
<String key="CabProbeInterval">Obnovení sondy každých N snímků</String>
|
|
||||||
<String key="CabProbeReflections">Kabina odráží sebe</String>
|
|
||||||
<String key="CabProbeBounce">Odražené světlo lampy v kabině</String>
|
|
||||||
<String key="FogQuality">Kvalita mlhy</String>
|
|
||||||
<String key="Clouds">Objemová oblaka</String>
|
|
||||||
<String key="CloudShadows">Stíny oblaků na zemi</String>
|
|
||||||
<String key="Grass">Tráva</String>
|
|
||||||
<String key="GrassDistance">Dosah trávy</String>
|
|
||||||
<String key="GrassDensity">Hustota trávy</String>
|
|
||||||
<String key="Precipitation">Srážky (částice)</String>
|
|
||||||
<String key="Bloom">Záře světlých míst (bloom)</String>
|
|
||||||
<String key="AutoExposure">Automatická expozice</String>
|
|
||||||
<String key="LevelOff">Vypnuto</String>
|
|
||||||
<String key="LevelLow">Nízká</String>
|
|
||||||
<String key="LevelMedium">Střední</String>
|
|
||||||
<String key="LevelHigh">Vysoká</String>
|
|
||||||
<String key="LevelUltra">Ultra</String>
|
|
||||||
<String key="ReflexOn">Zapnuto</String>
|
|
||||||
<String key="ReflexBoost">Zapnuto + boost</String>
|
|
||||||
<String key="AaTaa">TAA</String>
|
|
||||||
<String key="AaDlss">DLSS (škálování)</String>
|
|
||||||
<String key="AaDlaa">DLAA (nativní rozlišení)</String>
|
|
||||||
<String key="DlssPresetDefault">Automaticky</String>
|
|
||||||
<String key="DlssPresetK">K: nejlepší kvalita</String>
|
|
||||||
<String key="DlssPresetJ">J: méně rozmazání</String>
|
|
||||||
<String key="DlssPresetM">M: pro režim Výkon</String>
|
|
||||||
<String key="DlssPresetL">L: pro Ultra výkon</String>
|
|
||||||
<String key="Effects">Efekty</String>
|
<String key="Effects">Efekty</String>
|
||||||
<String key="GfxColImage">Rozlišení a vyhlazování</String>
|
<String key="GfxColImage">Rozlišení a vyhlazování</String>
|
||||||
<String key="GfxColLights">Osvětlení</String>
|
<String key="GfxColLights">Osvětlení</String>
|
||||||
<String key="GfxColPostFx">Postprocessing</String>
|
<String key="GfxColPostFx">Postprocessing</String>
|
||||||
<String key="GfxColNature">Kouř</String>
|
<String key="GfxColNature">Kouř</String>
|
||||||
<String key="AntiAliasing">Vyhlazování hran</String>
|
<String key="AntiAliasing">Vyhlazování hran</String>
|
||||||
<String key="VolumetricFog">Objemová mlha</String>
|
|
||||||
<String key="REOpenGLNote">DLSS, generování snímků, Reflex a ray tracing jen s Vulkanem.</String>
|
|
||||||
<String key="REVulkanNote">Vyžaduje exe s Vulkanem a kartu, která ho podporuje. Jinak simulátor spustí Plný nebo Starý.</String>
|
|
||||||
<String key="VulkanDeviceAuto">automaticky</String>
|
|
||||||
<String key="DlssPresetInfoDefault">K pro DLAA, Kvalitu a Vyvážený, M pro Výkon, L pro Ultra výkon. Ovladač to může při aktualizaci změnit.</String>
|
|
||||||
<String key="DlssPresetInfoK">Model transformer s nejlepší kvalitou obrazu, ale nejnáročnější. Výchozí pro DLAA, Kvalitu a Vyvážený.</String>
|
|
||||||
<String key="DlssPresetInfoJ">Podobný K: o něco méně šmouh za pohyblivými objekty za cenu většího blikání. NVIDIA doporučuje spíše K.</String>
|
|
||||||
<String key="DlssPresetInfoM">Model pro režim Výkon (měřítko asi 50 %), tam výchozí. Expozici obrazu počítá sám.</String>
|
|
||||||
<String key="DlssPresetInfoL">Model pro režim Ultra výkon (měřítko asi 33 %), tam výchozí. Expozici obrazu počítá sám.</String>
|
|
||||||
<String key="DlssMissingLibraryNote">Vedle simulátoru chybí {0}: bez této knihovny simulátor tuto funkci DLSS nepoužije.</String>
|
|
||||||
<String key="DlssNoPlatformNote">Na macOS není DLSS k dispozici.</String>
|
|
||||||
<String key="FrameGenerationNeedsDlssNote">Generování snímků funguje jen s DLSS nebo DLAA.</String>
|
|
||||||
<String key="ReflexForcedNote">Generování snímků zapíná Reflex samo, ať je zde vybráno cokoli.</String>
|
|
||||||
<String key="AoLightingPrepassNote">Potřebuje hloubku celé scény před barvou; bez SSR a kontaktních stínů je to průchod navíc (zátěž CPU v OpenGL).</String>
|
|
||||||
<String key="AoNeedsPipelineNote">Při přeskočeném postprocessingu AO nefunguje.</String>
|
|
||||||
<String key="CabProbeReflectionsOnlyNote">Bez klastrového osvětlení a lampy kabiny jako světla (gfx.lights.cab) dává sonda jen odrazy.</String>
|
|
||||||
<String key="TemporalNeedsPipelineNote">TAA a DLSS běží v postprocessingu: při jeho přeskočení se hrany nevyhladí.</String>
|
|
||||||
<String key="SettingsFile">Soubor eu07.ini</String>
|
<String key="SettingsFile">Soubor eu07.ini</String>
|
||||||
<String key="ImportIni">Importovat…</String>
|
<String key="ImportIni">Importovat…</String>
|
||||||
<String key="ImportIniTitle">Importovat nastavení z eu07.ini</String>
|
<String key="ImportIniTitle">Importovat nastavení z eu07.ini</String>
|
||||||
@@ -1007,9 +936,8 @@
|
|||||||
{0}</String>
|
{0}</String>
|
||||||
<String key="ExportIniDone">Exportováno do {0}</String>
|
<String key="ExportIniDone">Exportováno do {0}</String>
|
||||||
<String key="REFull">Plný</String>
|
<String key="REFull">Plný</String>
|
||||||
<String key="REOld">Starý</String>
|
<String key="REOld">Starý (nedoporučeno, pokud Plný funguje)</String>
|
||||||
<String key="RESimp">Zjednodušený</String>
|
<String key="RESimp">Zjednodušený (nedoporučeno, pokud Plný funguje)</String>
|
||||||
<String key="REExperimental">Experimentální</String>
|
|
||||||
<String key="RenderAngleVulkan">Použít renderer ANGLE Vulkan</String>
|
<String key="RenderAngleVulkan">Použít renderer ANGLE Vulkan</String>
|
||||||
<String key="RenderVBO">Vykreslování VBO</String>
|
<String key="RenderVBO">Vykreslování VBO</String>
|
||||||
<String key="CabShadowsRange">Dosah zdrojů stínů v kabině</String>
|
<String key="CabShadowsRange">Dosah zdrojů stínů v kabině</String>
|
||||||
@@ -1017,6 +945,4 @@
|
|||||||
<String key="UseGLESDesc">OpenGL ES místo OpenGL. Nefunguje s rendererem legacy.</String>
|
<String key="UseGLESDesc">OpenGL ES místo OpenGL. Nefunguje s rendererem legacy.</String>
|
||||||
<String key="GpuCard">{0}, {1} GB</String>
|
<String key="GpuCard">{0}, {1} GB</String>
|
||||||
<String key="GpuCardShared">{0}, sdílená paměť</String>
|
<String key="GpuCardShared">{0}, sdílená paměť</String>
|
||||||
<String key="GfxColNewRenderer">Novinky OpenGL 4.6 / Vulkan</String>
|
|
||||||
<String key="GfxNewRendererNote">Funguje jen s novým exe. Starší exe tato nastavení přeskočí.</String>
|
|
||||||
</Language>
|
</Language>
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
<String key="StartNoScenery">Select a scenery</String>
|
<String key="StartNoScenery">Select a scenery</String>
|
||||||
<String key="StartNoTrain">Select a consist</String>
|
<String key="StartNoTrain">Select a consist</String>
|
||||||
<String key="StartNoStaff">No crew / passenger</String>
|
<String key="StartNoStaff">No crew / passenger</String>
|
||||||
|
<String key="StartDecor">Decoration consist</String>
|
||||||
|
<String key="StartAi">AI consist</String>
|
||||||
<String key="StartNoStaffTitle">Consist without crew</String>
|
<String key="StartNoStaffTitle">Consist without crew</String>
|
||||||
<String key="StartNoStaffConfirm">This consist has no crew and no passenger — there will be nothing to drive. Start anyway?</String>
|
<String key="StartNoStaffConfirm">This consist has no crew and no passenger — there will be nothing to drive. Start anyway?</String>
|
||||||
<String key="RestoreWeather">Restore weather</String>
|
<String key="RestoreWeather">Restore weather</String>
|
||||||
@@ -260,8 +262,8 @@
|
|||||||
<String key="ConsistLoadTools">Whole-consist load</String>
|
<String key="ConsistLoadTools">Whole-consist load</String>
|
||||||
<String key="ConsistReady">Consist ready to go</String>
|
<String key="ConsistReady">Consist ready to go</String>
|
||||||
<String key="ConsistReadyDesc">The consist starts prepared: brake pipe charged, driver’s brake valve set, batteries closed. Unchecked it starts cold and braked.</String>
|
<String key="ConsistReadyDesc">The consist starts prepared: brake pipe charged, driver’s brake valve set, batteries closed. Unchecked it starts cold and braked.</String>
|
||||||
<String key="ReadyOverride">Force the consist state on launch</String>
|
<String key="ReadyOverride">Consist state at start</String>
|
||||||
<String key="ReadyOverrideDesc">Overrides the depot’s "consist ready to go" box for every scenario you start.</String>
|
<String key="ReadyOverrideDesc">Every consist you start will be cold or ready to go, whatever the scenario says.</String>
|
||||||
<String key="ReadyOverrideScenery">As authored</String>
|
<String key="ReadyOverrideScenery">As authored</String>
|
||||||
<String key="ReadyOverrideCold">Always cold</String>
|
<String key="ReadyOverrideCold">Always cold</String>
|
||||||
<String key="ReadyOverrideReady">Always ready</String>
|
<String key="ReadyOverrideReady">Always ready</String>
|
||||||
@@ -355,22 +357,23 @@
|
|||||||
<String key="General">General</String>
|
<String key="General">General</String>
|
||||||
|
|
||||||
<String key="Language">Language</String>
|
<String key="Language">Language</String>
|
||||||
<String key="LanguageDesc">Also the simulator's language. Saved as soon as it is picked.</String>
|
<String key="LanguageDesc">Language of the starter and the simulator. Saved as soon as you pick it.</String>
|
||||||
|
<String key="UnknownIniValue">Unknown value in eu07.ini: “{0}”. It stays in the file until you change this.</String>
|
||||||
<String key="LanguageSimMissing">The simulator has no translation for this language and will run in English.</String>
|
<String key="LanguageSimMissing">The simulator has no translation for this language and will run in English.</String>
|
||||||
<String key="Fullscreen">Fullscreen</String>
|
<String key="PauseSimInactive">Pause when window inactive</String>
|
||||||
<String key="PauseSimInactive">Pause simulation when window is inactive</String>
|
|
||||||
<String key="PauseSimStart">Pause on start</String>
|
<String key="PauseSimStart">Pause on start</String>
|
||||||
<String key="CursorSensitivity">Camera rotation sensitivity (horizontal)</String>
|
<String key="CursorSensitivity">Mouse sensitivity</String>
|
||||||
<String key="MouseHorInvert">Invert mouse horizontally</String>
|
<String key="MouseHorInvert">Invert mouse horizontally</String>
|
||||||
<String key="MouseVertInvert">Invert mouse vertically</String>
|
<String key="MouseVertInvert">Invert mouse vertically</String>
|
||||||
|
|
||||||
<String key="Communication">External devices</String>
|
<String key="Communication">External devices</String>
|
||||||
|
|
||||||
<String key="GamepadSignalIgnore">Ignore gamepad control</String>
|
<String key="GamepadSignalIgnore">Ignore gamepad</String>
|
||||||
<String key="GamepadSignalIgnoreDesc">Disables gamepad input even when one is connected.</String>
|
<String key="ConfirmGamepadUse">Ignoring the gamepad is the recommended default. Turning gamepad support on is known to cause control trouble. Change it only if you really drive with a gamepad. Change it?</String>
|
||||||
|
<String key="GamepadSignalIgnoreDesc">Recommended. The simulator ignores a gamepad, even a connected one.</String>
|
||||||
|
|
||||||
<String key="Feedback">Feedback</String>
|
<String key="Feedback">Feedback</String>
|
||||||
<String key="FeedbackDesc">How cab feedback signals are delivered to an external panel. Keyboard modes flash LEDs: (1) Caps Lock = CA or SHP, Scroll Lock = starting resistances; (2) Caps Lock = CA, Scroll Lock = SHP. Other modes require an LPT, PoKeys55 or serial interface.</String>
|
<String key="FeedbackDesc">Cab signals on an external desk or on keyboard lights (Caps Lock, Scroll Lock).</String>
|
||||||
<String key="FeedbackOff">Off</String>
|
<String key="FeedbackOff">Off</String>
|
||||||
<String key="FeedbackCASHP">Keyboard: Caps = CA+SHP, Scroll = starting resistances</String>
|
<String key="FeedbackCASHP">Keyboard: Caps = CA+SHP, Scroll = starting resistances</String>
|
||||||
<String key="FeedbackCA">Keyboard: Caps = CA, Scroll = SHP</String>
|
<String key="FeedbackCA">Keyboard: Caps = CA, Scroll = SHP</String>
|
||||||
@@ -378,11 +381,11 @@
|
|||||||
<String key="FeedbackPoKeys">PoKeys55 (USB)</String>
|
<String key="FeedbackPoKeys">PoKeys55 (USB)</String>
|
||||||
<String key="FeedbackSP">COM / serial port</String>
|
<String key="FeedbackSP">COM / serial port</String>
|
||||||
|
|
||||||
<String key="FeedbackPort">LPT port address</String>
|
<String key="FeedbackPort">LPT address</String>
|
||||||
<String key="FeedbackPortDesc">LPT port address used by the selected feedback mode.</String>
|
<String key="FeedbackPortDesc">Address of the desk's LPT port.</String>
|
||||||
|
|
||||||
<String key="UartSection">UART configuration</String>
|
<String key="UartSection">UART</String>
|
||||||
<String key="UartEnable">Enable UART communication</String>
|
<String key="UartEnable">Enable UART</String>
|
||||||
<String key="UartPort">Serial port</String>
|
<String key="UartPort">Serial port</String>
|
||||||
<String key="UartTune">Calibration</String>
|
<String key="UartTune">Calibration</String>
|
||||||
<String key="UartBaud">Speed (baud)</String>
|
<String key="UartBaud">Speed (baud)</String>
|
||||||
@@ -391,7 +394,7 @@
|
|||||||
<String key="UartPortMissing">Without a port UART stays off.</String>
|
<String key="UartPortMissing">Without a port UART stays off.</String>
|
||||||
<String key="UartTunePlaceholder">empty = simulator defaults</String>
|
<String key="UartTunePlaceholder">empty = simulator defaults</String>
|
||||||
<String key="UartTuneInvalid">Not {0} numbers: the calibration is not saved.</String>
|
<String key="UartTuneInvalid">Not {0} numbers: the calibration is not saved.</String>
|
||||||
<String key="UartDebug">Print debug data to the console</String>
|
<String key="UartDebug">Debug in console</String>
|
||||||
<String key="UartMain">Master controller</String>
|
<String key="UartMain">Master controller</String>
|
||||||
<String key="UartScnd">Secondary/shunting controller</String>
|
<String key="UartScnd">Secondary/shunting controller</String>
|
||||||
<String key="UartTrain">Train brake</String>
|
<String key="UartTrain">Train brake</String>
|
||||||
@@ -400,47 +403,40 @@
|
|||||||
<String key="UartRadioChannel">Radio channel</String>
|
<String key="UartRadioChannel">Radio channel</String>
|
||||||
|
|
||||||
<String key="Others">Other</String>
|
<String key="Others">Other</String>
|
||||||
<String key="SelectEXE">Select exe</String>
|
<String key="SelectEXE">Exe file</String>
|
||||||
<String key="SelectEXEAuto">Select automatically</String>
|
<String key="SelectEXEAuto">Select automatically</String>
|
||||||
<String key="SelectEXEBrowse">Choose file…</String>
|
<String key="SelectEXEBrowse">Choose file…</String>
|
||||||
<String key="SelectEXEBrowseTitle">Pick the simulator executable</String>
|
<String key="SelectEXEBrowseTitle">Pick the simulator executable</String>
|
||||||
<String key="SelectEXEUseAnyway">Use it anyway?</String>
|
<String key="SelectEXEUseAnyway">Use it anyway?</String>
|
||||||
<String key="DebugMode">Debug mode</String>
|
<String key="DebugMode">Debug mode</String>
|
||||||
<String key="DebugModeDesc">Unlocks debug menus, extra panels and test shortcuts.</String>
|
<String key="DebugModeDesc">Debug menu and test shortcuts in the simulator.</String>
|
||||||
<String key="VirtualShunting">Virtual shunting</String>
|
<String key="VirtualShunting">Virtual shunting</String>
|
||||||
<String key="VirtualShuntingDesc">Enables an AI assistant for coupling, uncoupling and simple shunting moves while the vehicle is stopped.</String>
|
<String key="VirtualShuntingDesc">An AI helper couples, uncouples and does simple shunting while the vehicle stands.</String>
|
||||||
<String key="LogMissingVehicleFiles">Log missing vehicle files during export</String>
|
<String key="LogMissingVehicleFiles">Log missing vehicles</String>
|
||||||
<String key="LogMissingVehicleFilesDesc">Writes vehicles the starter could not find into the log.</String>
|
<String key="LogMissingVehicleFilesDesc">When exporting, writes the missing vehicles to the log.</String>
|
||||||
|
|
||||||
<String key="Graphic">Graphics</String>
|
<String key="Graphic">Graphics</String>
|
||||||
<String key="RenderEngine">Render engine</String>
|
<String key="RenderEngine">Renderer</String>
|
||||||
<String key="RenderEngineDesc">Full works with every exe. Old, Simplified and Experimental only with older ones; a new exe starts Full instead.</String>
|
<String key="ConfirmRenderingChange">Changing “{0}” can stop the simulator from starting or spoil the picture. Change it?</String>
|
||||||
<String key="REExperimentalWarning">Note: the experimental renderer may be unstable, miss parts of the scene or not start on some graphics cards. If the simulator does not start or looks wrong, go back to the “Full” renderer.</String>
|
<String key="RenderEngineDesc">Use Full. Old and Simplified are only for cards Full does not work on.</String>
|
||||||
<String key="GpuChoice">Graphics card (Linux)</String>
|
<String key="GpuChoice">Graphics card</String>
|
||||||
<String key="GpuDiscrete">Faster (discrete)</String>
|
<String key="GpuDiscrete">Dedicated</String>
|
||||||
<String key="GpuSystem">As the system decides</String>
|
<String key="GpuSystem">System</String>
|
||||||
<String key="GpuNoteTarget">Found: {0}. The simulator will run on: {1}.</String>
|
<String key="GpuNoteTarget">Found: {0}. The simulator will run on: {1}.</String>
|
||||||
<String key="GpuNoteNone">Found: {0}. The screen is already driven by the right card – the starter changes nothing.</String>
|
<String key="GpuNoteNone">Found: {0}. The screen is already driven by the right card – the starter changes nothing.</String>
|
||||||
<String key="GpuNoteSystem">Found: {0}. The system picks the card, usually the integrated one.</String>
|
<String key="GpuNoteSystem">Found: {0}. The system picks the card, usually the integrated one.</String>
|
||||||
<String key="GpuNotePlayer">Found: {0}. Environment variables ({1}) choose the card; the starter leaves them alone.</String>
|
<String key="GpuNotePlayer">Found: {0}. Environment variables ({1}) choose the card; the starter leaves them alone.</String>
|
||||||
<String key="GpuNoteOne">One card: {0} – nothing to choose between.</String>
|
<String key="GpuNoteOne">One card: {0} – nothing to choose between.</String>
|
||||||
<String key="GpuNoteUnread">Could not read the graphics cards from /sys/class/drm.</String>
|
<String key="GpuNoteUnread">Could not read the graphics cards from /sys/class/drm.</String>
|
||||||
<String key="IdleWindowsBuildOnly">Only the Windows build of the simulator uses this.</String>
|
|
||||||
<String key="IdleLegacyRendererOnly">Only the legacy renderer reads this, and another one is chosen.</String>
|
|
||||||
<String key="IdleNeedsFrameRateTarget">Only works with a target frame rate (targetfps).</String>
|
|
||||||
<String key="IdleOpenGlRenderersOnly">The experimental renderer does not read this.</String>
|
|
||||||
<String key="IdleModernRendererOnly">Only the full renderer reads this, and another one is chosen.</String>
|
|
||||||
<String key="IdleNeedsNetworkServer">The pause in the background needs a network server (network.server).</String>
|
|
||||||
|
|
||||||
<String key="Resolution">Resolution</String>
|
<String key="Resolution">Resolution</String>
|
||||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||||
<String key="IdleMonitorMode">Has no effect with automatic resolution.</String>
|
|
||||||
<String key="BufforResolution">Buffer resolution</String>
|
<String key="BufforResolution">Buffer resolution</String>
|
||||||
<String key="BufforResolutionDesc">Scales the internal render buffer relative to the window resolution.</String>
|
<String key="BufforResolutionDesc">The resolution the picture is drawn at. Below 100% is faster but less sharp.</String>
|
||||||
<String key="MaxTexResolution">Maximum texture resolution</String>
|
<String key="MaxTexResolution">Textures</String>
|
||||||
<String key="MaxTexCabResolution">Maximum cabin texture resolution</String>
|
<String key="MaxTexCabResolution">Cab textures</String>
|
||||||
<String key="TexFilteringQuality">Texture filtering quality</String>
|
<String key="TexFilteringQuality">Texture filtering</String>
|
||||||
<String key="TexFilteringQualityDesc">Sharpness of textures seen at an angle, such as tracks. Even x16 costs little.</String>
|
<String key="TexFilteringQualityDesc">Sharpness of textures seen at an angle, like the track. Costs little.</String>
|
||||||
<String key="QualityVeryLow">Very low</String>
|
<String key="QualityVeryLow">Very low</String>
|
||||||
<String key="QualityLow">Low</String>
|
<String key="QualityLow">Low</String>
|
||||||
<String key="QualityNormal">Normal</String>
|
<String key="QualityNormal">Normal</String>
|
||||||
@@ -456,149 +452,132 @@
|
|||||||
<String key="RangeHigh">High</String>
|
<String key="RangeHigh">High</String>
|
||||||
<String key="RangeVeryHigh">Very high</String>
|
<String key="RangeVeryHigh">Very high</String>
|
||||||
<String key="RangeDisabled">Disabled</String>
|
<String key="RangeDisabled">Disabled</String>
|
||||||
<String key="DynamicLights">Dynamic light sources</String>
|
<String key="DynamicLights">Light sources</String>
|
||||||
<String key="DynamicLightsDesc">Maximum number of simultaneous dynamic light sources.</String>
|
<String key="DynamicLightsDesc">How many lights, like headlights, can light the surroundings at once.</String>
|
||||||
<String key="RenderRange">Draw distance stretch (max)</String>
|
<String key="RenderRange">Max. range stretch</String>
|
||||||
<String key="RenderRangeDesc">How many times the simulator may stretch the range when frames are to spare. Squared in the full renderer: ×3 means up to ×9.</String>
|
<String key="RenderRangeDesc">How far the simulator may stretch the draw range when frames are to spare. Works with target FPS.</String>
|
||||||
<String key="FpsLimitOff">No limit</String>
|
<String key="FpsLimitOff">No limit</String>
|
||||||
<String key="FpsLimit">Frame rate limit</String>
|
<String key="FpsLimit">FPS limit</String>
|
||||||
<String key="FpsLimitDesc">Fewer frames: a cooler, quieter computer. With V-Sync a limit above the refresh rate does nothing.</String>
|
<String key="FpsLimitDesc">Fewer frames make a cooler and quieter computer.</String>
|
||||||
<String key="ShadowAngleLimit">Shadow length limit</String>
|
<String key="ShadowAngleLimit">Shadow length</String>
|
||||||
<String key="ShadowAngleLimitDesc">Shortens the long shadows cast by a low sun. Higher values cut them sooner.</String>
|
<String key="ShadowAngleLimitDesc">Shortens long shadows when the sun is low.</String>
|
||||||
<String key="ShadowLimitShort">Shortened</String>
|
<String key="ShadowLimitShort">Shortened</String>
|
||||||
<String key="FullscreenWindowed">Automatic resolution (borderless fullscreen)</String>
|
<String key="DisplayMode">Display mode</String>
|
||||||
|
<String key="DisplayModeFullscreen">Full screen</String>
|
||||||
|
<String key="DisplayModeBorderless">Borderless full screen</String>
|
||||||
|
<String key="DisplayModeWindow">Window</String>
|
||||||
|
<String key="DisplayModeDesc">Borderless full screen takes the monitor's resolution and switches to other programs faster.</String>
|
||||||
|
<String key="FullscreenMonitor">Monitor</String>
|
||||||
|
<String key="FullscreenMonitorDesc">Which monitor the simulator opens on in full screen.</String>
|
||||||
|
<String key="MonitorPrimary">Primary</String>
|
||||||
<String key="VSync">VSync</String>
|
<String key="VSync">VSync</String>
|
||||||
<String key="VSyncDesc">Synchronizes frame rate with the monitor refresh rate.</String>
|
<String key="VSyncDesc">Matches frames to the monitor refresh and removes tearing.</String>
|
||||||
<String key="SmokeDisplay">Smoke display</String>
|
<String key="SmokeDisplay">Smoke</String>
|
||||||
<String key="SmokeParticlesMultiplier">Smoke particles multiplier</String>
|
<String key="SmokeParticlesMultiplier">Smoke amount</String>
|
||||||
|
|
||||||
<String key="ChromaticAberration">Chromatic aberration</String>
|
<String key="ChromaticAberration">Chromatic aberration</String>
|
||||||
<String key="MotionBlur">Motion blur</String>
|
<String key="MotionBlur">Motion blur</String>
|
||||||
<String key="AdditionalShadersEffects">Additional shader effects</String>
|
<String key="AdditionalShadersEffects">Additional shader effects</String>
|
||||||
<String key="ReflectionsCubeMap">Reflections as cubemap</String>
|
<String key="ReflectionsCubeMap">Reflections</String>
|
||||||
<String key="ReflectionsCubeMapDesc">Renders reflections into a cube map, so surfaces mirror the surroundings from every direction.</String>
|
<String key="ReflectionsCubeMapDesc">Surfaces reflect their surroundings.</String>
|
||||||
<String key="SkipPipeline">Simplified depth read (compatibility)</String>
|
<String key="SkipPipeline">SkipPipeline</String>
|
||||||
<String key="SkipPipelineDesc">Alternative depth-buffer read path with MSAA; enable it if your GPU has compatibility issues.</String>
|
<String key="SkipPipelineDesc">Draws straight to the window, with no post-processing: motion blur and the other final effects are gone. Turn on only if the picture has errors.</String>
|
||||||
<String key="RenderShadows">Render shadows</String>
|
<String key="RenderShadows">Draw shadows</String>
|
||||||
<String key="ReflectionsFramerate">Reflections refresh rate</String>
|
<String key="ReflectionsFramerate">Reflection refresh</String>
|
||||||
<String key="ReflectionsFramerateDesc">How often reflections refresh. Less often means more frames.</String>
|
<String key="ReflectionsFramerateDesc">Refreshing reflections less often means more FPS.</String>
|
||||||
<String key="EveryMinutes">every {0} min</String>
|
<String key="EveryMinutes">every {0} min</String>
|
||||||
<String key="EverySeconds">every {0} s</String>
|
<String key="EverySeconds">every {0} s</String>
|
||||||
<String key="TimesPerSecond">{0}× a second</String>
|
<String key="TimesPerSecond">{0}× a second</String>
|
||||||
<String key="ShadowsResolution">Shadows resolution</String>
|
<String key="ShadowsResolution">Shadow resolution</String>
|
||||||
<String key="ShaderRange">Shadow range</String>
|
<String key="ShaderRange">Shadow range</String>
|
||||||
<String key="ShaderRangeDesc">How far shadows reach; the further, the softer. After the arrow: the real reach.</String>
|
<String key="ShaderRangeDesc">How far shadows reach. Further means softer shadows.</String>
|
||||||
|
|
||||||
<String key="ShadowDisplay">Display shadows</String>
|
<String key="ShadowDisplay">Objects with shadows</String>
|
||||||
<String key="ShadowDisplayDesc">Sets which objects cast shadows based on material priority. Lower value = fewer shadows, higher performance.</String>
|
<String key="ShadowDisplayDesc">Fewer objects with shadows means more FPS.</String>
|
||||||
<String key="CSROnlyImportant">Only important</String>
|
<String key="CSROnlyImportant">Only important</String>
|
||||||
<String key="CSRLimited">Limited</String>
|
<String key="CSRLimited">Limited</String>
|
||||||
<String key="CSRAll">All</String>
|
<String key="CSRAll">All</String>
|
||||||
|
|
||||||
<String key="ReflectionsDetails">Reflections detail level</String>
|
<String key="ReflectionsDetails">Reflection detail</String>
|
||||||
<String key="ReflectionsDetailsDesc">Which objects are rendered into the reflection cubemap.</String>
|
<String key="ReflectionsDetailsDesc">What shows in reflections.</String>
|
||||||
<String key="RDTerrain">Terrain geometry only</String>
|
<String key="RDTerrain">Terrain</String>
|
||||||
<String key="RDTerrainModels">Terrain geometry and static models</String>
|
<String key="RDTerrainModels">Terrain and models</String>
|
||||||
<String key="RDTerrainModelsVehicles">Terrain geometry, static models and vehicles</String>
|
<String key="RDTerrainModelsVehicles">Terrain, models and vehicles</String>
|
||||||
|
|
||||||
<String key="FieldOfView">View angle</String>
|
<String key="FieldOfView">View angle</String>
|
||||||
<String key="FieldOfViewDesc">Vertical camera field of view in degrees (10–75).</String>
|
<String key="FieldOfViewDesc">Vertical field of view of the camera.</String>
|
||||||
<String key="RenderScreens">Render onboard computer screens</String>
|
<String key="RenderScreens">Screens on</String>
|
||||||
<String key="RenderScreensDesc">Enables cab screens driven by Python scripts.</String>
|
<String key="RenderScreensDesc">Screens and displays in cabs.</String>
|
||||||
<String key="RenderScreensThread">Render screens in a separate thread</String>
|
<String key="RenderScreensThread">Screens in own thread</String>
|
||||||
|
|
||||||
<String key="Physics">Physics</String>
|
<String key="Physics">Physics</String>
|
||||||
|
|
||||||
<String key="TrackCurvesQuality">Track curves quality</String>
|
<String key="TrackCurvesQuality">Track curves quality</String>
|
||||||
<String key="TrackCurvesQualityDesc">How finely curved track is subdivided. Higher values are smoother but cost more CPU/GPU when loading.</String>
|
<String key="TrackCurvesQualityDesc">Higher – smoother track curves.</String>
|
||||||
<String key="PhysicsAccuracyIncreased">Increased physics accuracy</String>
|
<String key="PhysicsAccuracyIncreased">More accurate physics</String>
|
||||||
<String key="PhysicsAccuracyIncreasedDesc">Runs the full physics model with smaller time steps. More faithful, but heavier CPU load on large consists.</String>
|
<String key="PhysicsAccuracyIncreasedDesc">The full physics model with a smaller time step.</String>
|
||||||
<String key="BreakingPantographPossibility">Possibility of pantograph breaking</String>
|
<String key="BreakingPantographPossibility">Pantograph breaking</String>
|
||||||
<String key="BreakingPantographPossibilityDesc">Disabling protects the pantograph from breaking on faulty overhead line geometry.</String>
|
<String key="BreakingPantographPossibilityDesc">A pantograph can break on badly laid wire.</String>
|
||||||
<String key="PowerOverheadLineOnly">Powered only under overhead line</String>
|
<String key="PowerOverheadLineOnly">Power only from the wire</String>
|
||||||
<String key="PowerOverheadLineOnlyDesc">When disabled, a raised pantograph can power the vehicle even without touching the wire.</String>
|
<String key="PowerOverheadLineOnlyDesc">The vehicle has power only while the pantograph touches the wire.</String>
|
||||||
<String key="SaveBlackBox">Record the black box and the speedometer tapes</String>
|
<String key="SaveBlackBox">Black box and tapes</String>
|
||||||
<String key="SaveBlackBoxDesc">Records the session to one file in the physicslog/ folder and writes the tapes (.dat) of the vehicles you are in as it goes, every 2 s.</String>
|
<String key="SaveBlackBoxDesc">Records the run and the speedometer tapes of the vehicles you drive (physicslog folder).</String>
|
||||||
<String key="SaveTrainTapes">Record the speedometer tapes of every train</String>
|
<String key="SaveTrainTapes">Tapes of all trains</String>
|
||||||
<String key="SaveTrainTapesDesc">Writes the tapes (.dat) of every train of the scenery to the physicslog/ folder as it goes, every 2 s: one per driver of rail vehicles, not of road vehicles nor passengers. Far fewer files than the physics log of every vehicle.</String>
|
<String key="SaveTrainTapesDesc">Records the speedometer tapes of every train on the scenery (physicslog folder).</String>
|
||||||
<String key="SaveSpeedometerTapes">Save the physics log of every vehicle</String>
|
<String key="SaveSpeedometerTapes">Physics log of all vehicles</String>
|
||||||
<String key="SaveSpeedometerTapesDesc">Writes the log of every vehicle of the scenery to the physicslog/ folder: a line every 0.05 s, added every 2 s. For diagnostics: on a large scenery that is hundreds of files.</String>
|
<String key="SaveSpeedometerTapesDesc">A detailed log of every vehicle, for diagnostics. A big scenery makes hundreds of files.</String>
|
||||||
<String key="SaveSimLogs">Save simulation log</String>
|
<String key="SaveSimLogs">Write log</String>
|
||||||
<String key="KeepPrevLogs">Keep previous logs</String>
|
<String key="KeepPrevLogs">Keep old logs</String>
|
||||||
<String key="KeepPrevLogsDesc">Creates a separate log file for each scenery instead of overwriting errors.txt.</String>
|
<String key="KeepPrevLogsDesc">A log per scenery instead of overwriting errors.txt.</String>
|
||||||
<String key="DisplaySimulation">Render 3D image</String>
|
<String key="DisplaySimulation">Render 3D picture</String>
|
||||||
<String key="DisplaySimulationDesc">When disabled, the scenery is not drawn (black screen), but the simulation keeps running.</String>
|
<String key="DisplaySimulationDesc">Off: black screen, the simulation keeps running.</String>
|
||||||
<String key="CrashDamage">Collision damage</String>
|
<String key="CrashDamage">Collision damage</String>
|
||||||
<String key="CrashDamageDesc">Damages couplers and consists during collisions and sharp jerks.</String>
|
<String key="CrashDamageDesc">Collisions and jerks can damage couplers and vehicles.</String>
|
||||||
<String key="Friction">Friction multiplier</String>
|
<String key="Friction">Friction</String>
|
||||||
<String key="FrictionDesc">Multiplies wheel-to-rail friction. 1.00 leaves it unchanged.</String>
|
<String key="FrictionDesc">Wheel to rail grip. 1.00 – unchanged.</String>
|
||||||
<String key="BrakeStep">Train brake step size (Num3/Num9)</String>
|
<String key="BrakeStep">Brake valve step</String>
|
||||||
<String key="BrakeStepDesc">Multiplies the size of a single step of the train brake handle controlled with Num3 and Num9. 1.00 leaves it unchanged.</String>
|
<String key="BrakeStepDesc">How far one key press moves the train brake valve (other than FV4a). 1.00 – one position.</String>
|
||||||
<String key="BrakeSpeed">FV4a valve speed</String>
|
<String key="BrakeSpeed">FV4a valve speed</String>
|
||||||
<String key="BrakeSpeedDesc">Multiplies how fast the locomotive brake handle (FV4a) and the local brake move. 1.00 leaves it unchanged.</String>
|
<String key="BrakeSpeedDesc">How fast the FV4a valve moves while you hold the brake key. 3.00 – the simulator default.</String>
|
||||||
|
|
||||||
<String key="Sounds">Sound</String>
|
<String key="Sounds">Sound</String>
|
||||||
<String key="EnableSounds">Enable sound</String>
|
<String key="EnableSounds">Enable sound</String>
|
||||||
<String key="Volume">Volume</String>
|
<String key="Volume">Volume</String>
|
||||||
<String key="RadiophoneVolume">Radio volume</String>
|
<String key="RadiophoneVolume">Radio</String>
|
||||||
<String key="VehiclesVolume">Vehicles volume</String>
|
<String key="VehiclesVolume">Vehicles</String>
|
||||||
<String key="PositionedSoundsVolume">Positional sounds volume</String>
|
<String key="PositionedSoundsVolume">Positional sounds</String>
|
||||||
<String key="AmbientVolume">Ambient volume</String>
|
<String key="AmbientVolume">Ambient</String>
|
||||||
<String key="SoundDevice">Sound device and effects</String>
|
|
||||||
<String key="SoundOutputDevice">Output device</String>
|
|
||||||
<String key="SoundOutputDeviceDesc">The device the simulator plays through. The system default follows the device chosen in the system, also when it changes during the game.</String>
|
|
||||||
<String key="SoundSystemDefault">System default</String>
|
|
||||||
<String key="SoundOutputMode">Speaker layout</String>
|
|
||||||
<String key="SoundOutputModeDesc">How the sound is mixed: for headphones, stereo speakers or a surround set. Automatic takes what the device reports.</String>
|
|
||||||
<String key="SoundAutomatic">Automatic</String>
|
|
||||||
<String key="SoundStereoBasic">Stereo (simple panning)</String>
|
|
||||||
<String key="SoundStereoUhj">Stereo (UHJ, wider)</String>
|
|
||||||
<String key="SoundHeadphones">Headphones (HRTF)</String>
|
|
||||||
<String key="SoundHrtfDesc">Head-related sound for headphones: sources behind, above and below can be told apart. Automatic turns it on where the device is headphones.</String>
|
|
||||||
<String key="SoundOn">On</String>
|
|
||||||
<String key="SoundOff">Off</String>
|
|
||||||
<String key="SoundHrtfProfile">HRTF data set</String>
|
|
||||||
<String key="SoundHrtfProfileDesc">Which head model HRTF uses, of those the library has. A different one may suit your ears better.</String>
|
|
||||||
<String key="SoundLibraryChoice">Library's choice</String>
|
|
||||||
<String key="SoundResampler">Resampler</String>
|
|
||||||
<String key="SoundResamplerDesc">How sounds are converted to the device's rate and pitched. The better ones sound cleaner and cost a little more processor time.</String>
|
|
||||||
<String key="SoundLibraryDefault">Library default</String>
|
|
||||||
<String key="SoundLimiter">Output limiter</String>
|
|
||||||
<String key="SoundLimiterDesc">Keeps loud moments from clipping by turning the whole mix down for a moment.</String>
|
|
||||||
<String key="SoundFrequency">Mixing rate</String>
|
|
||||||
<String key="SoundFrequencyDesc">The sample rate the sound is mixed at. The device's own rate avoids converting it once more.</String>
|
|
||||||
<String key="SoundDeviceRate">Device rate</String>
|
|
||||||
<String key="SoundDoppler">Doppler effect</String>
|
|
||||||
<String key="SoundDopplerDesc">How much the pitch of a passing vehicle changes. 0 turns the effect off, 1 is the physical one.</String>
|
|
||||||
<String key="SoundLowpass">Muffled sounds outside the cab</String>
|
|
||||||
<String key="SoundLowpassDesc">Sounds heard through the cab walls lose their high tones as well as their loudness.</String>
|
|
||||||
<String key="SoundAirAbsorption">Air absorption</String>
|
|
||||||
<String key="SoundAirAbsorptionDesc">Distant sounds lose their high tones, as in the open air. 0 turns it off, 1 is the natural amount.</String>
|
|
||||||
|
|
||||||
<String key="Advanced">Advanced</String>
|
<String key="Advanced">Advanced</String>
|
||||||
|
<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="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="CompressTextures">Compress TGA textures</String>
|
<String key="CompressTextures">Compress TGA textures</String>
|
||||||
<String key="ScaleSpeculars">Scale specular highlights (old-model compatibility)</String>
|
<String key="ScaleSpeculars">Specular scaling</String>
|
||||||
<String key="ScaleSpecularsDesc">Tones down the shine of models made for older renderers.</String>
|
<String key="ScaleSpecularsDesc">Less shine on older models.</String>
|
||||||
<String key="ShaderGamma">Gamma correction in shaders</String>
|
<String key="ShaderGamma">Shader gamma</String>
|
||||||
<String key="ShaderGammaDesc">Gamma in the shaders instead of sRGB. For when a driver gives too bright or dark a picture.</String>
|
<String key="ShaderGammaDesc">Turn on if the picture is too bright or too dark.</String>
|
||||||
<String key="ScreenMipmaps">Generate mipmaps for in-cab (Python) screen textures</String>
|
<String key="ScreenMipmaps">Screen mipmaps</String>
|
||||||
<String key="ScreenMipmapsDesc">Cab screens smoother from afar and at an angle, at a cost on each refresh.</String>
|
<String key="ScreenMipmapsDesc">Cab screens look smoother from afar.</String>
|
||||||
<String key="ExtendedModelConversion">Extended E3D model conversion (experimental)</String>
|
<String key="ExtendedModelConversion">Convert models to E3D</String>
|
||||||
<String key="ExtendedModelConversionDesc">Saves text models as binary E3D: faster loading, more files in the game folder.</String>
|
<String key="ExtendedModelConversionDesc">Saves models as E3D: faster loading, more files in the game folder.</String>
|
||||||
<String key="GfxResourceMove">Conservative texture memory management</String>
|
<String key="GfxResourceMove">Save texture memory</String>
|
||||||
<String key="GfxResourceSweep">Purge unused textures from GPU memory</String>
|
<String key="GfxResourceSweep">Free unused textures</String>
|
||||||
<String key="TrainPhysicsThreads">Vehicle physics threads (0 = main thread)</String>
|
<String key="TrainPhysicsThreads">Physics threads</String>
|
||||||
<String key="TrainPhysicsThreadsDesc">Threads for vehicle physics; 0 is the main thread. More helps with many consists.</String>
|
<String key="TrainPhysicsThreadsDesc">0 – physics in the main thread. More threads help with many consists.</String>
|
||||||
<String key="IgnoreIrrelevantTrains">Skip decorative consists when starting</String>
|
<String key="IgnoreIrrelevantTrains">Skip decoration consists</String>
|
||||||
|
|
||||||
<String key="Starter">Starter</String>
|
<String key="Starter">Starter</String>
|
||||||
<String key="SettingsProfile">Settings profile</String>
|
<String key="SettingsProfile">Settings profile</String>
|
||||||
<String key="ProfileApply">Apply</String>
|
<String key="ProfileApply">Apply</String>
|
||||||
<String key="ProfileSaveAs">Save as…</String>
|
<String key="ProfileSaveAs">Save as…</String>
|
||||||
<String key="ProfileNamePrompt">Profile name</String>
|
<String key="ProfileNamePrompt">Profile name</String>
|
||||||
<String key="AutoCloseStarter">Automatically close starter</String>
|
<String key="AutoCloseStarter">Close starter on launch</String>
|
||||||
<String key="LargeThumbnails">Large thumbnails</String>
|
<String key="LargeThumbnails">Large thumbnails</String>
|
||||||
<String key="AutoExpandSceneryTree">Automatically expand scenery tree</String>
|
<String key="AutoExpandSceneryTree">Expand scenery tree</String>
|
||||||
|
|
||||||
<!-- Controls / key bindings -->
|
<!-- Controls / key bindings -->
|
||||||
<String key="Controls">Controls</String>
|
<String key="Controls">Controls</String>
|
||||||
@@ -625,6 +604,7 @@
|
|||||||
<String key="Reset">Reset</String>
|
<String key="Reset">Reset</String>
|
||||||
<String key="SettingsSaved">Settings saved</String>
|
<String key="SettingsSaved">Settings saved</String>
|
||||||
<String key="DefaultsRestored">Defaults restored</String>
|
<String key="DefaultsRestored">Defaults restored</String>
|
||||||
|
<String key="AllDefaultsConfirm">Every setting goes back to its default. Kept: the language, the chosen simulator, the UART port and the key bindings. The changes still need saving.</String>
|
||||||
<String key="SettingsRestored">Saved settings restored</String>
|
<String key="SettingsRestored">Saved settings restored</String>
|
||||||
<String key="TreeExpanded">expanded</String>
|
<String key="TreeExpanded">expanded</String>
|
||||||
<String key="TreeCollapsed">collapsed</String>
|
<String key="TreeCollapsed">collapsed</String>
|
||||||
@@ -741,9 +721,9 @@
|
|||||||
<String key="StartEditorWizardTip">The new scenery wizard in the simulator's editor. Only some builds have the editor.</String>
|
<String key="StartEditorWizardTip">The new scenery wizard in the simulator's editor. Only some builds have the editor.</String>
|
||||||
<String key="StartEditor">Open the scenery editor</String>
|
<String key="StartEditor">Open the scenery editor</String>
|
||||||
<String key="StartEditorWarning">Only some simulator builds have the scenery editor (eu07 -edit). If the selected simulator does not, the editor will not open. It works on {0} itself, not on the starter's copy, so what you save goes into the scenery. Start it?</String>
|
<String key="StartEditorWarning">Only some simulator builds have the scenery editor (eu07 -edit). If the selected simulator does not, the editor will not open. It works on {0} itself, not on the starter's copy, so what you save goes into the scenery. Start it?</String>
|
||||||
<String key="DebugLogVisible">Show log in console</String>
|
<String key="DebugLogVisible">Log in console</String>
|
||||||
<String key="PyScreenPriority">Extra screen update delay</String>
|
<String key="PyScreenPriority">Extra screens refresh</String>
|
||||||
<String key="PyScreenPriorityDesc">Minimum time between Python cab screen updates in milliseconds. Higher value = less frequent updates.</String>
|
<String key="PyScreenPriorityDesc">How often cab screens refresh. Less often means more FPS.</String>
|
||||||
<String key="PyPriorityNormal">Standard (200 ms)</String>
|
<String key="PyPriorityNormal">Standard (200 ms)</String>
|
||||||
<String key="PyPriorityLower">Slower (400 ms)</String>
|
<String key="PyPriorityLower">Slower (400 ms)</String>
|
||||||
<String key="PyPriorityLowest">Very slow (800 ms)</String>
|
<String key="PyPriorityLowest">Very slow (800 ms)</String>
|
||||||
@@ -769,9 +749,9 @@
|
|||||||
<String key="RuleRemove">Remove from rule</String>
|
<String key="RuleRemove">Remove from rule</String>
|
||||||
<String key="CatAll">All</String>
|
<String key="CatAll">All</String>
|
||||||
<String key="GfxColResolution">Picture</String>
|
<String key="GfxColResolution">Picture</String>
|
||||||
<String key="GfxColRendering">Renderer</String>
|
<String key="GfxColRendering">Rendering</String>
|
||||||
<String key="GfxColShadows">Shadows</String>
|
<String key="GfxColShadows">Shadows</String>
|
||||||
<String key="GfxColTextures">Textures and anti-aliasing</String>
|
<String key="GfxColTextures">Textures</String>
|
||||||
<String key="GfxColDrawRange">Draw distance</String>
|
<String key="GfxColDrawRange">Draw distance</String>
|
||||||
<String key="GfxColSmoothness">Smoothness</String>
|
<String key="GfxColSmoothness">Smoothness</String>
|
||||||
<String key="GfxColReflections">Reflections</String>
|
<String key="GfxColReflections">Reflections</String>
|
||||||
@@ -801,7 +781,7 @@
|
|||||||
|
|
||||||
<!-- Key binding descriptions, by eu07_input-keyboard.ini command. Polish takes them
|
<!-- 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. -->
|
from the bundled key file; a language without its own falls back to these. -->
|
||||||
<String key="AdvancedResources">Resources and compatibility</String>
|
<String key="AdvancedResources">Resources</String>
|
||||||
<String key="AdvancedLogTools">Log and tools</String>
|
<String key="AdvancedLogTools">Log and tools</String>
|
||||||
<String key="LogAndTools">Event log and tools</String>
|
<String key="LogAndTools">Event log and tools</String>
|
||||||
<String key="OpenLogTools">Open the log and tools…</String>
|
<String key="OpenLogTools">Open the log and tools…</String>
|
||||||
@@ -856,68 +836,67 @@
|
|||||||
<String key="SyntaxIncludeNotClosed">include {1} without end</String>
|
<String key="SyntaxIncludeNotClosed">include {1} without end</String>
|
||||||
<String key="SyntaxTrainsetUnreadable">Trainset {0} could not be read</String>
|
<String key="SyntaxTrainsetUnreadable">Trainset {0} could not be read</String>
|
||||||
<String key="SyntaxVehicleUnreadable">Vehicle {0} could not be read</String>
|
<String key="SyntaxVehicleUnreadable">Vehicle {0} could not be read</String>
|
||||||
|
<String key="SyntaxVehicleMissing">Vehicle {0} missing: no file dynamic/{1} - the simulator leaves it out, the consist runs short</String>
|
||||||
<String key="WarehouseUseInScenery">Put into the selected scenery consist</String>
|
<String key="WarehouseUseInScenery">Put into the selected scenery consist</String>
|
||||||
<String key="WarehouseAppendToScenery">Append to the selected scenery consist</String>
|
<String key="WarehouseAppendToScenery">Append to the selected scenery consist</String>
|
||||||
<String key="ShortcutUndo">Undo a change to the consist</String>
|
<String key="ShortcutUndo">Undo a change to the consist</String>
|
||||||
<String key="ShortcutRedo">Redo a change to the consist</String>
|
<String key="ShortcutRedo">Redo a change to the consist</String>
|
||||||
<String key="AddToWarehouseNamed">Add to warehouse as…</String>
|
<String key="AddToWarehouseNamed">Add to warehouse as…</String>
|
||||||
<String key="Ini.ui.scale">Simulator UI scale</String>
|
<String key="Ini.ui.scale">Interface scale</String>
|
||||||
<String key="Ini.ui.fontsize">UI font size</String>
|
<String key="Ini.ui.fontsize">Interface font</String>
|
||||||
<String key="Ini.ui.bg.opacity">Window background opacity</String>
|
<String key="Ini.ui.bg.opacity">Window background opacity</String>
|
||||||
<String key="Ini.gui.defaultwindows">Show the driving aid and scenario windows on start</String>
|
<String key="Ini.gui.defaultwindows">Help windows at start</String>
|
||||||
<String key="Ini.gui.trainingdefault">Open the map, training card and vehicle list on start</String>
|
<String key="Ini.gui.trainingdefault">Map and training card at start</String>
|
||||||
<String key="Ini.gui.showtranscripts">Transcripts window (radio and voice messages)</String>
|
<String key="Ini.gui.showtranscripts">Message captions</String>
|
||||||
<String key="Ini.loadinglog">Show the log while loading</String>
|
<String key="Ini.loadinglog">Log while loading</String>
|
||||||
<String key="Ini.captureonstart">Mouse turns the camera on start</String>
|
<String key="Ini.captureonstart">Mouse turns camera at start</String>
|
||||||
<String key="Ini.mousecontrol">Click cab controls with the mouse</String>
|
<String key="Ini.mousecontrol">Switches by mouse</String>
|
||||||
<String key="Ini.fullscreenmonitor">Full-screen monitor</String>
|
|
||||||
<String key="Ini.screenshotsdir">Screenshots folder</String>
|
<String key="Ini.screenshotsdir">Screenshots folder</String>
|
||||||
<String key="Ini.basedrawrange">Base draw range</String>
|
<String key="Ini.basedrawrange">Draw range</String>
|
||||||
<String key="Ini.targetfps">Target frame rate</String>
|
<String key="Ini.targetfps">Target FPS</String>
|
||||||
<String key="Ini.sleeperdistance">Sleeper draw distance</String>
|
<String key="Ini.sleeperdistance">Sleeper range</String>
|
||||||
<String key="Ini.gfx.reflections.range_instances">Object reflection range</String>
|
<String key="Ini.gfx.reflections.range_instances">Object reflection range</String>
|
||||||
<String key="Ini.gfx.reflections.range_vehicles">Vehicle reflection range</String>
|
<String key="Ini.gfx.reflections.range_vehicles">Vehicle reflection range</String>
|
||||||
<String key="Ini.gfx.textures.streaming">Stream textures in the background</String>
|
<String key="Ini.gfx.textures.streaming">Textures in background</String>
|
||||||
<String key="Ini.gfx.textures.releasedistance">Release textures of distant vehicles</String>
|
<String key="Ini.gfx.textures.releasedistance">Release vehicle textures</String>
|
||||||
<String key="Ini.skyenabled">Draw the sky</String>
|
<String key="Ini.skyenabled">Sky</String>
|
||||||
<String key="Ini.rendercab">Draw the cab</String>
|
<String key="Ini.rendercab">Cab</String>
|
||||||
<String key="Ini.gfx.postfx.motionblur.shutter">Motion blur shutter time</String>
|
<String key="Ini.gfx.postfx.motionblur.shutter">Blur time</String>
|
||||||
<String key="Ini.python.vsync">Vertical sync for screen windows</String>
|
<String key="Ini.python.vsync">Screen windows VSync</String>
|
||||||
<String key="Ini.python.displaywindows">Cab screens in separate windows</String>
|
<String key="Ini.python.displaywindows">Screens in own windows</String>
|
||||||
<String key="Ini.newaircouplers">Draw air hoses by how the vehicles are coupled</String>
|
<String key="Ini.newaircouplers">Hoses by coupling</String>
|
||||||
<String key="Ini.smoothtraction">Smooth overhead wires (classic renderer)</String>
|
<String key="Ini.smoothtraction">Smooth wires</String>
|
||||||
<String key="Ini.sound.maxsources">Maximum sound sources</String>
|
<String key="Ini.sound.maxsources">Sound sources</String>
|
||||||
<String key="Ini.sound.asyncload">Decode sounds in the background</String>
|
<String key="Ini.sound.asyncload">Sounds in background</String>
|
||||||
<String key="Ini.loadtraction">Load overhead wires</String>
|
<String key="Ini.loadtraction">Overhead line</String>
|
||||||
<String key="Ini.rollfix">Recalculate track cant</String>
|
<String key="Ini.rollfix">Track cant</String>
|
||||||
<String key="Ini.shakefactor">Camera shake</String>
|
<String key="Ini.shakefactor">Camera shake</String>
|
||||||
<String key="Ini.map.manualswitchcontrol">Throw switches from the map</String>
|
<String key="Ini.map.manualswitchcontrol">Switches from map</String>
|
||||||
<String key="Ini.map.highlightdistance">Route highlight on the map</String>
|
<String key="Ini.map.highlightdistance">Route highlight</String>
|
||||||
<String key="Ini.showsystemconsole">Console window with the log (Windows)</String>
|
<String key="Ini.showsystemconsole">System console</String>
|
||||||
<String key="OpenLogToolsDesc">The starter's messages and bulk depot tools.</String>
|
<String key="OpenLogToolsDesc">Starter messages and depot tools.</String>
|
||||||
<String key="CompressTexturesDesc">Less graphics memory, longer loading.</String>
|
<String key="CompressTexturesDesc">Less card memory, longer loading.</String>
|
||||||
<String key="GfxResourceSweepDesc">Best left off when the graphics card has memory to spare.</String>
|
<String key="GfxResourceSweepDesc">Frees card memory. Turn off if you have plenty.</String>
|
||||||
<String key="GfxResourceMoveDesc">May cause trouble on some graphics cards.</String>
|
<String key="GfxResourceMoveDesc">May cause trouble on some cards.</String>
|
||||||
<String key="IgnoreIrrelevantTrainsDesc">Leaves out consists the scenery marks as decoration.</String>
|
<String key="IgnoreIrrelevantTrainsDesc">Does not load consists the scenery marks as decoration.</String>
|
||||||
<String key="Ini.ui.scale.Desc">Enlarges the simulator's windows and buttons.</String>
|
<String key="Ini.ui.scale.Desc">Size of windows and buttons in the simulator.</String>
|
||||||
<String key="Ini.ui.fontsize.Desc">Size of the text in the simulator's windows.</String>
|
<String key="Ini.ui.fontsize.Desc">Size of text in the simulator's windows.</String>
|
||||||
<String key="Ini.ui.bg.opacity.Desc">1 is solid; lower values let the view show through.</String>
|
<String key="Ini.ui.bg.opacity.Desc">1 – solid background, less – see-through.</String>
|
||||||
<String key="Ini.captureonstart.Desc">Unticked, it starts with a pointer in the cab.</String>
|
<String key="Ini.captureonstart.Desc">Off: the cursor is free after start.</String>
|
||||||
<String key="Ini.mousecontrol.Desc">Off, the pointer mode is unavailable and the mouse only turns the camera.</String>
|
<String key="Ini.mousecontrol.Desc">Off: the mouse only turns the camera.</String>
|
||||||
<String key="Ini.fullscreenmonitor.Desc">Empty: the primary monitor.</String>
|
<String key="Ini.screenshotsdir.Desc">Path relative to the game folder, without spaces.</String>
|
||||||
<String key="Ini.screenshotsdir.Desc">Relative to the game folder, with no spaces in the path.</String>
|
<String key="Ini.basedrawrange.Desc">How far the scenery is drawn.</String>
|
||||||
<String key="Ini.basedrawrange.Desc">How far the scenery is drawn; a target FPS may change it.</String>
|
<String key="Ini.targetfps.Desc">The simulator fits the draw range to keep this FPS. 0 – off.</String>
|
||||||
<String key="Ini.targetfps.Desc">Below this the simulator shortens the draw range, above it lengthens it.</String>
|
<String key="Ini.gfx.textures.streaming.Desc">Faster scenery loading. Does not raise FPS.</String>
|
||||||
<String key="Ini.gfx.textures.streaming.Desc">DDS textures are read in the background: the scenery loads faster. It does not raise FPS.</String>
|
<String key="Ini.gfx.textures.releasedistance.Desc">Frees textures of far vehicles from the card. 0 – off.</String>
|
||||||
<String key="Ini.gfx.textures.releasedistance.Desc">Multiple of the draw range beyond which vehicle textures leave the graphics card.</String>
|
<String key="Ini.rendercab.Desc">Off: no cab model (for testing).</String>
|
||||||
<String key="Ini.rendercab.Desc">Off hides the cab model; for testing.</String>
|
<String key="Ini.gfx.postfx.motionblur.shutter.Desc">Longer – stronger blur.</String>
|
||||||
<String key="Ini.gfx.postfx.motionblur.shutter.Desc">A longer time blurs more.</String>
|
<String key="Ini.python.displaywindows.Desc">For several monitors or a desk with its own displays.</String>
|
||||||
<String key="Ini.python.displaywindows.Desc">Useful with several monitors or a desk with its own displays.</String>
|
<String key="Ini.sound.maxsources.Desc">How many sounds play at once.</String>
|
||||||
<String key="Ini.sound.maxsources.Desc">How many sounds may play at once.</String>
|
<String key="Ini.sound.asyncload.Desc">Faster sound loading.</String>
|
||||||
<String key="Ini.sound.asyncload.Desc">Sound files are decoded by worker threads, for faster loading.</String>
|
<String key="Ini.loadtraction.Desc">Off: pantographs do not break and electric locomotives always have power.</String>
|
||||||
<String key="Ini.loadtraction.Desc">Without wires pantographs never break and electric locomotives always have power.</String>
|
<String key="Ini.shakefactor.Desc">0 – the camera does not sway.</String>
|
||||||
<String key="Ini.shakefactor.Desc">Multiplier of the cab view's sway on every axis; 0 means none.</String>
|
<String key="Ini.map.highlightdistance.Desc">How far ahead and behind the vehicle the map lights the track.</String>
|
||||||
<String key="Ini.map.highlightdistance.Desc">How far ahead of and behind the vehicle the map highlights the track.</String>
|
|
||||||
<String key="Cmd.aidriverenable">engage the AI driver</String>
|
<String key="Cmd.aidriverenable">engage the AI driver</String>
|
||||||
<String key="Cmd.aidriverdisable">disengage the AI driver</String>
|
<String key="Cmd.aidriverdisable">disengage the AI driver</String>
|
||||||
<String key="Cmd.mastercontrollerincrease">master controller up</String>
|
<String key="Cmd.mastercontrollerincrease">master controller up</String>
|
||||||
@@ -1108,8 +1087,8 @@
|
|||||||
<String key="PresetHigh">High</String>
|
<String key="PresetHigh">High</String>
|
||||||
<String key="PresetCustom">Custom</String>
|
<String key="PresetCustom">Custom</String>
|
||||||
<String key="MonitorRate">Screen: {0} Hz</String>
|
<String key="MonitorRate">Screen: {0} Hz</String>
|
||||||
<String key="MonitorRateNamed">Screen {0}: up to {1} Hz</String>
|
|
||||||
<String key="MonitorRateUse">Set {0} FPS</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">Hover over a level to see its values.</String>
|
||||||
<String key="TextureBaseDateHint">YYYY-MM-DD</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="LanguageStarterMissing">No starter translation: it stays in English. The simulator gets this language.</String>
|
||||||
@@ -1142,12 +1121,12 @@
|
|||||||
<String key="KbUseSceneryEvent">scenery events</String>
|
<String key="KbUseSceneryEvent">scenery events</String>
|
||||||
<String key="KbUseCamera">stored cameras</String>
|
<String key="KbUseCamera">stored cameras</String>
|
||||||
<String key="Ini.heightbase">Distance factor</String>
|
<String key="Ini.heightbase">Distance factor</String>
|
||||||
<String key="Ini.heightbase.Desc">Shortens or lengthens how far the scenery is drawn. A target FPS overrides it.</String>
|
<String key="Ini.heightbase.Desc">Shortens or stretches the draw range.</String>
|
||||||
<String key="PresetVeryHigh">Very high</String>
|
<String key="PresetVeryHigh">Very high</String>
|
||||||
<String key="PresetUltra">Ultra</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="PresetUltraNote">Everything at maximum. It may be too much even for a strong card.</String>
|
||||||
<String key="Ini.python.fpslimit">Screen window frame limit</String>
|
<String key="Ini.python.fpslimit">Screen windows FPS</String>
|
||||||
<String key="Ini.python.fpslimit.Desc">Works only with screens in separate windows; without them it changes nothing.</String>
|
<String key="Ini.python.fpslimit.Desc">Only for screens in their own windows.</String>
|
||||||
<String key="ShadowLimitNone">Longest</String>
|
<String key="ShadowLimitNone">Longest</String>
|
||||||
<String key="HaslerScenario">scenario {0}</String>
|
<String key="HaslerScenario">scenario {0}</String>
|
||||||
<String key="HaslerTrain">train {0}</String>
|
<String key="HaslerTrain">train {0}</String>
|
||||||
@@ -1167,93 +1146,13 @@
|
|||||||
<String key="WarehouseSaved">In the warehouse: {0}</String>
|
<String key="WarehouseSaved">In the warehouse: {0}</String>
|
||||||
<String key="WarehouseNothingToAdd">Pick a consist with vehicles</String>
|
<String key="WarehouseNothingToAdd">Pick a consist with vehicles</String>
|
||||||
<String key="GfxGroupLevelTip">Level for this part of the graphics only</String>
|
<String key="GfxGroupLevelTip">Level for this part of the graphics only</String>
|
||||||
<String key="REVulkan">Vulkan 1.4</String>
|
|
||||||
<String key="IdleVulkanOnly">Works with Vulkan only.</String>
|
|
||||||
<String key="DlssPreset">DLSS preset</String>
|
|
||||||
<String key="DlssPresetDesc">The model DLSS rebuilds the image with. The DLSS mode follows the buffer scale: about 67% Quality, 50% Performance, 33% Ultra Performance.</String>
|
|
||||||
<String key="FrameGeneration">Frame generation</String>
|
|
||||||
<String key="FrameGenerationDesc">Extra frames between the drawn ones. With DLSS or DLAA only. x3 and x4 need an RTX 50 card.</String>
|
|
||||||
<String key="Reflex">NVIDIA Reflex</String>
|
|
||||||
<String key="ReflexDesc">Less delay between the controls and the image.</String>
|
|
||||||
<String key="RayTracing">Ray traced reflections</String>
|
|
||||||
<String key="RayTracingDesc">Fills in reflections where SSR finds nothing. The card needs ray query.</String>
|
|
||||||
<String key="RayTracingRange">Ray tracing range</String>
|
|
||||||
<String key="VulkanDevice">Graphics card (Vulkan)</String>
|
|
||||||
<String key="VulkanDeviceDesc">A card's number from the list in the log, or part of its name, like RTX. Empty: chosen automatically.</String>
|
|
||||||
<String key="Ssr">Screen space reflections (SSR)</String>
|
|
||||||
<String key="SsrDesc">Reflections of what is on screen, on wet and smooth surfaces.</String>
|
|
||||||
<String key="AmbientOcclusion">Ambient occlusion</String>
|
|
||||||
<String key="AmbientOcclusionDesc">Darkens corners and places where surfaces meet. GTAO is more accurate than SSAO.</String>
|
|
||||||
<String key="AmbientOcclusionQuality">Occlusion quality</String>
|
|
||||||
<String key="AoLighting">Occlusion in ambient light</String>
|
|
||||||
<String key="AoLightingDesc">GTAO only. Darkens ambient light and reflections, sun and lamps stay bright. Off: multiplies the finished image, cheaper.</String>
|
|
||||||
<String key="LightsClustered">Clustered lighting</String>
|
|
||||||
<String key="LightsClusteredDesc">Vehicle lights and street lamps with no limit on their number. Needed for scenery lamps and the cab lamp.</String>
|
|
||||||
<String key="LightShadows">Lamp and headlight shadows</String>
|
|
||||||
<String key="LightShadowsDesc">Shadows cast by the cab lamp, street lamps and vehicle headlights.</String>
|
|
||||||
<String key="ContactShadows">Contact shadows</String>
|
|
||||||
<String key="ContactShadowsDesc">Small shadows where objects touch, which the shadow map misses.</String>
|
|
||||||
<String key="ShadowSdsm">Shadow cascades fitted to the scene (SDSM)</String>
|
|
||||||
<String key="ShadowSdsmDesc">Spreads the sun shadow resolution over what is actually in view.</String>
|
|
||||||
<String key="CabProbe">Cab probe</String>
|
|
||||||
<String key="CabProbeDesc">Light bounced off the cab walls and reflections of the interior in the windows.</String>
|
|
||||||
<String key="CabProbeInterval">Refresh the probe every N frames</String>
|
|
||||||
<String key="CabProbeReflections">Cab reflects itself</String>
|
|
||||||
<String key="CabProbeReflectionsDesc">The windows show the cab interior instead of the sky where SSR finds nothing.</String>
|
|
||||||
<String key="CabProbeBounce">Cab lamp light bounce</String>
|
|
||||||
<String key="CabProbeBounceDesc">How much of the lamp's light reflected off the walls lights the cab again. Works with the cab probe.</String>
|
|
||||||
<String key="FogQuality">Fog quality</String>
|
|
||||||
<String key="Clouds">Volumetric clouds</String>
|
|
||||||
<String key="CloudShadows">Cloud shadows on the ground</String>
|
|
||||||
<String key="Grass">Grass</String>
|
|
||||||
<String key="GrassDistance">Grass range</String>
|
|
||||||
<String key="GrassDensity">Grass density</String>
|
|
||||||
<String key="Precipitation">Precipitation (particles)</String>
|
|
||||||
<String key="PrecipitationDesc">Number of raindrops and snowflakes in the heaviest precipitation.</String>
|
|
||||||
<String key="Bloom">Glow of bright areas (bloom)</String>
|
|
||||||
<String key="AutoExposure">Automatic exposure</String>
|
|
||||||
<String key="AutoExposureDesc">Image brightness adapts to the scene, for instance entering a tunnel.</String>
|
|
||||||
<String key="LevelOff">Off</String>
|
|
||||||
<String key="LevelLow">Low</String>
|
|
||||||
<String key="LevelMedium">Medium</String>
|
|
||||||
<String key="LevelHigh">High</String>
|
|
||||||
<String key="LevelUltra">Ultra</String>
|
|
||||||
<String key="ReflexOn">On</String>
|
|
||||||
<String key="ReflexBoost">On + boost</String>
|
|
||||||
<String key="AaTaa">TAA</String>
|
|
||||||
<String key="AaDlss">DLSS (upscaling)</String>
|
|
||||||
<String key="AaDlaa">DLAA (native resolution)</String>
|
|
||||||
<String key="DlssPresetDefault">Automatic</String>
|
|
||||||
<String key="DlssPresetK">K: best quality</String>
|
|
||||||
<String key="DlssPresetJ">J: less smearing</String>
|
|
||||||
<String key="DlssPresetM">M: for Performance mode</String>
|
|
||||||
<String key="DlssPresetL">L: for Ultra Performance</String>
|
|
||||||
<String key="Effects">Effects</String>
|
<String key="Effects">Effects</String>
|
||||||
<String key="GfxColImage">Resolution and anti-aliasing</String>
|
<String key="GfxColImage">Picture</String>
|
||||||
<String key="GfxColLights">Lighting</String>
|
<String key="GfxColLights">Lighting</String>
|
||||||
<String key="GfxColPostFx">Post-processing</String>
|
<String key="GfxColPostFx">Post-processing</String>
|
||||||
<String key="GfxColNature">Smoke</String>
|
<String key="GfxColNature">Smoke</String>
|
||||||
<String key="AntiAliasing">Anti-aliasing</String>
|
<String key="AntiAliasing">Multisampling</String>
|
||||||
<String key="AntiAliasingDesc">MSAA smooths the edges of objects, TAA the whole image at the cost of a slight blur. DLSS and DLAA need Vulkan and an NVIDIA RTX card, otherwise the simulator uses TAA.</String>
|
<String key="AntiAliasingDesc">Smooths edges. A higher level gives a smoother picture and fewer FPS.</String>
|
||||||
<String key="VolumetricFog">Volumetric fog</String>
|
|
||||||
<String key="VolumetricFogDesc">Fog with sun shafts, cloud shadows and the light of lamps. Off: the simpler analytic fog.</String>
|
|
||||||
<String key="CloudsDesc">The quality of the clouds drawn in the sky.</String>
|
|
||||||
<String key="REOpenGLNote">DLSS, frame generation, Reflex and ray tracing need Vulkan.</String>
|
|
||||||
<String key="REVulkanNote">Needs an exe with Vulkan and a card that supports it. Otherwise the simulator starts Full or Old.</String>
|
|
||||||
<String key="VulkanDeviceAuto">automatic</String>
|
|
||||||
<String key="DlssPresetInfoDefault">K for DLAA, Quality and Balanced, M for Performance, L for Ultra Performance. The driver may change this with an update.</String>
|
|
||||||
<String key="DlssPresetInfoK">The transformer model with the best image quality, but the most expensive to compute. The default for DLAA, Quality and Balanced.</String>
|
|
||||||
<String key="DlssPresetInfoJ">Similar to K: slightly less ghosting behind moving objects at the cost of more flicker. NVIDIA recommends K instead.</String>
|
|
||||||
<String key="DlssPresetInfoM">The model tuned for Performance mode (about 50% scale), its default there. Works out the image exposure itself.</String>
|
|
||||||
<String key="DlssPresetInfoL">The model tuned for Ultra Performance mode (about 33% scale), its default there. Works out the image exposure itself.</String>
|
|
||||||
<String key="DlssMissingLibraryNote">{0} is not next to the simulator: without it the simulator cannot use this DLSS feature.</String>
|
|
||||||
<String key="DlssNoPlatformNote">DLSS is not available on macOS.</String>
|
|
||||||
<String key="FrameGenerationNeedsDlssNote">Frame generation works with DLSS or DLAA only.</String>
|
|
||||||
<String key="ReflexForcedNote">Frame generation turns Reflex on by itself, whatever is chosen here.</String>
|
|
||||||
<String key="AoLightingPrepassNote">Needs the depth of the whole scene before its colour; without SSR and contact shadows that is an extra pass (CPU cost on OpenGL).</String>
|
|
||||||
<String key="AoNeedsPipelineNote">With the post-processing skipped the AO does not work.</String>
|
|
||||||
<String key="CabProbeReflectionsOnlyNote">Without the clustered lighting and the cab lamp as a light (gfx.lights.cab) the probe gives the reflections only.</String>
|
|
||||||
<String key="TemporalNeedsPipelineNote">TAA and DLSS run in the post-processing: with it skipped the edges will not be smoothed.</String>
|
|
||||||
<String key="SettingsFile">eu07.ini file</String>
|
<String key="SettingsFile">eu07.ini file</String>
|
||||||
<String key="ImportIni">Import…</String>
|
<String key="ImportIni">Import…</String>
|
||||||
<String key="ImportIniTitle">Import settings from eu07.ini</String>
|
<String key="ImportIniTitle">Import settings from eu07.ini</String>
|
||||||
@@ -1266,19 +1165,16 @@
|
|||||||
{0}</String>
|
{0}</String>
|
||||||
<String key="ExportIniDone">Exported to {0}</String>
|
<String key="ExportIniDone">Exported to {0}</String>
|
||||||
<String key="REFull">Full</String>
|
<String key="REFull">Full</String>
|
||||||
<String key="REOld">Old</String>
|
<String key="REOld">Old (not recommended)</String>
|
||||||
<String key="RESimp">Simplified</String>
|
<String key="RESimp">Simplified (not recommended)</String>
|
||||||
<String key="REExperimental">Experimental</String>
|
<String key="RenderAngleVulkan">ANGLE (Vulkan)</String>
|
||||||
<String key="RenderAngleVulkan">Use ANGLE Vulkan renderer</String>
|
<String key="RenderAngleVulkanDesc">Draws through ANGLE on Vulkan. Turn on if plain OpenGL gives trouble.</String>
|
||||||
<String key="RenderAngleVulkanDesc">Runs the ANGLE renderer on Vulkan instead of the default backend. Useful when OpenGL misbehaves.</String>
|
<String key="RenderVBO">VBO</String>
|
||||||
<String key="RenderVBO">Render VBO</String>
|
<String key="RenderVBODesc">Turn off only if an older card has picture problems.</String>
|
||||||
<String key="RenderVBODesc">Keeps geometry in GPU buffers (faster). Disable only if you have problems with an old GPU.</String>
|
<String key="CabShadowsRange">Cab shadows</String>
|
||||||
<String key="CabShadowsRange">Cabin shadow sources range</String>
|
<String key="CabShadowsRangeDesc">How far lights cast shadows in the cab. 0 turns cab shadows off.</String>
|
||||||
<String key="CabShadowsRangeDesc">Distance at which light sources still cast shadows inside the cab. Zero turns cab shadows off.</String>
|
<String key="UseGLES">OpenGL ES</String>
|
||||||
<String key="UseGLES">Use OpenGL ES</String>
|
<String key="UseGLESDesc">OpenGL ES instead of OpenGL. Does not work with the old renderer.</String>
|
||||||
<String key="UseGLESDesc">OpenGL ES instead of OpenGL. Does not work with the legacy renderer.</String>
|
|
||||||
<String key="GpuCard">{0}, {1} GB</String>
|
<String key="GpuCard">{0}, {1} GB</String>
|
||||||
<String key="GpuCardShared">{0}, shared memory</String>
|
<String key="GpuCardShared">{0}, shared memory</String>
|
||||||
<String key="GfxColNewRenderer">New in OpenGL 4.6 / Vulkan</String>
|
|
||||||
<String key="GfxNewRendererNote">These work only with the new exe. An older exe skips them.</String>
|
|
||||||
</Language>
|
</Language>
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
<String key="StartNoScenery">Válasszon pályát</String>
|
<String key="StartNoScenery">Válasszon pályát</String>
|
||||||
<String key="StartNoTrain">Válasszon szerelvényt</String>
|
<String key="StartNoTrain">Válasszon szerelvényt</String>
|
||||||
<String key="StartNoStaff">Nincs személyzet / utas</String>
|
<String key="StartNoStaff">Nincs személyzet / utas</String>
|
||||||
|
<String key="StartDecor">Díszlet szerelvény</String>
|
||||||
|
<String key="StartAi">AI-szerelvény</String>
|
||||||
<String key="StartNoStaffTitle">Szerelvény személyzet nélkül</String>
|
<String key="StartNoStaffTitle">Szerelvény személyzet nélkül</String>
|
||||||
<String key="StartNoStaffConfirm">Ebben a szerelvényben nincs személyzet és utas sem — nem lesz mit vezetni. Mégis elindítja?</String>
|
<String key="StartNoStaffConfirm">Ebben a szerelvényben nincs személyzet és utas sem — nem lesz mit vezetni. Mégis elindítja?</String>
|
||||||
<String key="RestoreWeather">Időjárás visszaállítása</String>
|
<String key="RestoreWeather">Időjárás visszaállítása</String>
|
||||||
@@ -355,8 +357,8 @@
|
|||||||
<String key="General">Általános</String>
|
<String key="General">Általános</String>
|
||||||
|
|
||||||
<String key="Language">Nyelv</String>
|
<String key="Language">Nyelv</String>
|
||||||
|
<String key="UnknownIniValue">Ismeretlen érték az eu07.ini-ben: „{0}”. A fájlban marad, amíg meg nem változtatja.</String>
|
||||||
<String key="LanguageSimMissing">A szimulátornak nincs fordítása erre a nyelvre, angolul fog futni.</String>
|
<String key="LanguageSimMissing">A szimulátornak nincs fordítása erre a nyelvre, angolul fog futni.</String>
|
||||||
<String key="Fullscreen">Teljes képernyő</String>
|
|
||||||
<String key="PauseSimInactive">Szimuláció szüneteltetése inaktív ablaknál</String>
|
<String key="PauseSimInactive">Szimuláció szüneteltetése inaktív ablaknál</String>
|
||||||
<String key="PauseSimStart">Szüneteltetés indításkor</String>
|
<String key="PauseSimStart">Szüneteltetés indításkor</String>
|
||||||
<String key="CursorSensitivity">Kurzorérzékenység</String>
|
<String key="CursorSensitivity">Kurzorérzékenység</String>
|
||||||
@@ -366,6 +368,7 @@
|
|||||||
<String key="Communication">Kommunikáció</String>
|
<String key="Communication">Kommunikáció</String>
|
||||||
|
|
||||||
<String key="GamepadSignalIgnore">Gamepad bemenet mellőzése</String>
|
<String key="GamepadSignalIgnore">Gamepad bemenet mellőzése</String>
|
||||||
|
<String key="ConfirmGamepadUse">Az ajánlott és alapértelmezett beállítás a gamepad figyelmen kívül hagyása. A támogatás bekapcsolása gyakran okoz gondot az irányításban. Csak akkor módosítsa, ha valóban gamepaddel vezet. Módosítja?</String>
|
||||||
|
|
||||||
<String key="Feedback">Visszajelzés</String>
|
<String key="Feedback">Visszajelzés</String>
|
||||||
<String key="FeedbackOff">Ki</String>
|
<String key="FeedbackOff">Ki</String>
|
||||||
@@ -407,8 +410,8 @@
|
|||||||
|
|
||||||
<String key="Graphic">Grafika</String>
|
<String key="Graphic">Grafika</String>
|
||||||
<String key="RenderEngine">Megjelenítő motor</String>
|
<String key="RenderEngine">Megjelenítő motor</String>
|
||||||
<String key="RenderEngineDesc">A Teljes minden exe-vel működik. A Régi, az Egyszerűsített és a Kísérleti csak a régebbiekkel, az új helyettük a Teljeset indítja.</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="REExperimentalWarning">Figyelem: a kísérleti renderelő instabil lehet, a jelenet egyes részei hiányozhatnak, vagy egyes videokártyákon el sem indul. Ha a szimulátor nem indul el vagy hibásan jelenik meg, válts vissza a „Teljes” renderelőre.</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>
|
<String key="GpuChoice">Videokártya (Linux)</String>
|
||||||
<String key="GpuDiscrete">Erősebb (dedikált)</String>
|
<String key="GpuDiscrete">Erősebb (dedikált)</String>
|
||||||
<String key="GpuSystem">Ahogy a rendszer dönt</String>
|
<String key="GpuSystem">Ahogy a rendszer dönt</String>
|
||||||
@@ -418,16 +421,9 @@
|
|||||||
<String key="GpuNotePlayer">Találat: {0}. A kártyát környezeti változók választják ({1}); az indító nem módosítja őket.</String>
|
<String key="GpuNotePlayer">Találat: {0}. A kártyát környezeti változók választják ({1}); az indító nem módosítja őket.</String>
|
||||||
<String key="GpuNoteOne">Egy kártya: {0} – nincs miből választani.</String>
|
<String key="GpuNoteOne">Egy kártya: {0} – nincs miből választani.</String>
|
||||||
<String key="GpuNoteUnread">Nem sikerült beolvasni a videokártyákat a /sys/class/drm alól.</String>
|
<String key="GpuNoteUnread">Nem sikerült beolvasni a videokártyákat a /sys/class/drm alól.</String>
|
||||||
<String key="IdleWindowsBuildOnly">Csak a szimulátor Windowsos változata használja.</String>
|
|
||||||
<String key="IdleLegacyRendererOnly">Ezt csak a legacy renderelő olvassa, de más van kiválasztva.</String>
|
|
||||||
<String key="IdleNeedsFrameRateTarget">Csak cél képkockaszámmal működik (targetfps).</String>
|
|
||||||
<String key="IdleOpenGlRenderersOnly">A kísérleti renderelő ezt nem olvassa.</String>
|
|
||||||
<String key="IdleModernRendererOnly">Ezt csak a teljes renderelő olvassa, de más van kiválasztva.</String>
|
|
||||||
<String key="IdleNeedsNetworkServer">A háttérben szüneteléshez hálózati szerver kell (network.server).</String>
|
|
||||||
|
|
||||||
<String key="Resolution">Felbontás</String>
|
<String key="Resolution">Felbontás</String>
|
||||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||||
<String key="IdleMonitorMode">Automatikus felbontásnál nincs hatása.</String>
|
|
||||||
<String key="BufforResolution">Puffer felbontása</String>
|
<String key="BufforResolution">Puffer felbontása</String>
|
||||||
<String key="MaxTexResolution">Textúrák legnagyobb felbontása</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="MaxTexCabResolution">Vezetőállás-textúrák legnagyobb felbontása</String>
|
||||||
@@ -456,7 +452,14 @@
|
|||||||
<String key="FpsLimitDesc">Kevesebb képkocka: hűvösebb, csendesebb gép. V-Sync mellett a frissítés feletti korlát hatástalan.</String>
|
<String key="FpsLimitDesc">Kevesebb képkocka: hűvösebb, csendesebb gép. V-Sync mellett a frissítés feletti korlát hatástalan.</String>
|
||||||
<String key="ShadowAngleLimit">Árnyékhossz korlátozása</String>
|
<String key="ShadowAngleLimit">Árnyékhossz korlátozása</String>
|
||||||
<String key="ShadowLimitShort">Rövidített</String>
|
<String key="ShadowLimitShort">Rövidített</String>
|
||||||
<String key="FullscreenWindowed">Automatikus felbontás (keret nélküli teljes képernyő)</String>
|
<String key="DisplayMode">Megjelenítési mód</String>
|
||||||
|
<String key="DisplayModeFullscreen">Teljes képernyő</String>
|
||||||
|
<String key="DisplayModeBorderless">Keret nélküli teljes képernyő</String>
|
||||||
|
<String key="DisplayModeWindow">Ablak</String>
|
||||||
|
<String key="DisplayModeDesc">A keret nélküli teljes képernyő a monitor felbontását használja, és gyorsabban vált más programokra.</String>
|
||||||
|
<String key="FullscreenMonitor">Monitor</String>
|
||||||
|
<String key="FullscreenMonitorDesc">Melyik monitoron nyíljon meg a szimulátor teljes képernyőn.</String>
|
||||||
|
<String key="MonitorPrimary">Elsődleges</String>
|
||||||
<String key="VSync">VSync</String>
|
<String key="VSync">VSync</String>
|
||||||
<String key="SmokeDisplay">Füst megjelenítése</String>
|
<String key="SmokeDisplay">Füst megjelenítése</String>
|
||||||
<String key="SmokeParticlesMultiplier">Füstrészecskék szorzója</String>
|
<String key="SmokeParticlesMultiplier">Füstrészecskék szorzója</String>
|
||||||
@@ -518,28 +521,14 @@
|
|||||||
<String key="VehiclesVolume">Járművek hangereje</String>
|
<String key="VehiclesVolume">Járművek hangereje</String>
|
||||||
<String key="PositionedSoundsVolume">Térbeli hangok hangereje</String>
|
<String key="PositionedSoundsVolume">Térbeli hangok hangereje</String>
|
||||||
<String key="AmbientVolume">Környezeti hangok hangereje</String>
|
<String key="AmbientVolume">Környezeti hangok hangereje</String>
|
||||||
<String key="SoundDevice">Hangeszköz és effektek</String>
|
|
||||||
<String key="SoundOutputDevice">Kimeneti eszköz</String>
|
|
||||||
<String key="SoundSystemDefault">Rendszer alapértelmezése</String>
|
|
||||||
<String key="SoundOutputMode">Hangszóró-elrendezés</String>
|
|
||||||
<String key="SoundAutomatic">Automatikus</String>
|
|
||||||
<String key="SoundStereoBasic">Sztereó (egyszerű panoráma)</String>
|
|
||||||
<String key="SoundStereoUhj">Sztereó (UHJ, szélesebb)</String>
|
|
||||||
<String key="SoundHeadphones">Fejhallgató (HRTF)</String>
|
|
||||||
<String key="SoundOn">Be</String>
|
|
||||||
<String key="SoundOff">Ki</String>
|
|
||||||
<String key="SoundHrtfProfile">HRTF-adatkészlet</String>
|
|
||||||
<String key="SoundLibraryChoice">A könyvtár választása</String>
|
|
||||||
<String key="SoundResampler">Újramintavételezés</String>
|
|
||||||
<String key="SoundLibraryDefault">A könyvtár alapértelmezése</String>
|
|
||||||
<String key="SoundLimiter">Kimeneti limiter</String>
|
|
||||||
<String key="SoundFrequency">Keverési mintavételi frekvencia</String>
|
|
||||||
<String key="SoundDeviceRate">Az eszköz frekvenciája</String>
|
|
||||||
<String key="SoundDoppler">Doppler-hatás</String>
|
|
||||||
<String key="SoundLowpass">Tompított hangok a fülkén kívülről</String>
|
|
||||||
<String key="SoundAirAbsorption">Levegő általi elnyelés</String>
|
|
||||||
|
|
||||||
<String key="Advanced">Speciális</String>
|
<String key="Advanced">Speciális</String>
|
||||||
|
<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="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="CompressTextures">TGA textúrák tömörítése</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="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>
|
<String key="ScaleSpecularsDesc">Csökkenti a régebbi megjelenítőkhöz készült modellek csillogását.</String>
|
||||||
@@ -589,6 +578,7 @@
|
|||||||
<String key="Reset">Visszaállítás</String>
|
<String key="Reset">Visszaállítás</String>
|
||||||
<String key="SettingsSaved">A beállítások elmentve</String>
|
<String key="SettingsSaved">A beállítások elmentve</String>
|
||||||
<String key="DefaultsRestored">Alapértékek visszaállítva</String>
|
<String key="DefaultsRestored">Alapértékek visszaállítva</String>
|
||||||
|
<String key="AllDefaultsConfirm">Minden beállítás visszaáll az alapértékre. Megmarad: a nyelv, a kiválasztott szimulátor, az UART-port és a billentyűk. A változásokat még menteni kell.</String>
|
||||||
<String key="SettingsRestored">A mentett beállítások visszaállítva</String>
|
<String key="SettingsRestored">A mentett beállítások visszaállítva</String>
|
||||||
<String key="TreeExpanded">kibontva</String>
|
<String key="TreeExpanded">kibontva</String>
|
||||||
<String key="TreeCollapsed">összecsukva</String>
|
<String key="TreeCollapsed">összecsukva</String>
|
||||||
@@ -816,6 +806,7 @@
|
|||||||
<String key="SyntaxIncludeNotClosed">include {1} end nélkül</String>
|
<String key="SyntaxIncludeNotClosed">include {1} end nélkül</String>
|
||||||
<String key="SyntaxTrainsetUnreadable">A(z) {0} szerelvényt nem sikerült beolvasni</String>
|
<String key="SyntaxTrainsetUnreadable">A(z) {0} szerelvényt nem sikerült beolvasni</String>
|
||||||
<String key="SyntaxVehicleUnreadable">A(z) {0} járművet nem sikerült beolvasni</String>
|
<String key="SyntaxVehicleUnreadable">A(z) {0} járművet nem sikerült beolvasni</String>
|
||||||
|
<String key="SyntaxVehicleMissing">A(z) {0} jármű hiányzik: nincs dynamic/{1} fájl - a szimulátor kihagyja, a szerelvény rövidebb lesz</String>
|
||||||
<String key="WarehouseUseInScenery">Beillesztés a kijelölt pályaszerelvénybe</String>
|
<String key="WarehouseUseInScenery">Beillesztés a kijelölt pályaszerelvénybe</String>
|
||||||
<String key="WarehouseAppendToScenery">Hozzáfűzés a kijelölt pályaszerelvényhez</String>
|
<String key="WarehouseAppendToScenery">Hozzáfűzés a kijelölt pályaszerelvényhez</String>
|
||||||
<String key="ShortcutUndo">Szerelvénymódosítás visszavonása</String>
|
<String key="ShortcutUndo">Szerelvénymódosítás visszavonása</String>
|
||||||
@@ -830,7 +821,6 @@
|
|||||||
<String key="Ini.loadinglog">Napló megjelenítése betöltés közben</String>
|
<String key="Ini.loadinglog">Napló megjelenítése betöltés közben</String>
|
||||||
<String key="Ini.captureonstart">Induláskor az egér a kamerát forgatja</String>
|
<String key="Ini.captureonstart">Induláskor az egér a kamerát forgatja</String>
|
||||||
<String key="Ini.mousecontrol">Vezetőfülke kezelőszerveinek kattintása egérrel</String>
|
<String key="Ini.mousecontrol">Vezetőfülke kezelőszerveinek kattintása egérrel</String>
|
||||||
<String key="Ini.fullscreenmonitor">Teljes képernyős monitor</String>
|
|
||||||
<String key="Ini.screenshotsdir">Képernyőképek mappája</String>
|
<String key="Ini.screenshotsdir">Képernyőképek mappája</String>
|
||||||
<String key="Ini.basedrawrange">Alap megjelenítési távolság</String>
|
<String key="Ini.basedrawrange">Alap megjelenítési távolság</String>
|
||||||
<String key="Ini.targetfps">Cél képkockasebesség</String>
|
<String key="Ini.targetfps">Cél képkockasebesség</String>
|
||||||
@@ -869,8 +859,8 @@
|
|||||||
<String key="PresetHigh">Magas</String>
|
<String key="PresetHigh">Magas</String>
|
||||||
<String key="PresetCustom">Egyéni</String>
|
<String key="PresetCustom">Egyéni</String>
|
||||||
<String key="MonitorRate">Monitor: {0} Hz</String>
|
<String key="MonitorRate">Monitor: {0} Hz</String>
|
||||||
<String key="MonitorRateNamed">{0} kijelző: legfeljebb {1} Hz</String>
|
|
||||||
<String key="MonitorRateUse">{0} FPS beállítása</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">Vidd az egeret a szintre az értékekhez.</String>
|
||||||
<String key="TextureBaseDateHint">ÉÉÉÉ-HH-NN</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="LanguageStarterMissing">Nincs fordítás az indítóhoz: angol marad. A szimulátor ezt a nyelvet kapja.</String>
|
||||||
@@ -928,73 +918,12 @@
|
|||||||
<String key="WarehouseSaved">A raktárban: {0}</String>
|
<String key="WarehouseSaved">A raktárban: {0}</String>
|
||||||
<String key="WarehouseNothingToAdd">Válassz járműveket tartalmazó szerelvényt</String>
|
<String key="WarehouseNothingToAdd">Válassz járműveket tartalmazó szerelvényt</String>
|
||||||
<String key="GfxGroupLevelTip">Csak a grafika ezen részének szintje</String>
|
<String key="GfxGroupLevelTip">Csak a grafika ezen részének szintje</String>
|
||||||
<String key="REVulkan">Vulkan 1.4</String>
|
|
||||||
<String key="IdleVulkanOnly">Csak Vulkannal működik.</String>
|
|
||||||
<String key="DlssPreset">DLSS előbeállítás</String>
|
|
||||||
<String key="FrameGeneration">Képkocka-generálás</String>
|
|
||||||
<String key="Reflex">NVIDIA Reflex</String>
|
|
||||||
<String key="RayTracing">Sugárkövetéses tükröződés</String>
|
|
||||||
<String key="RayTracingRange">Sugárkövetés hatótávja</String>
|
|
||||||
<String key="VulkanDevice">Videokártya (Vulkan)</String>
|
|
||||||
<String key="Ssr">Képernyőtéri tükröződés (SSR)</String>
|
|
||||||
<String key="AmbientOcclusion">Környezeti kitakarás</String>
|
|
||||||
<String key="AmbientOcclusionQuality">Kitakarás minősége</String>
|
|
||||||
<String key="AoLighting">Kitakarás a környezeti fényben</String>
|
|
||||||
<String key="LightsClustered">Klaszteres megvilágítás</String>
|
|
||||||
<String key="LightShadows">Lámpák és fényszórók árnyéka</String>
|
|
||||||
<String key="ContactShadows">Kontaktárnyékok</String>
|
|
||||||
<String key="ShadowSdsm">Jelenethez igazított árnyékkaszkádok (SDSM)</String>
|
|
||||||
<String key="CabProbe">Fülkeszonda</String>
|
|
||||||
<String key="CabProbeInterval">Szonda frissítése N képkockánként</String>
|
|
||||||
<String key="CabProbeReflections">A fülke önmagát tükrözi</String>
|
|
||||||
<String key="CabProbeBounce">A fülkelámpa visszavert fénye</String>
|
|
||||||
<String key="FogQuality">Köd minősége</String>
|
|
||||||
<String key="Clouds">Térfogati felhők</String>
|
|
||||||
<String key="CloudShadows">Felhők árnyéka a talajon</String>
|
|
||||||
<String key="Grass">Fű</String>
|
|
||||||
<String key="GrassDistance">Fű hatótávja</String>
|
|
||||||
<String key="GrassDensity">Fű sűrűsége</String>
|
|
||||||
<String key="Precipitation">Csapadék (részecskék)</String>
|
|
||||||
<String key="Bloom">Világos részek ragyogása (bloom)</String>
|
|
||||||
<String key="AutoExposure">Automatikus expozíció</String>
|
|
||||||
<String key="LevelOff">Ki</String>
|
|
||||||
<String key="LevelLow">Alacsony</String>
|
|
||||||
<String key="LevelMedium">Közepes</String>
|
|
||||||
<String key="LevelHigh">Magas</String>
|
|
||||||
<String key="LevelUltra">Ultra</String>
|
|
||||||
<String key="ReflexOn">Be</String>
|
|
||||||
<String key="ReflexBoost">Be + boost</String>
|
|
||||||
<String key="AaTaa">TAA</String>
|
|
||||||
<String key="AaDlss">DLSS (felskálázás)</String>
|
|
||||||
<String key="AaDlaa">DLAA (natív felbontás)</String>
|
|
||||||
<String key="DlssPresetDefault">Automatikus</String>
|
|
||||||
<String key="DlssPresetK">K: legjobb minőség</String>
|
|
||||||
<String key="DlssPresetJ">J: kevesebb elmosódás</String>
|
|
||||||
<String key="DlssPresetM">M: Teljesítmény módhoz</String>
|
|
||||||
<String key="DlssPresetL">L: Ultra teljesítményhez</String>
|
|
||||||
<String key="Effects">Effektek</String>
|
<String key="Effects">Effektek</String>
|
||||||
<String key="GfxColImage">Felbontás és élsimítás</String>
|
<String key="GfxColImage">Felbontás és élsimítás</String>
|
||||||
<String key="GfxColLights">Világítás</String>
|
<String key="GfxColLights">Világítás</String>
|
||||||
<String key="GfxColPostFx">Utófeldolgozás</String>
|
<String key="GfxColPostFx">Utófeldolgozás</String>
|
||||||
<String key="GfxColNature">Füst</String>
|
<String key="GfxColNature">Füst</String>
|
||||||
<String key="AntiAliasing">Élsimítás</String>
|
<String key="AntiAliasing">Élsimítás</String>
|
||||||
<String key="VolumetricFog">Térfogati köd</String>
|
|
||||||
<String key="REOpenGLNote">A DLSS, a képkocka-generálás, a Reflex és a ray tracing csak Vulkannal működik.</String>
|
|
||||||
<String key="REVulkanNote">Vulkanos exe és azt támogató kártya kell hozzá. Különben a szimulátor a Teljeset vagy a Régit indítja.</String>
|
|
||||||
<String key="VulkanDeviceAuto">automatikus</String>
|
|
||||||
<String key="DlssPresetInfoDefault">K a DLAA, a Minőség és a Kiegyensúlyozott módhoz, M a Teljesítményhez, L az Ultra teljesítményhez. Az illesztőprogram frissítéskor módosíthatja.</String>
|
|
||||||
<String key="DlssPresetInfoK">A legjobb képminőségű transformer modell, de a legdrágább. Alapértelmezett a DLAA, a Minőség és a Kiegyensúlyozott módhoz.</String>
|
|
||||||
<String key="DlssPresetInfoJ">A K-hoz hasonló: kevesebb szellemkép a mozgó tárgyak mögött, több villogással. Az NVIDIA inkább a K-t ajánlja.</String>
|
|
||||||
<String key="DlssPresetInfoM">A Teljesítmény módhoz (kb. 50%-os méretezés) való modell, ott alapértelmezett. A kép expozícióját maga számolja.</String>
|
|
||||||
<String key="DlssPresetInfoL">Az Ultra teljesítmény módhoz (kb. 33%-os méretezés) való modell, ott alapértelmezett. A kép expozícióját maga számolja.</String>
|
|
||||||
<String key="DlssMissingLibraryNote">A szimulátor mellett nincs {0}: e könyvtár nélkül a szimulátor nem használja ezt a DLSS-funkciót.</String>
|
|
||||||
<String key="DlssNoPlatformNote">macOS-en a DLSS nem érhető el.</String>
|
|
||||||
<String key="FrameGenerationNeedsDlssNote">A képkocka-generálás csak DLSS-sel vagy DLAA-val működik.</String>
|
|
||||||
<String key="ReflexForcedNote">A képkocka-generálás magától bekapcsolja a Reflexet, bármi van itt kiválasztva.</String>
|
|
||||||
<String key="AoLightingPrepassNote">A teljes jelenet mélysége kell a szín előtt; SSR és kontaktárnyékok nélkül ez egy külön menet (CPU-terhelés OpenGL-ben).</String>
|
|
||||||
<String key="AoNeedsPipelineNote">Kihagyott utófeldolgozásnál az AO nem működik.</String>
|
|
||||||
<String key="CabProbeReflectionsOnlyNote">Klaszteres megvilágítás és a fülkelámpa mint fény (gfx.lights.cab) nélkül a szonda csak tükröződést ad.</String>
|
|
||||||
<String key="TemporalNeedsPipelineNote">A TAA és a DLSS az utófeldolgozásban fut: ha kihagyod, az élek nem simulnak ki.</String>
|
|
||||||
<String key="SettingsFile">eu07.ini fájl</String>
|
<String key="SettingsFile">eu07.ini fájl</String>
|
||||||
<String key="ImportIni">Importálás…</String>
|
<String key="ImportIni">Importálás…</String>
|
||||||
<String key="ImportIniTitle">Beállítások importálása az eu07.ini fájlból</String>
|
<String key="ImportIniTitle">Beállítások importálása az eu07.ini fájlból</String>
|
||||||
@@ -1007,9 +936,8 @@
|
|||||||
{0}</String>
|
{0}</String>
|
||||||
<String key="ExportIniDone">Exportálva ide: {0}</String>
|
<String key="ExportIniDone">Exportálva ide: {0}</String>
|
||||||
<String key="REFull">Teljes</String>
|
<String key="REFull">Teljes</String>
|
||||||
<String key="REOld">Régi</String>
|
<String key="REOld">Régi (nem ajánlott, ha a Teljes működik)</String>
|
||||||
<String key="RESimp">Egyszerűsített</String>
|
<String key="RESimp">Egyszerűsített (nem ajánlott, ha a Teljes működik)</String>
|
||||||
<String key="REExperimental">Kísérleti</String>
|
|
||||||
<String key="RenderAngleVulkan">ANGLE Vulkan megjelenítő használata</String>
|
<String key="RenderAngleVulkan">ANGLE Vulkan megjelenítő használata</String>
|
||||||
<String key="RenderVBO">VBO megjelenítés</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="CabShadowsRange">Vezetőállás árnyékforrásainak hatótávolsága</String>
|
||||||
@@ -1017,6 +945,4 @@
|
|||||||
<String key="UseGLESDesc">OpenGL ES az OpenGL helyett. A legacy megjelenítővel nem működik.</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="GpuCard">{0}, {1} GB</String>
|
||||||
<String key="GpuCardShared">{0}, megosztott memória</String>
|
<String key="GpuCardShared">{0}, megosztott memória</String>
|
||||||
<String key="GfxColNewRenderer">OpenGL 4.6 / Vulkan újdonságok</String>
|
|
||||||
<String key="GfxNewRendererNote">Csak az új exe-vel működnek. A régebbi exe kihagyja ezeket a beállításokat.</String>
|
|
||||||
</Language>
|
</Language>
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
<String key="StartNoScenery">Wybierz scenerię</String>
|
<String key="StartNoScenery">Wybierz scenerię</String>
|
||||||
<String key="StartNoTrain">Wybierz skład</String>
|
<String key="StartNoTrain">Wybierz skład</String>
|
||||||
<String key="StartNoStaff">Brak obsady / pasażera</String>
|
<String key="StartNoStaff">Brak obsady / pasażera</String>
|
||||||
|
<String key="StartDecor">Skład dekoracyjny</String>
|
||||||
|
<String key="StartAi">Skład AI</String>
|
||||||
<String key="StartNoStaffTitle">Skład bez obsady</String>
|
<String key="StartNoStaffTitle">Skład bez obsady</String>
|
||||||
<String key="StartNoStaffConfirm">Skład nie ma obsady ani pasażera — nie będzie czym kierować. Uruchomić mimo to?</String>
|
<String key="StartNoStaffConfirm">Skład nie ma obsady ani pasażera — nie będzie czym kierować. Uruchomić mimo to?</String>
|
||||||
<String key="RestoreWeather">Przywróć pogodę</String>
|
<String key="RestoreWeather">Przywróć pogodę</String>
|
||||||
@@ -260,8 +262,8 @@
|
|||||||
<String key="ConsistLoadTools">Ładunki zestawienia</String>
|
<String key="ConsistLoadTools">Ładunki zestawienia</String>
|
||||||
<String key="ConsistReady">Skład gotowy do jazdy</String>
|
<String key="ConsistReady">Skład gotowy do jazdy</String>
|
||||||
<String key="ConsistReadyDesc">Skład startuje przygotowany: przewód główny napełniony, kran maszynisty ustawiony, akumulatory załączone. Odznaczony startuje zimny i zahamowany.</String>
|
<String key="ConsistReadyDesc">Skład startuje przygotowany: przewód główny napełniony, kran maszynisty ustawiony, akumulatory załączone. Odznaczony startuje zimny i zahamowany.</String>
|
||||||
<String key="ReadyOverride">Wymuś stan składu przy starcie</String>
|
<String key="ReadyOverride">Stan składu przy starcie</String>
|
||||||
<String key="ReadyOverrideDesc">Nadpisuje pole „Skład gotowy do jazdy” w zajezdni dla każdego uruchamianego scenariusza.</String>
|
<String key="ReadyOverrideDesc">Każdy uruchamiany skład będzie zimny albo gotowy do jazdy, niezależnie od scenariusza.</String>
|
||||||
<String key="ReadyOverrideScenery">Jak w scenerii</String>
|
<String key="ReadyOverrideScenery">Jak w scenerii</String>
|
||||||
<String key="ReadyOverrideCold">Zawsze zimny</String>
|
<String key="ReadyOverrideCold">Zawsze zimny</String>
|
||||||
<String key="ReadyOverrideReady">Zawsze gotowy</String>
|
<String key="ReadyOverrideReady">Zawsze gotowy</String>
|
||||||
@@ -355,22 +357,23 @@
|
|||||||
<String key="General">Ogólne</String>
|
<String key="General">Ogólne</String>
|
||||||
|
|
||||||
<String key="Language">Język</String>
|
<String key="Language">Język</String>
|
||||||
<String key="LanguageDesc">Także język symulatora. Zapisywany od razu po wybraniu.</String>
|
<String key="LanguageDesc">Język startera i symulatora. Zmiana zapisuje się od razu.</String>
|
||||||
|
<String key="UnknownIniValue">Wartość w eu07.ini jest nieznana: „{0}”. Zostaje w pliku, dopóki tego nie zmienisz.</String>
|
||||||
<String key="LanguageSimMissing">Symulator nie ma tłumaczenia na ten język i uruchomi się po angielsku.</String>
|
<String key="LanguageSimMissing">Symulator nie ma tłumaczenia na ten język i uruchomi się po angielsku.</String>
|
||||||
<String key="Fullscreen">Tryb pełnoekranowy</String>
|
<String key="PauseSimInactive">Pauza, gdy okno nieaktywne</String>
|
||||||
<String key="PauseSimInactive">Wstrzymaj symulację, gdy okno nie jest aktywne</String>
|
|
||||||
<String key="PauseSimStart">Pauza po uruchomieniu</String>
|
<String key="PauseSimStart">Pauza po uruchomieniu</String>
|
||||||
<String key="CursorSensitivity">Czułość obrotu kamery (oś pozioma)</String>
|
<String key="CursorSensitivity">Czułość myszy</String>
|
||||||
<String key="MouseHorInvert">Inwersja myszy w poziomie</String>
|
<String key="MouseHorInvert">Odwróć mysz w poziomie</String>
|
||||||
<String key="MouseVertInvert">Inwersja myszy w pionie</String>
|
<String key="MouseVertInvert">Odwróć mysz w pionie</String>
|
||||||
|
|
||||||
<String key="Communication">Urządzenia zewnętrzne</String>
|
<String key="Communication">Urządzenia zewnętrzne</String>
|
||||||
|
|
||||||
<String key="GamepadSignalIgnore">Ignoruj sterowanie z gamepada</String>
|
<String key="GamepadSignalIgnore">Ignoruj gamepad</String>
|
||||||
<String key="GamepadSignalIgnoreDesc">Wyłącza obsługę gamepada, nawet gdy jest podłączony.</String>
|
<String key="ConfirmGamepadUse">Zalecane i domyślne jest ignorowanie gamepada. Włączenie jego obsługi bywa źródłem problemów ze sterowaniem. Zmieniaj tylko, jeśli naprawdę sterujesz gamepadem. Zmienić?</String>
|
||||||
|
<String key="GamepadSignalIgnoreDesc">Zalecane. Symulator nie reaguje na gamepada, nawet podłączonego.</String>
|
||||||
|
|
||||||
<String key="Feedback">Informacja zwrotna</String>
|
<String key="Feedback">Informacja zwrotna</String>
|
||||||
<String key="FeedbackDesc">Sposób przekazywania sygnałów kabinowych na zewnętrzny pulpit. Tryby klawiatury migają diodami: (1) Caps Lock = CA lub SHP, Scroll Lock = jazda na oporach; (2) Caps Lock = CA, Scroll Lock = SHP. Pozostałe tryby wymagają interfejsu LPT, PoKeys55 lub portu szeregowego.</String>
|
<String key="FeedbackDesc">Sygnalizacja z kabiny na zewnętrznym pulpicie albo diodach klawiatury (Caps Lock, Scroll Lock).</String>
|
||||||
<String key="FeedbackOff">Wyłączona</String>
|
<String key="FeedbackOff">Wyłączona</String>
|
||||||
<String key="FeedbackCASHP">Klawiatura: Caps = CA+SHP, Scroll = opory</String>
|
<String key="FeedbackCASHP">Klawiatura: Caps = CA+SHP, Scroll = opory</String>
|
||||||
<String key="FeedbackCA">Klawiatura: Caps = CA, Scroll = SHP</String>
|
<String key="FeedbackCA">Klawiatura: Caps = CA, Scroll = SHP</String>
|
||||||
@@ -378,11 +381,11 @@
|
|||||||
<String key="FeedbackPoKeys">PoKeys55 (USB)</String>
|
<String key="FeedbackPoKeys">PoKeys55 (USB)</String>
|
||||||
<String key="FeedbackSP">COM / port szeregowy</String>
|
<String key="FeedbackSP">COM / port szeregowy</String>
|
||||||
|
|
||||||
<String key="FeedbackPort">Adres portu LPT</String>
|
<String key="FeedbackPort">Adres LPT</String>
|
||||||
<String key="FeedbackPortDesc">Adres portu LPT używanego przez wybrany tryb informacji zwrotnej.</String>
|
<String key="FeedbackPortDesc">Adres portu LPT pulpitu.</String>
|
||||||
|
|
||||||
<String key="UartSection">Konfiguracja UART</String>
|
<String key="UartSection">UART</String>
|
||||||
<String key="UartEnable">Włącz komunikację UART</String>
|
<String key="UartEnable">Włącz UART</String>
|
||||||
<String key="UartPort">Port szeregowy</String>
|
<String key="UartPort">Port szeregowy</String>
|
||||||
<String key="UartTune">Kalibracja</String>
|
<String key="UartTune">Kalibracja</String>
|
||||||
<String key="UartBaud">Prędkość (baud)</String>
|
<String key="UartBaud">Prędkość (baud)</String>
|
||||||
@@ -391,7 +394,7 @@
|
|||||||
<String key="UartPortMissing">Bez portu UART zostanie wyłączony.</String>
|
<String key="UartPortMissing">Bez portu UART zostanie wyłączony.</String>
|
||||||
<String key="UartTunePlaceholder">puste = wartości symulatora</String>
|
<String key="UartTunePlaceholder">puste = wartości symulatora</String>
|
||||||
<String key="UartTuneInvalid">To nie jest {0} liczb: kalibracja nie zostanie zapisana.</String>
|
<String key="UartTuneInvalid">To nie jest {0} liczb: kalibracja nie zostanie zapisana.</String>
|
||||||
<String key="UartDebug">Wypisuj dane debugowania w konsoli</String>
|
<String key="UartDebug">Debug w konsoli</String>
|
||||||
<String key="UartMain">Nastawnik główny</String>
|
<String key="UartMain">Nastawnik główny</String>
|
||||||
<String key="UartScnd">Nastawnik manewrowy/pomocniczy</String>
|
<String key="UartScnd">Nastawnik manewrowy/pomocniczy</String>
|
||||||
<String key="UartTrain">Hamulec zespolony</String>
|
<String key="UartTrain">Hamulec zespolony</String>
|
||||||
@@ -400,47 +403,40 @@
|
|||||||
<String key="UartRadioChannel">Kanał radiotelefonu</String>
|
<String key="UartRadioChannel">Kanał radiotelefonu</String>
|
||||||
|
|
||||||
<String key="Others">Inne</String>
|
<String key="Others">Inne</String>
|
||||||
<String key="SelectEXE">Wybór exe</String>
|
<String key="SelectEXE">Plik exe</String>
|
||||||
<String key="SelectEXEAuto">Wybierz automatycznie</String>
|
<String key="SelectEXEAuto">Wybierz automatycznie</String>
|
||||||
<String key="SelectEXEBrowse">Wybierz plik…</String>
|
<String key="SelectEXEBrowse">Wybierz plik…</String>
|
||||||
<String key="SelectEXEBrowseTitle">Wskaż plik wykonywalny symulatora</String>
|
<String key="SelectEXEBrowseTitle">Wskaż plik wykonywalny symulatora</String>
|
||||||
<String key="SelectEXEUseAnyway">Użyć go mimo to?</String>
|
<String key="SelectEXEUseAnyway">Użyć go mimo to?</String>
|
||||||
<String key="DebugMode">Tryb testowy</String>
|
<String key="DebugMode">Tryb testowy</String>
|
||||||
<String key="DebugModeDesc">Odblokowuje menu debug, dodatkowe panele i skróty testowe.</String>
|
<String key="DebugModeDesc">Menu debugowania i skróty testowe w symulatorze.</String>
|
||||||
<String key="VirtualShunting">Wirtualny manewrowy</String>
|
<String key="VirtualShunting">Wirtualny manewrowy</String>
|
||||||
<String key="VirtualShuntingDesc">Włącza asystenta AI do sprzęgania, rozprzęgania i prostych manewrów, gdy pojazd stoi.</String>
|
<String key="VirtualShuntingDesc">Asystent AI sprzęga, rozprzęga i robi proste manewry, gdy pojazd stoi.</String>
|
||||||
<String key="LogMissingVehicleFiles">Zapisuj w logu brakujące pliki pojazdów podczas eksportu</String>
|
<String key="LogMissingVehicleFiles">Loguj brakujące pojazdy</String>
|
||||||
<String key="LogMissingVehicleFilesDesc">Zapisuje w logu pojazdy, których starter nie znalazł.</String>
|
<String key="LogMissingVehicleFilesDesc">Przy eksporcie zapisuje w logu pojazdy, których brakuje.</String>
|
||||||
|
|
||||||
<String key="Graphic">Grafika</String>
|
<String key="Graphic">Grafika</String>
|
||||||
<String key="RenderEngine">Silnik renderowania</String>
|
<String key="RenderEngine">Renderer</String>
|
||||||
<String key="RenderEngineDesc">Pełny działa z każdym exe. Stary, Uproszczony i Eksperymentalny tylko ze starszymi exe, nowy włączy zamiast nich Pełny.</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="REExperimentalWarning">Uwaga: renderer eksperymentalny może działać niestabilnie, nie pokazywać części obiektów albo nie uruchomić się na niektórych kartach graficznych. Gdy symulator nie startuje lub wygląda źle, wróć do renderera „Pełny”.</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="GpuChoice">Karta graficzna (Linux)</String>
|
<String key="GpuChoice">Karta graficzna</String>
|
||||||
<String key="GpuDiscrete">Wydajniejsza (dedykowana)</String>
|
<String key="GpuDiscrete">Dedykowana</String>
|
||||||
<String key="GpuSystem">Jak system</String>
|
<String key="GpuSystem">Systemowa</String>
|
||||||
<String key="GpuNoteTarget">Wykryto: {0}. Symulator ruszy na: {1}.</String>
|
<String key="GpuNoteTarget">Wykryto: {0}. Symulator ruszy na: {1}.</String>
|
||||||
<String key="GpuNoteNone">Wykryto: {0}. Ekran prowadzi już właściwa karta – starter nic nie zmienia.</String>
|
<String key="GpuNoteNone">Wykryto: {0}. Ekran prowadzi już właściwa karta – starter nic nie zmienia.</String>
|
||||||
<String key="GpuNoteSystem">Wykryto: {0}. Kartę wybierze system, zwykle zintegrowaną.</String>
|
<String key="GpuNoteSystem">Wykryto: {0}. Kartę wybierze system, zwykle zintegrowaną.</String>
|
||||||
<String key="GpuNotePlayer">Wykryto: {0}. Kartę wybierają zmienne środowiskowe ({1}); starter ich nie zmienia.</String>
|
<String key="GpuNotePlayer">Wykryto: {0}. Kartę wybierają zmienne środowiskowe ({1}); starter ich nie zmienia.</String>
|
||||||
<String key="GpuNoteOne">Jedna karta: {0} – nie ma między czym wybierać.</String>
|
<String key="GpuNoteOne">Jedna karta: {0} – nie ma między czym wybierać.</String>
|
||||||
<String key="GpuNoteUnread">Nie udało się odczytać kart graficznych z /sys/class/drm.</String>
|
<String key="GpuNoteUnread">Nie udało się odczytać kart graficznych z /sys/class/drm.</String>
|
||||||
<String key="IdleWindowsBuildOnly">Działa tylko w wersji symulatora dla Windows.</String>
|
|
||||||
<String key="IdleLegacyRendererOnly">Czyta to tylko renderer legacy, a wybrany jest inny.</String>
|
|
||||||
<String key="IdleNeedsFrameRateTarget">Działa tylko z docelową liczbą klatek (targetfps).</String>
|
|
||||||
<String key="IdleOpenGlRenderersOnly">Renderer eksperymentalny tego nie czyta.</String>
|
|
||||||
<String key="IdleModernRendererOnly">Czyta to tylko renderer pełny, a wybrany jest inny.</String>
|
|
||||||
<String key="IdleNeedsNetworkServer">Pauza w tle działa tylko z serwerem sieciowym (network.server).</String>
|
|
||||||
|
|
||||||
<String key="Resolution">Rozdzielczość</String>
|
<String key="Resolution">Rozdzielczość</String>
|
||||||
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
<String key="ResolutionOnMonitor">{0} (monitor)</String>
|
||||||
<String key="IdleMonitorMode">Nie działa przy automatycznej rozdzielczości.</String>
|
|
||||||
<String key="BufforResolution">Rozdzielczość bufora</String>
|
<String key="BufforResolution">Rozdzielczość bufora</String>
|
||||||
<String key="BufforResolutionDesc">Skaluje wewnętrzny bufor renderowania względem rozdzielczości okna.</String>
|
<String key="BufforResolutionDesc">W jakiej rozdzielczości rysowany jest obraz. Poniżej 100% szybciej, ale mniej ostro.</String>
|
||||||
<String key="MaxTexResolution">Maksymalna rozdzielczość tekstur</String>
|
<String key="MaxTexResolution">Tekstury</String>
|
||||||
<String key="MaxTexCabResolution">Maksymalna rozdzielczość tekstur kabiny</String>
|
<String key="MaxTexCabResolution">Tekstury kabiny</String>
|
||||||
<String key="TexFilteringQuality">Jakość filtrowania tekstur</String>
|
<String key="TexFilteringQuality">Filtrowanie tekstur</String>
|
||||||
<String key="TexFilteringQualityDesc">Ostrość tekstur oglądanych pod kątem, np. torów. Nawet x16 kosztuje niewiele.</String>
|
<String key="TexFilteringQualityDesc">Ostrość tekstur widzianych pod kątem, np. torów. Mało obciąża kartę.</String>
|
||||||
<String key="QualityVeryLow">Bardzo niska</String>
|
<String key="QualityVeryLow">Bardzo niska</String>
|
||||||
<String key="QualityLow">Niska</String>
|
<String key="QualityLow">Niska</String>
|
||||||
<String key="QualityNormal">Normalna</String>
|
<String key="QualityNormal">Normalna</String>
|
||||||
@@ -456,149 +452,132 @@
|
|||||||
<String key="RangeHigh">Wysoki</String>
|
<String key="RangeHigh">Wysoki</String>
|
||||||
<String key="RangeVeryHigh">Bardzo wysoki</String>
|
<String key="RangeVeryHigh">Bardzo wysoki</String>
|
||||||
<String key="RangeDisabled">Wyłączone</String>
|
<String key="RangeDisabled">Wyłączone</String>
|
||||||
<String key="DynamicLights">Dynamiczne źródła światła</String>
|
<String key="DynamicLights">Źródła światła</String>
|
||||||
<String key="DynamicLightsDesc">Maksymalna liczba jednoczesnych źródeł światła dynamicznego.</String>
|
<String key="DynamicLightsDesc">Ile świateł, np. reflektorów, może naraz oświetlać otoczenie.</String>
|
||||||
<String key="RenderRange">Wydłużanie zasięgu (maks.)</String>
|
<String key="RenderRange">Maks. wydłużenie zasięgu</String>
|
||||||
<String key="RenderRangeDesc">Ile razy symulator może wydłużyć zasięg, gdy klatek jest z zapasem. W pełnym rendererze w kwadracie: ×3 to do ×9.</String>
|
<String key="RenderRangeDesc">O ile symulator może wydłużyć zasięg rysowania, gdy ma zapas klatek. Działa z docelowym FPS.</String>
|
||||||
<String key="FpsLimitOff">Bez limitu</String>
|
<String key="FpsLimitOff">Bez limitu</String>
|
||||||
<String key="FpsLimit">Limit klatek na sekundę</String>
|
<String key="FpsLimit">Limit FPS</String>
|
||||||
<String key="FpsLimitDesc">Mniej klatek to chłodniejszy i cichszy komputer. Z V-Sync limit powyżej odświeżania nic nie daje.</String>
|
<String key="FpsLimitDesc">Mniej klatek to chłodniejszy i cichszy komputer.</String>
|
||||||
<String key="ShadowAngleLimit">Limit długości cienia</String>
|
<String key="ShadowAngleLimit">Długość cieni</String>
|
||||||
<String key="ShadowAngleLimitDesc">Skraca długie cienie rzucane przez nisko stojące słońce. Wyższe wartości ucinają je wcześniej.</String>
|
<String key="ShadowAngleLimitDesc">Skraca długie cienie przy nisko stojącym słońcu.</String>
|
||||||
<String key="ShadowLimitShort">Skrócone</String>
|
<String key="ShadowLimitShort">Skrócone</String>
|
||||||
<String key="FullscreenWindowed">Automatyczna rozdzielczość (pełny ekran bez obramowania)</String>
|
<String key="DisplayMode">Tryb wyświetlania</String>
|
||||||
|
<String key="DisplayModeFullscreen">Pełny ekran</String>
|
||||||
|
<String key="DisplayModeBorderless">Pełny ekran bez ramki</String>
|
||||||
|
<String key="DisplayModeWindow">Okno</String>
|
||||||
|
<String key="DisplayModeDesc">Pełny ekran bez ramki bierze rozdzielczość monitora i szybciej przełącza do innych programów.</String>
|
||||||
|
<String key="FullscreenMonitor">Monitor</String>
|
||||||
|
<String key="FullscreenMonitorDesc">Na którym monitorze otworzy się symulator w trybie pełnoekranowym.</String>
|
||||||
|
<String key="MonitorPrimary">Główny</String>
|
||||||
<String key="VSync">VSync</String>
|
<String key="VSync">VSync</String>
|
||||||
<String key="VSyncDesc">Synchronizacja klatek z odświeżaniem monitora.</String>
|
<String key="VSyncDesc">Zgrywa klatki z odświeżaniem monitora i usuwa rwanie obrazu.</String>
|
||||||
<String key="SmokeDisplay">Wyświetlanie dymu</String>
|
<String key="SmokeDisplay">Dym</String>
|
||||||
<String key="SmokeParticlesMultiplier">Mnożnik ilości cząsteczek dymu</String>
|
<String key="SmokeParticlesMultiplier">Ilość dymu</String>
|
||||||
|
|
||||||
<String key="ChromaticAberration">Aberracja chromatyczna</String>
|
<String key="ChromaticAberration">Aberracja chromatyczna</String>
|
||||||
<String key="MotionBlur">Rozmycie podczas ruchu</String>
|
<String key="MotionBlur">Rozmycie ruchu</String>
|
||||||
<String key="AdditionalShadersEffects">Dodatkowe efekty shaderów</String>
|
<String key="AdditionalShadersEffects">Dodatkowe efekty shaderów</String>
|
||||||
<String key="ReflectionsCubeMap">Odbicia jako cubemapa</String>
|
<String key="ReflectionsCubeMap">Odbicia</String>
|
||||||
<String key="ReflectionsCubeMapDesc">Renderuje odbicia do mapy sześciennej, dzięki czemu powierzchnie odbijają otoczenie ze wszystkich stron.</String>
|
<String key="ReflectionsCubeMapDesc">Powierzchnie odbijają otoczenie.</String>
|
||||||
<String key="SkipPipeline">Uproszczony odczyt głębi (zgodność)</String>
|
<String key="SkipPipeline">SkipPipeline</String>
|
||||||
<String key="SkipPipelineDesc">Alternatywna ścieżka odczytu bufora głębi przy MSAA; włącz przy problemach z kompatybilnością karty graficznej.</String>
|
<String key="SkipPipelineDesc">Rysuje prosto do okna, bez obróbki obrazu: znika rozmycie ruchu i inne efekty końcowe. Włącz tylko przy błędach obrazu.</String>
|
||||||
<String key="RenderShadows">Renderowanie cieni</String>
|
<String key="RenderShadows">Rysuj cienie</String>
|
||||||
<String key="ReflectionsFramerate">Odświeżanie odbić</String>
|
<String key="ReflectionsFramerate">Odświeżanie odbić</String>
|
||||||
<String key="ReflectionsFramerateDesc">Jak często odświeżać odbicia. Rzadziej to więcej klatek.</String>
|
<String key="ReflectionsFramerateDesc">Rzadsze odświeżanie odbić to więcej FPS.</String>
|
||||||
<String key="EveryMinutes">co {0} min</String>
|
<String key="EveryMinutes">co {0} min</String>
|
||||||
<String key="EverySeconds">co {0} s</String>
|
<String key="EverySeconds">co {0} s</String>
|
||||||
<String key="TimesPerSecond">{0}× na s</String>
|
<String key="TimesPerSecond">{0}× na s</String>
|
||||||
<String key="ShadowsResolution">Rozdzielczość cieni</String>
|
<String key="ShadowsResolution">Rozdzielczość cieni</String>
|
||||||
<String key="ShaderRange">Zasięg cieni</String>
|
<String key="ShaderRange">Zasięg cieni</String>
|
||||||
<String key="ShaderRangeDesc">Jak daleko sięgają cienie; im dalej, tym mniej ostre. Po strzałce zasięg rzeczywisty.</String>
|
<String key="ShaderRangeDesc">Jak daleko widać cienie. Dalej to mniej ostre cienie.</String>
|
||||||
|
|
||||||
<String key="ShadowDisplay">Wyświetlanie cieni</String>
|
<String key="ShadowDisplay">Obiekty z cieniem</String>
|
||||||
<String key="ShadowDisplayDesc">Określa, które obiekty rzucają cień według priorytetu materiału. Niższa wartość = mniej cieni, wyższa wydajność.</String>
|
<String key="ShadowDisplayDesc">Mniej obiektów z cieniem to więcej FPS.</String>
|
||||||
<String key="CSROnlyImportant">Tylko ważne</String>
|
<String key="CSROnlyImportant">Tylko ważne</String>
|
||||||
<String key="CSRLimited">Ograniczone</String>
|
<String key="CSRLimited">Ograniczone</String>
|
||||||
<String key="CSRAll">Wszystkie</String>
|
<String key="CSRAll">Wszystkie</String>
|
||||||
|
|
||||||
<String key="ReflectionsDetails">Szczegółowość odbić</String>
|
<String key="ReflectionsDetails">Szczegółowość odbić</String>
|
||||||
<String key="ReflectionsDetailsDesc">Jakie obiekty są renderowane w odbiciach cubemap.</String>
|
<String key="ReflectionsDetailsDesc">Co widać w odbiciach.</String>
|
||||||
<String key="RDTerrain">Tylko geometria terenu</String>
|
<String key="RDTerrain">Teren</String>
|
||||||
<String key="RDTerrainModels">Geometria terenu i modele statyczne</String>
|
<String key="RDTerrainModels">Teren i modele</String>
|
||||||
<String key="RDTerrainModelsVehicles">Geometria terenu, modele statyczne i pojazdy</String>
|
<String key="RDTerrainModelsVehicles">Teren, modele i pojazdy</String>
|
||||||
|
|
||||||
<String key="FieldOfView">Kąt widzenia</String>
|
<String key="FieldOfView">Kąt widzenia</String>
|
||||||
<String key="FieldOfViewDesc">Pionowy kąt widzenia kamery w stopniach (10–75).</String>
|
<String key="FieldOfViewDesc">Pionowy kąt widzenia kamery.</String>
|
||||||
<String key="RenderScreens">Renderowanie ekranów komputerów pokładowych</String>
|
<String key="RenderScreens">Ekrany włączone</String>
|
||||||
<String key="RenderScreensDesc">Włącza ekrany kabinowe obsługiwane przez skrypty Python.</String>
|
<String key="RenderScreensDesc">Ekrany i wyświetlacze w kabinach.</String>
|
||||||
<String key="RenderScreensThread">Renderowanie ekranów w osobnym wątku</String>
|
<String key="RenderScreensThread">Ekrany w osobnym wątku</String>
|
||||||
|
|
||||||
<String key="Physics">Fizyka</String>
|
<String key="Physics">Fizyka</String>
|
||||||
|
|
||||||
<String key="TrackCurvesQuality">Jakość łuków torów</String>
|
<String key="TrackCurvesQuality">Jakość łuków torów</String>
|
||||||
<String key="TrackCurvesQualityDesc">Gęstość podziału łuków torów. Wyższa wartość = gładsze łuki.</String>
|
<String key="TrackCurvesQualityDesc">Wyżej – gładsze łuki torów.</String>
|
||||||
<String key="PhysicsAccuracyIncreased">Zwiększona dokładność fizyki</String>
|
<String key="PhysicsAccuracyIncreased">Dokładniejsza fizyka</String>
|
||||||
<String key="PhysicsAccuracyIncreasedDesc">Uruchamia pełny model fizyki z mniejszym krokiem czasowym.</String>
|
<String key="PhysicsAccuracyIncreasedDesc">Pełny model fizyki z mniejszym krokiem czasu.</String>
|
||||||
<String key="BreakingPantographPossibility">Możliwość złamania pantografu</String>
|
<String key="BreakingPantographPossibility">Łamanie pantografów</String>
|
||||||
<String key="BreakingPantographPossibilityDesc">Wyłączenie chroni pantograf przed uszkodzeniem przy błędnej geometrii sieci.</String>
|
<String key="BreakingPantographPossibilityDesc">Pantograf może się złamać na źle poprowadzonej sieci.</String>
|
||||||
<String key="PowerOverheadLineOnly">Zasilanie tylko pod siecią trakcyjna</String>
|
<String key="PowerOverheadLineOnly">Zasilanie tylko z sieci</String>
|
||||||
<String key="PowerOverheadLineOnlyDesc">Gdy wyłączone, podniesiony pantograf zasila pojazd nawet bez kontaktu z drutem.</String>
|
<String key="PowerOverheadLineOnlyDesc">Pojazd ma prąd tylko wtedy, gdy pantograf dotyka sieci.</String>
|
||||||
<String key="SaveBlackBox">Zapisuj czarną skrzynkę i taśmy prędkościomierza</String>
|
<String key="SaveBlackBox">Czarna skrzynka i taśmy</String>
|
||||||
<String key="SaveBlackBoxDesc">Nagrywa przejazd do jednego pliku w folderze physicslog/ i na bieżąco, co 2 s, zapisuje taśmy (.dat) pojazdów, w których jesteś.</String>
|
<String key="SaveBlackBoxDesc">Zapisuje przejazd i taśmy prędkościomierza pojazdów, którymi jedziesz (folder physicslog).</String>
|
||||||
<String key="SaveTrainTapes">Zapisuj taśmy prędkościomierza wszystkich pociągów</String>
|
<String key="SaveTrainTapes">Taśmy wszystkich pociągów</String>
|
||||||
<String key="SaveTrainTapesDesc">Na bieżąco, co 2 s, zapisuje taśmy (.dat) każdego pociągu scenerii do folderu physicslog/: jedną na maszynistę pojazdów szynowych, bez pojazdów drogowych i pasażerów. Znacznie mniej plików niż log fizyki każdego pojazdu.</String>
|
<String key="SaveTrainTapesDesc">Zapisuje taśmy prędkościomierza wszystkich pociągów na scenerii (folder physicslog).</String>
|
||||||
<String key="SaveSpeedometerTapes">Zapisuj log parametrów fizycznych wszystkich pojazdów</String>
|
<String key="SaveSpeedometerTapes">Log fizyki wszystkich pojazdów</String>
|
||||||
<String key="SaveSpeedometerTapesDesc">Zapisuje log każdego pojazdu scenerii do folderu physicslog/: wiersz co 0,05 s, dopisywany co 2 s. Do diagnostyki: na dużej scenerii to setki plików.</String>
|
<String key="SaveSpeedometerTapesDesc">Szczegółowy log każdego pojazdu, do diagnostyki. Na dużej scenerii to setki plików.</String>
|
||||||
<String key="SaveSimLogs">Zapisuj log z symulacji</String>
|
<String key="SaveSimLogs">Zapisuj log</String>
|
||||||
<String key="KeepPrevLogs">Zachowuj poprzednie logi</String>
|
<String key="KeepPrevLogs">Zachowuj stare logi</String>
|
||||||
<String key="KeepPrevLogsDesc">Tworzy osobny plik logu dla każdej scenerii zamiast nadpisywać errors.txt.</String>
|
<String key="KeepPrevLogsDesc">Osobny log dla każdej scenerii zamiast nadpisywania errors.txt.</String>
|
||||||
<String key="DisplaySimulation">Renderuj obraz 3D</String>
|
<String key="DisplaySimulation">Renderuj obraz 3D</String>
|
||||||
<String key="DisplaySimulationDesc">Wyłączenie pomija rysowanie scenerii (czarny ekran), ale symulacja nadal działa.</String>
|
<String key="DisplaySimulationDesc">Wyłączone: czarny ekran, symulacja działa dalej.</String>
|
||||||
<String key="CrashDamage">Uszkodzenia przy zderzeniu</String>
|
<String key="CrashDamage">Uszkodzenia przy zderzeniu</String>
|
||||||
<String key="CrashDamageDesc">Uszkodzenia sprzęgów i składów przy kolizjach i gwałtownym naciągu.</String>
|
<String key="CrashDamageDesc">Kolizje i szarpnięcia mogą uszkodzić sprzęgi i pojazdy.</String>
|
||||||
<String key="Friction">Mnożnik tarcia</String>
|
<String key="Friction">Tarcie</String>
|
||||||
<String key="FrictionDesc">Mnoży tarcie koła o szynę. 1,00 nie zmienia niczego.</String>
|
<String key="FrictionDesc">Przyczepność kół do szyn. 1,00 – bez zmian.</String>
|
||||||
<String key="BrakeStep">Krok nastawy hamulca zespolonego (Num3/Num9)</String>
|
<String key="BrakeStep">Krok kranu hamulca</String>
|
||||||
<String key="BrakeStepDesc">Mnoży wielkość pojedynczego kroku kranu hamulca zespolonego sterowanego klawiszami Num3 i Num9. 1,00 nie zmienia niczego.</String>
|
<String key="BrakeStepDesc">O ile jedno naciśnięcie klawisza przesuwa kran hamulca zespolonego (poza FV4a). 1,00 – o jedną pozycję.</String>
|
||||||
<String key="BrakeSpeed">Szybkość zaworu FV4a</String>
|
<String key="BrakeSpeed">Szybkość kranu FV4a</String>
|
||||||
<String key="BrakeSpeedDesc">Mnoży szybkość przesuwania kranu hamulca lokomotywy (FV4a) i hamulca lokalnego. 1,00 nie zmienia niczego.</String>
|
<String key="BrakeSpeedDesc">Jak szybko przesuwa się kran FV4a, gdy trzymasz klawisz hamowania. 3,00 – domyślnie w symulatorze.</String>
|
||||||
|
|
||||||
<String key="Sounds">Dźwięk</String>
|
<String key="Sounds">Dźwięk</String>
|
||||||
<String key="EnableSounds">Włącz dźwięk</String>
|
<String key="EnableSounds">Włącz dźwięk</String>
|
||||||
<String key="Volume">Głośność</String>
|
<String key="Volume">Głośność</String>
|
||||||
<String key="RadiophoneVolume">Głośność radiotelefonu</String>
|
<String key="RadiophoneVolume">Radiotelefon</String>
|
||||||
<String key="VehiclesVolume">Głośność pojazdów</String>
|
<String key="VehiclesVolume">Pojazdy</String>
|
||||||
<String key="PositionedSoundsVolume">Głośność dźwięków pozycjonowanych</String>
|
<String key="PositionedSoundsVolume">Dźwięki pozycjonowane</String>
|
||||||
<String key="AmbientVolume">Głośność otoczenia</String>
|
<String key="AmbientVolume">Otoczenie</String>
|
||||||
<String key="SoundDevice">Urządzenie i efekty dźwięku</String>
|
|
||||||
<String key="SoundOutputDevice">Urządzenie wyjściowe</String>
|
|
||||||
<String key="SoundOutputDeviceDesc">Urządzenie, przez które gra symulator. Domyślne systemowe idzie za urządzeniem wybranym w systemie, także gdy zmieni się ono w trakcie gry.</String>
|
|
||||||
<String key="SoundSystemDefault">Domyślne systemowe</String>
|
|
||||||
<String key="SoundOutputMode">Układ głośników</String>
|
|
||||||
<String key="SoundOutputModeDesc">Jak dźwięk jest miksowany: na słuchawki, głośniki stereo albo zestaw dookólny. Automatycznie bierze to, co zgłasza urządzenie.</String>
|
|
||||||
<String key="SoundAutomatic">Automatycznie</String>
|
|
||||||
<String key="SoundStereoBasic">Stereo (proste panoramowanie)</String>
|
|
||||||
<String key="SoundStereoUhj">Stereo (UHJ, szersze)</String>
|
|
||||||
<String key="SoundHeadphones">Słuchawki (HRTF)</String>
|
|
||||||
<String key="SoundHrtfDesc">Dźwięk przestrzenny na słuchawki: źródła z tyłu, z góry i z dołu dają się odróżnić. Automatycznie włącza go, gdy urządzeniem są słuchawki.</String>
|
|
||||||
<String key="SoundOn">Włączone</String>
|
|
||||||
<String key="SoundOff">Wyłączone</String>
|
|
||||||
<String key="SoundHrtfProfile">Zestaw danych HRTF</String>
|
|
||||||
<String key="SoundHrtfProfileDesc">Którego modelu głowy używa HRTF, spośród tych, które ma biblioteka. Inny może lepiej pasować do twoich uszu.</String>
|
|
||||||
<String key="SoundLibraryChoice">Wybór biblioteki</String>
|
|
||||||
<String key="SoundResampler">Przepróbkowanie</String>
|
|
||||||
<String key="SoundResamplerDesc">Jak dźwięki są przeliczane na częstotliwość urządzenia i zmieniają wysokość. Lepsze brzmią czyściej i kosztują trochę więcej czasu procesora.</String>
|
|
||||||
<String key="SoundLibraryDefault">Domyślne biblioteki</String>
|
|
||||||
<String key="SoundLimiter">Ogranicznik wyjścia</String>
|
|
||||||
<String key="SoundLimiterDesc">Chroni głośne chwile przed przesterowaniem, na moment ściszając cały miks.</String>
|
|
||||||
<String key="SoundFrequency">Częstotliwość miksowania</String>
|
|
||||||
<String key="SoundFrequencyDesc">Częstotliwość próbkowania, z jaką dźwięk jest miksowany. Własna częstotliwość urządzenia oszczędza jeszcze jednego przeliczenia.</String>
|
|
||||||
<String key="SoundDeviceRate">Częstotliwość urządzenia</String>
|
|
||||||
<String key="SoundDoppler">Efekt Dopplera</String>
|
|
||||||
<String key="SoundDopplerDesc">Jak bardzo zmienia się wysokość dźwięku przejeżdżającego pojazdu. 0 wyłącza efekt, 1 to wartość fizyczna.</String>
|
|
||||||
<String key="SoundLowpass">Stłumione dźwięki spoza kabiny</String>
|
|
||||||
<String key="SoundLowpassDesc">Dźwięki słyszane przez ściany kabiny tracą wysokie tony, a nie tylko głośność.</String>
|
|
||||||
<String key="SoundAirAbsorption">Pochłanianie przez powietrze</String>
|
|
||||||
<String key="SoundAirAbsorptionDesc">Odległe dźwięki tracą wysokie tony, jak na otwartej przestrzeni. 0 wyłącza, 1 to naturalna wartość.</String>
|
|
||||||
|
|
||||||
<String key="Advanced">Zaawansowane</String>
|
<String key="Advanced">Zaawansowane</String>
|
||||||
<String key="CompressTextures">Kompresuj tekstury TGA</String>
|
<String key="AdvancedMode">Tryb zaawansowany</String>
|
||||||
<String key="ScaleSpeculars">Skaluj odbicia specularne (kompatybilność ze starymi modelami)</String>
|
<String key="AdvancedModeMenu">Tryb zaawansowany…</String>
|
||||||
<String key="ScaleSpecularsDesc">Osłabia połysk modeli robionych pod starsze renderery.</String>
|
<String key="AdvancedModeOff">Wyłącz tryb zaawansowany</String>
|
||||||
<String key="ShaderGamma">Korekcja gamma w shaderach</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="ShaderGammaDesc">Gamma w shaderach zamiast sRGB. Gdy sterownik daje za jasny lub za ciemny obraz.</String>
|
<String key="AdvancedModeOn">Włączam</String>
|
||||||
<String key="ScreenMipmaps">Generuj mipmapy dla tekstur ekranów kabinowych (Python)</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="ScreenMipmapsDesc">Ekrany w kabinie gładsze z daleka i pod kątem, kosztem każdego odświeżenia.</String>
|
<String key="CompressTextures">Kompresja tekstur TGA</String>
|
||||||
<String key="ExtendedModelConversion">Rozszerzona konwersja modeli E3D (eksperymentalne)</String>
|
<String key="ScaleSpeculars">Skalowanie specular</String>
|
||||||
<String key="ExtendedModelConversionDesc">Zapisuje modele tekstowe jako binarne E3D: szybsze wczytywanie, więcej plików w folderze gry.</String>
|
<String key="ScaleSpecularsDesc">Słabszy połysk starszych modeli.</String>
|
||||||
<String key="GfxResourceMove">Ostrożne zarządzanie pamięcią tekstur</String>
|
<String key="ShaderGamma">Gamma w shaderach</String>
|
||||||
<String key="GfxResourceSweep">Usuwaj nieużywane tekstury z pamięci GPU</String>
|
<String key="ShaderGammaDesc">Włącz, gdy obraz jest za jasny albo za ciemny.</String>
|
||||||
<String key="TrainPhysicsThreads">Wątki fizyki pojazdów (0 = wątek główny)</String>
|
<String key="ScreenMipmaps">Mipmapy ekranów</String>
|
||||||
<String key="TrainPhysicsThreadsDesc">Wątki fizyki pojazdów; 0 to wątek główny. Więcej pomaga przy wielu składach.</String>
|
<String key="ScreenMipmapsDesc">Ekrany w kabinie wyglądają gładziej z daleka.</String>
|
||||||
<String key="IgnoreIrrelevantTrains">Pomijaj składy dekoracyjne przy starcie</String>
|
<String key="ExtendedModelConversion">Konwersja modeli do E3D</String>
|
||||||
|
<String key="ExtendedModelConversionDesc">Zapisuje modele jako E3D: szybsze wczytywanie, więcej plików w folderze gry.</String>
|
||||||
|
<String key="GfxResourceMove">Oszczędzanie pamięci tekstur</String>
|
||||||
|
<String key="GfxResourceSweep">Zwalniaj nieużywane tekstury</String>
|
||||||
|
<String key="TrainPhysicsThreads">Wątki fizyki</String>
|
||||||
|
<String key="TrainPhysicsThreadsDesc">0 – fizyka w głównym wątku. Więcej wątków pomaga przy wielu składach.</String>
|
||||||
|
<String key="IgnoreIrrelevantTrains">Pomijaj składy-dekoracje</String>
|
||||||
|
|
||||||
<String key="Starter">Starter</String>
|
<String key="Starter">Starter</String>
|
||||||
<String key="SettingsProfile">Profil ustawień</String>
|
<String key="SettingsProfile">Profil ustawień</String>
|
||||||
<String key="ProfileApply">Zastosuj</String>
|
<String key="ProfileApply">Zastosuj</String>
|
||||||
<String key="ProfileSaveAs">Zapisz jako…</String>
|
<String key="ProfileSaveAs">Zapisz jako…</String>
|
||||||
<String key="ProfileNamePrompt">Nazwa profilu</String>
|
<String key="ProfileNamePrompt">Nazwa profilu</String>
|
||||||
<String key="AutoCloseStarter">Zamknij starter automatycznie</String>
|
<String key="AutoCloseStarter">Zamykaj starter po uruchomieniu</String>
|
||||||
<String key="LargeThumbnails">Duże miniaturki</String>
|
<String key="LargeThumbnails">Duże miniaturki</String>
|
||||||
<String key="AutoExpandSceneryTree">Automatycznie rozwijanie drzewka scenerii</String>
|
<String key="AutoExpandSceneryTree">Rozwijaj drzewo scenerii</String>
|
||||||
|
|
||||||
<!-- Sterowanie / przypisania klawiszy -->
|
<!-- Sterowanie / przypisania klawiszy -->
|
||||||
<String key="Controls">Sterowanie</String>
|
<String key="Controls">Sterowanie</String>
|
||||||
@@ -625,6 +604,7 @@
|
|||||||
<String key="Reset">Przywróć</String>
|
<String key="Reset">Przywróć</String>
|
||||||
<String key="SettingsSaved">Zapisano ustawienia</String>
|
<String key="SettingsSaved">Zapisano ustawienia</String>
|
||||||
<String key="DefaultsRestored">Przywrócono domyślne</String>
|
<String key="DefaultsRestored">Przywrócono domyślne</String>
|
||||||
|
<String key="AllDefaultsConfirm">Wszystkie ustawienia wrócą do domyślnych. Zostaną: język, wybrany symulator, port UART i klawisze sterowania. Zmiany trzeba jeszcze zapisać.</String>
|
||||||
<String key="SettingsRestored">Przywrócono zapisane ustawienia</String>
|
<String key="SettingsRestored">Przywrócono zapisane ustawienia</String>
|
||||||
<String key="TreeExpanded">rozwinięte</String>
|
<String key="TreeExpanded">rozwinięte</String>
|
||||||
<String key="TreeCollapsed">zwinięte</String>
|
<String key="TreeCollapsed">zwinięte</String>
|
||||||
@@ -741,9 +721,9 @@
|
|||||||
<String key="StartEditorWizardTip">Kreator nowej scenerii w edytorze symulatora. Edytor mają tylko niektóre wersje.</String>
|
<String key="StartEditorWizardTip">Kreator nowej scenerii w edytorze symulatora. Edytor mają tylko niektóre wersje.</String>
|
||||||
<String key="StartEditor">Uruchom edytor scenerii</String>
|
<String key="StartEditor">Uruchom edytor scenerii</String>
|
||||||
<String key="StartEditorWarning">Edytor scenerii (eu07 -edit) mają tylko niektóre wersje symulatora. Jeśli wybrany plik symulatora go nie obsługuje, edytor się nie otworzy. Edytor pracuje na samym pliku {0}, a nie na kopii przygotowanej przez starter, więc zapisane zmiany trafią do scenerii. Uruchomić?</String>
|
<String key="StartEditorWarning">Edytor scenerii (eu07 -edit) mają tylko niektóre wersje symulatora. Jeśli wybrany plik symulatora go nie obsługuje, edytor się nie otworzy. Edytor pracuje na samym pliku {0}, a nie na kopii przygotowanej przez starter, więc zapisane zmiany trafią do scenerii. Uruchomić?</String>
|
||||||
<String key="DebugLogVisible">Wyświetlaj log w konsoli</String>
|
<String key="DebugLogVisible">Log w konsoli</String>
|
||||||
<String key="PyScreenPriority">Opóźnienie odświeżania ekranów dodatkowych</String>
|
<String key="PyScreenPriority">Odświeżanie ekranów dodatkowych</String>
|
||||||
<String key="PyScreenPriorityDesc">Minimalny czas między aktualizacjami ekranów Python w kabinach (ms). Wyższa wartość = rzadsze odświeżanie.</String>
|
<String key="PyScreenPriorityDesc">Jak często odświeżać ekrany w kabinie. Rzadziej to więcej FPS.</String>
|
||||||
<String key="PyPriorityNormal">Standardowe (200 ms)</String>
|
<String key="PyPriorityNormal">Standardowe (200 ms)</String>
|
||||||
<String key="PyPriorityLower">Wolniejsze (400 ms)</String>
|
<String key="PyPriorityLower">Wolniejsze (400 ms)</String>
|
||||||
<String key="PyPriorityLowest">Bardzo wolne (800 ms)</String>
|
<String key="PyPriorityLowest">Bardzo wolne (800 ms)</String>
|
||||||
@@ -769,9 +749,9 @@
|
|||||||
<String key="RuleRemove">Usuń z reguły</String>
|
<String key="RuleRemove">Usuń z reguły</String>
|
||||||
<String key="CatAll">Wszystkie</String>
|
<String key="CatAll">Wszystkie</String>
|
||||||
<String key="GfxColResolution">Obraz</String>
|
<String key="GfxColResolution">Obraz</String>
|
||||||
<String key="GfxColRendering">Silnik renderowania</String>
|
<String key="GfxColRendering">Renderowanie</String>
|
||||||
<String key="GfxColShadows">Cienie</String>
|
<String key="GfxColShadows">Cienie</String>
|
||||||
<String key="GfxColTextures">Tekstury i wygładzanie</String>
|
<String key="GfxColTextures">Tekstury</String>
|
||||||
<String key="GfxColDrawRange">Zasięg rysowania</String>
|
<String key="GfxColDrawRange">Zasięg rysowania</String>
|
||||||
<String key="GfxColSmoothness">Płynność</String>
|
<String key="GfxColSmoothness">Płynność</String>
|
||||||
<String key="GfxColReflections">Odbicia</String>
|
<String key="GfxColReflections">Odbicia</String>
|
||||||
@@ -798,7 +778,7 @@
|
|||||||
<String key="ShortcutCardMenu">Otwórz menu pojazdu</String>
|
<String key="ShortcutCardMenu">Otwórz menu pojazdu</String>
|
||||||
|
|
||||||
<!-- Zakladka dla tworcow paczek -->
|
<!-- Zakladka dla tworcow paczek -->
|
||||||
<String key="AdvancedResources">Zasoby i zgodność</String>
|
<String key="AdvancedResources">Zasoby</String>
|
||||||
<String key="AdvancedLogTools">Dziennik i narzędzia</String>
|
<String key="AdvancedLogTools">Dziennik i narzędzia</String>
|
||||||
<String key="LogAndTools">Dziennik zdarzeń i narzędzia</String>
|
<String key="LogAndTools">Dziennik zdarzeń i narzędzia</String>
|
||||||
<String key="OpenLogTools">Otwórz dziennik i narzędzia…</String>
|
<String key="OpenLogTools">Otwórz dziennik i narzędzia…</String>
|
||||||
@@ -853,68 +833,67 @@
|
|||||||
<String key="SyntaxIncludeNotClosed">include {1} bez end</String>
|
<String key="SyntaxIncludeNotClosed">include {1} bez end</String>
|
||||||
<String key="SyntaxTrainsetUnreadable">Nie udało się odczytać składu {0}</String>
|
<String key="SyntaxTrainsetUnreadable">Nie udało się odczytać składu {0}</String>
|
||||||
<String key="SyntaxVehicleUnreadable">Nie udało się odczytać pojazdu {0}</String>
|
<String key="SyntaxVehicleUnreadable">Nie udało się odczytać pojazdu {0}</String>
|
||||||
|
<String key="SyntaxVehicleMissing">Brak pojazdu {0}: nie ma pliku dynamic/{1} - symulator go pominie, skład będzie krótszy</String>
|
||||||
<String key="WarehouseUseInScenery">Wstaw do wybranego składu na scenerii</String>
|
<String key="WarehouseUseInScenery">Wstaw do wybranego składu na scenerii</String>
|
||||||
<String key="WarehouseAppendToScenery">Dołącz do wybranego składu na scenerii</String>
|
<String key="WarehouseAppendToScenery">Dołącz do wybranego składu na scenerii</String>
|
||||||
<String key="ShortcutUndo">Cofnij zmianę składu</String>
|
<String key="ShortcutUndo">Cofnij zmianę składu</String>
|
||||||
<String key="ShortcutRedo">Ponów zmianę składu</String>
|
<String key="ShortcutRedo">Ponów zmianę składu</String>
|
||||||
<String key="AddToWarehouseNamed">Dodaj do magazynu jako…</String>
|
<String key="AddToWarehouseNamed">Dodaj do magazynu jako…</String>
|
||||||
<String key="Ini.ui.scale">Skala interfejsu symulatora</String>
|
<String key="Ini.ui.scale">Skala interfejsu</String>
|
||||||
<String key="Ini.ui.fontsize">Rozmiar czcionki interfejsu</String>
|
<String key="Ini.ui.fontsize">Czcionka interfejsu</String>
|
||||||
<String key="Ini.ui.bg.opacity">Nieprzezroczystość tła okien</String>
|
<String key="Ini.ui.bg.opacity">Krycie tła okien</String>
|
||||||
<String key="Ini.gui.defaultwindows">Pokazuj okna pomocy jazdy i scenariusza po starcie</String>
|
<String key="Ini.gui.defaultwindows">Okna pomocy po starcie</String>
|
||||||
<String key="Ini.gui.trainingdefault">Otwieraj mapę, kartę szkolenia i listę pojazdów po starcie</String>
|
<String key="Ini.gui.trainingdefault">Mapa i karta szkolenia po starcie</String>
|
||||||
<String key="Ini.gui.showtranscripts">Okno napisów (komunikaty radiowe i głosowe)</String>
|
<String key="Ini.gui.showtranscripts">Napisy komunikatów</String>
|
||||||
<String key="Ini.loadinglog">Pokazuj dziennik podczas wczytywania</String>
|
<String key="Ini.loadinglog">Dziennik przy wczytywaniu</String>
|
||||||
<String key="Ini.captureonstart">Po starcie mysz obraca kamerą</String>
|
<String key="Ini.captureonstart">Mysz obraca kamerą po starcie</String>
|
||||||
<String key="Ini.mousecontrol">Klikanie przełączników w kabinie myszą</String>
|
<String key="Ini.mousecontrol">Przełączniki myszą</String>
|
||||||
<String key="Ini.fullscreenmonitor">Monitor pełnoekranowy</String>
|
<String key="Ini.screenshotsdir">Folder zrzutów</String>
|
||||||
<String key="Ini.screenshotsdir">Folder zrzutów ekranu</String>
|
<String key="Ini.basedrawrange">Zasięg rysowania</String>
|
||||||
<String key="Ini.basedrawrange">Bazowy zasięg rysowania</String>
|
<String key="Ini.targetfps">Docelowy FPS</String>
|
||||||
<String key="Ini.targetfps">Docelowa liczba klatek</String>
|
<String key="Ini.sleeperdistance">Zasięg podkładów</String>
|
||||||
<String key="Ini.sleeperdistance">Zasięg rysowania podkładów</String>
|
|
||||||
<String key="Ini.gfx.reflections.range_instances">Zasięg odbić obiektów</String>
|
<String key="Ini.gfx.reflections.range_instances">Zasięg odbić obiektów</String>
|
||||||
<String key="Ini.gfx.reflections.range_vehicles">Zasięg odbić pojazdów</String>
|
<String key="Ini.gfx.reflections.range_vehicles">Zasięg odbić pojazdów</String>
|
||||||
<String key="Ini.gfx.textures.streaming">Wczytuj tekstury w tle</String>
|
<String key="Ini.gfx.textures.streaming">Tekstury w tle</String>
|
||||||
<String key="Ini.gfx.textures.releasedistance">Zwalniaj tekstury odległych pojazdów</String>
|
<String key="Ini.gfx.textures.releasedistance">Zwalnianie tekstur pojazdów</String>
|
||||||
<String key="Ini.skyenabled">Rysuj niebo</String>
|
<String key="Ini.skyenabled">Niebo</String>
|
||||||
<String key="Ini.rendercab">Rysuj kabinę</String>
|
<String key="Ini.rendercab">Kabina</String>
|
||||||
<String key="Ini.gfx.postfx.motionblur.shutter">Czas naświetlania rozmycia ruchu</String>
|
<String key="Ini.gfx.postfx.motionblur.shutter">Czas rozmycia</String>
|
||||||
<String key="Ini.python.vsync">Synchronizacja pionowa okien ekranów</String>
|
<String key="Ini.python.vsync">VSync okien ekranów</String>
|
||||||
<String key="Ini.python.displaywindows">Ekrany z kabiny w osobnych oknach</String>
|
<String key="Ini.python.displaywindows">Ekrany w osobnych oknach</String>
|
||||||
<String key="Ini.newaircouplers">Węże pneumatyczne rysowane według sprzęgnięcia</String>
|
<String key="Ini.newaircouplers">Węże wg sprzęgnięcia</String>
|
||||||
<String key="Ini.smoothtraction">Wygładzanie przewodów sieci (renderer klasyczny)</String>
|
<String key="Ini.smoothtraction">Wygładzanie sieci</String>
|
||||||
<String key="Ini.sound.maxsources">Maksymalna liczba źródeł dźwięku</String>
|
<String key="Ini.sound.maxsources">Źródła dźwięku</String>
|
||||||
<String key="Ini.sound.asyncload">Dekoduj dźwięki w tle</String>
|
<String key="Ini.sound.asyncload">Dźwięki w tle</String>
|
||||||
<String key="Ini.loadtraction">Wczytuj sieć trakcyjną</String>
|
<String key="Ini.loadtraction">Sieć trakcyjna</String>
|
||||||
<String key="Ini.rollfix">Przeliczaj przechyłkę torów</String>
|
<String key="Ini.rollfix">Przechyłka torów</String>
|
||||||
<String key="Ini.shakefactor">Bujanie kamery</String>
|
<String key="Ini.shakefactor">Bujanie kamery</String>
|
||||||
<String key="Ini.map.manualswitchcontrol">Przestawianie zwrotnic z mapy</String>
|
<String key="Ini.map.manualswitchcontrol">Zwrotnice z mapy</String>
|
||||||
<String key="Ini.map.highlightdistance">Podświetlanie drogi na mapie</String>
|
<String key="Ini.map.highlightdistance">Podświetlanie trasy</String>
|
||||||
<String key="Ini.showsystemconsole">Okno konsoli z dziennikiem (Windows)</String>
|
<String key="Ini.showsystemconsole">Konsola systemowa</String>
|
||||||
<String key="OpenLogToolsDesc">Komunikaty startera i zbiorcze narzędzia zajezdni.</String>
|
<String key="OpenLogToolsDesc">Komunikaty startera i narzędzia zajezdni.</String>
|
||||||
<String key="CompressTexturesDesc">Mniej pamięci karty, dłuższe wczytywanie.</String>
|
<String key="CompressTexturesDesc">Mniej pamięci karty, dłuższe wczytywanie.</String>
|
||||||
<String key="GfxResourceSweepDesc">Lepiej wyłączyć, gdy pamięci karty graficznej jest pod dostatkiem.</String>
|
<String key="GfxResourceSweepDesc">Zwalnia pamięć karty. Wyłącz, jeśli pamięci masz dużo.</String>
|
||||||
<String key="GfxResourceMoveDesc">Na niektórych kartach graficznych może sprawiać problemy.</String>
|
<String key="GfxResourceMoveDesc">Może powodować problemy na niektórych kartach.</String>
|
||||||
<String key="IgnoreIrrelevantTrainsDesc">Pomija składy oznaczone w scenerii jako dekoracja.</String>
|
<String key="IgnoreIrrelevantTrainsDesc">Nie wczytuje składów oznaczonych w scenerii jako dekoracja.</String>
|
||||||
<String key="Ini.ui.scale.Desc">Powiększa okna i przyciski interfejsu symulatora.</String>
|
<String key="Ini.ui.scale.Desc">Wielkość okien i przycisków w symulatorze.</String>
|
||||||
<String key="Ini.ui.fontsize.Desc">Wielkość tekstu w oknach symulatora.</String>
|
<String key="Ini.ui.fontsize.Desc">Wielkość tekstu w oknach symulatora.</String>
|
||||||
<String key="Ini.ui.bg.opacity.Desc">1 – tło pełne; mniejsze wartości prześwitują widok.</String>
|
<String key="Ini.ui.bg.opacity.Desc">1 – tło pełne, mniej – prześwituje.</String>
|
||||||
<String key="Ini.captureonstart.Desc">Bez zaznaczenia startuje z kursorem w kabinie.</String>
|
<String key="Ini.captureonstart.Desc">Wyłączone: po starcie kursor jest wolny.</String>
|
||||||
<String key="Ini.mousecontrol.Desc">Wyłączenie blokuje tryb kursora – mysz tylko obraca kamerą.</String>
|
<String key="Ini.mousecontrol.Desc">Wyłączone: mysz tylko obraca kamerą.</String>
|
||||||
<String key="Ini.fullscreenmonitor.Desc">Puste: monitor główny.</String>
|
<String key="Ini.screenshotsdir.Desc">Ścieżka względem folderu gry, bez spacji.</String>
|
||||||
<String key="Ini.screenshotsdir.Desc">Względem folderu gry, bez spacji w ścieżce.</String>
|
<String key="Ini.basedrawrange.Desc">Jak daleko rysowana jest sceneria.</String>
|
||||||
<String key="Ini.basedrawrange.Desc">Odległość rysowania scenerii; docelowy FPS może ją zmieniać.</String>
|
<String key="Ini.targetfps.Desc">Symulator dopasowuje zasięg rysowania, żeby utrzymać ten FPS. 0 – wyłączone.</String>
|
||||||
<String key="Ini.targetfps.Desc">Poniżej tej wartości symulator skraca zasięg rysowania, powyżej wydłuża.</String>
|
<String key="Ini.gfx.textures.streaming.Desc">Szybsze wczytywanie scenerii. Nie zwiększa FPS.</String>
|
||||||
<String key="Ini.gfx.textures.streaming.Desc">Tekstury DDS czytane w tle: sceneria wczytuje się szybciej. Nie podnosi FPS.</String>
|
<String key="Ini.gfx.textures.releasedistance.Desc">Usuwa z karty tekstury dalekich pojazdów. 0 – wyłączone.</String>
|
||||||
<String key="Ini.gfx.textures.releasedistance.Desc">Krotność zasięgu rysowania, poza którą tekstury pojazdów są usuwane z karty graficznej.</String>
|
<String key="Ini.rendercab.Desc">Wyłączone: bez modelu kabiny (do testów).</String>
|
||||||
<String key="Ini.rendercab.Desc">Wyłączenie ukrywa model kabiny – do testów.</String>
|
<String key="Ini.gfx.postfx.motionblur.shutter.Desc">Dłużej – silniejsze rozmycie.</String>
|
||||||
<String key="Ini.gfx.postfx.motionblur.shutter.Desc">Dłuższy czas – silniejsze rozmycie.</String>
|
<String key="Ini.python.displaywindows.Desc">Dla kilku monitorów albo pulpitu z wyświetlaczami.</String>
|
||||||
<String key="Ini.python.displaywindows.Desc">Przydatne przy kilku monitorach albo pulpicie z własnymi wyświetlaczami.</String>
|
<String key="Ini.sound.maxsources.Desc">Ile dźwięków gra naraz.</String>
|
||||||
<String key="Ini.sound.maxsources.Desc">Ile dźwięków może grać naraz.</String>
|
<String key="Ini.sound.asyncload.Desc">Szybsze wczytywanie dźwięków.</String>
|
||||||
<String key="Ini.sound.asyncload.Desc">Pliki dźwiękowe dekodują osobne wątki – szybsze wczytywanie.</String>
|
<String key="Ini.loadtraction.Desc">Wyłączone: pantografy się nie łamią, elektrowozy zawsze mają prąd.</String>
|
||||||
<String key="Ini.loadtraction.Desc">Bez sieci trakcyjnej pantografy się nie łamią, a elektrowozy zawsze mają zasilanie.</String>
|
<String key="Ini.shakefactor.Desc">0 – kamera nie buja.</String>
|
||||||
<String key="Ini.shakefactor.Desc">Mnożnik kołysania widoku z kabiny we wszystkich osiach; 0 – bez bujania.</String>
|
<String key="Ini.map.highlightdistance.Desc">Jak daleko przed i za pojazdem mapa podświetla tor.</String>
|
||||||
<String key="Ini.map.highlightdistance.Desc">Na jaką odległość przed i za pojazdem mapa podświetla tor.</String>
|
|
||||||
<String key="SectionDefaults">Domyślne</String>
|
<String key="SectionDefaults">Domyślne</String>
|
||||||
<String key="IniChangesButton">Zmiany w pliku…</String>
|
<String key="IniChangesButton">Zmiany w pliku…</String>
|
||||||
<String key="IniChangesTitle">Co zmieni zapis w eu07.ini</String>
|
<String key="IniChangesTitle">Co zmieni zapis w eu07.ini</String>
|
||||||
@@ -930,8 +909,8 @@
|
|||||||
<String key="PresetHigh">Wysoka</String>
|
<String key="PresetHigh">Wysoka</String>
|
||||||
<String key="PresetCustom">Własne</String>
|
<String key="PresetCustom">Własne</String>
|
||||||
<String key="MonitorRate">Monitor: {0} Hz</String>
|
<String key="MonitorRate">Monitor: {0} Hz</String>
|
||||||
<String key="MonitorRateNamed">Ekran {0}: do {1} Hz</String>
|
|
||||||
<String key="MonitorRateUse">Ustaw {0} FPS</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">Najedź na zestaw, żeby zobaczyć wartości.</String>
|
||||||
<String key="TextureBaseDateHint">RRRR-MM-DD</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="LanguageStarterMissing">Brak tłumaczenia Startera: zostaje angielski. Symulator dostanie ten język.</String>
|
||||||
@@ -964,12 +943,12 @@
|
|||||||
<String key="KbUseSceneryEvent">zdarzenia scenerii</String>
|
<String key="KbUseSceneryEvent">zdarzenia scenerii</String>
|
||||||
<String key="KbUseCamera">zapamiętane kamery</String>
|
<String key="KbUseCamera">zapamiętane kamery</String>
|
||||||
<String key="Ini.heightbase">Mnożnik zasięgu</String>
|
<String key="Ini.heightbase">Mnożnik zasięgu</String>
|
||||||
<String key="Ini.heightbase.Desc">Skraca lub wydłuża zasięg rysowania scenerii. Docelowy FPS go nadpisuje.</String>
|
<String key="Ini.heightbase.Desc">Skraca albo wydłuża zasięg rysowania.</String>
|
||||||
<String key="PresetVeryHigh">Bardzo wysoka</String>
|
<String key="PresetVeryHigh">Bardzo wysoka</String>
|
||||||
<String key="PresetUltra">Ultra</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="PresetUltraNote">Wszystko na maksimum. Może być za ciężkie nawet dla mocnej karty.</String>
|
||||||
<String key="Ini.python.fpslimit">Limit klatek okien ekranów</String>
|
<String key="Ini.python.fpslimit">FPS okien ekranów</String>
|
||||||
<String key="Ini.python.fpslimit.Desc">Działa tylko z ekranami w osobnych oknach; bez nich nic nie zmienia.</String>
|
<String key="Ini.python.fpslimit.Desc">Tylko dla ekranów w osobnych oknach.</String>
|
||||||
<String key="ShadowLimitNone">Najdłuższe</String>
|
<String key="ShadowLimitNone">Najdłuższe</String>
|
||||||
<String key="HaslerScenario">sceneriusz {0}</String>
|
<String key="HaslerScenario">sceneriusz {0}</String>
|
||||||
<String key="HaslerTrain">pociąg {0}</String>
|
<String key="HaslerTrain">pociąg {0}</String>
|
||||||
@@ -989,93 +968,13 @@
|
|||||||
<String key="WarehouseSaved">W magazynie: {0}</String>
|
<String key="WarehouseSaved">W magazynie: {0}</String>
|
||||||
<String key="WarehouseNothingToAdd">Wybierz skład z pojazdami</String>
|
<String key="WarehouseNothingToAdd">Wybierz skład z pojazdami</String>
|
||||||
<String key="GfxGroupLevelTip">Poziom tylko tej części grafiki</String>
|
<String key="GfxGroupLevelTip">Poziom tylko tej części grafiki</String>
|
||||||
<String key="REVulkan">Vulkan 1.4</String>
|
|
||||||
<String key="IdleVulkanOnly">Działa tylko z Vulkanem.</String>
|
|
||||||
<String key="DlssPreset">Preset DLSS</String>
|
|
||||||
<String key="DlssPresetDesc">Model, którym DLSS odtwarza obraz. Tryb DLSS wynika ze skali bufora: ok. 67% Jakość, 50% Wydajność, 33% Ultra wydajność.</String>
|
|
||||||
<String key="FrameGeneration">Generowanie klatek</String>
|
|
||||||
<String key="FrameGenerationDesc">Dodatkowe klatki między rysowanymi. Tylko z DLSS lub DLAA. x3 i x4 tylko na kartach RTX 50.</String>
|
|
||||||
<String key="Reflex">NVIDIA Reflex</String>
|
|
||||||
<String key="ReflexDesc">Mniejsze opóźnienie między sterowaniem a obrazem.</String>
|
|
||||||
<String key="RayTracing">Odbicia ray tracing</String>
|
|
||||||
<String key="RayTracingDesc">Uzupełnia odbicia tam, gdzie SSR nic nie znajduje. Karta musi mieć ray query.</String>
|
|
||||||
<String key="RayTracingRange">Zasięg ray tracingu</String>
|
|
||||||
<String key="VulkanDevice">Karta graficzna (Vulkan)</String>
|
|
||||||
<String key="VulkanDeviceDesc">Numer karty z listy w logu albo fragment nazwy, np. RTX. Puste: wybór automatyczny.</String>
|
|
||||||
<String key="Ssr">Odbicia w przestrzeni ekranu (SSR)</String>
|
|
||||||
<String key="SsrDesc">Odbicia tego, co widać na ekranie, na mokrych i gładkich powierzchniach.</String>
|
|
||||||
<String key="AmbientOcclusion">Okluzja otoczenia</String>
|
|
||||||
<String key="AmbientOcclusionDesc">Przyciemnia zakamarki i styki powierzchni. GTAO jest dokładniejsze od SSAO.</String>
|
|
||||||
<String key="AmbientOcclusionQuality">Jakość okluzji</String>
|
|
||||||
<String key="AoLighting">Okluzja w świetle otoczenia</String>
|
|
||||||
<String key="AoLightingDesc">Tylko z GTAO. Przyciemnia światło otoczenia i odbicia, a słońce i lampy zostają jasne. Wyłączone: mnoży gotowy obraz, taniej.</String>
|
|
||||||
<String key="LightsClustered">Oświetlenie klastrowe</String>
|
|
||||||
<String key="LightsClusteredDesc">Światła pojazdów i latarnie bez limitu liczby. Potrzebne dla lamp scenerii i lampy w kabinie.</String>
|
|
||||||
<String key="LightShadows">Cienie lamp i reflektorów</String>
|
|
||||||
<String key="LightShadowsDesc">Cienie rzucane przez lampę kabiny, latarnie i reflektory pojazdów.</String>
|
|
||||||
<String key="ContactShadows">Cienie kontaktowe</String>
|
|
||||||
<String key="ContactShadowsDesc">Drobne cienie w miejscach styku obiektów, których mapa cieni nie łapie.</String>
|
|
||||||
<String key="ShadowSdsm">Kaskady cieni dopasowane do sceny (SDSM)</String>
|
|
||||||
<String key="ShadowSdsmDesc">Rozkłada rozdzielczość cieni słońca na to, co faktycznie widać.</String>
|
|
||||||
<String key="CabProbe">Próbka kabiny</String>
|
|
||||||
<String key="CabProbeDesc">Światło odbite od ścian kabiny i odbicia wnętrza w szybach.</String>
|
|
||||||
<String key="CabProbeInterval">Odświeżanie próbki co N klatek</String>
|
|
||||||
<String key="CabProbeReflections">Kabina odbija siebie</String>
|
|
||||||
<String key="CabProbeReflectionsDesc">W szybach widać wnętrze kabiny zamiast nieba tam, gdzie SSR nic nie znajduje.</String>
|
|
||||||
<String key="CabProbeBounce">Odbite światło lampy w kabinie</String>
|
|
||||||
<String key="CabProbeBounceDesc">Ile światła lampy odbitego od ścian oświetla kabinę ponownie. Działa z próbką kabiny.</String>
|
|
||||||
<String key="FogQuality">Jakość mgły</String>
|
|
||||||
<String key="Clouds">Chmury wolumetryczne</String>
|
|
||||||
<String key="CloudShadows">Cienie chmur na ziemi</String>
|
|
||||||
<String key="Grass">Trawa</String>
|
|
||||||
<String key="GrassDistance">Zasięg trawy</String>
|
|
||||||
<String key="GrassDensity">Gęstość trawy</String>
|
|
||||||
<String key="Precipitation">Opady (cząsteczki)</String>
|
|
||||||
<String key="PrecipitationDesc">Liczba kropli deszczu i płatków śniegu przy największych opadach.</String>
|
|
||||||
<String key="Bloom">Poświata jasnych miejsc (bloom)</String>
|
|
||||||
<String key="AutoExposure">Automatyczna ekspozycja</String>
|
|
||||||
<String key="AutoExposureDesc">Jasność obrazu dopasowuje się do sceny, np. przy wjeździe do tunelu.</String>
|
|
||||||
<String key="LevelOff">Wyłączone</String>
|
|
||||||
<String key="LevelLow">Niskie</String>
|
|
||||||
<String key="LevelMedium">Średnie</String>
|
|
||||||
<String key="LevelHigh">Wysokie</String>
|
|
||||||
<String key="LevelUltra">Ultra</String>
|
|
||||||
<String key="ReflexOn">Włączony</String>
|
|
||||||
<String key="ReflexBoost">Włączony + boost</String>
|
|
||||||
<String key="AaTaa">TAA</String>
|
|
||||||
<String key="AaDlss">DLSS (skalowanie)</String>
|
|
||||||
<String key="AaDlaa">DLAA (natywna rozdzielczość)</String>
|
|
||||||
<String key="DlssPresetDefault">Automatyczny</String>
|
|
||||||
<String key="DlssPresetK">K: najlepsza jakość</String>
|
|
||||||
<String key="DlssPresetJ">J: mniej smużenia</String>
|
|
||||||
<String key="DlssPresetM">M: pod tryb Wydajność</String>
|
|
||||||
<String key="DlssPresetL">L: pod Ultra wydajność</String>
|
|
||||||
<String key="Effects">Efekty</String>
|
<String key="Effects">Efekty</String>
|
||||||
<String key="GfxColImage">Rozdzielczość i wygładzanie</String>
|
<String key="GfxColImage">Obraz</String>
|
||||||
<String key="GfxColLights">Oświetlenie</String>
|
<String key="GfxColLights">Oświetlenie</String>
|
||||||
<String key="GfxColPostFx">Postprocessing</String>
|
<String key="GfxColPostFx">Postprocessing</String>
|
||||||
<String key="GfxColNature">Dym</String>
|
<String key="GfxColNature">Dym</String>
|
||||||
<String key="AntiAliasing">Wygładzanie krawędzi</String>
|
<String key="AntiAliasing">Multisampling</String>
|
||||||
<String key="AntiAliasingDesc">MSAA wygładza krawędzie obiektów, TAA cały obraz kosztem lekkiego rozmycia. DLSS i DLAA tylko z Vulkanem na kartach NVIDIA RTX, inaczej symulator użyje TAA.</String>
|
<String key="AntiAliasingDesc">Wygładza krawędzie. Wyższy poziom to gładszy obraz i mniej FPS.</String>
|
||||||
<String key="VolumetricFog">Mgła wolumetryczna</String>
|
|
||||||
<String key="VolumetricFogDesc">Mgła z promieniami słońca, cieniami chmur i światłem lamp. Wyłączona: prostsza mgła analityczna.</String>
|
|
||||||
<String key="CloudsDesc">Jakość chmur rysowanych na niebie.</String>
|
|
||||||
<String key="REOpenGLNote">DLSS, generowanie klatek, Reflex i ray tracing tylko z Vulkanem.</String>
|
|
||||||
<String key="REVulkanNote">Wymaga exe z Vulkanem i karty, która go obsługuje. Inaczej symulator włączy Pełny albo Stary.</String>
|
|
||||||
<String key="VulkanDeviceAuto">automatycznie</String>
|
|
||||||
<String key="DlssPresetInfoDefault">K dla DLAA, Jakości i Zrównoważonego, M dla Wydajności, L dla Ultra wydajności. Sterownik może to zmienić przy aktualizacji.</String>
|
|
||||||
<String key="DlssPresetInfoK">Model transformer o najlepszej jakości obrazu, ale najdroższy w obliczeniach. Domyślny dla DLAA, Jakości i Zrównoważonego.</String>
|
|
||||||
<String key="DlssPresetInfoJ">Podobny do K: trochę mniej smug za ruchomymi obiektami kosztem większego migotania. NVIDIA zaleca raczej K.</String>
|
|
||||||
<String key="DlssPresetInfoM">Model dobrany do trybu Wydajność (skala ok. 50%), w nim domyślny. Sam liczy ekspozycję obrazu.</String>
|
|
||||||
<String key="DlssPresetInfoL">Model dobrany do trybu Ultra wydajność (skala ok. 33%), w nim domyślny. Sam liczy ekspozycję obrazu.</String>
|
|
||||||
<String key="DlssMissingLibraryNote">Obok symulatora nie ma {0}: bez tej biblioteki nie użyje tej funkcji DLSS.</String>
|
|
||||||
<String key="DlssNoPlatformNote">Na macOS DLSS nie jest dostępny.</String>
|
|
||||||
<String key="FrameGenerationNeedsDlssNote">Generowanie klatek działa tylko z DLSS albo DLAA.</String>
|
|
||||||
<String key="ReflexForcedNote">Generowanie klatek włącza Reflex samo, niezależnie od tego wyboru.</String>
|
|
||||||
<String key="AoLightingPrepassNote">Wymaga głębi całej sceny przed kolorem; bez SSR i cieni kontaktowych to dodatkowy przebieg (koszt CPU w OpenGL).</String>
|
|
||||||
<String key="AoNeedsPipelineNote">Przy pominiętym postprocessingu AO nie działa.</String>
|
|
||||||
<String key="CabProbeReflectionsOnlyNote">Bez oświetlenia klastrowego i lampy kabiny jako światła (gfx.lights.cab) próbka daje tylko odbicia.</String>
|
|
||||||
<String key="TemporalNeedsPipelineNote">TAA i DLSS działają w postprocessingu: gdy go pominiesz, krawędzie nie będą wygładzane.</String>
|
|
||||||
<String key="SettingsFile">Plik eu07.ini</String>
|
<String key="SettingsFile">Plik eu07.ini</String>
|
||||||
<String key="ImportIni">Importuj…</String>
|
<String key="ImportIni">Importuj…</String>
|
||||||
<String key="ImportIniTitle">Importuj ustawienia z eu07.ini</String>
|
<String key="ImportIniTitle">Importuj ustawienia z eu07.ini</String>
|
||||||
@@ -1088,19 +987,16 @@
|
|||||||
{0}</String>
|
{0}</String>
|
||||||
<String key="ExportIniDone">Wyeksportowano do {0}</String>
|
<String key="ExportIniDone">Wyeksportowano do {0}</String>
|
||||||
<String key="REFull">Pełny</String>
|
<String key="REFull">Pełny</String>
|
||||||
<String key="REOld">Stary</String>
|
<String key="REOld">Stary (niezalecany)</String>
|
||||||
<String key="RESimp">Uproszczony</String>
|
<String key="RESimp">Uproszczony (niezalecany)</String>
|
||||||
<String key="REExperimental">Eksperymentalny</String>
|
<String key="RenderAngleVulkan">ANGLE (Vulkan)</String>
|
||||||
<String key="RenderAngleVulkan">Użyj renderera ANGLE Vulkan</String>
|
<String key="RenderAngleVulkanDesc">Rysuje przez ANGLE na Vulkanie. Włącz, jeśli zwykły OpenGL sprawia problemy.</String>
|
||||||
<String key="RenderAngleVulkanDesc">Uruchamia renderer ANGLE na Vulkanie zamiast domyślnego backendu. Przydatne, gdy OpenGL sprawia problemy.</String>
|
<String key="RenderVBO">VBO</String>
|
||||||
<String key="RenderVBO">Renderowanie VBO</String>
|
<String key="RenderVBODesc">Wyłącz tylko, gdy starsza karta ma problemy z obrazem.</String>
|
||||||
<String key="RenderVBODesc">Trzyma geometrię w buforach karty graficznej. Wyłącz tylko przy problemach ze starszymi kartami.</String>
|
<String key="CabShadowsRange">Cienie w kabinie</String>
|
||||||
<String key="CabShadowsRange">Zasięg źródeł cieni 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="CabShadowsRangeDesc">Odległość, z jakiej źródła światła nadal rzucają cień w kabinie. Zero wyłącza cienie w kabinie.</String>
|
<String key="UseGLES">OpenGL ES</String>
|
||||||
<String key="UseGLES">Używaj OpenGL ES</String>
|
<String key="UseGLESDesc">OpenGL ES zamiast OpenGL. Nie działa ze starym rendererem.</String>
|
||||||
<String key="UseGLESDesc">OpenGL ES zamiast OpenGL. Nie działa z rendererem legacy.</String>
|
|
||||||
<String key="GpuCard">{0}, {1} GB</String>
|
<String key="GpuCard">{0}, {1} GB</String>
|
||||||
<String key="GpuCardShared">{0}, pamięć wspólna</String>
|
<String key="GpuCardShared">{0}, pamięć wspólna</String>
|
||||||
<String key="GfxColNewRenderer">Nowości OpenGL 4.6 / Vulkan</String>
|
|
||||||
<String key="GfxNewRendererNote">Działa tylko z nowym exe. Starsze exe pomija te ustawienia.</String>
|
|
||||||
</Language>
|
</Language>
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
<String key="StartNoScenery">Выберите сценерию</String>
|
<String key="StartNoScenery">Выберите сценерию</String>
|
||||||
<String key="StartNoTrain">Выберите состав</String>
|
<String key="StartNoTrain">Выберите состав</String>
|
||||||
<String key="StartNoStaff">Нет бригады / пассажира</String>
|
<String key="StartNoStaff">Нет бригады / пассажира</String>
|
||||||
|
<String key="StartDecor">Декоративный состав</String>
|
||||||
|
<String key="StartAi">Состав ИИ</String>
|
||||||
<String key="StartNoStaffTitle">Состав без бригады</String>
|
<String key="StartNoStaffTitle">Состав без бригады</String>
|
||||||
<String key="StartNoStaffConfirm">В этом составе нет ни бригады, ни пассажира — управлять будет нечем. Всё равно запустить?</String>
|
<String key="StartNoStaffConfirm">В этом составе нет ни бригады, ни пассажира — управлять будет нечем. Всё равно запустить?</String>
|
||||||
<String key="RestoreWeather">Восстановить погоду</String>
|
<String key="RestoreWeather">Восстановить погоду</String>
|
||||||
@@ -355,8 +357,8 @@
|
|||||||
<String key="General">Общие</String>
|
<String key="General">Общие</String>
|
||||||
|
|
||||||
<String key="Language">Язык</String>
|
<String key="Language">Язык</String>
|
||||||
|
<String key="UnknownIniValue">Неизвестное значение в eu07.ini: «{0}». Оно останется в файле, пока вы его не измените.</String>
|
||||||
<String key="LanguageSimMissing">В симуляторе нет перевода на этот язык, он запустится на английском.</String>
|
<String key="LanguageSimMissing">В симуляторе нет перевода на этот язык, он запустится на английском.</String>
|
||||||
<String key="Fullscreen">Полный экран</String>
|
|
||||||
<String key="PauseSimInactive">Приостанавливать симуляцию при неактивном окне</String>
|
<String key="PauseSimInactive">Приостанавливать симуляцию при неактивном окне</String>
|
||||||
<String key="PauseSimStart">Пауза при запуске</String>
|
<String key="PauseSimStart">Пауза при запуске</String>
|
||||||
<String key="CursorSensitivity">Чувствительность курсора</String>
|
<String key="CursorSensitivity">Чувствительность курсора</String>
|
||||||
@@ -366,6 +368,7 @@
|
|||||||
<String key="Communication">Связь</String>
|
<String key="Communication">Связь</String>
|
||||||
|
|
||||||
<String key="GamepadSignalIgnore">Игнорировать ввод с геймпада</String>
|
<String key="GamepadSignalIgnore">Игнорировать ввод с геймпада</String>
|
||||||
|
<String key="ConfirmGamepadUse">Рекомендуется и по умолчанию геймпад игнорируется. Включение его поддержки часто вызывает проблемы с управлением. Меняйте, только если действительно управляете геймпадом. Изменить?</String>
|
||||||
|
|
||||||
<String key="Feedback">Обратная связь</String>
|
<String key="Feedback">Обратная связь</String>
|
||||||
<String key="FeedbackOff">Выкл.</String>
|
<String key="FeedbackOff">Выкл.</String>
|
||||||
@@ -407,8 +410,8 @@
|
|||||||
|
|
||||||
<String key="Graphic">Графика</String>
|
<String key="Graphic">Графика</String>
|
||||||
<String key="RenderEngine">Движок отрисовки</String>
|
<String key="RenderEngine">Движок отрисовки</String>
|
||||||
<String key="RenderEngineDesc">Полный работает с любым exe. Старый, Упрощённый и Экспериментальный только со старыми, новый вместо них запустит Полный.</String>
|
<String key="ConfirmRenderingChange">Изменение «{0}» может помешать запуску симулятора или испортить изображение. Изменить?</String>
|
||||||
<String key="REExperimentalWarning">Внимание: экспериментальный рендерер может работать нестабильно, не показывать части сцены или не запускаться на некоторых видеокартах. Если симулятор не запускается или выглядит неправильно, вернитесь к рендереру «Полный».</String>
|
<String key="RenderEngineDesc">Полный — рекомендуемый рендерер симулятора. Старый и Упрощённый рисуют классическим рендерером и не рекомендуются, если Полный работает, — они для видеокарт, с которыми у Полного проблемы.</String>
|
||||||
<String key="GpuChoice">Видеокарта (Linux)</String>
|
<String key="GpuChoice">Видеокарта (Linux)</String>
|
||||||
<String key="GpuDiscrete">Мощнее (дискретная)</String>
|
<String key="GpuDiscrete">Мощнее (дискретная)</String>
|
||||||
<String key="GpuSystem">Как решит система</String>
|
<String key="GpuSystem">Как решит система</String>
|
||||||
@@ -418,16 +421,9 @@
|
|||||||
<String key="GpuNotePlayer">Найдено: {0}. Карту выбирают переменные среды ({1}); стартер их не меняет.</String>
|
<String key="GpuNotePlayer">Найдено: {0}. Карту выбирают переменные среды ({1}); стартер их не меняет.</String>
|
||||||
<String key="GpuNoteOne">Одна карта: {0} – выбирать не из чего.</String>
|
<String key="GpuNoteOne">Одна карта: {0} – выбирать не из чего.</String>
|
||||||
<String key="GpuNoteUnread">Не удалось прочитать видеокарты из /sys/class/drm.</String>
|
<String key="GpuNoteUnread">Не удалось прочитать видеокарты из /sys/class/drm.</String>
|
||||||
<String key="IdleWindowsBuildOnly">Работает только в версии симулятора для Windows.</String>
|
|
||||||
<String key="IdleLegacyRendererOnly">Это читает только рендерер legacy, а выбран другой.</String>
|
|
||||||
<String key="IdleNeedsFrameRateTarget">Работает только с целевой частотой кадров (targetfps).</String>
|
|
||||||
<String key="IdleOpenGlRenderersOnly">Экспериментальный рендерер это не читает.</String>
|
|
||||||
<String key="IdleModernRendererOnly">Это читает только полный рендерер, а выбран другой.</String>
|
|
||||||
<String key="IdleNeedsNetworkServer">Пауза в фоне требует сетевого сервера (network.server).</String>
|
|
||||||
|
|
||||||
<String key="Resolution">Разрешение</String>
|
<String key="Resolution">Разрешение</String>
|
||||||
<String key="ResolutionOnMonitor">{0} (монитор)</String>
|
<String key="ResolutionOnMonitor">{0} (монитор)</String>
|
||||||
<String key="IdleMonitorMode">Не работает при автоматическом разрешении.</String>
|
|
||||||
<String key="BufforResolution">Разрешение буфера</String>
|
<String key="BufforResolution">Разрешение буфера</String>
|
||||||
<String key="MaxTexResolution">Максимальное разрешение текстур</String>
|
<String key="MaxTexResolution">Максимальное разрешение текстур</String>
|
||||||
<String key="MaxTexCabResolution">Максимальное разрешение текстур кабины</String>
|
<String key="MaxTexCabResolution">Максимальное разрешение текстур кабины</String>
|
||||||
@@ -456,7 +452,14 @@
|
|||||||
<String key="FpsLimitDesc">Меньше кадров: холоднее и тише компьютер. С V-Sync лимит выше частоты обновления ничего не даёт.</String>
|
<String key="FpsLimitDesc">Меньше кадров: холоднее и тише компьютер. С V-Sync лимит выше частоты обновления ничего не даёт.</String>
|
||||||
<String key="ShadowAngleLimit">Ограничение длины теней</String>
|
<String key="ShadowAngleLimit">Ограничение длины теней</String>
|
||||||
<String key="ShadowLimitShort">Укороченные</String>
|
<String key="ShadowLimitShort">Укороченные</String>
|
||||||
<String key="FullscreenWindowed">Автоматическое разрешение (полный экран без рамки)</String>
|
<String key="DisplayMode">Режим отображения</String>
|
||||||
|
<String key="DisplayModeFullscreen">Полный экран</String>
|
||||||
|
<String key="DisplayModeBorderless">Полный экран без рамки</String>
|
||||||
|
<String key="DisplayModeWindow">Окно</String>
|
||||||
|
<String key="DisplayModeDesc">Полный экран без рамки берёт разрешение монитора и быстрее переключается на другие программы.</String>
|
||||||
|
<String key="FullscreenMonitor">Монитор</String>
|
||||||
|
<String key="FullscreenMonitorDesc">На каком мониторе симулятор откроется в полноэкранном режиме.</String>
|
||||||
|
<String key="MonitorPrimary">Основной</String>
|
||||||
<String key="VSync">VSync</String>
|
<String key="VSync">VSync</String>
|
||||||
<String key="SmokeDisplay">Отображение дыма</String>
|
<String key="SmokeDisplay">Отображение дыма</String>
|
||||||
<String key="SmokeParticlesMultiplier">Множитель частиц дыма</String>
|
<String key="SmokeParticlesMultiplier">Множитель частиц дыма</String>
|
||||||
@@ -518,28 +521,14 @@
|
|||||||
<String key="VehiclesVolume">Громкость подвижного состава</String>
|
<String key="VehiclesVolume">Громкость подвижного состава</String>
|
||||||
<String key="PositionedSoundsVolume">Громкость позиционных звуков</String>
|
<String key="PositionedSoundsVolume">Громкость позиционных звуков</String>
|
||||||
<String key="AmbientVolume">Громкость окружения</String>
|
<String key="AmbientVolume">Громкость окружения</String>
|
||||||
<String key="SoundDevice">Звуковое устройство и эффекты</String>
|
|
||||||
<String key="SoundOutputDevice">Устройство вывода</String>
|
|
||||||
<String key="SoundSystemDefault">Системное по умолчанию</String>
|
|
||||||
<String key="SoundOutputMode">Конфигурация динамиков</String>
|
|
||||||
<String key="SoundAutomatic">Автоматически</String>
|
|
||||||
<String key="SoundStereoBasic">Стерео (простое панорамирование)</String>
|
|
||||||
<String key="SoundStereoUhj">Стерео (UHJ, шире)</String>
|
|
||||||
<String key="SoundHeadphones">Наушники (HRTF)</String>
|
|
||||||
<String key="SoundOn">Вкл.</String>
|
|
||||||
<String key="SoundOff">Выкл.</String>
|
|
||||||
<String key="SoundHrtfProfile">Набор данных HRTF</String>
|
|
||||||
<String key="SoundLibraryChoice">Выбор библиотеки</String>
|
|
||||||
<String key="SoundResampler">Передискретизация</String>
|
|
||||||
<String key="SoundLibraryDefault">По умолчанию библиотеки</String>
|
|
||||||
<String key="SoundLimiter">Ограничитель выхода</String>
|
|
||||||
<String key="SoundFrequency">Частота микширования</String>
|
|
||||||
<String key="SoundDeviceRate">Частота устройства</String>
|
|
||||||
<String key="SoundDoppler">Эффект Доплера</String>
|
|
||||||
<String key="SoundLowpass">Приглушённые звуки вне кабины</String>
|
|
||||||
<String key="SoundAirAbsorption">Поглощение воздухом</String>
|
|
||||||
|
|
||||||
<String key="Advanced">Дополнительно</String>
|
<String key="Advanced">Дополнительно</String>
|
||||||
|
<String key="AdvancedMode">Расширенный режим</String>
|
||||||
|
<String key="AdvancedModeMenu">Расширенный режим…</String>
|
||||||
|
<String key="AdvancedModeOff">Выключить расширенный режим</String>
|
||||||
|
<String key="AdvancedModeOffConfirm">Выключение расширенного режима вернёт значения по умолчанию для всех настроек, доступных только в нём, и сохранит настройки этой страницы. Выключить?</String>
|
||||||
|
<String key="AdvancedModeOn">Включить</String>
|
||||||
|
<String key="AdvancedModeWarning">Расширенный режим показывает все настройки симулятора и стартера, в том числе те, после изменения которых симулятор может не запуститься, работать нестабильно или показывать плохую картинку. Он также позволяет менять экипажи составов, составы ИИ и декорации, поэтому сценарий может работать не так, как задумал автор. Меняйте эти настройки, только если знаете, что они делают. Проблемы из-за них — не ошибки симулятора: прежде чем сообщить об ошибке, выключите расширенный режим и восстановите настройки по умолчанию. Прочитайте внимательно. Кнопка включения заработает через 20 секунд.</String>
|
||||||
<String key="CompressTextures">Сжимать текстуры TGA</String>
|
<String key="CompressTextures">Сжимать текстуры TGA</String>
|
||||||
<String key="ScaleSpeculars">Масштабировать блики (совместимость со старыми моделями)</String>
|
<String key="ScaleSpeculars">Масштабировать блики (совместимость со старыми моделями)</String>
|
||||||
<String key="ScaleSpecularsDesc">Ослабляет блеск моделей, сделанных для старых рендереров.</String>
|
<String key="ScaleSpecularsDesc">Ослабляет блеск моделей, сделанных для старых рендереров.</String>
|
||||||
@@ -589,6 +578,7 @@
|
|||||||
<String key="Reset">Сбросить</String>
|
<String key="Reset">Сбросить</String>
|
||||||
<String key="SettingsSaved">Настройки сохранены</String>
|
<String key="SettingsSaved">Настройки сохранены</String>
|
||||||
<String key="DefaultsRestored">Восстановлены значения по умолчанию</String>
|
<String key="DefaultsRestored">Восстановлены значения по умолчанию</String>
|
||||||
|
<String key="AllDefaultsConfirm">Все настройки вернутся к значениям по умолчанию. Останутся: язык, выбранный симулятор, порт UART и клавиши управления. Изменения ещё нужно сохранить.</String>
|
||||||
<String key="SettingsRestored">Восстановлены сохранённые настройки</String>
|
<String key="SettingsRestored">Восстановлены сохранённые настройки</String>
|
||||||
<String key="TreeExpanded">развёрнуто</String>
|
<String key="TreeExpanded">развёрнуто</String>
|
||||||
<String key="TreeCollapsed">свёрнуто</String>
|
<String key="TreeCollapsed">свёрнуто</String>
|
||||||
@@ -816,6 +806,7 @@
|
|||||||
<String key="SyntaxIncludeNotClosed">include {1} без end</String>
|
<String key="SyntaxIncludeNotClosed">include {1} без end</String>
|
||||||
<String key="SyntaxTrainsetUnreadable">Не удалось прочитать состав {0}</String>
|
<String key="SyntaxTrainsetUnreadable">Не удалось прочитать состав {0}</String>
|
||||||
<String key="SyntaxVehicleUnreadable">Не удалось прочитать единицу {0}</String>
|
<String key="SyntaxVehicleUnreadable">Не удалось прочитать единицу {0}</String>
|
||||||
|
<String key="SyntaxVehicleMissing">Единица {0} отсутствует: нет файла dynamic/{1} - симулятор её пропустит, состав будет короче</String>
|
||||||
<String key="WarehouseUseInScenery">Вставить в выбранный состав сценерии</String>
|
<String key="WarehouseUseInScenery">Вставить в выбранный состав сценерии</String>
|
||||||
<String key="WarehouseAppendToScenery">Добавить к выбранному составу сценерии</String>
|
<String key="WarehouseAppendToScenery">Добавить к выбранному составу сценерии</String>
|
||||||
<String key="ShortcutUndo">Отменить изменение состава</String>
|
<String key="ShortcutUndo">Отменить изменение состава</String>
|
||||||
@@ -830,7 +821,6 @@
|
|||||||
<String key="Ini.loadinglog">Показывать журнал во время загрузки</String>
|
<String key="Ini.loadinglog">Показывать журнал во время загрузки</String>
|
||||||
<String key="Ini.captureonstart">После запуска мышь вращает камеру</String>
|
<String key="Ini.captureonstart">После запуска мышь вращает камеру</String>
|
||||||
<String key="Ini.mousecontrol">Нажатие органов управления в кабине мышью</String>
|
<String key="Ini.mousecontrol">Нажатие органов управления в кабине мышью</String>
|
||||||
<String key="Ini.fullscreenmonitor">Монитор для полноэкранного режима</String>
|
|
||||||
<String key="Ini.screenshotsdir">Папка снимков экрана</String>
|
<String key="Ini.screenshotsdir">Папка снимков экрана</String>
|
||||||
<String key="Ini.basedrawrange">Базовая дальность прорисовки</String>
|
<String key="Ini.basedrawrange">Базовая дальность прорисовки</String>
|
||||||
<String key="Ini.targetfps">Целевая частота кадров</String>
|
<String key="Ini.targetfps">Целевая частота кадров</String>
|
||||||
@@ -869,8 +859,8 @@
|
|||||||
<String key="PresetHigh">Высокое</String>
|
<String key="PresetHigh">Высокое</String>
|
||||||
<String key="PresetCustom">Своё</String>
|
<String key="PresetCustom">Своё</String>
|
||||||
<String key="MonitorRate">Монитор: {0} Гц</String>
|
<String key="MonitorRate">Монитор: {0} Гц</String>
|
||||||
<String key="MonitorRateNamed">Экран {0}: до {1} Гц</String>
|
|
||||||
<String key="MonitorRateUse">Задать {0} FPS</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="TextureBaseDateHint">ГГГГ-ММ-ДД</String>
|
||||||
<String key="LanguageStarterMissing">Нет перевода стартера: останется английский. Симулятор получит этот язык.</String>
|
<String key="LanguageStarterMissing">Нет перевода стартера: останется английский. Симулятор получит этот язык.</String>
|
||||||
@@ -928,73 +918,12 @@
|
|||||||
<String key="WarehouseSaved">На складе: {0}</String>
|
<String key="WarehouseSaved">На складе: {0}</String>
|
||||||
<String key="WarehouseNothingToAdd">Выберите состав с транспортом</String>
|
<String key="WarehouseNothingToAdd">Выберите состав с транспортом</String>
|
||||||
<String key="GfxGroupLevelTip">Уровень только для этой части графики</String>
|
<String key="GfxGroupLevelTip">Уровень только для этой части графики</String>
|
||||||
<String key="REVulkan">Vulkan 1.4</String>
|
|
||||||
<String key="IdleVulkanOnly">Работает только с Vulkan.</String>
|
|
||||||
<String key="DlssPreset">Пресет DLSS</String>
|
|
||||||
<String key="FrameGeneration">Генерация кадров</String>
|
|
||||||
<String key="Reflex">NVIDIA Reflex</String>
|
|
||||||
<String key="RayTracing">Отражения с трассировкой лучей</String>
|
|
||||||
<String key="RayTracingRange">Дальность трассировки лучей</String>
|
|
||||||
<String key="VulkanDevice">Видеокарта (Vulkan)</String>
|
|
||||||
<String key="Ssr">Отражения в экранном пространстве (SSR)</String>
|
|
||||||
<String key="AmbientOcclusion">Фоновое затенение</String>
|
|
||||||
<String key="AmbientOcclusionQuality">Качество затенения</String>
|
|
||||||
<String key="AoLighting">Затенение в фоновом свете</String>
|
|
||||||
<String key="LightsClustered">Кластерное освещение</String>
|
|
||||||
<String key="LightShadows">Тени ламп и прожекторов</String>
|
|
||||||
<String key="ContactShadows">Контактные тени</String>
|
|
||||||
<String key="ShadowSdsm">Каскады теней по сцене (SDSM)</String>
|
|
||||||
<String key="CabProbe">Зонд кабины</String>
|
|
||||||
<String key="CabProbeInterval">Обновление зонда каждые N кадров</String>
|
|
||||||
<String key="CabProbeReflections">Кабина отражает себя</String>
|
|
||||||
<String key="CabProbeBounce">Отражённый свет лампы в кабине</String>
|
|
||||||
<String key="FogQuality">Качество тумана</String>
|
|
||||||
<String key="Clouds">Объёмные облака</String>
|
|
||||||
<String key="CloudShadows">Тени облаков на земле</String>
|
|
||||||
<String key="Grass">Трава</String>
|
|
||||||
<String key="GrassDistance">Дальность травы</String>
|
|
||||||
<String key="GrassDensity">Густота травы</String>
|
|
||||||
<String key="Precipitation">Осадки (частицы)</String>
|
|
||||||
<String key="Bloom">Свечение ярких мест (bloom)</String>
|
|
||||||
<String key="AutoExposure">Автоматическая экспозиция</String>
|
|
||||||
<String key="LevelOff">Выкл.</String>
|
|
||||||
<String key="LevelLow">Низкое</String>
|
|
||||||
<String key="LevelMedium">Среднее</String>
|
|
||||||
<String key="LevelHigh">Высокое</String>
|
|
||||||
<String key="LevelUltra">Ультра</String>
|
|
||||||
<String key="ReflexOn">Вкл.</String>
|
|
||||||
<String key="ReflexBoost">Вкл. + boost</String>
|
|
||||||
<String key="AaTaa">TAA</String>
|
|
||||||
<String key="AaDlss">DLSS (масштабирование)</String>
|
|
||||||
<String key="AaDlaa">DLAA (родное разрешение)</String>
|
|
||||||
<String key="DlssPresetDefault">Автоматически</String>
|
|
||||||
<String key="DlssPresetK">K: лучшее качество</String>
|
|
||||||
<String key="DlssPresetJ">J: меньше размытия</String>
|
|
||||||
<String key="DlssPresetM">M: для режима Производительность</String>
|
|
||||||
<String key="DlssPresetL">L: для Ультра производительность</String>
|
|
||||||
<String key="Effects">Эффекты</String>
|
<String key="Effects">Эффекты</String>
|
||||||
<String key="GfxColImage">Разрешение и сглаживание</String>
|
<String key="GfxColImage">Разрешение и сглаживание</String>
|
||||||
<String key="GfxColLights">Освещение</String>
|
<String key="GfxColLights">Освещение</String>
|
||||||
<String key="GfxColPostFx">Постобработка</String>
|
<String key="GfxColPostFx">Постобработка</String>
|
||||||
<String key="GfxColNature">Дым</String>
|
<String key="GfxColNature">Дым</String>
|
||||||
<String key="AntiAliasing">Сглаживание</String>
|
<String key="AntiAliasing">Сглаживание</String>
|
||||||
<String key="VolumetricFog">Объёмный туман</String>
|
|
||||||
<String key="REOpenGLNote">DLSS, генерация кадров, Reflex и трассировка лучей только с Vulkan.</String>
|
|
||||||
<String key="REVulkanNote">Нужен exe с Vulkan и карта с его поддержкой. Иначе симулятор запустит Полный или Старый.</String>
|
|
||||||
<String key="VulkanDeviceAuto">автоматически</String>
|
|
||||||
<String key="DlssPresetInfoDefault">K для DLAA, «Качества» и «Баланса», M для «Производительности», L для «Ультрапроизводительности». Драйвер может изменить это при обновлении.</String>
|
|
||||||
<String key="DlssPresetInfoK">Модель transformer с лучшим качеством изображения, но самая затратная. По умолчанию для DLAA, «Качества» и «Баланса».</String>
|
|
||||||
<String key="DlssPresetInfoJ">Похожа на K: чуть меньше шлейфов за движущимися объектами ценой большего мерцания. NVIDIA скорее рекомендует K.</String>
|
|
||||||
<String key="DlssPresetInfoM">Модель для режима «Производительность» (масштаб около 50%), в нём по умолчанию. Сама вычисляет экспозицию.</String>
|
|
||||||
<String key="DlssPresetInfoL">Модель для режима «Ультрапроизводительность» (масштаб около 33%), в нём по умолчанию. Сама вычисляет экспозицию.</String>
|
|
||||||
<String key="DlssMissingLibraryNote">Рядом с симулятором нет {0}: без этой библиотеки симулятор не использует эту функцию DLSS.</String>
|
|
||||||
<String key="DlssNoPlatformNote">На macOS DLSS недоступен.</String>
|
|
||||||
<String key="FrameGenerationNeedsDlssNote">Генерация кадров работает только с DLSS или DLAA.</String>
|
|
||||||
<String key="ReflexForcedNote">Генерация кадров сама включает Reflex, что бы здесь ни было выбрано.</String>
|
|
||||||
<String key="AoLightingPrepassNote">Нужна глубина всей сцены до цвета; без SSR и контактных теней это лишний проход (нагрузка на ЦП в OpenGL).</String>
|
|
||||||
<String key="AoNeedsPipelineNote">Если постобработка пропущена, AO не работает.</String>
|
|
||||||
<String key="CabProbeReflectionsOnlyNote">Без кластерного освещения и лампы кабины как источника света (gfx.lights.cab) зонд даёт только отражения.</String>
|
|
||||||
<String key="TemporalNeedsPipelineNote">TAA и DLSS работают в постобработке: если её пропустить, края не сгладятся.</String>
|
|
||||||
<String key="SettingsFile">Файл eu07.ini</String>
|
<String key="SettingsFile">Файл eu07.ini</String>
|
||||||
<String key="ImportIni">Импорт…</String>
|
<String key="ImportIni">Импорт…</String>
|
||||||
<String key="ImportIniTitle">Импорт настроек из eu07.ini</String>
|
<String key="ImportIniTitle">Импорт настроек из eu07.ini</String>
|
||||||
@@ -1007,9 +936,8 @@
|
|||||||
{0}</String>
|
{0}</String>
|
||||||
<String key="ExportIniDone">Экспортировано в {0}</String>
|
<String key="ExportIniDone">Экспортировано в {0}</String>
|
||||||
<String key="REFull">Полный</String>
|
<String key="REFull">Полный</String>
|
||||||
<String key="REOld">Старый</String>
|
<String key="REOld">Старый (не рекомендуется, если Полный работает)</String>
|
||||||
<String key="RESimp">Упрощённый</String>
|
<String key="RESimp">Упрощённый (не рекомендуется, если Полный работает)</String>
|
||||||
<String key="REExperimental">Экспериментальный</String>
|
|
||||||
<String key="RenderAngleVulkan">Использовать рендерер ANGLE Vulkan</String>
|
<String key="RenderAngleVulkan">Использовать рендерер ANGLE Vulkan</String>
|
||||||
<String key="RenderVBO">Отрисовка VBO</String>
|
<String key="RenderVBO">Отрисовка VBO</String>
|
||||||
<String key="CabShadowsRange">Дальность источников теней в кабине</String>
|
<String key="CabShadowsRange">Дальность источников теней в кабине</String>
|
||||||
@@ -1017,6 +945,4 @@
|
|||||||
<String key="UseGLESDesc">OpenGL ES вместо OpenGL. Не работает с рендерером legacy.</String>
|
<String key="UseGLESDesc">OpenGL ES вместо OpenGL. Не работает с рендерером legacy.</String>
|
||||||
<String key="GpuCard">{0}, {1} ГБ</String>
|
<String key="GpuCard">{0}, {1} ГБ</String>
|
||||||
<String key="GpuCardShared">{0}, общая память</String>
|
<String key="GpuCardShared">{0}, общая память</String>
|
||||||
<String key="GfxColNewRenderer">Новое в OpenGL 4.6 / Vulkan</String>
|
|
||||||
<String key="GfxNewRendererNote">Работает только с новым exe. Старый exe пропускает эти настройки.</String>
|
|
||||||
</Language>
|
</Language>
|
||||||
|
|||||||
Reference in New Issue
Block a user