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.crConstant Summary
-
PRUNED_SUBTREE_CLASSES =
Set {"PopupMenu", "EditorFileDialog", "ConfirmationDialog", "AcceptDialog", "CreateDialog", "ScriptCreateDialog", "Tree", "ItemList", "TabContainer", "CodeEdit", "TextEdit", "DocumentList", "DocumentOutline", "FindReplaceBar", "ProjectSettingsEditor"}
Instance Method Summary
- #active_hooks : Array(DialogHook)
- #cleanup! : Void
-
#create_crshader_from_template!(res_path : String, template : Templates::Entry, source_dialog : Godot::ConfirmationDialog | Nil = nil) : CrShader::CRShader | Nil
Materializes a new
.crshaderfile from the chosen template, registers it with Godot's ResourceLoader & EditorFileSystem, emitsshader_created, and opens it in the Shader Editor. - #last_selected_was_crshader=(val : Bool) : Bool
- #last_selected_was_crshader? : Bool
-
#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 toCRShader. -
#refresh_hook_on_open!(hook : DialogHook) : Void
Synchronizes
proxy_type_obwith Godot's nativeorig_type_obwhenever the dialog opens. - #select_crshader_in_hook!(hook : DialogHook, template_id : String | Nil = nil) : Void
-
#sync_dialogs!(force_rescan : Bool = false) : Int32
Hooks
ShaderCreateDialoginstances 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). - #to_crshader_path(raw_path : String, auto_uniquify_default : Bool = false) : String
Instance Method Detail
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.
Triggers Godot's Shader Editor "New Shader..." (Ctrl+N) dialog pre-selected to CRShader.
Synchronizes proxy_type_ob with Godot's native orig_type_ob whenever the dialog opens.
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).