fix(runtime,ui): Campaign LA gate round 2 — world name reads durably; dialogs center on the canvas
Two live-integration gaps the ef96c554 unit tests could not see:
1. World box stayed empty against ACE: ServerName (0xF7E1) arrives in the
SAME connect batch as CharacterList, so ServerNameReceived fires during
the handshake pump BEFORE the controller binding subscribes - the
event-only wiring proved the state and controller but never the live
ordering. StartCore now reads the durable WorldSession.ServerInfo after
connect exactly like the roster (ILiveSessionOperations.GetServerInfo,
default interface method so no fake breaks); the event remains for
post-connect updates. Pinned by a Start-level test.
2. The exit confirmation rendered far right of the screen: all three
retail dialog views centered against the raw window size while the
active screen lays out in the fixed 800x600 canvas - center-of-1920
is canvas-760, which the stretch pushes off-center. Views now center
against UiRoot.EffectiveCanvasSize (canvas while a pre-world screen is
active, window otherwise). Pinned by growing the window over the fixed
canvas in the exit-dialog test and asserting the scrim spans the canvas
with the popup centered at 400.
Runtime 1666, App 5100+6 skips, green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
2e6d69ddc7
commit
0a7dc7d626
7 changed files with 97 additions and 6 deletions
|
|
@ -129,10 +129,15 @@ internal sealed class RetailConfirmationDialogView : IRetailDialogView
|
|||
|
||||
private void SizeAndCenter()
|
||||
{
|
||||
// Center against the space the tree lays out in — the fixed authored
|
||||
// canvas while a pre-world screen is active (gate round 2: centering
|
||||
// against the raw window width put the exit dialog far right of the
|
||||
// stretched 800x600 canvas center).
|
||||
var space = _host.EffectiveCanvasSize;
|
||||
Root.Left = 0f;
|
||||
Root.Top = 0f;
|
||||
Root.Width = _host.Width;
|
||||
Root.Height = _host.Height;
|
||||
Root.Width = space.X;
|
||||
Root.Height = space.Y;
|
||||
_popup.Left = MathF.Round((Root.Width - _popup.Width) * 0.5f);
|
||||
_popup.Top = MathF.Round((Root.Height - _popup.Height) * 0.5f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,10 +150,13 @@ internal sealed class RetailConfirmationTextInputDialogView : IRetailDialogView
|
|||
|
||||
private void SizeAndCenter()
|
||||
{
|
||||
// Center against the layout space (fixed canvas while a pre-world
|
||||
// screen is active) — see RetailConfirmationDialogView.SizeAndCenter.
|
||||
var space = _host.EffectiveCanvasSize;
|
||||
Root.Left = 0f;
|
||||
Root.Top = 0f;
|
||||
Root.Width = _host.Width;
|
||||
Root.Height = _host.Height;
|
||||
Root.Width = space.X;
|
||||
Root.Height = space.Y;
|
||||
_popup.Left = MathF.Round((Root.Width - _popup.Width) * 0.5f);
|
||||
_popup.Top = MathF.Round((Root.Height - _popup.Height) * 0.5f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,10 +95,13 @@ internal sealed class RetailMessageDialogView : IRetailDialogView
|
|||
|
||||
private void SizeAndCenter()
|
||||
{
|
||||
// Center against the layout space (fixed canvas while a pre-world
|
||||
// screen is active) — see RetailConfirmationDialogView.SizeAndCenter.
|
||||
var space = _host.EffectiveCanvasSize;
|
||||
Root.Left = 0f;
|
||||
Root.Top = 0f;
|
||||
Root.Width = _host.Width;
|
||||
Root.Height = _host.Height;
|
||||
Root.Width = space.X;
|
||||
Root.Height = space.Y;
|
||||
_popup.Left = MathF.Round((Root.Width - _popup.Width) * 0.5f);
|
||||
_popup.Top = MathF.Round((Root.Height - _popup.Height) * 0.5f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,19 @@ public sealed class UiRoot : UiElement
|
|||
/// </summary>
|
||||
public Vector2? FixedCanvasSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The coordinate space the retained tree currently lays out in: the fixed
|
||||
/// authored canvas while one is active, else the window itself. Anything
|
||||
/// that positions against "the screen" (dialog centering, full-screen
|
||||
/// scrims) must use THIS — the gate-round-2 exit dialog centered against
|
||||
/// the 1920px window while the tree lived in the 800px canvas, landing far
|
||||
/// right of the visible screen center.
|
||||
/// </summary>
|
||||
public Vector2 EffectiveCanvasSize =>
|
||||
FixedCanvasSize is { X: > 0f, Y: > 0f } canvas
|
||||
? canvas
|
||||
: new Vector2(Width, Height);
|
||||
|
||||
/// <summary>Window→canvas stretch factor; One when no fixed canvas is set.</summary>
|
||||
public Vector2 CanvasScale =>
|
||||
FixedCanvasSize is { X: > 0f, Y: > 0f } canvas && Width > 0f && Height > 0f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue