fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -15,19 +15,41 @@ func run() -> void:
|
||||
check(view.build(AssetRoot.path(), 0), "warrior builds")
|
||||
root.add_child(view)
|
||||
view.anim.set_process(false)
|
||||
check(Metin2AnimPlayer.get_clip_cache_stats().misses == 1, "two actors decode idle only once")
|
||||
var initial_paths := {}
|
||||
for view in [a, b]:
|
||||
initial_paths[String(view.anim.get("anim_path"))] = true
|
||||
check(Metin2AnimPlayer.get_clip_cache_stats().misses == initial_paths.size(),
|
||||
"two actors decode only the distinct weighted idle resources")
|
||||
a.anim.set_time(0.3)
|
||||
b.anim.set_time(0.9)
|
||||
check(not is_equal_approx(a.anim.get_time(), b.anim.get_time()), "playback clocks remain independent")
|
||||
# 40250 refuses to interrupt an active one-shot with a locomotion motion, so
|
||||
# repeatedly calling set_anim_state() is not a cache stress test. Switch
|
||||
# the same three registered resources explicitly to exercise the hot reload
|
||||
# path while preserving the actor-level interruption gate.
|
||||
# WAIT is a weighted RaceData vector; asking _motion_file("wait") again
|
||||
# would roll a new resource and make the cache expectation nondeterministic.
|
||||
# Reuse the exact wait path already bound by actor A instead.
|
||||
var hot_paths: Array[String] = [a._motion_file("run"), a._motion_file("attack"),
|
||||
String(a.anim.get("anim_path"))]
|
||||
var expected_paths := {}
|
||||
for view in [a, b]:
|
||||
expected_paths[String(view.anim.get("anim_path"))] = true
|
||||
for path in hot_paths:
|
||||
expected_paths[path] = true
|
||||
for i in 3:
|
||||
for state in ["run", "attack", "wait"]:
|
||||
for path in hot_paths:
|
||||
for view in [a, b]:
|
||||
view.set_anim_state(state)
|
||||
view.anim.set("anim_path", path)
|
||||
view.anim.set("playing", true)
|
||||
view.anim.set_time(0.2)
|
||||
var stats: Dictionary = Metin2AnimPlayer.get_clip_cache_stats()
|
||||
check(stats.misses == 3 and stats.hits >= 17, "hot motion switches reuse decoded clips")
|
||||
var expected_misses := expected_paths.size()
|
||||
check(stats.misses == expected_misses and stats.hits >= 20 - expected_misses,
|
||||
"hot motion switches reuse decoded clips across weighted wait variants")
|
||||
check(stats.entries <= 32 and stats.section_bytes <= 64 * 1024 * 1024, "cache has entry and decoded-section budget")
|
||||
check(stats.msa_misses == 3 and stats.msa_hits >= 17, "hot switches reuse parsed MSA metadata")
|
||||
check(stats.msa_misses == expected_misses and stats.msa_hits >= 20 - expected_misses,
|
||||
"hot switches reuse parsed MSA metadata across weighted wait variants")
|
||||
check(stats.msa_entries <= 128, "MSA cache has an entry limit")
|
||||
Metin2AnimPlayer.clear_clip_cache()
|
||||
check(Metin2AnimPlayer.get_clip_cache_stats().msa_entries == 0, "MSA cache clears with clips")
|
||||
|
||||
Reference in New Issue
Block a user