fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -54,7 +54,7 @@ class FakeClient extends Node:
|
||||
func use_skill(id, vid) -> bool:
|
||||
requests.append(["use_skill", int(id), int(vid)])
|
||||
return in_game
|
||||
func cast_skill(motion, rot, x, y) -> bool:
|
||||
func cast_skill(motion, rot, x, y, _arg = 0) -> bool:
|
||||
requests.append(["cast_skill", int(motion)])
|
||||
return in_game
|
||||
func quickslot_add(pos, type, ref) -> bool:
|
||||
@@ -210,7 +210,9 @@ func test_single_request_per_activation() -> void:
|
||||
tick(rig)
|
||||
check(rig.count("use_skill") == 1 and rig.count("cast_skill") == 1,
|
||||
"one activation sends exactly one use_skill and one cast_skill: %s" % [rig.client.requests])
|
||||
check(rig.client.requests[0] == ["use_skill", SKILL, MOB], "use_skill carries the resolved target")
|
||||
check(rig.client.requests[0] == ["cast_skill", 1]
|
||||
and rig.client.requests[1] == ["use_skill", SKILL, MOB],
|
||||
"40250 order: FUNC_SKILL action state precedes CG_USE_SKILL target intent: %s" % [rig.client.requests])
|
||||
var casts := rig.observed("cast_started")
|
||||
check(casts.size() == 1 and int(casts[0][1].target_vid) == MOB and casts[0][1].source == "local",
|
||||
"cast_started is a local event bound to the cast target")
|
||||
@@ -275,7 +277,9 @@ func test_dead_target_rejected_without_request() -> void:
|
||||
check(rejected.size() == 1 and rejected[0][1].code == "CANNOT_ATTACK", "dead target -> CANNOT_ATTACK")
|
||||
check(rig.client.requests.is_empty(), "dead target sends no skill request")
|
||||
tick(rig, 600_000)
|
||||
check(rig.client.requests.size() == 2 and rig.client.requests[0] == ["use_skill", SKILL, MOB_B],
|
||||
check(rig.client.requests.size() == 2
|
||||
and rig.client.requests[0] == ["cast_skill", 1]
|
||||
and rig.client.requests[1] == ["use_skill", SKILL, MOB_B],
|
||||
"flow re-targets a living monster instead of the corpse: %s" % [rig.client.requests])
|
||||
|
||||
func test_dead_self_holds_without_request() -> void:
|
||||
|
||||
Reference in New Issue
Block a user