From 9a9dc6d2247fc353bf4d5ac28913ea44b0314ad5 Mon Sep 17 00:00:00 2001 From: shen <> Date: Thu, 24 Sep 2026 01:58:27 -0700 Subject: [PATCH] fix(launcher): update run-client.command to launch built app or dev client with repo Client --- run-client.command | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/run-client.command b/run-client.command index d024e5cd..3d66b3d9 100755 --- a/run-client.command +++ b/run-client.command @@ -1,7 +1,22 @@ #!/usr/bin/env bash -# 双击直接跑完整客户端(不打包,用已装的 Godot 当运行时)。 -# 登录 → 选人 → 进游戏。资源用仓库内 assets/。 +# 双击直接跑完整客户端(优先使用已构建的自包含 .app,亦可回退到已装的 Godot 引擎)。 +# 登录 → 选人 → 进游戏。 cd "$(dirname "$0")" -export MT_ASSETS="$PWD/assets" +REPO="$PWD" +export MT_40250_CLIENT="$REPO/Client" export MT_PROTOCOL="${MT_PROTOCOL:-classic}" -exec "${GODOT:-godot}" --path project res://client_main.tscn "$@" + +APP="$REPO/build/export/mtgodot-poc.app" +if [ -x "$APP/Contents/MacOS/mtgodot-poc" ]; then + echo ">> 启动已构建的自包含客户端: $APP" + exec "$APP/Contents/MacOS/mtgodot-poc" "$@" +fi + +GODOT_BIN="${GODOT:-$(which godot 2>/dev/null || echo "/Applications/Godot.app/Contents/MacOS/Godot")}" +if [ -x "$GODOT_BIN" ]; then + echo ">> 启动 Godot 开发运行环境: $GODOT_BIN" + exec "$GODOT_BIN" --path project res://client_main.tscn "$@" +fi + +echo "错误:未找到可执行的客户端应用 ($APP) 或 Godot 引擎" >&2 +exit 1