Files
Joywayer dd3eb24d0f refactor: 拆分 claude-dev-stack 为 windows-dev-stack 和 wsl-dev-stack
将原 claude-dev-stack 目录拆分为独立的 Windows 和 WSL 部署栈,便于分别维护和使用。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-29 01:11:20 +08:00

35 lines
925 B
GDScript

## Autoload injected by Godot MCP Pro plugin at runtime.
## Monitors for screenshot requests from the editor and captures the game viewport.
extends Node
const REQUEST_PATH := "user://mcp_screenshot_request"
const SCREENSHOT_PATH := "user://mcp_screenshot.png"
func _ready() -> void:
process_mode = Node.PROCESS_MODE_ALWAYS
func _process(_delta: float) -> void:
if FileAccess.file_exists(REQUEST_PATH):
_take_screenshot()
func _take_screenshot() -> void:
# Delete request file immediately to avoid re-triggering
DirAccess.remove_absolute(REQUEST_PATH)
# Wait one frame so the viewport has a fully rendered image
# process_always=true (default) so the timer ticks even when tree is paused
await get_tree().create_timer(0.05).timeout
var viewport := get_viewport()
if viewport == null:
return
var image := viewport.get_texture().get_image()
if image == null:
return
image.save_png(SCREENSHOT_PATH)