Files
windroost/p2_godot_sample/run_ui_scroll_layout_test.sh
T
wushenghua 4d8d8582b8 fix: mobile UI/UX - list scroll, safe area, text overflow, battle top-right
Owner device feedback after seeing parchment skin:
- Lists could not scroll when the finger started on a button/frame; only blank
  areas scrolled. Root cause: buttons/panels defaulted to MOUSE_FILTER_STOP and
  swallowed drags. make_button/make_panel/glass_panel now use MOUSE_FILTER_PASS
  (still tappable, but drags bubble to the parent ScrollContainer).
- Header pushed ~quarter screen down: safe area subtracted window_get_position()
  (Godot 4 get_display_safe_area() is already in window coords). Now uses the
  rect directly and clamps insets to sane bounds (top<=96, bottom<=64).
- Growth page talent buttons overflowed: 4-in-a-row HBox squeezed labels. Now a
  2-column GridContainer with wider buttons; star button widened to 150px;
  buttons get an 8px content margin so text no longer touches the frame.
- Battle top-right had no text: the timer Label was created empty and never
  assigned. Added an always-on info label (enemy count / boss name) and populate
  the countdown text when a timer is visible.
- New ui_scroll_layout_test gate asserts button/panel PASS filters, 2-col grid,
  and non-empty battle top-right info. 108 gates pass.

Owner must re-verify on device; these are automated_verified, not human_reviewed.
2026-11-20 13:00:03 +08:00

20 lines
740 B
Bash
Executable File

#!/bin/zsh
set -euo pipefail
ROOT_DIR="${0:A:h}"
source "${0:A:h}/_test_env.sh"
GODOT_BIN="${GODOT_BIN:-/Applications/Godot.app/Contents/MacOS/Godot}"
LOG_PATH="$ROOT_DIR/artifacts/ui_scroll_layout_test.log"
if [[ ! -x "$GODOT_BIN" ]]; then print -u2 "no Godot"; exit 127; fi
mkdir -p "$ROOT_DIR/artifacts"
"$GODOT_BIN" --headless --path "$ROOT_DIR" --script res://scripts/ui_scroll_layout_test.gd > "$LOG_PATH" 2>&1 &
PID=$!
( sleep 120; kill -TERM "$PID" 2>/dev/null || true ) &
W=$!
set +e; wait "$PID"; STATUS=$?; set -e
kill -TERM "$W" 2>/dev/null || true; wait "$W" 2>/dev/null || true
cat "$LOG_PATH"
if [[ $STATUS -ne 0 ]] || ! grep -q "UI_SCROLL_LAYOUT_PASS" "$LOG_PATH"; then
print -u2 "UI_SCROLL_LAYOUT_FAIL"; exit 1
fi
exit 0