fix(ui): finish retail stack selector polish
Keep the horizontal thumb at its raw pointer position so both endpoints are reachable, honor the stack entry's authored right alignment, and preserve PublicWeenieDesc plural names from CreateObject through the object table. Port retail's singular s/es fallback when no plural was sent. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
a20e5c68c7
commit
6005c51c4d
22 changed files with 233 additions and 36 deletions
|
|
@ -549,6 +549,23 @@ public sealed class CreateObjectTests
|
|||
Assert.Equal(0x500000F0u, parsed.Value.ContainerId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WeenieHeader_pluralName_isPreserved()
|
||||
{
|
||||
byte[] body = BuildMinimalCreateObjectWithWeenieHeader(
|
||||
guid: 0x50000023u,
|
||||
name: "Pyreal Scarab",
|
||||
itemType: (uint)ItemType.Misc,
|
||||
weenieFlags: 0x00000001u | 0x00001000u,
|
||||
stackSize: 2,
|
||||
pluralName: "Pyreal Scarabs");
|
||||
|
||||
var parsed = CreateObject.TryParse(body);
|
||||
|
||||
Assert.NotNull(parsed);
|
||||
Assert.Equal("Pyreal Scarabs", parsed.Value.PluralName);
|
||||
}
|
||||
|
||||
private static byte[] BuildMinimalCreateObjectWithWeenieHeader(
|
||||
uint guid,
|
||||
string name,
|
||||
|
|
@ -580,6 +597,7 @@ public sealed class CreateObjectTests
|
|||
uint? currentWieldedLocation = null,
|
||||
uint? priority = null,
|
||||
float? workmanship = null,
|
||||
string? pluralName = null,
|
||||
byte? radarBlipColor = null,
|
||||
byte? radarBehavior = null,
|
||||
byte? combatUse = null,
|
||||
|
|
@ -621,7 +639,7 @@ public sealed class CreateObjectTests
|
|||
// WorldObject_Networking.cs:87-206. Each field is written only when
|
||||
// its weenieFlags bit is set, matching the parser's walker exactly.
|
||||
// Fields not parameterized above default to 0.
|
||||
if ((weenieFlags & 0x00000001u) != 0) { /* PluralName — not parameterized */ }
|
||||
if ((weenieFlags & 0x00000001u) != 0) WriteString16L(bytes, pluralName ?? "");
|
||||
if ((weenieFlags & 0x00000002u) != 0) bytes.Add(itemsCapacity ?? 0); // ItemsCapacity u8
|
||||
if ((weenieFlags & 0x00000004u) != 0) bytes.Add(containersCapacity ?? 0); // ContainersCapacity u8
|
||||
if ((weenieFlags & 0x00000100u) != 0) WriteU16(bytes, 0); // AmmoType u16
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue