feat(client): 完成40250客户端核心功能1:1对齐与桥梁高度采样修复
- 桥梁与静态物体高度采样修复: - 严格对齐 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 客户端对拍缺陷发现与修复工程指南
This commit is contained in:
@@ -28,6 +28,10 @@ var context_consumer: Callable = Callable()
|
||||
const UiAssets = preload("res://ui/ui_assets.gd")
|
||||
const EquipRules = preload("res://equip_rules.gd")
|
||||
const ItemTooltip = preload("res://ui/item_tooltip.gd")
|
||||
const ChestSystem = preload("res://chest_system.gd")
|
||||
const ItemAttrSystem = preload("res://item_attr_system.gd")
|
||||
const MetinSocketSystem = preload("res://metin_socket_system.gd")
|
||||
const ConsumableSystem = preload("res://consumable_system.gd")
|
||||
|
||||
const EQUIP_BASE := 90 # uiscript EQUIPMENT_START_INDEX
|
||||
const BELT_BASE := 200 # 仅 UI 内部索引,避免与旧 slot_index 相撞
|
||||
@@ -94,6 +98,11 @@ func setup(ui_manager: CanvasLayer, m2client: Node, proto_node: Node, assets: St
|
||||
uiscript_dir = assets.path_join("uiscript")
|
||||
if client and client.has_signal("inventory_changed"):
|
||||
client.inventory_changed.connect(_on_inv_changed)
|
||||
if ui and ui.has_signal("window_closed"):
|
||||
ui.window_closed.connect(func(w):
|
||||
if not _win.is_empty() and _win.get("root") == w:
|
||||
close()
|
||||
)
|
||||
set_process_input(true)
|
||||
|
||||
func is_open() -> bool:
|
||||
@@ -127,13 +136,14 @@ func close() -> void:
|
||||
item_mouse.unregister_owner(self)
|
||||
if item_mouse.has_method("is_attached") and item_mouse.is_attached():
|
||||
item_mouse.cancel()
|
||||
if is_open():
|
||||
ui.close(_win["root"])
|
||||
var r: Control = _win.get("root", null)
|
||||
_win = {}
|
||||
_cells.clear()
|
||||
_combine_from = -1
|
||||
_mobile_selected_ui = -1
|
||||
_hint = null
|
||||
if r and is_instance_valid(r) and ui:
|
||||
ui.close(r)
|
||||
|
||||
func open() -> void:
|
||||
if is_open():
|
||||
@@ -147,6 +157,7 @@ func open() -> void:
|
||||
_add_extended_cells(_win["root"])
|
||||
_wire_cells()
|
||||
_wire_money()
|
||||
_wire_mall_button()
|
||||
refresh()
|
||||
|
||||
# --- 填充 ---------------------------------------------------------------
|
||||
@@ -258,6 +269,14 @@ func _wire_money() -> void:
|
||||
else:
|
||||
_money_button = null
|
||||
|
||||
func _wire_mall_button() -> void:
|
||||
var mall_btn = _win.get("nodes", {}).get("MallButton", null)
|
||||
if mall_btn is BaseButton:
|
||||
mall_btn.pressed.connect(func():
|
||||
if client and client.has_method("say"):
|
||||
client.say(0, "/click_mall")
|
||||
)
|
||||
|
||||
func _current_gold() -> int:
|
||||
if client and client.has_method("get_points"):
|
||||
return maxi(0, int(client.get_points().get("gold", 0)))
|
||||
@@ -623,6 +642,16 @@ func _drop_mouse_item(payload: Dictionary, target_ui: int) -> bool:
|
||||
and client.mall_checkout(source_cell, target[0], target[1])
|
||||
if source_window not in [WINDOW_INVENTORY, 2]:
|
||||
return false
|
||||
var target_cell_node: Panel = _cells.get(target_ui, null)
|
||||
var target_vnum := int(target_cell_node.get_meta("vnum", 0)) if target_cell_node else 0
|
||||
var source_vnum := int(payload.get("vnum", 0))
|
||||
if target_vnum != 0 and source_vnum != 0:
|
||||
if ChestSystem.is_treasure_key(source_vnum) and ChestSystem.is_treasure_box(target_vnum):
|
||||
if client and client.has_method("use_item_to_item"):
|
||||
return client.use_item_to_item(source_window, source_cell, int(target[0]), int(target[1]))
|
||||
if ItemAttrSystem.is_attr_scroll(source_vnum) or MetinSocketSystem.is_metin_stone(source_vnum) or MetinSocketSystem.is_clean_socket_scroll(source_vnum):
|
||||
if client and client.has_method("use_item_to_item"):
|
||||
return client.use_item_to_item(source_window, source_cell, int(target[0]), int(target[1]))
|
||||
return move_wire(source_window, source_cell, int(target[0]), int(target[1]),
|
||||
maxi(1, int(payload.get("count", 1))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user