- 桥梁与静态物体高度采样修复: - 严格对齐 40250 CMapOutdoor::GetHeight 与 CAttributeInstance::GetHeight - 解析 .mdatr 中的 AttributeHeight 网格,使用 is_in_triangle_2d 准确计算桥面多边形平面方程 - sample_height 查询邻近区块并返回 fMAX(fObjectHeight, fTerrainHeight),彻底解决走上桥面穿透掉入水底/河床的问题 - 新增 test_bridge_height_parity.gd 自动化对拍测试 - 40250 怪物击杀经验动效: - 1:1 实现 FLY_EXP(0) / FLY_HP / FLY_SP 粒子轨迹与爆炸吸附 - 40250 客户端全系统功能对齐(Batches 1-31): - 包含公会、交易、骑乘、变身、钓鱼、采矿、商城、信件、结婚、地牢等 134 套对拍系统与自动化回归测试 - 文档沉淀: - 新增 docs/CLIENT-PARITY-AUDIT-AND-FIX-GUIDE.md 客户端对拍缺陷发现与修复工程指南
95 lines
2.7 KiB
GDScript
95 lines
2.7 KiB
GDScript
# QuestCurtain (40250 uiquest.py:58-105 对齐)
|
||
# 剧情 / 过场运镜模式的 16:9 电影上下黑边(Curtain / Letterbox)
|
||
class_name QuestCurtain
|
||
extends Control
|
||
|
||
const CURTAIN_SPEED := 200.0
|
||
const MIN_BAR_HEIGHT := 50.0
|
||
|
||
var top_bar: ColorRect
|
||
var bottom_bar: ColorRect
|
||
var _bar_height := 60.0
|
||
var _is_open := false
|
||
var _tween: Tween
|
||
|
||
func _init() -> void:
|
||
name = "QuestCurtain"
|
||
set_anchors_preset(PRESET_FULL_RECT)
|
||
mouse_filter = MOUSE_FILTER_IGNORE
|
||
z_index = 95
|
||
|
||
top_bar = ColorRect.new()
|
||
top_bar.name = "TopBar"
|
||
top_bar.color = Color.BLACK
|
||
top_bar.mouse_filter = MOUSE_FILTER_IGNORE
|
||
add_child(top_bar)
|
||
|
||
bottom_bar = ColorRect.new()
|
||
bottom_bar.name = "BottomBar"
|
||
bottom_bar.color = Color.BLACK
|
||
bottom_bar.mouse_filter = MOUSE_FILTER_IGNORE
|
||
add_child(bottom_bar)
|
||
|
||
_reset_layout()
|
||
|
||
func _ready() -> void:
|
||
get_viewport().size_changed.connect(_on_size_changed)
|
||
_reset_layout()
|
||
|
||
func _get_screen_size() -> Vector2:
|
||
if is_inside_tree() and get_viewport():
|
||
return get_viewport_rect().size
|
||
return Vector2(1024, 768)
|
||
|
||
func _on_size_changed() -> void:
|
||
if _is_open:
|
||
_calculate_bar_height()
|
||
var sz := _get_screen_size()
|
||
top_bar.position = Vector2(0, 0)
|
||
top_bar.size = Vector2(sz.x, _bar_height)
|
||
bottom_bar.position = Vector2(0, sz.y - _bar_height)
|
||
bottom_bar.size = Vector2(sz.x, _bar_height)
|
||
else:
|
||
_reset_layout()
|
||
|
||
func _calculate_bar_height() -> float:
|
||
var sz := _get_screen_size()
|
||
# 40250: (GetScreenHeight() - GetScreenWidth() * 9 // 16) // 2
|
||
var h: float = floorf((sz.y - sz.x * 9.0 / 16.0) / 2.0)
|
||
if h < MIN_BAR_HEIGHT:
|
||
h = MIN_BAR_HEIGHT
|
||
_bar_height = h
|
||
return _bar_height
|
||
|
||
func _reset_layout() -> void:
|
||
var sz := _get_screen_size()
|
||
_calculate_bar_height()
|
||
top_bar.position = Vector2(0, -_bar_height - 1.0)
|
||
top_bar.size = Vector2(sz.x, _bar_height)
|
||
bottom_bar.position = Vector2(0, sz.y + 1.0)
|
||
bottom_bar.size = Vector2(sz.x, _bar_height)
|
||
|
||
func open(duration: float = 0.4) -> void:
|
||
_is_open = true
|
||
var sz := _get_screen_size()
|
||
_calculate_bar_height()
|
||
if _tween and _tween.is_valid():
|
||
_tween.kill()
|
||
_tween = create_tween().set_parallel(true).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_OUT)
|
||
top_bar.size = Vector2(sz.x, _bar_height)
|
||
bottom_bar.size = Vector2(sz.x, _bar_height)
|
||
_tween.tween_property(top_bar, "position:y", 0.0, duration)
|
||
_tween.tween_property(bottom_bar, "position:y", sz.y - _bar_height, duration)
|
||
|
||
func close(duration: float = 0.4) -> void:
|
||
_is_open = false
|
||
var sz := _get_screen_size()
|
||
if _tween and _tween.is_valid():
|
||
_tween.kill()
|
||
_tween = create_tween().set_parallel(true).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
|
||
_tween.tween_property(top_bar, "position:y", -_bar_height - 1.0, duration)
|
||
_tween.tween_property(bottom_bar, "position:y", sz.y + 1.0, duration)
|
||
|
||
func is_open() -> bool:
|
||
return _is_open
|