feat(D.2b): UiButton (Type 1) — Send + Max/Min as generic buttons (widget-generalization Task 3)
Introduces UiButton: a dedicated dat-widget button that ports UIElement_Button (RegisterElementClass(1,...) @ acclient_2013_pseudo_c.txt:125828). State selection, tiled DrawSprite, and label rendering mirror UiDatElement exactly so the chat Send and Max/Min buttons have zero behavioral change. DatWidgetFactory now maps Type 1 → UiButton (beside Type 7 → UiMeter, Type 11 → UiScrollbar). ChatWindowController's Send and Max/Min bind blocks updated from UiDatElement casts to UiButton casts; ClickThrough=false lines dropped (UiButton is interactive by construction). The old UiPanel.cs UiButton (a plain dev-scaffold rect+text button with no dat sprites) is renamed UiSimpleButton to free the name — no production code instantiated it. Full suite: 402 passed, 2 skipped, 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3593d6623d
commit
805ab5f40b
6 changed files with 154 additions and 6 deletions
|
|
@ -57,14 +57,17 @@ public class UiLabel : UiElement
|
|||
/// callback. Retail equivalent is Keystone's button widget, driven by
|
||||
/// a <c>StateDesc</c> per <c>UIStateId</c> (normal / hot / pressed /
|
||||
/// disabled) from the panel layout.
|
||||
/// Note: the dat-widget button (Type 1 / UIElement_Button) is <see cref="AcDream.App.UI.UiButton"/>
|
||||
/// in <c>UiButton.cs</c> — that is the production widget used by D.2b panels.
|
||||
/// This class is the earlier dev-scaffold button (plain rect + text; no dat sprites).
|
||||
/// </summary>
|
||||
public class UiButton : UiPanel
|
||||
public class UiSimpleButton : UiPanel
|
||||
{
|
||||
public string Text { get; set; } = string.Empty;
|
||||
public Vector4 TextColor { get; set; } = new(1f, 1f, 1f, 1f);
|
||||
public event System.Action? Click;
|
||||
|
||||
public UiButton()
|
||||
public UiSimpleButton()
|
||||
{
|
||||
BackgroundColor = new Vector4(0.1f, 0.1f, 0.15f, 0.8f);
|
||||
BorderColor = new Vector4(0.45f, 0.45f, 0.55f, 1f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue