Move pre-window loading, startup application, live settings mutation, toon context, quality reapply, and SettingsVM loans behind one RuntimeSettingsController. Preserve retail command behavior, ordered target publication, draft semantics, and retryable failure convergence while removing duplicate GameWindow state and feature bodies. Co-authored-by: Codex <codex@openai.com>
56 lines
1.7 KiB
C#
56 lines
1.7 KiB
C#
using AcDream.App.Settings;
|
|
using AcDream.App.Rendering.Vfx;
|
|
using AcDream.App.Update;
|
|
using AcDream.UI.Abstractions.Panels.Settings;
|
|
|
|
namespace AcDream.App.Tests.World;
|
|
|
|
public sealed class LiveObjectFrameControllerTests
|
|
{
|
|
[Theory]
|
|
[InlineData(ParticleRange.Retail, 1f)]
|
|
[InlineData(
|
|
ParticleRange.Extended,
|
|
ParticleVisibilityController.ExtendedRangeMultiplier)]
|
|
public void ParticleRange_UsesCurrentSettingsPreview(
|
|
ParticleRange range,
|
|
float expected)
|
|
{
|
|
var preview = new FakeSettingsPreview(
|
|
DisplaySettings.Default with { ParticleRange = range });
|
|
var source = new SettingsParticleRangeSource(preview);
|
|
|
|
Assert.Equal(expected, source.RangeMultiplier);
|
|
}
|
|
|
|
[Fact]
|
|
public void ParticleRange_UpdatesImmediatelyWhenPreviewChanges()
|
|
{
|
|
var preview = new FakeSettingsPreview(DisplaySettings.Default);
|
|
var source = new SettingsParticleRangeSource(preview);
|
|
|
|
preview.DisplayPreview = preview.DisplayPreview with
|
|
{
|
|
ParticleRange = ParticleRange.Retail,
|
|
};
|
|
Assert.Equal(1f, source.RangeMultiplier);
|
|
|
|
preview.DisplayPreview = preview.DisplayPreview with
|
|
{
|
|
ParticleRange = ParticleRange.Extended,
|
|
};
|
|
Assert.Equal(
|
|
ParticleVisibilityController.ExtendedRangeMultiplier,
|
|
source.RangeMultiplier);
|
|
}
|
|
|
|
private sealed class FakeSettingsPreview(DisplaySettings display)
|
|
: IRuntimeSettingsPreviewSource
|
|
{
|
|
public bool HasDraftPreview => true;
|
|
|
|
public DisplaySettings DisplayPreview { get; set; } = display;
|
|
|
|
public AudioSettings AudioPreview => AudioSettings.Default;
|
|
}
|
|
}
|