fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
@@ -35,6 +35,7 @@ var _map_origin := Vector2.ZERO
|
||||
var _map_px := Vector2.ZERO
|
||||
var _world_size_m := Vector2(1, 1)
|
||||
var _center_position_adjust := Vector2.ZERO
|
||||
var _signal_points: Array[Vector2] = []
|
||||
var _touches: Dictionary = {}
|
||||
var _touch_dragging := false
|
||||
var _touch_drag_origin := Vector2.ZERO
|
||||
@@ -71,6 +72,22 @@ func close() -> void:
|
||||
_touches.clear()
|
||||
_touch_dragging = false
|
||||
|
||||
# CPythonMiniMap::AddSignalPoint also calls AddWayPoint(TYPE_WAYPOINT), so the
|
||||
# same quest-script coordinate must remain visible in the Atlas overlay, not
|
||||
# only on the circular minimap.
|
||||
func add_signal_point(x: float, y: float) -> void:
|
||||
_signal_points.append(Vector2(x, y))
|
||||
if _overlay:
|
||||
_overlay.queue_redraw()
|
||||
|
||||
func clear_signal_points() -> void:
|
||||
_signal_points.clear()
|
||||
if _overlay:
|
||||
_overlay.queue_redraw()
|
||||
|
||||
func signal_point_count() -> int:
|
||||
return _signal_points.size()
|
||||
|
||||
# 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.
|
||||
@@ -298,6 +315,12 @@ func _draw_world_marks(canvas: CanvasItem) -> void:
|
||||
canvas.draw_colored_polygon(PackedVector2Array([op + Vector2(0, -6), op + Vector2(6, 0),
|
||||
op + Vector2(0, 6), op + Vector2(-6, 0)]), Color(0.8, 0.35, 1.0, 0.95))
|
||||
# Quest/warp markers remain visible when the Atlas is used for navigation.
|
||||
for signal_point in _signal_points:
|
||||
var signal_world := MapCoord.to_world(Vector3(signal_point.x * 0.01, 0,
|
||||
-signal_point.y * 0.01))
|
||||
var signal_px := _world_to_px(signal_world)
|
||||
canvas.draw_circle(signal_px, 6.0, Color(1.0, 0.75, 0.15, 0.95))
|
||||
canvas.draw_arc(signal_px, 10.0, 0.0, TAU, 20, Color(1.0, 0.4, 0.1, 0.9), 2.0)
|
||||
if client.has_method("get_world_markers"):
|
||||
for marker in client.get_world_markers():
|
||||
var mp := _world_to_px(MapCoord.to_world(marker.get("pos", Vector3.ZERO)))
|
||||
|
||||
Reference in New Issue
Block a user