mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-10-31 03:59:58 +01:00
Add settings parsing
This commit is contained in:
@@ -60,6 +60,10 @@ public partial class Scenarios : UserControl
|
||||
Tag = i
|
||||
});
|
||||
}
|
||||
|
||||
// refresh the consist preview when the view is shown again (e.g. after
|
||||
// editing the consist in the depot)
|
||||
AttachedToVisualTree += (_, _) => RefreshSelectedConsist();
|
||||
}
|
||||
|
||||
private void SceneryList_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
@@ -89,16 +93,14 @@ public partial class Scenarios : UserControl
|
||||
|
||||
private void VehicleList_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
consistStack.Children.Clear();
|
||||
|
||||
// get selected scenery
|
||||
var tItem = sceneryList.SelectedItem as TreeViewItem;
|
||||
if (tItem?.Tag is not int tTag)
|
||||
return;
|
||||
Scenery selectedScn = sceneries[tTag];
|
||||
|
||||
|
||||
// get selected trainset
|
||||
ListBoxItem vItem = vehicleList.SelectedItem as ListBoxItem;
|
||||
ListBoxItem? vItem = vehicleList.SelectedItem as ListBoxItem;
|
||||
if (vItem?.Tag is not int vTag)
|
||||
return;
|
||||
Trainset selectedTrainset = selectedScn.Trainsets[vTag];
|
||||
@@ -107,29 +109,41 @@ public partial class Scenarios : UserControl
|
||||
AppState.Instance.CurrentScenery = selectedScn;
|
||||
AppState.Instance.CurrentTrainset = selectedTrainset;
|
||||
|
||||
ShowConsist(selectedTrainset);
|
||||
}
|
||||
|
||||
// Renders the consist preview for a trainset (re-reads its current vehicles
|
||||
// so depot edits are reflected).
|
||||
private void ShowConsist(Trainset trainset)
|
||||
{
|
||||
consistStack.Children.Clear();
|
||||
|
||||
var db = GameData.Instance.Vehicles;
|
||||
foreach (var train in selectedTrainset.Vehicles)
|
||||
foreach (var train in trainset.Vehicles)
|
||||
{
|
||||
// thumbnail name comes from the matching texture's texture_mini
|
||||
string miniName = db.MiniForSkin(train.SkinFile) ?? train.SkinFile;
|
||||
string? path = VehicleDatabase.MiniPath(miniName);
|
||||
if (path is null)
|
||||
{
|
||||
// fallback
|
||||
continue;
|
||||
}
|
||||
continue; // fallback: no mini
|
||||
|
||||
var bitmap = new Bitmap(path);
|
||||
var image = new Image
|
||||
consistStack.Children.Add(new Image
|
||||
{
|
||||
Source = bitmap,
|
||||
Source = new Bitmap(path),
|
||||
Height = 45,
|
||||
Stretch = Avalonia.Media.Stretch.Uniform,
|
||||
Margin = new Thickness(0)
|
||||
};
|
||||
consistStack.Children.Add(image);
|
||||
});
|
||||
}
|
||||
missionDescription.Text = selectedTrainset.Description;
|
||||
missionDescription.Text = trainset.Description;
|
||||
}
|
||||
|
||||
// When returning to this view, refresh the preview of the selected consist
|
||||
// in case it was modified in the depot.
|
||||
private void RefreshSelectedConsist()
|
||||
{
|
||||
if (AppState.Instance.CurrentTrainset is { } trainset)
|
||||
ShowConsist(trainset);
|
||||
}
|
||||
|
||||
// Exports the (possibly depot-modified) scenery to a $-prefixed copy and
|
||||
@@ -159,6 +173,9 @@ public partial class Scenarios : UserControl
|
||||
.FirstOrDefault(v => v.DriverType is eDriverType.Headdriver or eDriverType.Reardriver)?.Name
|
||||
?? trainset?.Vehicles.FirstOrDefault()?.Name;
|
||||
|
||||
// make sure the latest settings are on disk before the sim reads them
|
||||
StarterNG.Classes.Settings.Instance.CaptureAndSave();
|
||||
|
||||
// launch the game: -s $<name>.scn -v <vehicle>
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -7,376 +7,392 @@
|
||||
xmlns:starterNg="clr-namespace:StarterNG"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="StarterNG.Views.Settings">
|
||||
<suki:SettingsLayout>
|
||||
<suki:SettingsLayout.Items>
|
||||
<objectModel:ObservableCollection x:TypeArguments="suki:SettingsLayoutItem">
|
||||
<suki:SettingsLayoutItem Header="{Binding [General], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label Content="{Binding [Language], Source={x:Static starterNg:App.Loc}}" VerticalAlignment="Center" FontSize="14"/>
|
||||
<ComboBox x:Name="ChangeLanguageCb" MinWidth="350" MaxWidth="350" SelectedIndex="1" SelectionChanged="LanguageComboBox_OnSelectionChanged">
|
||||
<ComboBoxItem>Polski</ComboBoxItem>
|
||||
<ComboBoxItem>English</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<DockPanel>
|
||||
<!-- Save / reset bar -->
|
||||
<Border DockPanel.Dock="Bottom" Padding="16,10" Background="#11000000">
|
||||
<StackPanel Orientation="Horizontal" Spacing="12" HorizontalAlignment="Right">
|
||||
<TextBlock x:Name="SaveStatus" VerticalAlignment="Center" Opacity="0.8" Text="" />
|
||||
<Button x:Name="ResetButton" Classes="Flat" Click="ResetButton_OnClick"
|
||||
Content="{Binding [Reset], Source={x:Static starterNg:App.Loc}}" />
|
||||
<Button x:Name="SaveButton" Classes="Flat Accent" Click="SaveButton_OnClick"
|
||||
Content="{Binding [Save], Source={x:Static starterNg:App.Loc}}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<suki:SettingsLayout>
|
||||
<suki:SettingsLayout.Items>
|
||||
<objectModel:ObservableCollection x:TypeArguments="suki:SettingsLayoutItem">
|
||||
<suki:SettingsLayoutItem Header="{Binding [General], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label Content="{Binding [Language], Source={x:Static starterNg:App.Loc}}" VerticalAlignment="Center" FontSize="14"/>
|
||||
<ComboBox x:Name="ChangeLanguageCb" MinWidth="350" MaxWidth="350" SelectedIndex="1" SelectionChanged="LanguageComboBox_OnSelectionChanged">
|
||||
<ComboBoxItem>Polski</ComboBoxItem>
|
||||
<ComboBoxItem>English</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox x:Name="FullscreenCb" Content="{Binding [Fullscreen], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="PauseInactiveCb" Content="{Binding [PauseSimInactive], Source={x:Static starterNg:App.Loc}}" />
|
||||
|
||||
<CheckBox x:Name="PauseStartCb" Content="{Binding [PauseSimStart], Source={x:Static starterNg:App.Loc}}" />
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [CursorSensitivity], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="CursorSensitivitySlider" Minimum="1" Maximum="5" TickFrequency="1" MinWidth="200" MaxWidth="200"
|
||||
IsSnapToTickEnabled="True" Value="3">
|
||||
</Slider>
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox x:Name="MouseHorInvertCb" Content="{Binding [MouseHorInvert], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox x:Name="MouseVertInvertCb" Content="{Binding [MouseVertInvert], Source={x:Static starterNg:App.Loc}}" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [Fullscreen], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
<suki:SettingsLayoutItem Header="{Binding [Communication], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<CheckBox x:Name="GamepadIgnoreCb" Content="{Binding [GamepadSignalIgnore], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [PauseSimInactive], Source={x:Static starterNg:App.Loc}}" />
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [Feedback], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="FeedbackCb" MinWidth="350" MaxWidth="350" SelectedIndex="0">
|
||||
<ComboBoxItem Tag="0" Content="{Binding [FeedbackOff], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="1" Content="{Binding [FeedbackCASHP], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="2" Content="{Binding [FeedbackCA], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="3" Content="{Binding [FeedbackLPT], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="4" Content="{Binding [FeedbackPoKeys], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="5" Content="{Binding [FeedbackSP], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [PauseSimStart], Source={x:Static starterNg:App.Loc}}" />
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [CursorSensitivity], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" Maximum="5" TickFrequency="1" MinWidth="200" MaxWidth="200"
|
||||
IsSnapToTickEnabled="True" Value="3">
|
||||
</Slider>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<CheckBox Content="{Binding [MouseHorInvert], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox Content="{Binding [MouseVertInvert], Source={x:Static starterNg:App.Loc}}" />
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
<suki:SettingsLayoutItem Header="{Binding [Communication], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<CheckBox Content="{Binding [GamepadSignalIgnore], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<suki:SettingsLayoutItem Header="{Binding [Others], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [SelectEXE], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="SelectExeCb" MinWidth="350" MaxWidth="350" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [SelectEXEAuto], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem>eu07.exe</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [Feedback], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="350" MaxWidth="350" SelectedIndex="0">
|
||||
<ComboBoxItem Tag="0" Content="{Binding [FeedbackOff], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="1" Content="{Binding [FeedbackCASHP], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="2" Content="{Binding [FeedbackCA], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="3" Content="{Binding [FeedbackLPT], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="4" Content="{Binding [FeedbackPoKeys], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Tag="5" Content="{Binding [FeedbackSP], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
<CheckBox x:Name="DebugModeCb" Content="{Binding [DebugMode], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="VirtualShuntingCb" Content="{Binding [VirtualShunting], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
<suki:SettingsLayoutItem Header="{Binding [Graphic], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [RenderEngine], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="RenderEngineCb" MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [REFull], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [REOld], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RESimpShader], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RESimp], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [REOff], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [REExperimental], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [Resolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="ResolutionCb" MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem>3840x2160</ComboBoxItem>
|
||||
<ComboBoxItem>2560x1440</ComboBoxItem>
|
||||
<ComboBoxItem>1920x1080</ComboBoxItem>
|
||||
<ComboBoxItem>1600x900</ComboBoxItem>
|
||||
<ComboBoxItem>1366x768</ComboBoxItem>
|
||||
<ComboBoxItem>1280x720</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [BufforResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="bufferScale" Minimum="50" MaxWidth="400" HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="200" TickFrequency="1" IsSnapToTickEnabled="True"
|
||||
Value="100" />
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Text="{Binding #bufferScale.Value, StringFormat='{}{0}%'}" />
|
||||
</StackPanel>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Others], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [SelectEXE], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="350" MaxWidth="350" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [SelectEXEAuto], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem>eu07.exe</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [MaxTexResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="textureResolutionSlider" Minimum="9" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="14"
|
||||
ValueChanged="TextureResolutionSlider_OnValueChanged" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12" />
|
||||
<TextBlock Name="texResolution" VerticalAlignment="Center" Text="4096" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [MaxTexCabResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="cabTextureResolutionSlider" Minimum="9" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="14"
|
||||
ValueChanged="CabTextureResolutionSlider_OnValueChanged" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12" />
|
||||
<TextBlock Name="cabTexResolution" VerticalAlignment="Center" Text="4096" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [TexFilteringQuality], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="TexFilteringSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="5"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="4" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [Multisampling], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="MultisamplingSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="4"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="3" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [RenderRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="RenderRangeSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="3" Value="1" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox x:Name="VSyncCb" Content="{Binding [VSync], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="SmokeDisplayCb" Content="{Binding [SmokeDisplay], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [SmokeParticlesMultiplier], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="SmokeParticlesSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="4"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="2" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [Postprocessing], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="PostprocessingCb" MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [PPReinhard], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [PPACES], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox x:Name="ChromaticAberrationCb" Content="{Binding [ChromaticAberration], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="MotionBlurCb" Content="{Binding [MotionBlur], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="AdditionalShadersCb" Content="{Binding [AdditionalShadersEffects], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="ReflectionsCubeMapCb" Content="{Binding [ReflectionsCubeMap], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="RenderVBOCb" Content="{Binding [RenderVBO], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="RenderShadowsCb" Content="{Binding [RenderShadows], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ReflectionsFramerate], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="reflectionsFramerate" Minimum="5" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="120"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="30" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #reflectionsFramerate.Value, StringFormat='{}{0} FPS'}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShadowsResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="shaderResolutionSlider" Minimum="9" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="14"
|
||||
ValueChanged="shaderResolutionSlider_OnValueChanged" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12" />
|
||||
<TextBlock Name="shaderResolution" VerticalAlignment="Center" Text="4096 px" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShaderRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="shaderRange" Minimum="25" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="400"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="150" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #shaderRange.Value, StringFormat='{}{0} m'}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [CabShadowsRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="cabShaderSourceRange" Minimum="0" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="10"
|
||||
IsSnapToTickEnabled="True" Value="30" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #cabShaderSourceRange.Value, StringFormat='{}{0} m'}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShadowDisplay], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="ShadowDisplayCb" MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [CSROnlyImportant], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [CSRLimited], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [CSRAll], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ReflectionsDetails], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox x:Name="ReflectionsDetailsCb" MinWidth="350" MaxWidth="350" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [RDTerrain], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModels], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModelsVehicles], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShadowsCabRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="fovSlider" Minimum="5" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="110"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="30" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #fovSlider.Value, StringFormat='{}{0} stopni'}" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox x:Name="RenderScreensCb" Content="{Binding [RenderScreens], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox x:Name="RenderScreensThreadCb" Content="{Binding [RenderScreensThread], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [RenderScreensFramerate], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="RenderScreensFramerateSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="5"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="5" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<CheckBox Content="{Binding [DebugMode], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<suki:SettingsLayoutItem Header="{Binding [Physics], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [TrackCurvesQuality], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="TrackCurvesSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="4"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="4" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [VirtualShunting], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
<CheckBox x:Name="PhysicsAccuracyCb" Content="{Binding [PhysicsAccuracyIncreased], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Graphic], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [RenderEngine], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [REFull], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [REOld], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RESimpShader], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RESimp], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [REOff], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [REExperimental], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
<CheckBox x:Name="PantographBreakCb" Content="{Binding [BreakingPantographPossibility], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="OverheadOnlyCb" Content="{Binding [PowerOverheadLineOnly], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="SpeedometerTapesCb" Content="{Binding [SaveSpeedometerTapes], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="SimLogsCb" Content="{Binding [SaveSimLogs], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="KeepLogsCb" Content="{Binding [KeepPrevLogs], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="DisplaySimulationCb" Content="{Binding [DisplaySimulation], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox x:Name="CrashDamageCb" Content="{Binding [CrashDamage], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<Label VerticalAlignment="Center" FontSize="14" Content="{Binding [Resolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem>2560x1440</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Sounds], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<CheckBox x:Name="EnableSoundsCb" Content="{Binding [EnableSounds], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [Volume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="VolumeSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [RadiophoneVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="RadioVolumeSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [VehiclesVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="VehiclesVolumeSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [PositionedSoundsVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="PositionalVolumeSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [AmbientVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="AmbientVolumeSlider" Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [VolumeDuringPause], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider x:Name="PauseVolumeSlider" Minimum="0" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="0" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [BufforResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="bufferScale" Minimum="50" MaxWidth="400" HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="200" TickFrequency="1" IsSnapToTickEnabled="True"
|
||||
Value="100" />
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Text="{Binding #bufferScale.Value, StringFormat='{}{0}%'}" />
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Starter], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<CheckBox x:Name="AutoCloseStarterCb" Content="{Binding [AutoCloseStarter], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox x:Name="LargeThumbnailsCb" Content="{Binding [LargeThumbnails], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox x:Name="AutoExpandTreeCb" Content="{Binding [AutoExpandSceneryTree], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [MaxTexResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="textureResolutionSlider" Minimum="9" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="14"
|
||||
ValueChanged="TextureResolutionSlider_OnValueChanged" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12" />
|
||||
<TextBlock Name="texResolution" VerticalAlignment="Center" Text="4096" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [MaxTexCabResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="cabTextureResolutionSlider" Minimum="9" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="14"
|
||||
ValueChanged="CabTextureResolutionSlider_OnValueChanged" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12" />
|
||||
<TextBlock Name="cabTexResolution" VerticalAlignment="Center" Text="4096" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [TexFilteringQuality], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="5"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="4" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [Multisampling], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="4"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="3" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [RenderRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="3" Value="1" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [VSync], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [SmokeDisplay], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [SmokeParticlesMultiplier], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="4"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="2" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [Postprocessing], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [PPReinhard], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [PPACES], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [ChromaticAberration], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [MotionBlur], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [AdditionalShadersEffects], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [ReflectionsCubeMap], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [RenderVBO], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [RenderShadows], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ReflectionsFramerate], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="reflectionsFramerate" Minimum="5" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="120"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="30" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #reflectionsFramerate.Value, StringFormat='{}{0} FPS'}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShadowsResolution], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="shaderResolutionSlider" Minimum="9" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="14"
|
||||
ValueChanged="shaderResolutionSlider_OnValueChanged" TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="12" />
|
||||
<TextBlock Name="shaderResolution" VerticalAlignment="Center" Text="4096 px" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShaderRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="shaderRange" Minimum="25" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="400"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="150" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #shaderRange.Value, StringFormat='{}{0} m'}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [CabShadowsRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="cabShaderSourceRange" Minimum="0" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="10"
|
||||
IsSnapToTickEnabled="True" Value="30" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #cabShaderSourceRange.Value, StringFormat='{}{0} m'}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShadowDisplay], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="150" MaxWidth="150" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [CSROnlyImportant], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [CSRLimited], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [CSRAll], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ReflectionsDetails], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBox MinWidth="350" MaxWidth="350" SelectedIndex="0">
|
||||
<ComboBoxItem Content="{Binding [RDTerrain], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModels], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<ComboBoxItem Content="{Binding [RDTerrainModelsVehicles], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [ShadowsCabRange], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Name="fovSlider" Minimum="5" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="110"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="30" />
|
||||
<Label VerticalAlignment="Center" FontSize="14"
|
||||
Content="{Binding #fovSlider.Value, StringFormat='{}{0} stopni'}" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [RenderScreens], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox Content="{Binding [RenderScreensThread], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [RenderScreensFramerate], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="5"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="5" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Physics], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [TrackCurvesQuality], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="4"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True" Value="4" />
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Content="{Binding [PhysicsAccuracyIncreased], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [BreakingPantographPossibility], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [PowerOverheadLineOnly], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [SaveSpeedometerTapes], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [SaveSimLogs], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [KeepPrevLogs], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [DisplaySimulation], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<CheckBox Content="{Binding [CrashDamage], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Sounds], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<CheckBox Content="{Binding [EnableSounds], Source={x:Static starterNg:App.Loc}}"/>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [Volume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [RadiophoneVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [VehiclesVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [PositionedSoundsVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [AmbientVolume], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="8" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding [VolumeDuringPause], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<Slider Minimum="1" MaxWidth="400"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="250" Maximum="100"
|
||||
TickFrequency="5"
|
||||
IsSnapToTickEnabled="True" Value="100" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
|
||||
<suki:SettingsLayoutItem Header="{Binding [Starter], Source={x:Static starterNg:App.Loc}}">
|
||||
<suki:SettingsLayoutItem.Content>
|
||||
<StackPanel Spacing="8" Orientation="Vertical">
|
||||
<CheckBox Content="{Binding [AutoCloseStarter], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox Content="{Binding [LargeThumbnails], Source={x:Static starterNg:App.Loc}}"/>
|
||||
<CheckBox Content="{Binding [AutoExpandSceneryTree], Source={x:Static starterNg:App.Loc}}"/>
|
||||
</StackPanel>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
</objectModel:ObservableCollection>
|
||||
</suki:SettingsLayout.Items>
|
||||
</suki:SettingsLayout>
|
||||
</UserControl>
|
||||
</suki:SettingsLayoutItem.Content>
|
||||
</suki:SettingsLayoutItem>
|
||||
</objectModel:ObservableCollection>
|
||||
</suki:SettingsLayout.Items>
|
||||
</suki:SettingsLayout>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,30 +1,259 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml.Styling;
|
||||
using StarterNG.Classes;
|
||||
|
||||
namespace StarterNG.Views;
|
||||
|
||||
public partial class Settings : UserControl
|
||||
{
|
||||
private bool _loading;
|
||||
|
||||
public Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.AttachedToVisualTree += (_, _) =>
|
||||
{
|
||||
TextureResolutionSlider_OnValueChanged(null, null);
|
||||
CabTextureResolutionSlider_OnValueChanged(null, null);
|
||||
shaderResolutionSlider_OnValueChanged(null, null);
|
||||
};
|
||||
|
||||
|
||||
ChangeLanguageCb.SelectedIndex = App.Loc.CurrentLanguage switch
|
||||
{
|
||||
"Polski" => 0,
|
||||
_ => 1
|
||||
};
|
||||
|
||||
// The settings instance pulls live values from here whenever the app
|
||||
// closes or the game is launched.
|
||||
StarterNG.Classes.Settings.Instance.CaptureFromUi = ReadFromUi;
|
||||
|
||||
ApplyToUi();
|
||||
}
|
||||
|
||||
// ── Settings instance → controls ──────────────────────────────────────
|
||||
private void ApplyToUi()
|
||||
{
|
||||
var s = StarterNG.Classes.Settings.Instance;
|
||||
_loading = true;
|
||||
try
|
||||
{
|
||||
// General
|
||||
ChangeLanguageCb.SelectedIndex = s.Language == "Polski" ? 0 : 1;
|
||||
FullscreenCb.IsChecked = s.Fullscreen;
|
||||
PauseInactiveCb.IsChecked = s.PauseWhenInactive;
|
||||
PauseStartCb.IsChecked = s.PauseOnStart;
|
||||
CursorSensitivitySlider.Value = s.CursorSensitivity;
|
||||
MouseHorInvertCb.IsChecked = s.InvertMouseHorizontal;
|
||||
MouseVertInvertCb.IsChecked = s.InvertMouseVertical;
|
||||
|
||||
// Communication
|
||||
GamepadIgnoreCb.IsChecked = s.IgnoreGamepad;
|
||||
FeedbackCb.SelectedIndex = s.FeedbackMode;
|
||||
|
||||
// Other
|
||||
SelectExeCb.SelectedIndex = s.SelectExeAutomatically ? 0 : 1;
|
||||
DebugModeCb.IsChecked = s.DebugMode;
|
||||
VirtualShuntingCb.IsChecked = s.VirtualShunting;
|
||||
|
||||
// Graphics
|
||||
RenderEngineCb.SelectedIndex = s.RenderEngine;
|
||||
SelectResolution(s.Width, s.Height);
|
||||
bufferScale.Value = s.BufferScalePercent;
|
||||
textureResolutionSlider.Value = Log2(s.MaxTextureSize, 12);
|
||||
cabTextureResolutionSlider.Value = Log2(s.MaxCabTextureSize, 12);
|
||||
TexFilteringSlider.Value = AnisotropyToSlider(s.TextureFiltering);
|
||||
MultisamplingSlider.Value = s.Multisampling + 1;
|
||||
RenderRangeSlider.Value = (int)Math.Round(s.DrawRangeFactor);
|
||||
VSyncCb.IsChecked = s.VSync;
|
||||
SmokeDisplayCb.IsChecked = s.Smoke;
|
||||
SmokeParticlesSlider.Value = s.SmokeFidelity;
|
||||
PostprocessingCb.SelectedIndex = s.Tonemapping;
|
||||
ChromaticAberrationCb.IsChecked = s.ChromaticAberration;
|
||||
MotionBlurCb.IsChecked = s.MotionBlur;
|
||||
AdditionalShadersCb.IsChecked = s.ExtraEffects;
|
||||
ReflectionsCubeMapCb.IsChecked = s.EnvMap;
|
||||
RenderVBOCb.IsChecked = s.UseVbo;
|
||||
RenderShadowsCb.IsChecked = s.RenderShadows;
|
||||
reflectionsFramerate.Value = s.ReflectionsFramerate;
|
||||
shaderResolutionSlider.Value = Log2(s.ShadowMapResolution, 12);
|
||||
shaderRange.Value = s.ShadowProjectionRange;
|
||||
cabShaderSourceRange.Value = s.CabShadowsRange;
|
||||
ShadowDisplayCb.SelectedIndex = Clamp(s.ShadowRankCutoff - 1, 0, 2);
|
||||
ReflectionsDetailsCb.SelectedIndex = s.ReflectionsFidelity;
|
||||
fovSlider.Value = s.FieldOfView;
|
||||
RenderScreensCb.IsChecked = s.PythonScreens;
|
||||
RenderScreensThreadCb.IsChecked = s.PythonThreadedUpload;
|
||||
RenderScreensFramerateSlider.Value = s.ScreenRendererPriority;
|
||||
|
||||
// Physics
|
||||
TrackCurvesSlider.Value = s.SplineFidelity;
|
||||
PhysicsAccuracyCb.IsChecked = s.FullPhysics;
|
||||
PantographBreakCb.IsChecked = s.EnableTraction;
|
||||
OverheadOnlyCb.IsChecked = s.LiveTraction;
|
||||
SpeedometerTapesCb.IsChecked = s.PhysicsLog;
|
||||
SimLogsCb.IsChecked = s.DebugLog;
|
||||
KeepLogsCb.IsChecked = s.MultipleLogs;
|
||||
DisplaySimulationCb.IsChecked = s.DisplaySimulation;
|
||||
CrashDamageCb.IsChecked = s.CrashDamage;
|
||||
|
||||
// Sound
|
||||
EnableSoundsCb.IsChecked = s.SoundEnabled;
|
||||
VolumeSlider.Value = s.Volume;
|
||||
RadioVolumeSlider.Value = s.RadioVolume;
|
||||
VehiclesVolumeSlider.Value = s.VehiclesVolume;
|
||||
PositionalVolumeSlider.Value = s.PositionalVolume;
|
||||
AmbientVolumeSlider.Value = s.AmbientVolume;
|
||||
PauseVolumeSlider.Value = s.PausedVolume;
|
||||
|
||||
// Starter
|
||||
AutoCloseStarterCb.IsChecked = s.AutoCloseStarter;
|
||||
LargeThumbnailsCb.IsChecked = s.LargeThumbnails;
|
||||
AutoExpandTreeCb.IsChecked = s.AutoExpandSceneryTree;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
// ── controls → Settings instance ──────────────────────────────────────
|
||||
private void ReadFromUi()
|
||||
{
|
||||
var s = StarterNG.Classes.Settings.Instance;
|
||||
|
||||
// General
|
||||
s.Language = ChangeLanguageCb.SelectedIndex == 0 ? "Polski" : "English";
|
||||
s.Fullscreen = IsChecked(FullscreenCb);
|
||||
s.PauseWhenInactive = IsChecked(PauseInactiveCb);
|
||||
s.PauseOnStart = IsChecked(PauseStartCb);
|
||||
s.CursorSensitivity = (int)CursorSensitivitySlider.Value;
|
||||
s.InvertMouseHorizontal = IsChecked(MouseHorInvertCb);
|
||||
s.InvertMouseVertical = IsChecked(MouseVertInvertCb);
|
||||
|
||||
// Communication
|
||||
s.IgnoreGamepad = IsChecked(GamepadIgnoreCb);
|
||||
s.FeedbackMode = Math.Max(0, FeedbackCb.SelectedIndex);
|
||||
|
||||
// Other
|
||||
s.SelectExeAutomatically = SelectExeCb.SelectedIndex == 0;
|
||||
s.ExecutablePath = s.SelectExeAutomatically ? "eu07.exe"
|
||||
: (SelectExeCb.SelectedItem as ComboBoxItem)?.Content?.ToString() ?? "eu07.exe";
|
||||
s.DebugMode = IsChecked(DebugModeCb);
|
||||
s.VirtualShunting = IsChecked(VirtualShuntingCb);
|
||||
|
||||
// Graphics
|
||||
s.RenderEngine = Math.Max(0, RenderEngineCb.SelectedIndex);
|
||||
ReadResolution(s);
|
||||
s.BufferScalePercent = (int)bufferScale.Value;
|
||||
s.MaxTextureSize = 1 << (int)textureResolutionSlider.Value;
|
||||
s.MaxCabTextureSize = 1 << (int)cabTextureResolutionSlider.Value;
|
||||
s.TextureFiltering = StarterNG.Classes.Settings.AnisotropySteps[
|
||||
Clamp((int)TexFilteringSlider.Value - 1, 0, StarterNG.Classes.Settings.AnisotropySteps.Length - 1)];
|
||||
s.Multisampling = Clamp((int)MultisamplingSlider.Value - 1, 0, 3);
|
||||
s.DrawRangeFactor = RenderRangeSlider.Value;
|
||||
s.VSync = IsChecked(VSyncCb);
|
||||
s.Smoke = IsChecked(SmokeDisplayCb);
|
||||
s.SmokeFidelity = (int)SmokeParticlesSlider.Value;
|
||||
s.Tonemapping = Math.Max(0, PostprocessingCb.SelectedIndex);
|
||||
s.ChromaticAberration = IsChecked(ChromaticAberrationCb);
|
||||
s.MotionBlur = IsChecked(MotionBlurCb);
|
||||
s.ExtraEffects = IsChecked(AdditionalShadersCb);
|
||||
s.EnvMap = IsChecked(ReflectionsCubeMapCb);
|
||||
s.UseVbo = IsChecked(RenderVBOCb);
|
||||
s.RenderShadows = IsChecked(RenderShadowsCb);
|
||||
s.ReflectionsFramerate = (int)reflectionsFramerate.Value;
|
||||
s.ShadowMapResolution = 1 << (int)shaderResolutionSlider.Value;
|
||||
s.ShadowProjectionRange = (int)shaderRange.Value;
|
||||
s.CabShadowsRange = (int)cabShaderSourceRange.Value;
|
||||
s.ShadowRankCutoff = Math.Max(0, ShadowDisplayCb.SelectedIndex) + 1;
|
||||
s.ReflectionsFidelity = Math.Max(0, ReflectionsDetailsCb.SelectedIndex);
|
||||
s.FieldOfView = Clamp((int)fovSlider.Value, 15, 75);
|
||||
s.PythonScreens = IsChecked(RenderScreensCb);
|
||||
s.PythonThreadedUpload = IsChecked(RenderScreensThreadCb);
|
||||
s.ScreenRendererPriority = (int)RenderScreensFramerateSlider.Value;
|
||||
|
||||
// Physics
|
||||
s.SplineFidelity = (int)TrackCurvesSlider.Value;
|
||||
s.FullPhysics = IsChecked(PhysicsAccuracyCb);
|
||||
s.EnableTraction = IsChecked(PantographBreakCb);
|
||||
s.LiveTraction = IsChecked(OverheadOnlyCb);
|
||||
s.PhysicsLog = IsChecked(SpeedometerTapesCb);
|
||||
s.DebugLog = IsChecked(SimLogsCb);
|
||||
s.MultipleLogs = IsChecked(KeepLogsCb);
|
||||
s.DisplaySimulation = IsChecked(DisplaySimulationCb);
|
||||
s.CrashDamage = IsChecked(CrashDamageCb);
|
||||
|
||||
// Sound
|
||||
s.SoundEnabled = IsChecked(EnableSoundsCb);
|
||||
s.Volume = (int)VolumeSlider.Value;
|
||||
s.RadioVolume = (int)RadioVolumeSlider.Value;
|
||||
s.VehiclesVolume = (int)VehiclesVolumeSlider.Value;
|
||||
s.PositionalVolume = (int)PositionalVolumeSlider.Value;
|
||||
s.AmbientVolume = (int)AmbientVolumeSlider.Value;
|
||||
s.PausedVolume = (int)PauseVolumeSlider.Value;
|
||||
|
||||
// Starter
|
||||
s.AutoCloseStarter = IsChecked(AutoCloseStarterCb);
|
||||
s.LargeThumbnails = IsChecked(LargeThumbnailsCb);
|
||||
s.AutoExpandSceneryTree = IsChecked(AutoExpandTreeCb);
|
||||
}
|
||||
|
||||
private void SaveButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
ReadFromUi();
|
||||
StarterNG.Classes.Settings.Instance.Save();
|
||||
if (SaveStatus is not null)
|
||||
SaveStatus.Text = App.Loc["SettingsSaved"];
|
||||
}
|
||||
|
||||
private void ResetButton_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
StarterNG.Classes.Settings.Instance.Load();
|
||||
ApplyToUi();
|
||||
if (SaveStatus is not null)
|
||||
SaveStatus.Text = string.Empty;
|
||||
}
|
||||
|
||||
// ── resolution combo helpers ──────────────────────────────────────────
|
||||
private void SelectResolution(int width, int height)
|
||||
{
|
||||
string target = $"{width}x{height}";
|
||||
foreach (var obj in ResolutionCb.Items)
|
||||
{
|
||||
if (obj is ComboBoxItem item && item.Content?.ToString() == target)
|
||||
{
|
||||
ResolutionCb.SelectedItem = item;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Not in the predefined list: add and select it.
|
||||
var added = new ComboBoxItem { Content = target };
|
||||
ResolutionCb.Items.Add(added);
|
||||
ResolutionCb.SelectedItem = added;
|
||||
}
|
||||
|
||||
private void ReadResolution(Classes.Settings s)
|
||||
{
|
||||
var text = (ResolutionCb.SelectedItem as ComboBoxItem)?.Content?.ToString();
|
||||
if (string.IsNullOrEmpty(text))
|
||||
return;
|
||||
var parts = text.Split('x');
|
||||
if (parts.Length == 2 &&
|
||||
int.TryParse(parts[0], out int w) && int.TryParse(parts[1], out int h))
|
||||
{
|
||||
s.Width = w;
|
||||
s.Height = h;
|
||||
}
|
||||
}
|
||||
|
||||
// ── existing slider readouts ──────────────────────────────────────────
|
||||
private void TextureResolutionSlider_OnValueChanged(object? sender, RangeBaseValueChangedEventArgs e)
|
||||
{
|
||||
if (texResolution is null || textureResolutionSlider is null)
|
||||
@@ -54,12 +283,11 @@ public partial class Settings : UserControl
|
||||
|
||||
private void LanguageComboBox_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
if (sender is not ComboBox { SelectedItem: ComboBoxItem item }) return;
|
||||
if (!item.IsKeyboardFocusWithin) return;
|
||||
if (!item.IsKeyboardFocusWithin) return; // ignore programmatic (ApplyToUi) changes
|
||||
var lang = item.Content?.ToString();
|
||||
if (string.IsNullOrEmpty(lang)) return;
|
||||
|
||||
|
||||
var langDict = new ResourceInclude(new Uri("avares://StarterNG/"))
|
||||
{
|
||||
Source = new Uri($"Assets/Langs/{lang}.axaml", UriKind.Relative)
|
||||
@@ -77,4 +305,25 @@ public partial class Settings : UserControl
|
||||
|
||||
App.Loc.SetLanguage(langDict, lang);
|
||||
}
|
||||
}
|
||||
|
||||
// ── tiny helpers ──────────────────────────────────────────────────────
|
||||
private static bool IsChecked(CheckBox cb) => cb.IsChecked == true;
|
||||
|
||||
private static int Clamp(int v, int lo, int hi) => v < lo ? lo : (v > hi ? hi : v);
|
||||
|
||||
private static int Log2(int value, int fallback)
|
||||
{
|
||||
if (value <= 0) return fallback;
|
||||
int log = (int)Math.Round(Math.Log2(value));
|
||||
return log;
|
||||
}
|
||||
|
||||
private static int AnisotropyToSlider(int anisotropy)
|
||||
{
|
||||
var steps = StarterNG.Classes.Settings.AnisotropySteps;
|
||||
for (int i = 0; i < steps.Length; i++)
|
||||
if (steps[i] == anisotropy)
|
||||
return i + 1;
|
||||
return 4; // default → 8x
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user