Settings design

This commit is contained in:
2025-12-23 12:14:03 +01:00
parent abfaa5ec4c
commit ef74d73d5e
4 changed files with 436 additions and 1 deletions

View File

@@ -0,0 +1,48 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Markup.Xaml;
namespace StarterNG.Views;
public partial class Settings : UserControl
{
public Settings()
{
InitializeComponent();
this.AttachedToVisualTree += (_, _) =>
{
TextureResolutionSlider_OnValueChanged(null, null);
CabTextureResolutionSlider_OnValueChanged(null, null);
shaderResolutionSlider_OnValueChanged(null, null);
};
}
private void TextureResolutionSlider_OnValueChanged(object? sender, RangeBaseValueChangedEventArgs e)
{
if (texResolution is null || textureResolutionSlider is null)
return;
int resolution = 1 << (int)textureResolutionSlider.Value;
texResolution.Text = $"{resolution} px";
}
private void CabTextureResolutionSlider_OnValueChanged(object? sender, RangeBaseValueChangedEventArgs e)
{
if (cabTexResolution is null || cabTextureResolutionSlider is null)
return;
int resolution = 1 << (int)cabTextureResolutionSlider.Value;
cabTexResolution.Text = $"{resolution} px";
}
private void shaderResolutionSlider_OnValueChanged(object? sender, RangeBaseValueChangedEventArgs e)
{
if (shaderResolution is null || shaderResolutionSlider is null)
return;
int resolution = 1 << (int)shaderResolutionSlider.Value;
shaderResolution.Text = $"{resolution} px";
}
}