P08-03: 配置の通常操作受入

This commit is contained in:
Agent Control Runner
2026-10-14 05:51:27 +09:00
parent 4a17d0e0f5
commit d01286360e
21 changed files with 7225 additions and 79 deletions
+26 -2
View File
@@ -58,7 +58,26 @@ func annotate(row: Dictionary) -> void:
func point(node: Control) -> Dictionary:
var viewport: Vector2 = node.get_global_transform_with_canvas() * (node.size * 0.5)
var screen: Vector2 = node.get_screen_transform() * (node.size * 0.5)
return {"node": String(node.get_path()), "viewport": [viewport.x, viewport.y], "screen": [screen.x, screen.y], "window_id": node.get_window().get_window_id()}
return {"node": String(node.get_path()), "viewport": [viewport.x, viewport.y], "screen": [screen.x, screen.y], "window_id": node.get_window().get_window_id(),
"viewport_to_screen": affine(node.get_screen_transform() * node.get_global_transform_with_canvas().affine_inverse())}
func unsupported_cell() -> Vector3i:
# Read-only selection: retain the production predicate and avoid the guide.
var view: WorldPreview = main.world_preview
var bounds: Dictionary = runtime.world_service.get_bounds()
for y: int in range(4, int(bounds[&"max_y"]) + 1):
for x: int in range(int(bounds[&"max_x"]) - 1, int(bounds[&"min_x"]) - 1, -1):
var cell := Vector3i(x, y, 0)
var local := view.cell_to_canvas(cell)
var viewport := view.get_global_transform_with_canvas() * local
if not Rect2(Vector2.ZERO, view.size).has_point(local):
continue
if main.opening_guide.visible and main.opening_guide.get_global_rect().has_point(viewport):
continue
if "UNSUPPORTED" in view.get_build_preview_report(cell).get("error_codes", []):
return cell
expect(false, "visible unsupported target outside opening guide")
return Vector3i(4, 4, 0)
func setup() -> void:
input_method = "native_os"
@@ -125,9 +144,14 @@ func click(cell: Vector3i) -> Dictionary:
var local := view.cell_to_canvas(cell)
var viewport := view.get_global_transform_with_canvas() * local
var screen := view.get_screen_transform() * local
var mapping := affine(view.get_screen_transform() * view.get_global_transform_with_canvas().affine_inverse())
var guide_rect: Rect2 = main.opening_guide.get_global_rect()
observed_cell = null
await request({"action": "cell", "world_cell": vector(cell), "viewport": [viewport.x, viewport.y],
"screen": [screen.x, screen.y], "instructions": "Click this transformed world-cell center. If clipped, use normal zoom/pan first and request a new collection; never substitute fixed pixels."})
"screen": [screen.x, screen.y], "viewport_to_screen": mapping,
"guide_rect": [guide_rect.position.x, guide_rect.position.y, guide_rect.size.x, guide_rect.size.y],
"guide_visible": main.opening_guide.visible,
"instructions": "Click screen coordinates derived from viewport_to_screen (includes canvas stretch and window translation). Retain actual CUA coordinates and screenshots. If clipped or intercepted, recollect; never substitute fixed pixels."})
var selected: Variant = observed_cell
if not selected is Vector3i:
# With no active build tool, the normal preview selects a facility.