module
Godot::EditorScriptCreation
Defined in:
libgodot/editor_script_creation.crConstant Summary
-
COMMON_BASE_TYPES =
["Node", "Node2D", "Node3D", "CharacterBody3D", "CharacterBody2D", "Control", "Camera3D", "Area3D", "Area2D", "RigidBody3D", "RigidBody2D", "Resource", "RefCounted"] -
ID_CRYSTAL_SCRIPT =
889901_i64 -
ID_SCENE_ATTACH =
889902_i64 -
TEMPLATES =
["Standard Node (_ready & _process)", "Physics Movement (CharacterBody)", "Tool Script (@[Tool] In-Editor Execution)", "Empty Class"]
Class Method Summary
-
.adapt_script_create_dialog_path(scd : Node) : Void
Adapts the file path inside a native ScriptCreateDialog to ensure a clean .cr extension when Crystal is selected
- .cleanup : Void
- .cleanup_on_shutdown : Void
-
.ensure_cr_extension(path : String) : String
Normalizes a path to end with exactly one .cr extension, stripping duplicate dots or other extensions
-
.find_all_children(parent : Node, type_name : String) : Array(Node)
Recursively discovers all child nodes matching the specified Godot class name
-
.fix_script_create_dialog(scd : Node) : Void
Repairs a Godot native ScriptCreateDialog's language menu: - Updates index 1 (CrystalLanguage) text to "Crystal" and sets official Crystal icon - Prunes any out-of-bounds surplus items (count must never exceed ScriptServer language count) - Ensures valid selection index so it never shows broken red icon or empty fields - Sets up live path adaptation when language is switched
- .generate_template_code(class_name : String, base_type : String, tmpl_idx : Int64) : String
-
.get_create_dialog_selected_type(cd : Node) : String
Retrieves the selected type from a Godot CreateDialog by inspecting its Tree control
-
.hook_create_new_submenu(fs_dock : Node, sub_node : Node) : Void
Hooks dynamically created "Create New" submenus in FileSystemDock
-
.setup(ed_iface : EditorInterface, base_ctrl : Control) : Void
Sets up all editor integration entry points: toolbar button, FileSystem dock menus, SceneTree menus, and ScriptCreateDialog interception
-
.setup_filesystem_dock_menus(ed_iface : EditorInterface) : Void
-
.setup_scene_tree_dock_menus(ed_iface : EditorInterface, base_ctrl : Control) : Void
-
.setup_script_create_dialog_interception(ed_iface : EditorInterface, base_ctrl : Control) : Void
Intercepts Godot's built-in ScriptCreateDialog whenever CrystalScript is selected in "Create New Resource" (FileSystem Dock -> Create New -> Resource -> CrystalScript) and repairs native ScriptCreateDialog instances so they never show broken red icons.
-
.setup_toolbar_button(ed_iface : EditorInterface, base_ctrl : Control) : Void
-
.show_dialog(initial_path : String = "", default_name : String = "", default_base : String = "") : Void
-
.to_snake_case(str : String) : String
Converts CamelCase to snake_case for clean Crystal file naming
Class Method Detail
Adapts the file path inside a native ScriptCreateDialog to ensure a clean .cr extension when Crystal is selected
Normalizes a path to end with exactly one .cr extension, stripping duplicate dots or other extensions
Recursively discovers all child nodes matching the specified Godot class name
Repairs a Godot native ScriptCreateDialog's language menu:
- Updates index 1 (CrystalLanguage) text to "Crystal" and sets official Crystal icon
- Prunes any out-of-bounds surplus items (count must never exceed ScriptServer language count)
- Ensures valid selection index so it never shows broken red icon or empty fields
- Sets up live path adaptation when language is switched
Retrieves the selected type from a Godot CreateDialog by inspecting its Tree control
Sets up all editor integration entry points: toolbar button, FileSystem dock menus, SceneTree menus, and ScriptCreateDialog interception
Intercepts Godot's built-in ScriptCreateDialog whenever CrystalScript is selected in "Create New Resource" (FileSystem Dock -> Create New -> Resource -> CrystalScript) and repairs native ScriptCreateDialog instances so they never show broken red icons.
- Top Toolbar "+ Script" Button
- Interactive Dialog Presentation
Converts CamelCase to snake_case for clean Crystal file naming