class Lapis::Editor::ActionDriver

Defined in:

libgodot/editor/action_driver.cr
libgodot/editor/action_driver_vision.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.new(base : Godot::Control | Nil = nil) #

Instance Method Detail

def action_log : Array(String) #

def base_control : Godot::Control | Nil #

def capture_ai_manifest(output_dir : String = "reports/ai_vision") : NamedTuple(manifest_path: String, screenshot_path: String, count: Int32) #

Discovers all visible interactive controls, saves crops, full screenshot, and a JSON manifest


def click(control : Godot::Control) : Void #

Simulates a mouse click (mouse button down + mouse button up) at center of target control


def click_crystal_build_button : Bool #

Clicks the "Build Crystal" toolbar button


def crop_element(control : Godot::Control, output_path : String = "reports/elements/element.png") : String | Nil #

Crops a single Control into an isolated PNG screenshot based on its global rectangle


def double_click(control : Godot::Control) : Void #

Simulates a double-click


def dump_dom(root : Godot::Node | Nil = nil, max_depth : Int32 = 6) : String #

Dumps the editor UI hierarchy as an indented text tree


def find_button(text_or_name : String, root : Godot::Node | Nil = nil) : Godot::Button | Nil #

Finds a Button by text, tooltip, or node name


def find_control(selector : String, root : Godot::Node | Nil = nil) : Godot::Control | Nil #

Finds a generic Control by CSS/XPath-like selector (e.g. "Button[text='Build']", "LineEdit#Filter", "CrystalPanel")


def find_control_where(root : Godot::Node | Nil = nil, max_depth : Int32 = 12, &predicate : Godot::Control -> Bool) : Godot::Control | Nil #

Finds any Control matching predicate recursively


def find_crystal_build_button : Godot::Button | Nil #

Locates the "Build Crystal" toolbar button


def find_crystal_console_dock : Godot::Control | Nil #

Locates the "CrystalConsoleDock" bottom panel companion control


def find_crystal_panel : Godot::Control | Nil #

Locates the "CrystalPanel" main screen hub control


def find_dock(dock_name : String) : Godot::Control | Nil #

Finds an Editor Dock by title/name (e.g. "Scene", "FileSystem", "Inspector", "CrystalPanel")


def find_inspector_property(prop_name : String) : Godot::Control | Nil #

Finds an Inspector EditorProperty control for property name


def find_line_edit(name_or_placeholder : String, root : Godot::Node | Nil = nil) : Godot::LineEdit | Nil #

Finds a LineEdit by placeholder text or node name


def find_tree(name_or_class : String = "Tree", root : Godot::Node | Nil = nil) : Godot::Tree | Nil #

Finds a Tree control by name or class


def get_active_code_edit : Godot::Control | Nil #

Returns the active CodeEdit control inside ScriptEditor if available


def get_current_script_path : String | Nil #

Returns the resource path of the currently active script in ScriptEditor, or nil


def get_open_script_paths : Array(String) #

Returns resource paths of all currently open scripts in ScriptEditor


def has_crystal_build_button? : Bool #

Checks whether the "Build Crystal" button exists in the editor UI


def has_crystal_console_dock? : Bool #

Checks whether the "CrystalConsoleDock" bottom panel dock exists in the editor UI


def has_crystal_panel? : Bool #

Checks whether the "CrystalPanel" main screen tab exists in the editor UI


def log_action(msg : String) : Void #

def open_crystal_main_screen : Bool #

Switches the active main screen tab to Crystal


def open_scene(res_path : String) : Void #

Opens a scene in the editor from path


def open_script(path : String, line : Int32 = 1, col : Int32 = 0) : Bool #

Opens a script in the editor's ScriptEditor and jumps to the line/column


def resolve_editor_base_control : Godot::Control | Nil #

Resolves the root Control of the Godot Editor


def right_click(control : Godot::Control) : Void #

Simulates a right-click (secondary mouse button for context menus)


def save_scene : Void #

Triggers Save Scene (Ctrl+S equivalent)


def select_node_in_scene(node_name_or_path : String) : Void #

Selects an edited scene node by name or path


def select_tab(container_or_bar : Godot::Control, tab_name_or_index : String | Int32) : Void #

Switches an Editor TabBar or TabContainer to the named tab or index


def switch_to_main_screen(screen_name : String) : Void #

Switches the Godot Editor Main Screen tab (e.g. "2D", "3D", "Script", "Crystal")


def take_screenshot(output_path : String = "reports/screenshots/editor.png") : String | Nil #

Captures full editor viewport screenshot and saves to file


def trigger_crystal_build : Void #

Triggers the "Build Crystal" compile button


def type_text(control : Godot::Control, text : String) : Void #

Simulates entering text into a LineEdit / TextEdit


def wait_for_visible(control : Godot::Control, timeout_sec : Float64 = 3.0) : Void #

Waits until control is visible


def wait_until(timeout_sec : Float64 = 5.0, msg : String = "", &condition : -> Bool) : Bool #

Waits until the condition evaluates to true within timeout_sec