fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -34,6 +34,8 @@ var _origin := Vector3.ZERO
|
||||
var _origin_valid := false
|
||||
var _mutations := true
|
||||
var _reconnect := true
|
||||
var _warp_command := ""
|
||||
var _phase_command := ""
|
||||
var _finished := false
|
||||
var _finish_queued := false
|
||||
var _report_path := ""
|
||||
@@ -45,6 +47,8 @@ func setup(flow: Node, m2client: Node) -> void:
|
||||
_state_since_ms = _started_ms
|
||||
_mutations = OS.get_environment("MT_SMOKE_MUTATIONS") != "0"
|
||||
_reconnect = OS.get_environment("MT_SMOKE_RECONNECT") != "0"
|
||||
_warp_command = OS.get_environment("MT_SMOKE_WARP_COMMAND").strip_edges()
|
||||
_phase_command = OS.get_environment("MT_SMOKE_PHASE_COMMAND").strip_edges()
|
||||
_report_path = OS.get_environment("MT_TEST_REPORT").strip_edges()
|
||||
if _report_path.is_empty():
|
||||
_report_path = "user://live_smoke_report.json"
|
||||
@@ -71,7 +75,8 @@ func setup(flow: Node, m2client: Node) -> void:
|
||||
_client.chat.connect(_on_chat)
|
||||
|
||||
_state = "waiting_login"
|
||||
_log("START mutations=%s reconnect=%s report=%s" % [_mutations, _reconnect, _report_path])
|
||||
_log("START mutations=%s reconnect=%s warp=%s phase_command=%s report=%s" %
|
||||
[_mutations, _reconnect, not _warp_command.is_empty(), _phase_command, _report_path])
|
||||
_check(OS.get_environment("MT_PROTOCOL") == "classic", "classic 协议已启用")
|
||||
_check(OS.get_environment("MT_ACCOUNT") != "", "账号环境变量已提供")
|
||||
_check(OS.get_environment("MT_PASSWORD") != "", "密码环境变量已提供")
|
||||
@@ -99,10 +104,18 @@ func _process(_delta: float) -> void:
|
||||
"wait_chat":
|
||||
if _seconds_in_state(now) >= 0.5:
|
||||
_send_chat()
|
||||
"wait_warp":
|
||||
if _seconds_in_state(now) >= STEP_TIMEOUT_SECONDS:
|
||||
_fail("GC_WARP 后未重新进入游戏")
|
||||
_finish_later()
|
||||
"wait_reconnect":
|
||||
if _seconds_in_state(now) >= STEP_TIMEOUT_SECONDS:
|
||||
_fail("重连后未重新进入游戏")
|
||||
_finish_later()
|
||||
"wait_phase_close":
|
||||
if _seconds_in_state(now) >= STEP_TIMEOUT_SECONDS:
|
||||
_fail("服务器命令断线后未回到 LoginPhase owner")
|
||||
_finish_later()
|
||||
"settle_second":
|
||||
if _seconds_in_state(now) >= SETTLE_SECONDS:
|
||||
_check(_client != null and _client.is_in_game(), "重连后客户端仍处于游戏状态")
|
||||
@@ -148,7 +161,7 @@ func _on_entered_game() -> void:
|
||||
_check(true, "第 %d 次进入游戏" % _entered_count)
|
||||
if _entered_count == 1:
|
||||
_set_state("settle_first")
|
||||
elif _state == "wait_reconnect":
|
||||
elif _state == "wait_reconnect" or _state == "wait_warp":
|
||||
_set_state("settle_second")
|
||||
|
||||
func _on_login_failed(reason: String) -> void:
|
||||
@@ -158,7 +171,16 @@ func _on_login_failed(reason: String) -> void:
|
||||
func _on_disconnected(reason: String) -> void:
|
||||
_events["disconnected"] += 1
|
||||
_log("disconnected=%s" % reason)
|
||||
if _state != "wait_reconnect" and _state != "settle_second":
|
||||
if _state == "wait_phase_close":
|
||||
_check(_flow != null and int(_flow.state()) == 0,
|
||||
"server peer close returns the AppFlow LoginPhase owner")
|
||||
_check(_flow == null or _flow.get("_game") == null,
|
||||
"server peer close releases the AppFlow GameScene")
|
||||
_check(_flow == null or not bool(_flow.get("_reconnecting_game")),
|
||||
"server peer close does not arm a retained reconnect owner")
|
||||
_finish_later()
|
||||
return
|
||||
if _state != "wait_reconnect" and _state != "wait_warp" and _state != "settle_second":
|
||||
_fail("测试期间意外断线:%s" % reason)
|
||||
_finish_later()
|
||||
|
||||
@@ -206,6 +228,12 @@ func _run_world_checks() -> void:
|
||||
await _capture_diagnostic_frame()
|
||||
_start_reconnect()
|
||||
return
|
||||
if not _phase_command.is_empty():
|
||||
_send_phase_command()
|
||||
return
|
||||
if not _warp_command.is_empty():
|
||||
_send_warp()
|
||||
return
|
||||
_send_move()
|
||||
|
||||
func _capture_diagnostic_frame() -> void:
|
||||
@@ -249,6 +277,22 @@ func _send_chat() -> void:
|
||||
_check(ok, "发送普通聊天包")
|
||||
_start_reconnect()
|
||||
|
||||
func _send_warp() -> void:
|
||||
var ok := bool(_client.say(CHAT_TALKING, _warp_command))
|
||||
_check(ok, "发送 GC_WARP 测试命令")
|
||||
if ok:
|
||||
_set_state("wait_warp")
|
||||
else:
|
||||
_finish_later()
|
||||
|
||||
func _send_phase_command() -> void:
|
||||
var ok := bool(_client.say(CHAT_TALKING, _phase_command))
|
||||
_check(ok, "发送阶段关闭测试命令")
|
||||
if ok:
|
||||
_set_state("wait_phase_close")
|
||||
else:
|
||||
_finish_later()
|
||||
|
||||
func _start_reconnect() -> void:
|
||||
if not _reconnect:
|
||||
_finish_later()
|
||||
@@ -297,6 +341,8 @@ func _finish() -> void:
|
||||
"failures": _failures,
|
||||
"mutations": _mutations,
|
||||
"reconnect": _reconnect,
|
||||
"warp_command": not _warp_command.is_empty(),
|
||||
"phase_command": _phase_command,
|
||||
}
|
||||
var file := FileAccess.open(_report_path, FileAccess.WRITE)
|
||||
if file:
|
||||
|
||||
Reference in New Issue
Block a user