UnityTowerDefense/Assets/_Project/UI/HUD.uxml
Matt F 16706a1ecf Scale difficulty by run position; wipe towers at phase end
Follow-up pass on the 2.0 refactor, closing the gap between "waves are drawn
at random" and "difficulty still lives in the enemy assets".

- Enemy health is no longer authored per enemy type. New EnemyScalingConfig
  scales a per-zone HP *budget* by encounter number; per-enemy health is that
  budget divided by the wave's enemy count. Scaling the total rather than the
  per-enemy value keeps enemy count a texture knob (few tanks vs many swarmers)
  instead of a second, uncontrolled difficulty axis. EnemyDefinition.MaxHp
  becomes HpMultiplier, a deviation around 1.0. Speed stays archetype-only and
  unscaled -- escalating it compounds with health and invalidates tower balance
  mid-run.
- GoldConfig entries no longer reference a WaveDefinition. Payout is a property
  of run position, not of which wave got drawn: WaveGoldEntry ->
  EncounterGoldEntry, Waves -> Encounters, keyed by global encounter number.
  Its inspector labels elements "Encounter N" and projects cumulative earnings.
- The wave's voted buffs now show as icon badges in the top bar, read from the
  same RunState slot the spawn path uses so the display can't drift from what
  the enemies actually carry. Hover names the buff; unillustrated cards fall
  back to a lettered badge rather than vanishing.
- Clearing a phase's boss destroys every built tower, unrefunded. Queued build
  jobs still refund -- those towers were never delivered. Runs with the field
  empty, so the walkability churn doesn't hit the re-path scheduler.
- Fixed an RPC codegen break: [ClientRpc] requires a ClientRpc suffix, unlike
  the newer [Rpc(SendTo...)] style this file doesn't use.
- Setup checklist reordered into dependency order; it previously asked for a
  RunDefinition two sections before creating one.

Also carries the editor-side asset reorganisation into Definitions/RunDefinitions
and the sprite move into Enemy/Player draft icon folders.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 00:32:33 -07:00

92 lines
5.8 KiB
Text

<ui:UXML xmlns:ui="UnityEngine.UIElements" editor-extension-mode="False">
<Style src="project://database/Assets/_Project/UI/HUD.uss?fileID=7433441132597879392&amp;guid=7997d647c4888b94c870943338c17d41&amp;type=3#HUD"/>
<ui:VisualElement name="hud-root" class="hud-root">
<ui:VisualElement name="top-bar" class="top-bar">
<ui:VisualElement class="res-group">
<ui:Label name="gold-label" text="0 g" class="gold-label"/>
<ui:Label name="income-label" text="+? g/wave" class="income-label"/>
</ui:VisualElement>
<ui:VisualElement class="top-spacer"/>
<ui:VisualElement class="res-group">
<ui:Label name="wave-label" text="Wave ? / ?" class="wave-label"/>
<ui:Label name="next-wave-label" text="next: --:--" class="dimmed-label"/>
<ui:Label name="leaked-label" text="leaked: ?" class="dimmed-label"/>
<ui:Label name="lives-label" text="lives: ?" class="dimmed-label"/>
<!-- Buff icons for the wave currently spawning. Populated by HUDController
from RunState's replicated per-slot upgrade list; empty on an unbuffed
wave, which is every wave of cycle 1. -->
<ui:VisualElement name="wave-buff-row" class="wave-buff-row"/>
</ui:VisualElement>
<!-- Gear → opens the in-match menu (Escape does the same). The icon is
painted procedurally by GameMenuView, so no sprite asset is required. -->
<ui:Button name="menu-button" text="" class="menu-button"/>
</ui:VisualElement>
<ui:VisualElement name="main-area" class="main-area">
<ui:VisualElement name="map-area" class="map-area">
<ui:Label name="rejection-label" text="" class="rejection-label"/>
</ui:VisualElement>
<ui:VisualElement name="right-panel" class="right-panel">
<ui:Label text="scoreboard" class="panel-header"/>
<ui:Label text="name · gold · leaked" class="section-label"/>
<ui:VisualElement name="player-list" class="player-list"/>
<ui:Label text="race" class="section-label" style="margin-top: 8px;"/>
<ui:VisualElement class="income-row">
<ui:Label text="builder" class="income-key"/>
<ui:Label name="race-label" text="?" class="income-val"/>
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="bottom-ui" class="bottom-ui">
<!-- Section 1: Minimap (tall frame) -->
<ui:VisualElement name="minimap-frame" class="minimap-frame">
<ui:VisualElement name="minimap" class="minimap"/>
</ui:VisualElement>
<!-- Section 2: Portrait (short frame) -->
<ui:VisualElement name="portrait-frame" class="portrait-frame">
<ui:VisualElement name="portrait-image" class="portrait-image"/>
<ui:Label name="level-label" text="" class="level-label"/>
</ui:VisualElement>
<!-- Section 3: Info Panel — name + contextual stat lines (short frame).
The build-progress block is hidden by default and only shown when
a BuildSiteVisual is selected (HUDController toggles via style.display). -->
<ui:VisualElement name="info-frame" class="info-frame">
<ui:Label name="portrait-name" text="" class="portrait-name"/>
<ui:VisualElement name="stat-lines" class="stat-lines"/>
<ui:VisualElement name="build-progress" class="build-progress" style="display: none;">
<ui:VisualElement name="build-progress-bg" class="build-progress-bg">
<ui:VisualElement name="build-progress-fill" class="build-progress-fill"/>
</ui:VisualElement>
<ui:Label name="build-progress-percent" text="0%" class="build-progress-percent"/>
</ui:VisualElement>
</ui:VisualElement>
<!-- Section 4: Tool Tip — shows info for whatever the player hovers in the action menu (short frame) -->
<ui:VisualElement name="tooltip-frame" class="tooltip-frame">
<ui:Label name="tt-title" text="" class="tt-title"/>
<ui:Label name="tt-desc" text="" class="tt-desc"/>
<ui:Label name="tt-stats" text="" class="tt-stats"/>
<ui:Label name="tt-cost" text="" class="tt-cost"/>
</ui:VisualElement>
<!-- Section 5: Action Menu (tall frame). Hides entirely when nothing actionable is selected.
The Build/Paint tabs are shown only when the builder is selected. -->
<ui:VisualElement name="action-frame" class="action-frame">
<ui:VisualElement name="command-tabs" class="command-tabs">
<ui:Button name="tab-build" text="Build" class="cmd-tab"/>
<ui:Button name="tab-paint" text="Paint" class="cmd-tab"/>
</ui:VisualElement>
<ui:VisualElement name="command-grid" class="command-grid"/>
</ui:VisualElement>
<!-- Section 6: Spell Hotbar (short frame) — builder spells bound to fixed
hotkeys (grant order = slot order). Hidden entirely until the player has
been granted at least one spell. -->
<ui:VisualElement name="spell-hotbar-frame" class="spell-hotbar-frame" style="visibility: hidden;">
<ui:Label text="spells" class="section-label"/>
<ui:VisualElement name="spell-hotbar" class="spell-hotbar"/>
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>