feat(ui): port retail component book rows
Instantiate gmSpellComponentUI category and component entries from LayoutDesc 0x21000033 instead of synthesizing catalog rows. Preserve localized category titles, authored textures and geometry, live icon/count/desired bindings, selected-object synchronization, and retail's inclusive 0..5000 desired-level contract. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
15bb61e05d
commit
a1175e6aac
13 changed files with 2395 additions and 60 deletions
|
|
@ -47,6 +47,22 @@ public sealed class RetailLayoutFixtureGenerator
|
|||
"Asheron's Call");
|
||||
using var dats = new DatCollection(datDir, DatAccessType.Read);
|
||||
|
||||
var localStrings = new DatStringResolver(dats);
|
||||
foreach ((string key, string expected) in new[]
|
||||
{
|
||||
("ID_SpellComp_Category_Scarabs", "SCARABS"),
|
||||
("ID_SpellComp_Category_Herbs", "HERBS"),
|
||||
("ID_SpellComp_Category_Gems", "POWDERED GEMS"),
|
||||
("ID_SpellComp_Category_Alchemical", "ALCHEMICAL SUBSTANCES"),
|
||||
("ID_SpellComp_Category_Talismans", "TALISMANS"),
|
||||
("ID_SpellComp_Category_Tapers", "TAPERS"),
|
||||
("ID_SpellComp_Category_Peas", "PEAS"),
|
||||
})
|
||||
{
|
||||
Assert.Equal(expected, localStrings.Resolve(
|
||||
0x23000001u, DatStringResolver.ComputeHash(key)));
|
||||
}
|
||||
|
||||
uint masterDid = (uint)dats.Portal.Header.MasterMapId;
|
||||
Assert.True(dats.Portal.TryGet<EnumIDMap>(masterDid, out var master));
|
||||
Assert.True(master!.ClientEnumToID.TryGetValue(5u, out uint uiMapDid));
|
||||
|
|
@ -102,6 +118,26 @@ public sealed class RetailLayoutFixtureGenerator
|
|||
File.WriteAllText(Path.Combine(FixtureDirectory(), fileName), effectsJson);
|
||||
}
|
||||
|
||||
foreach ((uint rootId, string fileName) in new[]
|
||||
{
|
||||
(0x10000466u,
|
||||
"component_category_21000033_10000466.json"),
|
||||
(0x10000467u,
|
||||
"component_row_21000033_10000467.json"),
|
||||
})
|
||||
{
|
||||
ElementInfo? componentTemplate = LayoutImporter.ImportInfos(
|
||||
dats, 0x21000033u, rootId);
|
||||
Assert.NotNull(componentTemplate);
|
||||
var componentJson = JsonSerializer.Serialize(componentTemplate,
|
||||
new JsonSerializerOptions
|
||||
{
|
||||
IncludeFields = true,
|
||||
WriteIndented = true,
|
||||
});
|
||||
File.WriteAllText(Path.Combine(FixtureDirectory(), fileName), componentJson);
|
||||
}
|
||||
|
||||
foreach (var (layoutId, fileName) in Layouts)
|
||||
{
|
||||
var info = LayoutImporter.ImportInfos(dats, layoutId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue