fix: 装备属性面板避让逻辑 + 多项功能更新

- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧
- inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域
- 包含其他累积的功能开发和测试文件
This commit is contained in:
shen
2026-09-21 16:38:59 -07:00
parent 1522a8a1a1
commit c93894313a
5498 changed files with 4558004 additions and 1442 deletions
+49 -1
View File
@@ -53,6 +53,7 @@ func _run() -> void:
# mock 服务器:等连接 → 收请求 → 回 RESPOND_CHANNELSTATUS
var conn: StreamPeerTCP = null
var replied := false
var split_tail := PackedByteArray()
for i in 300:
if srv.is_connection_available() and conn == null:
conn = srv.take_connection()
@@ -82,8 +83,15 @@ func _run() -> void:
body.encode_s32(4, 2)
body.encode_s16(8, 13011); body.encode_u8(10, 1) # CH1 正常
body.encode_s16(11, 13021); body.encode_u8(13, 3) # CH2 爆满
conn.put_data(body)
# Split in the middle of the first 3-byte record. The reference
# NetStream waits for the complete response instead of finishing
# with a partial map.
conn.put_data(body.slice(0, 10))
split_tail = body.slice(10)
replied = true
if conn and not split_tail.is_empty():
conn.put_data(split_tail)
split_tail = PackedByteArray()
if not result[0].is_empty():
break
await process_frame
@@ -101,6 +109,46 @@ func _run() -> void:
_ck(result[0].get(13021, -1) == 3, "CH2 (13021) -> status 3")
_ck(cs.text_for(3) == "爆满" and cs.text_for(1) == "正常", "状态文案")
# A callback is allowed to start the next probe synchronously. The first
# result must not be delivered to that second callback by _finish().
var stale_callback := [false]
var cs3: Node = ChannelStatus.new()
get_root().add_child(cs3)
cs3.query("127.0.0.1", port, func(m):
if m.has(13011):
cs3.query("127.0.0.1", 1, func(second):
if not second.is_empty():
stale_callback[0] = true
, 0.1)
)
# Serve the re-entrant probe using the same response fixture.
var conn3: StreamPeerTCP = null
var replied3 := false
for i in 300:
if srv.is_connection_available() and conn3 == null:
conn3 = srv.take_connection()
if conn3:
conn3.poll()
if conn3.get_status() == StreamPeerTCP.STATUS_CONNECTED:
var req3 := 1 if classic else 4
if not replied3 and conn3.get_available_bytes() >= req3:
conn3.get_data(req3)
var resp3 := PackedByteArray()
if classic:
resp3.resize(1 + 4 + 3)
resp3.encode_u8(0, 210); resp3.encode_s32(1, 1)
resp3.encode_s16(5, 13011); resp3.encode_u8(7, 1)
else:
resp3.resize(4 + 4 + 3)
resp3.encode_u16(0, 0x0010); resp3.encode_u16(2, 4)
resp3.encode_s32(4, 1)
resp3.encode_s16(8, 13011); resp3.encode_u8(10, 1)
conn3.put_data(resp3)
replied3 = true
await process_frame
_ck(not stale_callback[0], "重入 query 不调用新回调旧结果")
# 连不上的端口 -> 空 map,不卡死
var cs2: Node = ChannelStatus.new()
get_root().add_child(cs2)