Expand the typed client-command boundary across travel, character queries, local UI and layout controls, AFK and consent, emotes, friends, squelch and filters, and fill-components. Preserve retail packet layouts and queue ownership, import the confirmation dialog, and keep authoritative social state in Core. Co-Authored-By: Codex <codex@openai.com>
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using System.Globalization;
|
|
using AcDream.Core.Physics;
|
|
|
|
namespace AcDream.Core.Ui;
|
|
|
|
/// <summary>Retail text formatting for world positions and outdoor cells.</summary>
|
|
public static class RetailPositionFormatter
|
|
{
|
|
/// <summary>
|
|
/// Verbatim field order and precision from
|
|
/// <c>Position::ToString @ 0x005A9330</c>.
|
|
/// </summary>
|
|
public static string Format(Position position)
|
|
{
|
|
var p = position.Frame.Origin;
|
|
var q = position.Frame.Orientation;
|
|
return string.Create(CultureInfo.InvariantCulture,
|
|
$"0x{position.ObjCellId:X8} [{p.X:F6} {p.Y:F6} {p.Z:F6}] " +
|
|
$"{q.W:F6} {q.X:F6} {q.Y:F6} {q.Z:F6}");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Port of <c>LandDefs::CellidToCoordinateString @ 0x005A9CB0</c>.
|
|
/// Returns null for indoor/invalid cells, matching the underlying
|
|
/// <c>gid_to_lcoord</c> failure.
|
|
/// </summary>
|
|
public static string? FormatOutdoorCell(uint cellId) =>
|
|
RadarCoordinates.TryFromCell(cellId, out var coordinates)
|
|
? coordinates.CombinedText
|
|
: null;
|
|
}
|