fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -27,7 +27,9 @@ class MockClient extends Node:
|
||||
return _main_vid
|
||||
|
||||
func get_entity(vid: int) -> Dictionary:
|
||||
return {"vid": vid, "pos": Vector3.ZERO, "race": 101, "name": "Wild Dog", "hp": 100, "max_hp": 100}
|
||||
# The ground item owner is the local player. Keep the fixture aligned with
|
||||
# the 40250 ownership pre-check instead of accidentally testing rejection.
|
||||
return {"vid": vid, "pos": Vector3.ZERO, "race": 101, "name": "Hero" if vid == _main_vid else "Wild Dog", "hp": 100, "max_hp": 100}
|
||||
|
||||
func get_ground_items() -> Array:
|
||||
return []
|
||||
@@ -46,7 +48,9 @@ func _init() -> void:
|
||||
test_player_controller_ignores_dead()
|
||||
test_ground_items_coordinate_mapping()
|
||||
print("mob_death_drop_test passed with 0 failures!")
|
||||
quit(0)
|
||||
await process_frame
|
||||
await process_frame
|
||||
call_deferred("quit", 0)
|
||||
|
||||
func test_mob_death_and_despawn() -> void:
|
||||
var client = MockClient.new()
|
||||
@@ -95,9 +99,9 @@ func test_mob_death_and_despawn() -> void:
|
||||
assert(not net_world._by_vid.has(mob_vid), "Mob should be erased from _by_vid on despawn")
|
||||
print("OK: Mob death detach & despawn lifecycle verified")
|
||||
|
||||
net_world.queue_free()
|
||||
mount.queue_free()
|
||||
client.queue_free()
|
||||
net_world.free()
|
||||
mount.free()
|
||||
client.free()
|
||||
|
||||
func test_player_controller_ignores_dead() -> void:
|
||||
var pc = PlayerController.new()
|
||||
@@ -119,9 +123,9 @@ func test_player_controller_ignores_dead() -> void:
|
||||
assert(not blocked, "Dead mob should not block player movement")
|
||||
|
||||
print("OK: PlayerController ignores dead mobs for collision and picking")
|
||||
pc.queue_free()
|
||||
player.queue_free()
|
||||
dead_mob.queue_free()
|
||||
pc.free()
|
||||
player.free()
|
||||
dead_mob.free()
|
||||
|
||||
func test_ground_items_coordinate_mapping() -> void:
|
||||
# Set map base position (e.g. Map 1: 400000 cm X, 300000 cm Y)
|
||||
@@ -187,8 +191,8 @@ func test_ground_items_coordinate_mapping() -> void:
|
||||
# Reset MapCoord base
|
||||
MapCoord.set_base(Vector2.ZERO)
|
||||
|
||||
gi.queue_free()
|
||||
world.queue_free()
|
||||
player.queue_free()
|
||||
mount.queue_free()
|
||||
client.queue_free()
|
||||
gi.free()
|
||||
world.free()
|
||||
player.free()
|
||||
mount.free()
|
||||
client.free()
|
||||
|
||||
Reference in New Issue
Block a user