fix(ui): restore retail magic shortcut bar
Port the retail horizontal ItemList empty-slot padding and share UIItem shortcut-number graphics with the status toolbar. Preserve all authored face children on compound DAT buttons so the three-piece Cast control reflows and renders as one complete button. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
0527325b25
commit
e3605672bb
12 changed files with 466 additions and 62 deletions
|
|
@ -552,8 +552,12 @@ public static class DatWidgetFactory
|
|||
// Spellbook school/level filters are Type-1 buttons with no parent media:
|
||||
// their 13x13 child carries Normal/Highlight art. Keep that child as the
|
||||
// face of this retained leaf instead of consuming and losing it.
|
||||
ElementInfo? face = info.StateMedia.Count == 0
|
||||
? FindStatefulFaceChild(info)
|
||||
ElementInfo[] authoredFaces = info.StateMedia.Count == 0
|
||||
? FindStatefulFaceChildren(info)
|
||||
: [];
|
||||
ElementInfo? face = authoredFaces.Length == 1 ? authoredFaces[0] : null;
|
||||
IReadOnlyList<ElementInfo>? faceSegments = authoredFaces.Length > 1
|
||||
? authoredFaces
|
||||
: null;
|
||||
|
||||
string? label = ResolveAuthoredString(info, stringResolve);
|
||||
|
|
@ -576,7 +580,7 @@ public static class DatWidgetFactory
|
|||
if (labelInfo.FontDid != 0u && fontResolve is not null)
|
||||
labelFont = fontResolve(labelInfo.FontDid) ?? elementFont;
|
||||
|
||||
var button = new UiButton(info, resolve, face)
|
||||
var button = new UiButton(info, resolve, face, faceSegments)
|
||||
{
|
||||
Label = label,
|
||||
LabelFont = labelFont,
|
||||
|
|
@ -638,11 +642,16 @@ public static class DatWidgetFactory
|
|||
}
|
||||
|
||||
private static ElementInfo? FindStatefulFaceChild(ElementInfo info)
|
||||
=> info.Children.FirstOrDefault(child =>
|
||||
=> FindStatefulFaceChildren(info).FirstOrDefault();
|
||||
|
||||
private static ElementInfo[] FindStatefulFaceChildren(ElementInfo info)
|
||||
=> info.Children.Where(child =>
|
||||
child.StateMedia.Count != 0
|
||||
&& child.StateMedia.Keys.Any(childState =>
|
||||
info.States.Values.Any(parentState =>
|
||||
string.Equals(parentState.Name, childState, StringComparison.Ordinal))));
|
||||
string.Equals(parentState.Name, childState, StringComparison.Ordinal))))
|
||||
.OrderBy(child => child.ReadOrder)
|
||||
.ToArray();
|
||||
|
||||
private static string? ResolveAuthoredString(
|
||||
ElementInfo info,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue