//
// Generated by UI Creator. Do not edit; your changes are lost on the next export.
// Put hand written code in HudScreen.cs, which is the other half of this partial class.
//
using Uigenx;
using Uigenx.Actions;
using Uigenx.Animation;
using Uigenx.Binding;
using UnityEngine.UIElements;
namespace Game.UI.Generated
{
public sealed partial class HudScreen : UgxScreen
{
public const string Key = "Hud";
public override string ScreenKey => Key;
public SafeAreaRoot HudRoot { get; private set; }
public Label HealthLabel { get; private set; }
public VisualElement HealthTrack { get; private set; }
public VisualElement HealthFill { get; private set; }
public Label HealthValue { get; private set; }
public Label Warning { get; private set; }
public Button Pause { get; private set; }
public Button Item0 { get; private set; }
public Button Item1 { get; private set; }
public Button Item2 { get; private set; }
// Paths are the member names the data source reports, with no screen or source prefix.
static readonly UgxBindingEntry[] BindingTable =
{
new UgxBindingEntry("health-value", "text", "hp", BindingMode.ToTarget,
UgxBindingEngine.Runtime, UgxFormatKind.Template, 0, "{0} / 100"),
new UgxBindingEntry("health-fill", "width", "hpNormalised", BindingMode.ToTarget,
UgxBindingEngine.Runtime, UgxFormatKind.Percent),
new UgxBindingEntry("warning", "style.opacity", "warningOpacity", BindingMode.ToTarget,
UgxBindingEngine.Runtime),
};
static readonly UgxEventEntry[] EventTable =
{
new UgxEventEntry("pause", UgxUiEvent.Click, HudActions.Pause, "n_pause"),
new UgxEventEntry("item-0", UgxUiEvent.Click, HudActions.UseItem, "n_item0", PayloadForSlot0),
new UgxEventEntry("item-1", UgxUiEvent.Click, HudActions.UseItem, "n_item1", PayloadForSlot1),
new UgxEventEntry("item-2", UgxUiEvent.Click, HudActions.UseItem, "n_item2", PayloadForSlot2),
new UgxEventEntry("item-0", UgxUiEvent.LongPress, HudActions.InspectItem, "n_item0", PayloadForSlot0),
};
static readonly UgxClip[] ClipTable =
{
new UgxClip("hud-in", 220f, UgxLoopMode.None,
new UgxTrack(null, "opacity",
new UgxKeyframe(0f, "0", UgxEasingCurve.Of(UgxEasingKind.EaseOut)),
new UgxKeyframe(220f, "1")),
new UgxTrack(null, "translate",
new UgxKeyframe(0f, "0 16px", UgxEasingCurve.Of(UgxEasingKind.EaseOutCubic)),
new UgxKeyframe(220f, "0 0"))),
// Scale, not opacity: opacity on this element is already driven by a binding, and the
// last writer per frame would win.
new UgxClip("warning-pulse", 600f, UgxLoopMode.PingPong,
new UgxTrack("warning", "scale",
new UgxKeyframe(0f, "1", UgxEasingCurve.Of(UgxEasingKind.EaseInOutSine)),
new UgxKeyframe(600f, "1.12"))),
};
static readonly UgxAnimationTrigger[] TriggerTable =
{
new UgxAnimationTrigger(UgxTriggerKind.Show, "hud-in"),
new UgxAnimationTrigger(UgxTriggerKind.DataChange, "warning-pulse", null, "lowHealth",
UgxPlayMode.IgnoreIfPlaying),
};
protected override UgxClip[] Clips => ClipTable;
protected override void AttachElements(VisualElement root)
{
HudRoot = Q("hud-root");
HealthLabel = Q