完善客户端功能并同步差距文档

This commit is contained in:
shenlei
2026-09-03 18:40:01 +09:00
parent f93a172296
commit 13ccb8d02d
135 changed files with 21881 additions and 1259 deletions
+12 -1
View File
@@ -34,6 +34,7 @@ var _drag_origin := Vector2.ZERO
var _map_origin := Vector2.ZERO
var _map_px := Vector2.ZERO
var _world_size_m := Vector2(1, 1)
var _center_position_adjust := Vector2.ZERO
func setup(metin_world: Node, ui_manager: CanvasLayer, get_player: Callable,
name := "", m2client: Node = null) -> void:
@@ -64,6 +65,16 @@ func close() -> void:
ui.close(_win)
_win = null
# CPythonMiniMap::SetAtlasCenterPosition ultimately calls the atlas window's
# SetCenterPositionAdjust. Keep the same screen-space adjustment instead of
# treating this event as a world-coordinate teleport.
func set_center_position_adjust(x: int, y: int) -> void:
_center_position_adjust = Vector2(x, y)
if _map_view and _map:
_map_origin = (_map_view.size - _map.size) * 0.5 + _center_position_adjust
_map.position = _map_origin
_overlay.position = _map.position
func reload_map(metin_world: Node, name := "") -> void:
world = metin_world
if name != "":
@@ -149,7 +160,7 @@ func _build_map() -> void:
_map.stretch_mode = TextureRect.STRETCH_SCALE
_map.size = _map_px
_map.mouse_filter = Control.MOUSE_FILTER_IGNORE
_map_origin = (_map_view.size - _map_px) * 0.5
_map_origin = (_map_view.size - _map_px) * 0.5 + _center_position_adjust
_map.position = _map_origin
_map_view.add_child(_map)
_overlay.position = _map.position