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
45
tests/AcDream.Core.Tests/Items/ClientObjectNameTests.cs
Normal file
45
tests/AcDream.Core.Tests/Items/ClientObjectNameTests.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using AcDream.Core.Items;
|
||||
using Xunit;
|
||||
|
||||
namespace AcDream.Core.Tests.Items;
|
||||
|
||||
public sealed class ClientObjectNameTests
|
||||
{
|
||||
[Fact]
|
||||
public void AppropriateName_usesWirePluralForStack()
|
||||
{
|
||||
var item = new ClientObject
|
||||
{
|
||||
Name = "Pyreal Scarab",
|
||||
PluralName = "Pyreal Scarabs",
|
||||
StackSize = 2,
|
||||
};
|
||||
|
||||
Assert.Equal("Pyreal Scarabs", item.GetAppropriateName());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Arrow", "Arrows")]
|
||||
[InlineData("Pyreal", "Pyreals")]
|
||||
[InlineData("Compass", "Compasses")]
|
||||
public void AppropriateName_withoutWirePlural_usesRetailSuffixFallback(
|
||||
string singular, string expected)
|
||||
{
|
||||
var item = new ClientObject { Name = singular, StackSize = 2 };
|
||||
|
||||
Assert.Equal(expected, item.GetAppropriateName());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AppropriateName_forSingleItem_remainsSingular()
|
||||
{
|
||||
var item = new ClientObject
|
||||
{
|
||||
Name = "Pyreal Scarab",
|
||||
PluralName = "Pyreal Scarabs",
|
||||
StackSize = 1,
|
||||
};
|
||||
|
||||
Assert.Equal("Pyreal Scarab", item.GetAppropriateName());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue