fix(ui): preserve retail item titles and spacing

Carry PublicWeenieDesc material type into the live object model so examination titles use the DAT-authored material prefix. Preserve retail AddItemInfo empty appends and embedded armor separator, restoring the deliberate blank rows between appraisal sections.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-24 05:21:01 +02:00
parent d78d09cfbc
commit 6718ee45a0
19 changed files with 341 additions and 46 deletions

View file

@ -93,6 +93,43 @@ public sealed class AppraisalUiControllerTests
Assert.Equal(1, closed);
}
[Fact]
public void ItemResponse_TitleUsesRetailMaterialDecoratedAppropriateName()
{
ImportedLayout layout = FixtureLoader.LoadExamination();
var objects = new ClientObjectTable();
objects.AddOrUpdate(new ClientObject
{
ObjectId = ObjectId,
Name = "Steel Toed Boots",
Type = ItemType.Clothing,
MaterialType = 77u,
});
using var interaction = NewInteraction(objects, []);
var names = new RetailAppraisalNameResolver(
new Dictionary<uint, string> { [77u] = "Reed Shark Hide" },
new CreatureDisplayNameResolver(new Dictionary<uint, string>()));
using AppraisalUiController controller = Bind(
layout,
objects,
interaction,
new CombatState(),
[],
[],
() => { },
() => { },
itemNames: names)!;
interaction.ExamineSelectedOrEnterMode(ObjectId);
Assert.True(controller.Apply(Parsed(new PropertyBundle())));
UiText title = Assert.IsType<UiText>(
layout.FindElement(AppraisalUiController.TitleId));
Assert.Equal(
"Reed Shark Hide Steel Toed Boots",
Assert.Single(title.LinesProvider()).Text);
}
[Fact]
public void CreatureResponse_SelectsCreatureSubviewAndRefreshesInCombatWithoutBusy()
{
@ -662,7 +699,8 @@ public sealed class AppraisalUiControllerTests
Action close,
CreatureAppraisalRowTemplateFactory? creatureRows = null,
CreatureDisplayNameResolver? creatureNames = null,
SelectionState? selection = null)
SelectionState? selection = null,
RetailAppraisalNameResolver? itemNames = null)
=> AppraisalUiController.Bind(
layout,
objects,
@ -676,7 +714,8 @@ public sealed class AppraisalUiControllerTests
show,
close,
creatureRows,
creatureNames);
creatureNames,
itemNames);
private static ItemInteractionController NewInteraction(
ClientObjectTable objects,