module CrShader::ShaderCreateDialogIntegration

Overview

============================================================================= ShaderCreateDialogIntegration - Native CRShader Type & Templates in Ctrl+N

Hooks every ShaderCreateDialog in Godot 4.8 (Shader Editor Ctrl+N / File -> New Shader..., FileSystem Create New -> Shader..., and Inspector ShaderMaterial -> New Shader...) using crash-safe proxy controls so C++ ShaderCreateDialog internal type indices (0..2) are never out-of-bounds.

Extended Modules

Defined in:

crshader/editor/shader_create_dialog_integration.cr

Constant Summary

PRUNED_SUBTREE_CLASSES = Set {"PopupMenu", "EditorFileDialog", "ConfirmationDialog", "AcceptDialog", "CreateDialog", "ScriptCreateDialog", "Tree", "ItemList", "TabContainer", "CodeEdit", "TextEdit", "DocumentList", "DocumentOutline", "FindReplaceBar", "ProjectSettingsEditor"}

Instance Method Summary

Instance Method Detail

def active_hooks : Array(DialogHook) #

def cleanup! : Void #

def create_crshader_from_template!(res_path : String, template : Templates::Entry, source_dialog : Godot::ConfirmationDialog | Nil = nil) : CrShader::CRShader | Nil #

Materializes a new .crshader file from the chosen template, registers it with Godot's ResourceLoader & EditorFileSystem, emits shader_created, and opens it in the Shader Editor.


def last_selected_was_crshader=(val : Bool) : Bool #

def last_selected_was_crshader? : Bool #

def prompt_new_crshader!(template_id : String | Nil = nil, host_plugin : Godot::Object | Nil = nil) : Bool #

Triggers Godot's Shader Editor "New Shader..." (Ctrl+N) dialog pre-selected to CRShader.


def refresh_hook_on_open!(hook : DialogHook) : Void #

Synchronizes proxy_type_ob with Godot's native orig_type_ob whenever the dialog opens.


def select_crshader_in_hook!(hook : DialogHook, template_id : String | Nil = nil) : Void #

def sync_dialogs!(force_rescan : Bool = false) : Int32 #

Hooks ShaderCreateDialog instances across the Shader Editor, FileSystem dock, and Scene dock in O(1) steady-state time (zero full-tree walks and zero per-tick allocations once hooked).


def to_crshader_path(raw_path : String, auto_uniquify_default : Bool = false) : String #