Retail's ChatInterface::SetOpacity (0x004F3120) fades the WHOLE composited
window surface with one alpha; UiRenderContext.ApplyAlpha already gated
DrawSprite/DrawRect/DrawFill (since 1da697ec, pre-CH6) but DrawStringDat and
DrawString still passed applyAlpha:false, so text stayed sharp over a
translucent window. Both now route through the same chokepoint.
RetailWindowOpacityController (new) subscribes to a new
RetailWindowManager.WindowRegistered event and drives every registered
window's live Opacity from keyboard-focus state, applied to EVERY window
(chat, floaties, vitals, toolbar, ...) rather than retail's ChatInterface-only
scope — register row AP-190, retiring the stale AP-40 "fixed 0.75, no focus
transition" row in the same commit.
Verified retail's shipped opacity defaults from the decomp (constructor
literals, no cdb needed): the base ChatInterface ctor sets
DefaultOpacity=0.5/ActiveOpacity=1.0, kept unmodified by the four floating
windows; gmMainChatUI's own ctor overrides the main window to 1.0/1.0
(always fully opaque). acdream ships one shared global default (0.5/1.0)
rather than replicating the per-class override — also AP-190. The linking
invariant (raising default above active drags active UP; lowering active
below default drags default DOWN — never a clamp) is ported verbatim as
ChatOpacityLink in AcDream.UI.Abstractions, shared by the live controller
and the new Settings -> Chat tab's two linked opacity sliders.
Persistence: ChatSettings.DefaultOpacity/ActiveOpacity round-trip through
SettingsStore; Save pushes both through IRuntimeSettingsTargets.SetChatOpacity
into the live controller, no restart required.
Rider (CH6a/b re-review): strengthened the grip-media regression guard past
a bare SpriteFile != 0 check — ChatLayoutConformanceTests now drives each
live grip through a real UiRenderContext/TextRenderer (backed by the
in-memory RecordingGpuDevice test double) and asserts the draw call chain
actually queued sprite geometry, via a new TextRenderer.DebugSpriteSegments
test-only accessor.
Full Release suite 12,459 passed / 4 skipped / 0 failed (baseline
12,420/4/0). No subagents, no client launches (session hard constraints);
pending the next connected user gate for visual confirmation.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
55 lines
2 KiB
C#
55 lines
2 KiB
C#
using AcDream.UI.Abstractions.Panels.Settings;
|
|
|
|
namespace AcDream.UI.Abstractions.Tests.Panels.Settings;
|
|
|
|
/// <summary>
|
|
/// L.0: <see cref="ChatSettings"/> default-pin tests.
|
|
/// </summary>
|
|
public sealed class ChatSettingsTests
|
|
{
|
|
[Fact]
|
|
public void Default_values_match_AceCharacterOptions2Default_stance()
|
|
{
|
|
// N4 (CH3 Opus review): ACE's real CharacterOptions2.Default
|
|
// (0x00948700) turns General/Trade/LFG on but leaves Roleplay
|
|
// (0x800) and Society (0x80000) off — this is no longer an
|
|
// invented "all channels on" stance.
|
|
var d = ChatSettings.Default;
|
|
Assert.True(d.HearGeneralChat);
|
|
Assert.True(d.HearTradeChat);
|
|
Assert.True(d.HearLFGChat);
|
|
Assert.False(d.HearRoleplayChat);
|
|
Assert.False(d.HearSocietyChat);
|
|
Assert.False(d.AppearOffline);
|
|
Assert.True(d.ShowTimestamps);
|
|
Assert.True(d.FilterProfanity);
|
|
Assert.Equal(12f, d.FontSize);
|
|
|
|
// Campaign CH slice CH6c: retail's base ChatInterface constructor
|
|
// (0x004F4550) sets DefaultOpacity=0.5/ActiveOpacity=1.0 — the value
|
|
// every gmFloatyChatUI (the four floating windows) keeps unmodified.
|
|
// acdream ships that pair as ONE shared global default (register row
|
|
// AP-190), rather than gmMainChatUI's own 1.0/1.0 override.
|
|
Assert.Equal(0.5f, d.DefaultOpacity);
|
|
Assert.Equal(1.0f, d.ActiveOpacity);
|
|
}
|
|
|
|
[Fact]
|
|
public void Equality_is_value_based()
|
|
{
|
|
var a = ChatSettings.Default;
|
|
var b = ChatSettings.Default with { HearTradeChat = false };
|
|
var c = ChatSettings.Default with { HearTradeChat = false };
|
|
Assert.NotEqual(a, b);
|
|
Assert.Equal(b, c);
|
|
}
|
|
|
|
[Fact]
|
|
public void With_expression_clones_one_field()
|
|
{
|
|
var d = ChatSettings.Default with { FontSize = 16f };
|
|
Assert.Equal(16f, d.FontSize);
|
|
Assert.True(d.HearGeneralChat);
|
|
Assert.True(d.ShowTimestamps);
|
|
}
|
|
}
|