diff options
Diffstat (limited to 'editor/plugins')
91 files changed, 1342 insertions, 1307 deletions
diff --git a/editor/plugins/abstract_polygon_2d_editor.h b/editor/plugins/abstract_polygon_2d_editor.h index c0e7c1be2e..b0483cbb62 100644 --- a/editor/plugins/abstract_polygon_2d_editor.h +++ b/editor/plugins/abstract_polygon_2d_editor.h @@ -40,9 +40,9 @@ class CanvasItemEditor; class AbstractPolygon2DEditor : public HBoxContainer { GDCLASS(AbstractPolygon2DEditor, HBoxContainer); - Button *button_create; - Button *button_edit; - Button *button_delete; + Button *button_create = nullptr; + Button *button_edit = nullptr; + Button *button_delete = nullptr; struct Vertex { Vertex() {} @@ -85,9 +85,9 @@ class AbstractPolygon2DEditor : public HBoxContainer { bool _polygon_editing_enabled; - CanvasItemEditor *canvas_item_editor; - Panel *panel; - ConfirmationDialog *create_resource; + CanvasItemEditor *canvas_item_editor = nullptr; + Panel *panel = nullptr; + ConfirmationDialog *create_resource = nullptr; protected: enum { @@ -99,7 +99,7 @@ protected: int mode; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _menu_option(int p_option); void _wip_changed(); @@ -149,7 +149,7 @@ public: class AbstractPolygon2DEditorPlugin : public EditorPlugin { GDCLASS(AbstractPolygon2DEditorPlugin, EditorPlugin); - AbstractPolygon2DEditor *polygon_editor; + AbstractPolygon2DEditor *polygon_editor = nullptr; String klass; public: diff --git a/editor/plugins/animation_blend_space_1d_editor.h b/editor/plugins/animation_blend_space_1d_editor.h index 54cded6048..816c2555ca 100644 --- a/editor/plugins/animation_blend_space_1d_editor.h +++ b/editor/plugins/animation_blend_space_1d_editor.h @@ -45,36 +45,36 @@ class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin { Ref<AnimationNodeBlendSpace1D> blend_space; - HBoxContainer *goto_parent_hb; - Button *goto_parent; - - PanelContainer *panel; - Button *tool_blend; - Button *tool_select; - Button *tool_create; - VSeparator *tool_erase_sep; - Button *tool_erase; - Button *snap; - SpinBox *snap_value; - - LineEdit *label_value; - SpinBox *max_value; - SpinBox *min_value; - - HBoxContainer *edit_hb; - SpinBox *edit_value; - Button *open_editor; + HBoxContainer *goto_parent_hb = nullptr; + Button *goto_parent = nullptr; + + PanelContainer *panel = nullptr; + Button *tool_blend = nullptr; + Button *tool_select = nullptr; + Button *tool_create = nullptr; + VSeparator *tool_erase_sep = nullptr; + Button *tool_erase = nullptr; + Button *snap = nullptr; + SpinBox *snap_value = nullptr; + + LineEdit *label_value = nullptr; + SpinBox *max_value = nullptr; + SpinBox *min_value = nullptr; + + HBoxContainer *edit_hb = nullptr; + SpinBox *edit_value = nullptr; + Button *open_editor = nullptr; int selected_point; - Control *blend_space_draw; + Control *blend_space_draw = nullptr; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; static AnimationNodeBlendSpace1DEditor *singleton; @@ -87,8 +87,8 @@ class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin { void _labels_changed(String); void _snap_toggled(); - PopupMenu *menu; - PopupMenu *animations_menu; + PopupMenu *menu = nullptr; + PopupMenu *animations_menu = nullptr; Vector<String> animations_to_add; float add_point_pos; Vector<real_t> points; @@ -108,7 +108,7 @@ class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin { void _edit_point_pos(double); void _open_editor(); - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_blend_space_2d_editor.h b/editor/plugins/animation_blend_space_2d_editor.h index 933d2bd96d..db54e84254 100644 --- a/editor/plugins/animation_blend_space_2d_editor.h +++ b/editor/plugins/animation_blend_space_2d_editor.h @@ -45,43 +45,43 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { Ref<AnimationNodeBlendSpace2D> blend_space; - PanelContainer *panel; - Button *tool_blend; - Button *tool_select; - Button *tool_create; - Button *tool_triangle; - VSeparator *tool_erase_sep; - Button *tool_erase; - Button *snap; - SpinBox *snap_x; - SpinBox *snap_y; - OptionButton *interpolation; - - Button *auto_triangles; - - LineEdit *label_x; - LineEdit *label_y; - SpinBox *max_x_value; - SpinBox *min_x_value; - SpinBox *max_y_value; - SpinBox *min_y_value; - - HBoxContainer *edit_hb; - SpinBox *edit_x; - SpinBox *edit_y; - Button *open_editor; + PanelContainer *panel = nullptr; + Button *tool_blend = nullptr; + Button *tool_select = nullptr; + Button *tool_create = nullptr; + Button *tool_triangle = nullptr; + VSeparator *tool_erase_sep = nullptr; + Button *tool_erase = nullptr; + Button *snap = nullptr; + SpinBox *snap_x = nullptr; + SpinBox *snap_y = nullptr; + OptionButton *interpolation = nullptr; + + Button *auto_triangles = nullptr; + + LineEdit *label_x = nullptr; + LineEdit *label_y = nullptr; + SpinBox *max_x_value = nullptr; + SpinBox *min_x_value = nullptr; + SpinBox *max_y_value = nullptr; + SpinBox *min_y_value = nullptr; + + HBoxContainer *edit_hb = nullptr; + SpinBox *edit_x = nullptr; + SpinBox *edit_y = nullptr; + Button *open_editor = nullptr; int selected_point; int selected_triangle; - Control *blend_space_draw; + Control *blend_space_draw = nullptr; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; static AnimationNodeBlendSpace2DEditor *singleton; @@ -94,8 +94,8 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { void _labels_changed(String); void _snap_toggled(); - PopupMenu *menu; - PopupMenu *animations_menu; + PopupMenu *menu = nullptr; + PopupMenu *animations_menu = nullptr; Vector<String> animations_to_add; Vector2 add_point_pos; Vector<Vector2> points; @@ -123,7 +123,7 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin { StringName get_blend_position_path() const; - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.h b/editor/plugins/animation_blend_tree_editor_plugin.h index c111f9245e..cacf8379f9 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.h +++ b/editor/plugins/animation_blend_tree_editor_plugin.h @@ -47,19 +47,19 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin { GDCLASS(AnimationNodeBlendTreeEditor, AnimationTreeNodeEditorPlugin); Ref<AnimationNodeBlendTree> blend_tree; - GraphEdit *graph; - MenuButton *add_node; + GraphEdit *graph = nullptr; + MenuButton *add_node = nullptr; Vector2 position_from_popup_menu; bool use_position_from_popup_menu; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; - AcceptDialog *filter_dialog; - Tree *filters; - CheckBox *filter_enabled; + AcceptDialog *filter_dialog = nullptr; + Tree *filters = nullptr; + CheckBox *filter_enabled = nullptr; Map<StringName, ProgressBar *> animations; Vector<EditorProperty *> visible_properties; @@ -122,7 +122,7 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin { void _update_editor_settings(); void _update_theme(); - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index ab8e2ca54a..af7c092d03 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1267,7 +1267,7 @@ void AnimationPlayerEditor::_onion_skinning_menu(int p_option) { } } -void AnimationPlayerEditor::unhandled_key_input(const Ref<InputEvent> &p_ev) { +void AnimationPlayerEditor::shortcut_input(const Ref<InputEvent> &p_ev) { ERR_FAIL_COND(p_ev.is_null()); Ref<InputEventKey> k = p_ev; @@ -1750,7 +1750,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug last_active = false; timeline_position = 0; - set_process_unhandled_key_input(true); + set_process_shortcut_input(true); add_child(track_editor); track_editor->set_v_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index 5bb32e25e6..4f6a9c534f 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -46,8 +46,8 @@ class AnimationPlayerEditorPlugin; class AnimationPlayerEditor : public VBoxContainer { GDCLASS(AnimationPlayerEditor, VBoxContainer); - AnimationPlayerEditorPlugin *plugin; - AnimationPlayer *player; + AnimationPlayerEditorPlugin *plugin = nullptr; + AnimationPlayer *player = nullptr; enum { TOOL_NEW_ANIM, @@ -88,31 +88,31 @@ class AnimationPlayerEditor : public VBoxContainer { RESOURCE_SAVE }; - OptionButton *animation; - Button *stop; - Button *play; - Button *play_from; - Button *play_bw; - Button *play_bw_from; - Button *autoplay; - - MenuButton *tool_anim; - Button *onion_toggle; - MenuButton *onion_skinning; - Button *pin; - SpinBox *frame; - LineEdit *scale; - LineEdit *name; - Label *name_title; - UndoRedo *undo_redo; + OptionButton *animation = nullptr; + Button *stop = nullptr; + Button *play = nullptr; + Button *play_from = nullptr; + Button *play_bw = nullptr; + Button *play_bw_from = nullptr; + Button *autoplay = nullptr; + + MenuButton *tool_anim = nullptr; + Button *onion_toggle = nullptr; + MenuButton *onion_skinning = nullptr; + Button *pin = nullptr; + SpinBox *frame = nullptr; + LineEdit *scale = nullptr; + LineEdit *name = nullptr; + Label *name_title = nullptr; + UndoRedo *undo_redo = nullptr; Ref<Texture2D> autoplay_icon; Ref<Texture2D> reset_icon; Ref<ImageTexture> autoplay_reset_icon; bool last_active; float timeline_position; - EditorFileDialog *file; - ConfirmationDialog *delete_dialog; + EditorFileDialog *file = nullptr; + ConfirmationDialog *delete_dialog = nullptr; struct BlendEditor { AcceptDialog *dialog = nullptr; @@ -121,14 +121,14 @@ class AnimationPlayerEditor : public VBoxContainer { } blend_editor; - ConfirmationDialog *name_dialog; - ConfirmationDialog *error_dialog; + ConfirmationDialog *name_dialog = nullptr; + ConfirmationDialog *error_dialog = nullptr; int name_dialog_op = TOOL_NEW_ANIM; bool updating; bool updating_blends; - AnimationTrackEditor *track_editor; + AnimationTrackEditor *track_editor = nullptr; static AnimationPlayerEditor *singleton; // Onion skinning. @@ -204,7 +204,7 @@ class AnimationPlayerEditor : public VBoxContainer { void _animation_key_editor_seek(float p_pos, bool p_drag, bool p_timeline_only = false); void _animation_key_editor_anim_len_changed(float p_len); - virtual void unhandled_key_input(const Ref<InputEvent> &p_ev) override; + virtual void shortcut_input(const Ref<InputEvent> &p_ev) override; void _animation_tool_menu(int p_option); void _onion_skinning_menu(int p_option); @@ -250,7 +250,7 @@ public: class AnimationPlayerEditorPlugin : public EditorPlugin { GDCLASS(AnimationPlayerEditorPlugin, EditorPlugin); - AnimationPlayerEditor *anim_editor; + AnimationPlayerEditor *anim_editor = nullptr; protected: void _notification(int p_what); diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index bd0c1afd19..f0dabed652 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -499,7 +499,7 @@ void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, co accent.a *= 0.6; } - Ref<Texture2D> icons[6] = { + const Ref<Texture2D> icons[6] = { get_theme_icon(SNAME("TransitionImmediateBig"), SNAME("EditorIcons")), get_theme_icon(SNAME("TransitionSyncBig"), SNAME("EditorIcons")), get_theme_icon(SNAME("TransitionEndBig"), SNAME("EditorIcons")), diff --git a/editor/plugins/animation_state_machine_editor.h b/editor/plugins/animation_state_machine_editor.h index 03991d00f9..bf3f7e93cf 100644 --- a/editor/plugins/animation_state_machine_editor.h +++ b/editor/plugins/animation_state_machine_editor.h @@ -47,36 +47,36 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { Ref<AnimationNodeStateMachine> state_machine; - Button *tool_select; - Button *tool_create; - Button *tool_connect; - Popup *name_edit_popup; - LineEdit *name_edit; + Button *tool_select = nullptr; + Button *tool_create = nullptr; + Button *tool_connect = nullptr; + Popup *name_edit_popup = nullptr; + LineEdit *name_edit = nullptr; - HBoxContainer *tool_erase_hb; - Button *tool_erase; - Button *tool_autoplay; - Button *tool_end; + HBoxContainer *tool_erase_hb = nullptr; + Button *tool_erase = nullptr; + Button *tool_autoplay = nullptr; + Button *tool_end = nullptr; - OptionButton *transition_mode; - OptionButton *play_mode; + OptionButton *transition_mode = nullptr; + OptionButton *play_mode = nullptr; - PanelContainer *panel; + PanelContainer *panel = nullptr; StringName selected_node; - HScrollBar *h_scroll; - VScrollBar *v_scroll; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; - Control *state_machine_draw; - Control *state_machine_play_pos; + Control *state_machine_draw = nullptr; + Control *state_machine_play_pos = nullptr; - PanelContainer *error_panel; - Label *error_label; + PanelContainer *error_panel = nullptr; + Label *error_label = nullptr; bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; static AnimationNodeStateMachineEditor *singleton; @@ -87,8 +87,8 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { void _update_graph(); - PopupMenu *menu; - PopupMenu *animations_menu; + PopupMenu *menu = nullptr; + PopupMenu *animations_menu = nullptr; Vector<String> animations_to_add; Vector2 add_node_pos; @@ -166,7 +166,7 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin { float error_time; String error_text; - EditorFileDialog *open_file; + EditorFileDialog *open_file = nullptr; Ref<AnimationNode> file_loaded; void _file_opened(const String &p_file); diff --git a/editor/plugins/animation_tree_editor_plugin.h b/editor/plugins/animation_tree_editor_plugin.h index 5442584a40..ab4ef5a001 100644 --- a/editor/plugins/animation_tree_editor_plugin.h +++ b/editor/plugins/animation_tree_editor_plugin.h @@ -52,11 +52,11 @@ public: class AnimationTreeEditor : public VBoxContainer { GDCLASS(AnimationTreeEditor, VBoxContainer); - ScrollContainer *path_edit; - HBoxContainer *path_hb; + ScrollContainer *path_edit = nullptr; + HBoxContainer *path_hb = nullptr; - AnimationTree *tree; - MarginContainer *editor_base; + AnimationTree *tree = nullptr; + MarginContainer *editor_base = nullptr; Vector<String> button_path; Vector<String> edited_path; @@ -96,8 +96,8 @@ public: class AnimationTreeEditorPlugin : public EditorPlugin { GDCLASS(AnimationTreeEditorPlugin, EditorPlugin); - AnimationTreeEditor *anim_tree_editor; - Button *button; + AnimationTreeEditor *anim_tree_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "AnimationTree"; } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 1468d63daf..405ece1471 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -640,7 +640,7 @@ void EditorAssetLibrary::_update_repository_options() { } } -void EditorAssetLibrary::unhandled_key_input(const Ref<InputEvent> &p_event) { +void EditorAssetLibrary::shortcut_input(const Ref<InputEvent> &p_event) { ERR_FAIL_COND(p_event.is_null()); const Ref<InputEventKey> key = p_event; @@ -997,7 +997,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int hbc->add_theme_constant_override("separation", 5 * EDSCALE); Button *first = memnew(Button); - first->set_text(TTR("First")); + first->set_text(TTR("First", "Pagination")); if (p_page != 0) { first->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(0)); } else { @@ -1007,7 +1007,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int hbc->add_child(first); Button *prev = memnew(Button); - prev->set_text(TTR("Previous")); + prev->set_text(TTR("Previous", "Pagination")); if (p_page > 0) { prev->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(p_page - 1)); } else { @@ -1037,7 +1037,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int } Button *next = memnew(Button); - next->set_text(TTR("Next")); + next->set_text(TTR("Next", "Pagination")); if (p_page < p_page_count - 1) { next->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(p_page + 1)); } else { @@ -1048,7 +1048,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int hbc->add_child(next); Button *last = memnew(Button); - last->set_text(TTR("Last")); + last->set_text(TTR("Last", "Pagination")); if (p_page != p_page_count - 1) { last->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(p_page_count - 1)); } else { @@ -1541,7 +1541,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { description = nullptr; set_process(true); - set_process_unhandled_key_input(true); // Global shortcuts since there is no main element to be focused. + set_process_shortcut_input(true); // Global shortcuts since there is no main element to be focused. downloads_scroll = memnew(ScrollContainer); downloads_scroll->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 493ffc4033..96830c31fd 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -53,12 +53,12 @@ class EditorAssetLibraryItem : public PanelContainer { GDCLASS(EditorAssetLibraryItem, PanelContainer); - TextureButton *icon; - LinkButton *title; - LinkButton *category; - LinkButton *author; + TextureButton *icon = nullptr; + LinkButton *title = nullptr; + LinkButton *category = nullptr; + LinkButton *author = nullptr; TextureRect *stars[5]; - Label *price; + Label *price = nullptr; int asset_id; int category_id; @@ -83,11 +83,11 @@ public: class EditorAssetLibraryItemDescription : public ConfirmationDialog { GDCLASS(EditorAssetLibraryItemDescription, ConfirmationDialog); - EditorAssetLibraryItem *item; - RichTextLabel *description; - ScrollContainer *previews; - HBoxContainer *preview_hb; - PanelContainer *previews_bg; + EditorAssetLibraryItem *item = nullptr; + RichTextLabel *description = nullptr; + ScrollContainer *previews = nullptr; + HBoxContainer *preview_hb = nullptr; + PanelContainer *previews_bg = nullptr; struct Preview { int id = 0; @@ -98,7 +98,7 @@ class EditorAssetLibraryItemDescription : public ConfirmationDialog { }; Vector<Preview> preview_images; - TextureRect *preview; + TextureRect *preview = nullptr; void set_image(int p_type, int p_index, const Ref<Texture2D> &p_image); @@ -130,19 +130,19 @@ public: class EditorAssetLibraryItemDownload : public MarginContainer { GDCLASS(EditorAssetLibraryItemDownload, MarginContainer); - PanelContainer *panel; - TextureRect *icon; - Label *title; - ProgressBar *progress; - Button *install_button; - Button *retry_button; - TextureButton *dismiss_button; + PanelContainer *panel = nullptr; + TextureRect *icon = nullptr; + Label *title = nullptr; + ProgressBar *progress = nullptr; + Button *install_button = nullptr; + Button *retry_button = nullptr; + TextureButton *dismiss_button = nullptr; - AcceptDialog *download_error; - HTTPRequest *download; + AcceptDialog *download_error = nullptr; + HTTPRequest *download = nullptr; String host; String sha256; - Label *status; + Label *status = nullptr; int prev_status; @@ -150,7 +150,7 @@ class EditorAssetLibraryItemDownload : public MarginContainer { bool external_install; - EditorAssetInstaller *asset_installer; + EditorAssetInstaller *asset_installer = nullptr; void _close(); void _make_request(); @@ -176,35 +176,35 @@ class EditorAssetLibrary : public PanelContainer { String host; - EditorFileDialog *asset_open; - EditorAssetInstaller *asset_installer; + EditorFileDialog *asset_open = nullptr; + EditorAssetInstaller *asset_installer = nullptr; void _asset_open(); void _asset_file_selected(const String &p_file); void _update_repository_options(); - PanelContainer *library_scroll_bg; - ScrollContainer *library_scroll; - VBoxContainer *library_vb; - Label *library_loading; - Label *library_error; - LineEdit *filter; - Timer *filter_debounce_timer; - OptionButton *categories; - OptionButton *repository; - OptionButton *sort; - HBoxContainer *error_hb; - TextureRect *error_tr; - Label *error_label; - MenuButton *support; - - HBoxContainer *contents; - - HBoxContainer *asset_top_page; - GridContainer *asset_items; - HBoxContainer *asset_bottom_page; - - HTTPRequest *request; + PanelContainer *library_scroll_bg = nullptr; + ScrollContainer *library_scroll = nullptr; + VBoxContainer *library_vb = nullptr; + Label *library_loading = nullptr; + Label *library_error = nullptr; + LineEdit *filter = nullptr; + Timer *filter_debounce_timer = nullptr; + OptionButton *categories = nullptr; + OptionButton *repository = nullptr; + OptionButton *sort = nullptr; + HBoxContainer *error_hb = nullptr; + TextureRect *error_tr = nullptr; + Label *error_label = nullptr; + MenuButton *support = nullptr; + + HBoxContainer *contents = nullptr; + + HBoxContainer *asset_top_page = nullptr; + GridContainer *asset_items = nullptr; + HBoxContainer *asset_bottom_page = nullptr; + + HTTPRequest *request = nullptr; bool templates_only; bool initial_loading; @@ -260,7 +260,7 @@ class EditorAssetLibrary : public PanelContainer { HBoxContainer *_make_pages(int p_page, int p_page_count, int p_page_len, int p_total_items, int p_current_items); // - EditorAssetLibraryItemDescription *description; + EditorAssetLibraryItemDescription *description = nullptr; // enum RequestType { @@ -273,8 +273,8 @@ class EditorAssetLibrary : public PanelContainer { RequestType requesting; Dictionary category_map; - ScrollContainer *downloads_scroll; - HBoxContainer *downloads_hb; + ScrollContainer *downloads_scroll = nullptr; + HBoxContainer *downloads_hb = nullptr; void _install_asset(); @@ -304,7 +304,7 @@ class EditorAssetLibrary : public PanelContainer { protected: static void _bind_methods(); void _notification(int p_what); - virtual void unhandled_key_input(const Ref<InputEvent> &p_event) override; + virtual void shortcut_input(const Ref<InputEvent> &p_event) override; public: void disable_community_support(); @@ -315,7 +315,7 @@ public: class AssetLibraryEditorPlugin : public EditorPlugin { GDCLASS(AssetLibraryEditorPlugin, EditorPlugin); - EditorAssetLibrary *addon_library; + EditorAssetLibrary *addon_library = nullptr; public: virtual String get_name() const override { return "AssetLib"; } diff --git a/editor/plugins/audio_stream_editor_plugin.h b/editor/plugins/audio_stream_editor_plugin.h index 2478210430..0d927bddd5 100644 --- a/editor/plugins/audio_stream_editor_plugin.h +++ b/editor/plugins/audio_stream_editor_plugin.h @@ -75,7 +75,7 @@ public: class AudioStreamEditorPlugin : public EditorPlugin { GDCLASS(AudioStreamEditorPlugin, EditorPlugin); - AudioStreamEditor *audio_editor; + AudioStreamEditor *audio_editor = nullptr; public: virtual String get_name() const override { return "Audio"; } diff --git a/editor/plugins/camera_3d_editor_plugin.h b/editor/plugins/camera_3d_editor_plugin.h index c1f71d3b1b..a8164f9b85 100644 --- a/editor/plugins/camera_3d_editor_plugin.h +++ b/editor/plugins/camera_3d_editor_plugin.h @@ -37,9 +37,9 @@ class Camera3DEditor : public Control { GDCLASS(Camera3DEditor, Control); - Panel *panel; - Button *preview; - Node *node; + Panel *panel = nullptr; + Button *preview = nullptr; + Node *node = nullptr; void _pressed(); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d713e70251..a90e151adb 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -475,7 +475,7 @@ real_t CanvasItemEditor::snap_angle(real_t p_target, real_t p_start) const { } } -void CanvasItemEditor::unhandled_key_input(const Ref<InputEvent> &p_ev) { +void CanvasItemEditor::shortcut_input(const Ref<InputEvent> &p_ev) { ERR_FAIL_COND(p_ev.is_null()); Ref<InputEventKey> k = p_ev; @@ -860,7 +860,7 @@ void CanvasItemEditor::_commit_canvas_item_state(List<CanvasItem *> p_canvas_ite } void CanvasItemEditor::_snap_changed() { - ((SnapDialog *)snap_dialog)->get_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step); + static_cast<SnapDialog *>(snap_dialog)->get_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step); grid_step_multiplier = 0; viewport->update(); } @@ -1504,7 +1504,7 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { } } - DragType dragger[] = { + const DragType dragger[] = { DRAG_ANCHOR_TOP_LEFT, DRAG_ANCHOR_TOP_RIGHT, DRAG_ANCHOR_BOTTOM_RIGHT, @@ -1635,14 +1635,14 @@ bool CanvasItemEditor::_gui_input_resize(const Ref<InputEvent> &p_event) { Rect2 rect = canvas_item->_edit_get_rect(); Transform2D xform = transform * canvas_item->get_global_transform_with_canvas(); - Vector2 endpoints[4] = { + const Vector2 endpoints[4] = { xform.xform(rect.position), xform.xform(rect.position + Vector2(rect.size.x, 0)), xform.xform(rect.position + rect.size), xform.xform(rect.position + Vector2(0, rect.size.y)) }; - DragType dragger[] = { + const DragType dragger[] = { DRAG_TOP_LEFT, DRAG_TOP, DRAG_TOP_RIGHT, @@ -2318,7 +2318,6 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { Vector<_SelectResult> selection = Vector<_SelectResult>(); // Retrieve the canvas items - selection = Vector<_SelectResult>(); _get_canvas_items_at_pos(click, selection); if (!selection.is_empty()) { canvas_item = selection[0].item; @@ -2572,7 +2571,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { void CanvasItemEditor::_update_cursor() { // Compute an eventual rotation of the cursor - CursorShape rotation_array[4] = { CURSOR_HSIZE, CURSOR_BDIAGSIZE, CURSOR_VSIZE, CURSOR_FDIAGSIZE }; + const CursorShape rotation_array[4] = { CURSOR_HSIZE, CURSOR_BDIAGSIZE, CURSOR_VSIZE, CURSOR_FDIAGSIZE }; int rotation_array_index = 0; List<CanvasItem *> selection = _get_edited_canvas_items(); @@ -3150,7 +3149,6 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { if (dragged_anchor >= 0) { // Draw the 4 lines when dragged - bool anchor_snapped; Color color_snapped = Color(0.64, 0.93, 0.67, 0.5); Vector2 corners_pos[4]; @@ -3164,7 +3162,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) { real_t anchor_val = (i >= 2) ? ANCHOR_END - anchors_values[i] : anchors_values[i]; line_starts[i] = corners_pos[i].lerp(corners_pos[(i + 1) % 4], anchor_val); line_ends[i] = corners_pos[(i + 3) % 4].lerp(corners_pos[(i + 2) % 4], anchor_val); - anchor_snapped = anchors_values[i] == 0.0 || anchors_values[i] == 0.5 || anchors_values[i] == 1.0; + bool anchor_snapped = anchors_values[i] == 0.0 || anchors_values[i] == 0.5 || anchors_values[i] == 1.0; viewport->draw_line(line_starts[i], line_ends[i], anchor_snapped ? color_snapped : color_base, (i == dragged_anchor || (i + 3) % 4 == dragged_anchor) ? 2 : 1); } @@ -3328,7 +3326,7 @@ void CanvasItemEditor::_draw_selection() { // Draw the selected items position / surrounding boxes if (canvas_item->_edit_use_rect()) { Rect2 rect = canvas_item->_edit_get_rect(); - Vector2 endpoints[4] = { + const Vector2 endpoints[4] = { xform.xform(rect.position), xform.xform(rect.position + Vector2(rect.size.x, 0)), xform.xform(rect.position + rect.size), @@ -4103,7 +4101,7 @@ void CanvasItemEditor::_button_tool_select(int p_index) { } void CanvasItemEditor::_insert_animation_keys(bool p_location, bool p_rotation, bool p_scale, bool p_on_existing) { - Map<Node *, Object *> &selection = editor_selection->get_selection(); + const Map<Node *, Object *> &selection = editor_selection->get_selection(); for (const KeyValue<Node *, Object *> &E : selection) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E.key); @@ -4269,7 +4267,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { snap_config_menu->get_popup()->set_item_checked(idx, snap_pixel); } break; case SNAP_CONFIGURE: { - ((SnapDialog *)snap_dialog)->set_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step); + static_cast<SnapDialog *>(snap_dialog)->set_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step); snap_dialog->popup_centered(Size2(220, 160) * EDSCALE); } break; case SKELETON_SHOW_BONES: { @@ -4324,8 +4322,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(this, "emit_signal", "item_lock_status_changed"); undo_redo->add_undo_method(this, "emit_signal", "item_lock_status_changed"); } - undo_redo->add_do_method(viewport, "update", Variant()); - undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->add_do_method(viewport, "update"); + undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } break; case UNLOCK_SELECTED: { @@ -4346,8 +4344,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(this, "emit_signal", "item_lock_status_changed"); undo_redo->add_undo_method(this, "emit_signal", "item_lock_status_changed"); } - undo_redo->add_do_method(viewport, "update", Variant()); - undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->add_do_method(viewport, "update"); + undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } break; case GROUP_SELECTED: { @@ -4368,8 +4366,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(this, "emit_signal", "item_group_status_changed"); undo_redo->add_undo_method(this, "emit_signal", "item_group_status_changed"); } - undo_redo->add_do_method(viewport, "update", Variant()); - undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->add_do_method(viewport, "update"); + undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } break; case UNGROUP_SELECTED: { @@ -4390,8 +4388,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(this, "emit_signal", "item_group_status_changed"); undo_redo->add_undo_method(this, "emit_signal", "item_group_status_changed"); } - undo_redo->add_do_method(viewport, "update", Variant()); - undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->add_do_method(viewport, "update"); + undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } break; @@ -4414,7 +4412,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { case ANIM_COPY_POSE: { pose_clipboard.clear(); - Map<Node *, Object *> &selection = editor_selection->get_selection(); + const Map<Node *, Object *> &selection = editor_selection->get_selection(); for (const KeyValue<Node *, Object *> &E : selection) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E.key); @@ -5322,7 +5320,7 @@ CanvasItemEditor::CanvasItemEditor() { ED_SHORTCUT("canvas_item_editor/zoom_800_percent", TTR("Zoom to 800%"), Key::KEY_4); ED_SHORTCUT("canvas_item_editor/zoom_1600_percent", TTR("Zoom to 1600%"), Key::KEY_5); - set_process_unhandled_key_input(true); + set_process_shortcut_input(true); // Update the menus' checkboxes call_deferred(SNAME("set_state"), get_state()); @@ -5735,7 +5733,6 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p if (root_node) { target_node = root_node; } else { - drop_pos = p_point; target_node = nullptr; } } diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 1a9d49a4a8..26852ea8ed 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -183,16 +183,16 @@ private: bool selection_menu_additive_selection; Tool tool = TOOL_SELECT; - Control *viewport; - Control *viewport_scrollable; + Control *viewport = nullptr; + Control *viewport_scrollable = nullptr; - HScrollBar *h_scroll; - VScrollBar *v_scroll; - HBoxContainer *hb; + HScrollBar *h_scroll = nullptr; + VScrollBar *v_scroll = nullptr; + HBoxContainer *hb = nullptr; // Used for secondary menu items which are displayed depending on the currently selected node // (such as MeshInstance's "Mesh" menu). - PanelContainer *context_menu_container; - HBoxContainer *hbc_context_menu; + PanelContainer *context_menu_container = nullptr; + HBoxContainer *hbc_context_menu = nullptr; Transform2D transform; GridVisibility grid_visibility = GRID_VISIBILITY_SHOW_WHEN_SNAPPING; @@ -293,47 +293,47 @@ private: }; List<PoseClipboard> pose_clipboard; - Button *select_button; + Button *select_button = nullptr; - Button *move_button; - Button *scale_button; - Button *rotate_button; + Button *move_button = nullptr; + Button *scale_button = nullptr; + Button *rotate_button = nullptr; - Button *list_select_button; - Button *pivot_button; - Button *pan_button; + Button *list_select_button = nullptr; + Button *pivot_button = nullptr; + Button *pan_button = nullptr; - Button *ruler_button; + Button *ruler_button = nullptr; - Button *smart_snap_button; - Button *grid_snap_button; - MenuButton *snap_config_menu; - PopupMenu *smartsnap_config_popup; + Button *smart_snap_button = nullptr; + Button *grid_snap_button = nullptr; + MenuButton *snap_config_menu = nullptr; + PopupMenu *smartsnap_config_popup = nullptr; - Button *lock_button; - Button *unlock_button; + Button *lock_button = nullptr; + Button *unlock_button = nullptr; - Button *group_button; - Button *ungroup_button; + Button *group_button = nullptr; + Button *ungroup_button = nullptr; - MenuButton *skeleton_menu; - Button *override_camera_button; - MenuButton *view_menu; - PopupMenu *grid_menu; - HBoxContainer *animation_hb; - MenuButton *animation_menu; + MenuButton *skeleton_menu = nullptr; + Button *override_camera_button = nullptr; + MenuButton *view_menu = nullptr; + PopupMenu *grid_menu = nullptr; + HBoxContainer *animation_hb = nullptr; + MenuButton *animation_menu = nullptr; - Button *key_loc_button; - Button *key_rot_button; - Button *key_scale_button; - Button *key_insert_button; - Button *key_auto_insert_button; + Button *key_loc_button = nullptr; + Button *key_rot_button = nullptr; + Button *key_scale_button = nullptr; + Button *key_insert_button = nullptr; + Button *key_auto_insert_button = nullptr; - PopupMenu *selection_menu; - PopupMenu *add_node_menu; + PopupMenu *selection_menu = nullptr; + PopupMenu *add_node_menu = nullptr; - Control *top_ruler; - Control *left_ruler; + Control *top_ruler = nullptr; + Control *left_ruler = nullptr; Point2 drag_start_origin; DragType drag_type = DRAG_NONE; @@ -374,9 +374,9 @@ private: void _find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_node, List<CanvasItem *> *r_items, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D()); bool _select_click_on_item(CanvasItem *item, Point2 p_click_pos, bool p_append); - ConfirmationDialog *snap_dialog; + ConfirmationDialog *snap_dialog = nullptr; - CanvasItem *ref_item; + CanvasItem *ref_item = nullptr; void _save_canvas_item_state(List<CanvasItem *> p_canvas_items, bool save_bones = false); void _restore_canvas_item_state(List<CanvasItem *> p_canvas_items, bool restore_bones = false); @@ -400,7 +400,7 @@ private: void _prepare_grid_menu(); void _on_grid_menu_id_pressed(int p_id); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; List<CanvasItem *> _get_edited_canvas_items(bool retrieve_locked = false, bool remove_canvas_item_if_parent_in_selection = true); Rect2 _get_encompassing_rect_from_list(List<CanvasItem *> p_list); @@ -413,7 +413,7 @@ private: void _keying_changed(); - virtual void unhandled_key_input(const Ref<InputEvent> &p_ev) override; + virtual void shortcut_input(const Ref<InputEvent> &p_ev) override; void _draw_text_at_position(Point2 p_position, String p_string, Side p_side); void _draw_margin_at_position(int p_value, Point2 p_position, Side p_side); @@ -476,8 +476,8 @@ private: const SnapTarget p_snap_target, List<const CanvasItem *> p_exceptions, const Node *p_current); - VBoxContainer *controls_vb; - EditorZoomWidget *zoom_widget; + VBoxContainer *controls_vb = nullptr; + EditorZoomWidget *zoom_widget = nullptr; void _update_zoom(real_t p_zoom); void _shortcut_zoom_set(real_t p_zoom); void _zoom_on_position(real_t p_zoom, Point2 p_position = Point2()); @@ -488,9 +488,9 @@ private: void _update_override_camera_button(bool p_game_running); - HSplitContainer *left_panel_split; - HSplitContainer *right_panel_split; - VSplitContainer *bottom_split; + HSplitContainer *left_panel_split = nullptr; + HSplitContainer *right_panel_split = nullptr; + VSplitContainer *bottom_split = nullptr; void _update_context_menu_stylebox(); @@ -555,7 +555,7 @@ public: void focus_selection(); - EditorSelection *editor_selection; + EditorSelection *editor_selection = nullptr; CanvasItemEditor(); }; @@ -563,7 +563,7 @@ public: class CanvasItemEditorPlugin : public EditorPlugin { GDCLASS(CanvasItemEditorPlugin, EditorPlugin); - CanvasItemEditor *canvas_item_editor; + CanvasItemEditor *canvas_item_editor = nullptr; public: virtual String get_name() const override { return "2D"; } @@ -589,18 +589,18 @@ class CanvasItemEditorViewport : public Control { Vector<String> texture_node_types; Vector<String> selected_files; - Node *target_node; + Node *target_node = nullptr; Point2 drop_pos; - EditorData *editor_data; - CanvasItemEditor *canvas_item_editor; - Control *preview_node; - AcceptDialog *accept; - AcceptDialog *selector; - Label *selector_label; - Label *label; - Label *label_desc; - VBoxContainer *btn_group; + EditorData *editor_data = nullptr; + CanvasItemEditor *canvas_item_editor = nullptr; + Control *preview_node = nullptr; + AcceptDialog *accept = nullptr; + AcceptDialog *selector = nullptr; + Label *selector_label = nullptr; + Label *label = nullptr; + Label *label_desc = nullptr; + VBoxContainer *btn_group = nullptr; Ref<ButtonGroup> button_group; void _on_mouse_exit(); diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 5d769e7987..f018376e4b 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -38,10 +38,7 @@ void CollisionPolygon2DEditor::_set_node(Node *p_polygon) { node = Object::cast_to<CollisionPolygon2D>(p_polygon); } -CollisionPolygon2DEditor::CollisionPolygon2DEditor() : - AbstractPolygon2DEditor() { - node = nullptr; -} +CollisionPolygon2DEditor::CollisionPolygon2DEditor() {} CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin() : AbstractPolygon2DEditorPlugin(memnew(CollisionPolygon2DEditor), "CollisionPolygon2D") { diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.h b/editor/plugins/collision_polygon_2d_editor_plugin.h index bdd4228b3b..0225d5d620 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -37,7 +37,7 @@ class CollisionPolygon2DEditor : public AbstractPolygon2DEditor { GDCLASS(CollisionPolygon2DEditor, AbstractPolygon2DEditor); - CollisionPolygon2D *node; + CollisionPolygon2D *node = nullptr; protected: virtual Node2D *_get_node() const override; diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 033ea3db93..da9e9f339f 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -61,9 +61,9 @@ class CollisionShape2DEditor : public Control { Point2(1, -1), }; - UndoRedo *undo_redo; - CanvasItemEditor *canvas_item_editor; - CollisionShape2D *node; + UndoRedo *undo_redo = nullptr; + CanvasItemEditor *canvas_item_editor = nullptr; + CollisionShape2D *node = nullptr; Vector<Point2> handles; @@ -96,7 +96,7 @@ public: class CollisionShape2DEditorPlugin : public EditorPlugin { GDCLASS(CollisionShape2DEditorPlugin, EditorPlugin); - CollisionShape2DEditor *collision_shape_2d_editor; + CollisionShape2DEditor *collision_shape_2d_editor = nullptr; public: virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) override { return collision_shape_2d_editor->forward_canvas_gui_input(p_event); } diff --git a/editor/plugins/control_editor_plugin.h b/editor/plugins/control_editor_plugin.h index 37d218abb9..96451f7dcf 100644 --- a/editor/plugins/control_editor_plugin.h +++ b/editor/plugins/control_editor_plugin.h @@ -70,7 +70,7 @@ public: class EditorPropertyAnchorsPreset : public EditorProperty { GDCLASS(EditorPropertyAnchorsPreset, EditorProperty); - OptionButton *options; + OptionButton *options = nullptr; void _option_selected(int p_which); @@ -94,9 +94,9 @@ class EditorPropertySizeFlags : public EditorProperty { SIZE_FLAGS_PRESET_CUSTOM, }; - OptionButton *flag_presets; - CheckBox *flag_expand; - VBoxContainer *flag_options; + OptionButton *flag_presets = nullptr; + CheckBox *flag_expand = nullptr; + VBoxContainer *flag_options = nullptr; Vector<CheckBox *> flag_checks; bool vertical = false; @@ -128,8 +128,8 @@ public: class ControlEditorToolbar : public HBoxContainer { GDCLASS(ControlEditorToolbar, HBoxContainer); - UndoRedo *undo_redo; - EditorSelection *editor_selection; + UndoRedo *undo_redo = nullptr; + EditorSelection *editor_selection = nullptr; enum MenuOption { ANCHORS_AND_OFFSETS_PRESET_TOP_LEFT, @@ -198,12 +198,12 @@ class ControlEditorToolbar : public HBoxContainer { CONTAINERS_V_PRESET_SHRINK_END, }; - MenuButton *anchor_presets_menu; - PopupMenu *anchors_popup; - MenuButton *container_h_presets_menu; - MenuButton *container_v_presets_menu; + MenuButton *anchor_presets_menu = nullptr; + PopupMenu *anchors_popup = nullptr; + MenuButton *container_h_presets_menu = nullptr; + MenuButton *container_v_presets_menu = nullptr; - Button *anchor_mode_button; + Button *anchor_mode_button = nullptr; bool anchors_mode = false; @@ -239,7 +239,7 @@ public: class ControlEditorPlugin : public EditorPlugin { GDCLASS(ControlEditorPlugin, EditorPlugin); - ControlEditorToolbar *toolbar; + ControlEditorToolbar *toolbar = nullptr; public: virtual String get_name() const override { return "Control"; } diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.h b/editor/plugins/cpu_particles_2d_editor_plugin.h index b10ed73e38..cc59bc924f 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.h +++ b/editor/plugins/cpu_particles_2d_editor_plugin.h @@ -55,22 +55,22 @@ class CPUParticles2DEditorPlugin : public EditorPlugin { EMISSION_MODE_BORDER_DIRECTED }; - CPUParticles2D *particles; + CPUParticles2D *particles = nullptr; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - HBoxContainer *toolbar; - MenuButton *menu; + HBoxContainer *toolbar = nullptr; + MenuButton *menu = nullptr; - SpinBox *epoints; + SpinBox *epoints = nullptr; - ConfirmationDialog *emission_mask; - OptionButton *emission_mask_mode; - CheckBox *emission_colors; + ConfirmationDialog *emission_mask = nullptr; + OptionButton *emission_mask_mode = nullptr; + CheckBox *emission_colors = nullptr; String source_emission_file; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _file_selected(const String &p_file); void _menu_callback(int p_idx); void _generate_emission_mask(); diff --git a/editor/plugins/cpu_particles_3d_editor_plugin.h b/editor/plugins/cpu_particles_3d_editor_plugin.h index 0501936574..70f2da4b2d 100644 --- a/editor/plugins/cpu_particles_3d_editor_plugin.h +++ b/editor/plugins/cpu_particles_3d_editor_plugin.h @@ -44,7 +44,7 @@ class CPUParticles3DEditor : public GPUParticles3DEditorBase { }; - CPUParticles3D *node; + CPUParticles3D *node = nullptr; void _menu_option(int); @@ -65,7 +65,7 @@ public: class CPUParticles3DEditorPlugin : public EditorPlugin { GDCLASS(CPUParticles3DEditorPlugin, EditorPlugin); - CPUParticles3DEditor *particles_editor; + CPUParticles3DEditor *particles_editor = nullptr; public: virtual String get_name() const override { return "CPUParticles3D"; } diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h index 4aba2fffd0..5cf3b16a06 100644 --- a/editor/plugins/curve_editor_plugin.h +++ b/editor/plugins/curve_editor_plugin.h @@ -99,8 +99,8 @@ private: Transform2D _world_to_view; Ref<Curve> _curve_ref; - PopupMenu *_context_menu; - PopupMenu *_presets_menu; + PopupMenu *_context_menu = nullptr; + PopupMenu *_presets_menu = nullptr; Array _undo_data; bool _has_undo_data; diff --git a/editor/plugins/debugger_editor_plugin.h b/editor/plugins/debugger_editor_plugin.h index c024526285..10e1a27933 100644 --- a/editor/plugins/debugger_editor_plugin.h +++ b/editor/plugins/debugger_editor_plugin.h @@ -41,9 +41,9 @@ class DebuggerEditorPlugin : public EditorPlugin { GDCLASS(DebuggerEditorPlugin, EditorPlugin); private: - MenuButton *debug_menu; - EditorFileServer *file_server; - PopupMenu *instances_menu; + MenuButton *debug_menu = nullptr; + EditorFileServer *file_server = nullptr; + PopupMenu *instances_menu = nullptr; enum MenuOptions { RUN_FILE_SERVER, diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.h b/editor/plugins/gpu_particles_2d_editor_plugin.h index f94ce632e9..75f68617d1 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.h +++ b/editor/plugins/gpu_particles_2d_editor_plugin.h @@ -56,26 +56,26 @@ class GPUParticles2DEditorPlugin : public EditorPlugin { EMISSION_MODE_BORDER_DIRECTED }; - GPUParticles2D *particles; + GPUParticles2D *particles = nullptr; List<GPUParticles2D *> selected_particles; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - HBoxContainer *toolbar; - MenuButton *menu; + HBoxContainer *toolbar = nullptr; + MenuButton *menu = nullptr; - SpinBox *epoints; + SpinBox *epoints = nullptr; - ConfirmationDialog *generate_visibility_rect; - SpinBox *generate_seconds; + ConfirmationDialog *generate_visibility_rect = nullptr; + SpinBox *generate_seconds = nullptr; - ConfirmationDialog *emission_mask; - OptionButton *emission_mask_mode; - CheckBox *emission_colors; + ConfirmationDialog *emission_mask = nullptr; + OptionButton *emission_mask_mode = nullptr; + CheckBox *emission_colors = nullptr; String source_emission_file; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _file_selected(const String &p_file); void _menu_callback(int p_idx); void _generate_visibility_rect(); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.h b/editor/plugins/gpu_particles_3d_editor_plugin.h index 39aa596ece..190fb9954b 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.h +++ b/editor/plugins/gpu_particles_3d_editor_plugin.h @@ -41,16 +41,16 @@ class GPUParticles3DEditorBase : public Control { GDCLASS(GPUParticles3DEditorBase, Control); protected: - Node3D *base_node; - Panel *panel; - MenuButton *options; - HBoxContainer *particles_editor_hb; + Node3D *base_node = nullptr; + Panel *panel = nullptr; + MenuButton *options = nullptr; + HBoxContainer *particles_editor_hb = nullptr; - SceneTreeDialog *emission_tree_dialog; + SceneTreeDialog *emission_tree_dialog = nullptr; - ConfirmationDialog *emission_dialog; - SpinBox *emission_amount; - OptionButton *emission_fill; + ConfirmationDialog *emission_dialog = nullptr; + SpinBox *emission_amount = nullptr; + OptionButton *emission_fill = nullptr; Vector<Face3> geometry; @@ -67,9 +67,9 @@ public: class GPUParticles3DEditor : public GPUParticles3DEditorBase { GDCLASS(GPUParticles3DEditor, GPUParticles3DEditorBase); - ConfirmationDialog *generate_aabb; - SpinBox *generate_seconds; - GPUParticles3D *node; + ConfirmationDialog *generate_aabb = nullptr; + SpinBox *generate_seconds = nullptr; + GPUParticles3D *node = nullptr; enum Menu { MENU_OPTION_GENERATE_AABB, @@ -101,7 +101,7 @@ public: class GPUParticles3DEditorPlugin : public EditorPlugin { GDCLASS(GPUParticles3DEditorPlugin, EditorPlugin); - GPUParticles3DEditor *particles_editor; + GPUParticles3DEditor *particles_editor = nullptr; public: virtual String get_name() const override { return "GPUParticles3D"; } diff --git a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h index f6e4fd3dec..684279039a 100644 --- a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h +++ b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.h @@ -41,12 +41,12 @@ class EditorFileDialog; class GPUParticlesCollisionSDF3DEditorPlugin : public EditorPlugin { GDCLASS(GPUParticlesCollisionSDF3DEditorPlugin, EditorPlugin); - GPUParticlesCollisionSDF3D *col_sdf; + GPUParticlesCollisionSDF3D *col_sdf = nullptr; - HBoxContainer *bake_hb; - Button *bake; + HBoxContainer *bake_hb = nullptr; + Button *bake = nullptr; - EditorFileDialog *probe_file; + EditorFileDialog *probe_file = nullptr; static EditorProgress *tmp_progress; static void bake_func_begin(int p_steps); diff --git a/editor/plugins/gradient_editor_plugin.h b/editor/plugins/gradient_editor_plugin.h index 9857ea018d..26bf76fecd 100644 --- a/editor/plugins/gradient_editor_plugin.h +++ b/editor/plugins/gradient_editor_plugin.h @@ -65,9 +65,9 @@ class GradientReverseButton : public BaseButton { class EditorInspectorPluginGradient : public EditorInspectorPlugin { GDCLASS(EditorInspectorPluginGradient, EditorInspectorPlugin); - GradientEditor *editor; - HBoxContainer *gradient_tools_hbox; - GradientReverseButton *reverse_btn; + GradientEditor *editor = nullptr; + HBoxContainer *gradient_tools_hbox = nullptr; + GradientReverseButton *reverse_btn = nullptr; void _reverse_button_pressed(); diff --git a/editor/plugins/input_event_editor_plugin.h b/editor/plugins/input_event_editor_plugin.h index ab948462ab..3c658a86e9 100644 --- a/editor/plugins/input_event_editor_plugin.h +++ b/editor/plugins/input_event_editor_plugin.h @@ -38,11 +38,11 @@ class InputEventConfigContainer : public HBoxContainer { GDCLASS(InputEventConfigContainer, HBoxContainer); - Label *input_event_text; - Button *open_config_button; + Label *input_event_text = nullptr; + Button *open_config_button = nullptr; Ref<InputEvent> input_event; - InputEventConfigurationDialog *config_dialog; + InputEventConfigurationDialog *config_dialog = nullptr; void _config_dialog_confirmed(); void _configure_pressed(); diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp index 6a5ead58d0..4fbc8188b9 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -102,10 +102,7 @@ void LightOccluder2DEditor::_create_resource() { _menu_option(MODE_CREATE); } -LightOccluder2DEditor::LightOccluder2DEditor() : - AbstractPolygon2DEditor() { - node = nullptr; -} +LightOccluder2DEditor::LightOccluder2DEditor() {} LightOccluder2DEditorPlugin::LightOccluder2DEditorPlugin() : AbstractPolygon2DEditorPlugin(memnew(LightOccluder2DEditor), "LightOccluder2D") { diff --git a/editor/plugins/light_occluder_2d_editor_plugin.h b/editor/plugins/light_occluder_2d_editor_plugin.h index 557e8bf292..aeee12b5b6 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/editor/plugins/light_occluder_2d_editor_plugin.h @@ -37,7 +37,7 @@ class LightOccluder2DEditor : public AbstractPolygon2DEditor { GDCLASS(LightOccluder2DEditor, AbstractPolygon2DEditor); - LightOccluder2D *node; + LightOccluder2D *node = nullptr; Ref<OccluderPolygon2D> _ensure_occluder() const; diff --git a/editor/plugins/lightmap_gi_editor_plugin.h b/editor/plugins/lightmap_gi_editor_plugin.h index e658230181..1202efe8fc 100644 --- a/editor/plugins/lightmap_gi_editor_plugin.h +++ b/editor/plugins/lightmap_gi_editor_plugin.h @@ -41,11 +41,11 @@ class EditorFileDialog; class LightmapGIEditorPlugin : public EditorPlugin { GDCLASS(LightmapGIEditorPlugin, EditorPlugin); - LightmapGI *lightmap; + LightmapGI *lightmap = nullptr; - Button *bake; + Button *bake = nullptr; - EditorFileDialog *file_dialog; + EditorFileDialog *file_dialog = nullptr; static EditorProgress *tmp_progress; static bool bake_func_step(float p_progress, const String &p_description, void *, bool p_refresh); static void bake_func_end(uint64_t p_time_started); diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp index 0f81b17cb3..31053f90b8 100644 --- a/editor/plugins/line_2d_editor_plugin.cpp +++ b/editor/plugins/line_2d_editor_plugin.cpp @@ -56,10 +56,7 @@ void Line2DEditor::_action_set_polygon(int p_idx, const Variant &p_previous, con undo_redo->add_undo_method(node, "set_points", p_previous); } -Line2DEditor::Line2DEditor() : - AbstractPolygon2DEditor() { - node = nullptr; -} +Line2DEditor::Line2DEditor() {} Line2DEditorPlugin::Line2DEditorPlugin() : AbstractPolygon2DEditorPlugin(memnew(Line2DEditor), "Line2D") { diff --git a/editor/plugins/line_2d_editor_plugin.h b/editor/plugins/line_2d_editor_plugin.h index 307cf11207..0d407b3150 100644 --- a/editor/plugins/line_2d_editor_plugin.h +++ b/editor/plugins/line_2d_editor_plugin.h @@ -37,7 +37,7 @@ class Line2DEditor : public AbstractPolygon2DEditor { GDCLASS(Line2DEditor, AbstractPolygon2DEditor); - Line2D *node; + Line2D *node = nullptr; protected: virtual Node2D *_get_node() const override; diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index daa864cfa1..eb004568d0 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -270,7 +270,7 @@ void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo Texture2D *texture = Object::cast_to<Texture2D>(p_new_value); if (texture) { if (p_property == "roughness_texture") { - if (base_material->get_texture(StandardMaterial3D::TEXTURE_ROUGHNESS).is_null() && texture) { + if (base_material->get_texture(StandardMaterial3D::TEXTURE_ROUGHNESS).is_null()) { undo_redo->add_do_property(p_edited, "roughness", 1.0); bool valid = false; @@ -280,7 +280,7 @@ void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo } } } else if (p_property == "metallic_texture") { - if (base_material->get_texture(StandardMaterial3D::TEXTURE_METALLIC).is_null() && texture) { + if (base_material->get_texture(StandardMaterial3D::TEXTURE_METALLIC).is_null()) { undo_redo->add_do_property(p_edited, "metallic", 1.0); bool valid = false; diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 37464c98fe..3554b3c1e9 100644 --- a/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -44,17 +44,17 @@ class MeshEditor : public SubViewportContainer { float rot_x; float rot_y; - SubViewport *viewport; - MeshInstance3D *mesh_instance; - Node3D *rotation; - DirectionalLight3D *light1; - DirectionalLight3D *light2; - Camera3D *camera; + SubViewport *viewport = nullptr; + MeshInstance3D *mesh_instance = nullptr; + Node3D *rotation = nullptr; + DirectionalLight3D *light1 = nullptr; + DirectionalLight3D *light2 = nullptr; + Camera3D *camera = nullptr; Ref<Mesh> mesh; - TextureButton *light_1_switch; - TextureButton *light_2_switch; + TextureButton *light_1_switch = nullptr; + TextureButton *light_2_switch = nullptr; void _button_pressed(Node *p_button); bool first_enter; diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index 8f285cb7f9..d33803213a 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -75,7 +75,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) { CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shape); StaticBody3D *body = memnew(StaticBody3D); - body->add_child(cshape); + body->add_child(cshape, true); Node *owner = node == get_tree()->get_edited_scene_root() ? node : node->get_owner(); @@ -110,7 +110,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) { CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(shape); StaticBody3D *body = memnew(StaticBody3D); - body->add_child(cshape); + body->add_child(cshape, true); Node *owner = instance == get_tree()->get_edited_scene_root() ? instance : instance->get_owner(); diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.h b/editor/plugins/mesh_instance_3d_editor_plugin.h index 9c59c5fb9f..36d8eacd98 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.h +++ b/editor/plugins/mesh_instance_3d_editor_plugin.h @@ -51,17 +51,17 @@ class MeshInstance3DEditor : public Control { MENU_OPTION_DEBUG_UV2, }; - MeshInstance3D *node; + MeshInstance3D *node = nullptr; - MenuButton *options; + MenuButton *options = nullptr; - ConfirmationDialog *outline_dialog; - SpinBox *outline_size; + ConfirmationDialog *outline_dialog = nullptr; + SpinBox *outline_size = nullptr; - AcceptDialog *err_dialog; + AcceptDialog *err_dialog = nullptr; - AcceptDialog *debug_uv_dialog; - Control *debug_uv; + AcceptDialog *debug_uv_dialog = nullptr; + Control *debug_uv = nullptr; Vector<Vector2> uv_lines; void _menu_option(int p_option); @@ -84,7 +84,7 @@ public: class MeshInstance3DEditorPlugin : public EditorPlugin { GDCLASS(MeshInstance3DEditorPlugin, EditorPlugin); - MeshInstance3DEditor *mesh_editor; + MeshInstance3DEditor *mesh_editor = nullptr; public: virtual String get_name() const override { return "MeshInstance3D"; } diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 41e3471a78..423ec5f4ed 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -271,7 +271,7 @@ MeshLibraryEditor::MeshLibraryEditor() { menu = memnew(MenuButton); Node3DEditor::get_singleton()->add_control_to_menu_panel(menu); menu->set_position(Point2(1, 1)); - menu->set_text(TTR("Mesh Library")); + menu->set_text(TTR("MeshLibrary")); menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("MeshLibrary"), SNAME("EditorIcons"))); menu->get_popup()->add_item(TTR("Add Item"), MENU_OPTION_ADD_ITEM); menu->get_popup()->add_item(TTR("Remove Selected Item"), MENU_OPTION_REMOVE_ITEM); diff --git a/editor/plugins/mesh_library_editor_plugin.h b/editor/plugins/mesh_library_editor_plugin.h index 6bc992869b..85ead35534 100644 --- a/editor/plugins/mesh_library_editor_plugin.h +++ b/editor/plugins/mesh_library_editor_plugin.h @@ -43,10 +43,10 @@ class MeshLibraryEditor : public Control { Ref<MeshLibrary> mesh_library; - MenuButton *menu; - ConfirmationDialog *cd_remove; - ConfirmationDialog *cd_update; - EditorFileDialog *file; + MenuButton *menu = nullptr; + ConfirmationDialog *cd_remove = nullptr; + ConfirmationDialog *cd_update = nullptr; + EditorFileDialog *file = nullptr; bool apply_xforms; int to_erase; @@ -81,7 +81,7 @@ public: class MeshLibraryEditorPlugin : public EditorPlugin { GDCLASS(MeshLibraryEditorPlugin, EditorPlugin); - MeshLibraryEditor *mesh_library_editor; + MeshLibraryEditor *mesh_library_editor = nullptr; public: virtual String get_name() const override { return "MeshLibrary"; } diff --git a/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h index 846e6d17f3..9f5e85216c 100644 --- a/editor/plugins/multimesh_editor_plugin.h +++ b/editor/plugins/multimesh_editor_plugin.h @@ -43,26 +43,26 @@ class MultiMeshEditor : public Control { friend class MultiMeshEditorPlugin; - AcceptDialog *err_dialog; - MenuButton *options; - MultiMeshInstance3D *_last_pp_node; + AcceptDialog *err_dialog = nullptr; + MenuButton *options = nullptr; + MultiMeshInstance3D *_last_pp_node = nullptr; bool browsing_source; - Panel *panel; - MultiMeshInstance3D *node; + Panel *panel = nullptr; + MultiMeshInstance3D *node = nullptr; - LineEdit *surface_source; - LineEdit *mesh_source; + LineEdit *surface_source = nullptr; + LineEdit *mesh_source = nullptr; - SceneTreeDialog *std; + SceneTreeDialog *std = nullptr; - ConfirmationDialog *populate_dialog; - OptionButton *populate_axis; - HSlider *populate_rotate_random; - HSlider *populate_tilt_random; - SpinBox *populate_scale_random; - SpinBox *populate_scale; - SpinBox *populate_amount; + ConfirmationDialog *populate_dialog = nullptr; + OptionButton *populate_axis = nullptr; + HSlider *populate_rotate_random = nullptr; + HSlider *populate_tilt_random = nullptr; + SpinBox *populate_scale_random = nullptr; + SpinBox *populate_scale = nullptr; + SpinBox *populate_amount = nullptr; enum Menu { MENU_OPTION_POPULATE @@ -85,7 +85,7 @@ public: class MultiMeshEditorPlugin : public EditorPlugin { GDCLASS(MultiMeshEditorPlugin, EditorPlugin); - MultiMeshEditor *multimesh_editor; + MultiMeshEditor *multimesh_editor = nullptr; public: virtual String get_name() const override { return "MultiMesh"; } diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index fe31f254df..17eaf45bb5 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -112,10 +112,7 @@ void NavigationPolygonEditor::_create_resource() { _menu_option(MODE_CREATE); } -NavigationPolygonEditor::NavigationPolygonEditor() : - AbstractPolygon2DEditor() { - node = nullptr; -} +NavigationPolygonEditor::NavigationPolygonEditor() {} NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin() : AbstractPolygon2DEditorPlugin(memnew(NavigationPolygonEditor), "NavigationRegion2D") { diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 16fbb241e9..7550b75fa3 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -37,7 +37,7 @@ class NavigationPolygonEditor : public AbstractPolygon2DEditor { GDCLASS(NavigationPolygonEditor, AbstractPolygon2DEditor); - NavigationRegion2D *node; + NavigationRegion2D *node = nullptr; Ref<NavigationPolygon> _ensure_navpoly() const; diff --git a/editor/plugins/node_3d_editor_gizmos.h b/editor/plugins/node_3d_editor_gizmos.h index fa55651d26..3b67b898e3 100644 --- a/editor/plugins/node_3d_editor_gizmos.h +++ b/editor/plugins/node_3d_editor_gizmos.h @@ -70,14 +70,14 @@ class EditorNode3DGizmo : public Node3DGizmo { bool valid; bool hidden; Vector<Instance> instances; - Node3D *spatial_node; + Node3D *spatial_node = nullptr; void _set_spatial_node(Node *p_node) { set_spatial_node(Object::cast_to<Node3D>(p_node)); } protected: static void _bind_methods(); - EditorNode3DGizmoPlugin *gizmo_plugin; + EditorNode3DGizmoPlugin *gizmo_plugin = nullptr; GDVIRTUAL0(_redraw) GDVIRTUAL2RC(String, _get_handle_name, int, bool) @@ -618,7 +618,7 @@ public: class Joint3DGizmoPlugin : public EditorNode3DGizmoPlugin { GDCLASS(Joint3DGizmoPlugin, EditorNode3DGizmoPlugin); - Timer *update_timer; + Timer *update_timer = nullptr; uint64_t update_idx = 0; void incremental_update_gizmos(); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 52e60b606c..855fc2b2a9 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -205,7 +205,7 @@ void ViewportRotationControl::gui_input(const Ref<InputEvent> &p_event) { orbiting = false; if (Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) { Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); - Input::get_singleton()->warp_mouse_position(orbiting_mouse_start); + Input::get_singleton()->warp_mouse(orbiting_mouse_start); } } } @@ -369,7 +369,7 @@ Transform3D Node3DEditorViewport::to_camera_transform(const Cursor &p_cursor) co } int Node3DEditorViewport::get_selected_count() const { - Map<Node *, Object *> &selection = editor_selection->get_selection(); + const Map<Node *, Object *> &selection = editor_selection->get_selection(); int count = 0; @@ -2467,7 +2467,7 @@ void Node3DEditorViewport::_notification(int p_what) { _update_camera(delta); - Map<Node *, Object *> &selection = editor_selection->get_selection(); + const Map<Node *, Object *> &selection = editor_selection->get_selection(); bool changed = false; bool exist = false; @@ -2564,7 +2564,7 @@ void Node3DEditorViewport::_notification(int p_what) { text += "\n"; text += vformat(TTR("Objects: %d\n"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_OBJECTS_IN_FRAME)); - text += vformat(TTR("Primitives: %d\n"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_PRIMITIVES_IN_FRAME)); + text += vformat(TTR("Primitive Indices: %d\n"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_PRIMITIVES_IN_FRAME)); text += vformat(TTR("Draw Calls: %d"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_DRAW_CALLS_IN_FRAME)); info_label->set_text(text); @@ -6848,7 +6848,7 @@ void Node3DEditor::snap_selected_nodes_to_floor() { } } -void Node3DEditor::unhandled_key_input(const Ref<InputEvent> &p_event) { +void Node3DEditor::shortcut_input(const Ref<InputEvent> &p_event) { ERR_FAIL_COND(p_event.is_null()); if (!is_visible_in_tree()) { @@ -7893,7 +7893,7 @@ Node3DEditor::Node3DEditor() { selected = nullptr; - set_process_unhandled_key_input(true); + set_process_shortcut_input(true); add_to_group("_spatial_editor_group"); EDITOR_DEF("editors/3d/manipulator_gizmo_size", 80); diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 5c0bfab34e..d5d50c743c 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -190,27 +190,27 @@ private: ViewType view_type; void _menu_option(int p_option); void _set_auto_orthogonal(); - Node3D *preview_node; - AABB *preview_bounds; + Node3D *preview_node = nullptr; + AABB *preview_bounds = nullptr; Vector<String> selected_files; - AcceptDialog *accept; + AcceptDialog *accept = nullptr; - Node *target_node; + Node *target_node = nullptr; Point2 drop_pos; - EditorData *editor_data; - EditorSelection *editor_selection; - UndoRedo *undo_redo; + EditorData *editor_data = nullptr; + EditorSelection *editor_selection = nullptr; + UndoRedo *undo_redo = nullptr; - CheckBox *preview_camera; - SubViewportContainer *subviewport_container; + CheckBox *preview_camera = nullptr; + SubViewportContainer *subviewport_container = nullptr; - MenuButton *view_menu; - PopupMenu *display_submenu; + MenuButton *view_menu = nullptr; + PopupMenu *display_submenu = nullptr; - Control *surface; - SubViewport *viewport; - Camera3D *camera; + Control *surface = nullptr; + SubViewport *viewport = nullptr; + Camera3D *camera = nullptr; bool transforming; bool orthogonal; bool auto_orthogonal; @@ -221,17 +221,17 @@ private: real_t freelook_speed; Vector2 previous_mouse_position; - Label *info_label; - Label *cinema_label; - Label *locked_label; - Label *zoom_limit_label; + Label *info_label = nullptr; + Label *cinema_label = nullptr; + Label *locked_label = nullptr; + Label *zoom_limit_label = nullptr; - VBoxContainer *top_right_vbox; - ViewportRotationControl *rotation_control; - Gradient *frame_time_gradient; - Label *cpu_time_label; - Label *gpu_time_label; - Label *fps_label; + VBoxContainer *top_right_vbox = nullptr; + ViewportRotationControl *rotation_control = nullptr; + Gradient *frame_time_gradient = nullptr; + Label *cpu_time_label = nullptr; + Label *gpu_time_label = nullptr; + Label *fps_label = nullptr; struct _RayResult { Node3D *item = nullptr; @@ -274,7 +274,7 @@ private: bool clicked_wants_append; bool selection_in_progress = false; - PopupMenu *selection_menu; + PopupMenu *selection_menu = nullptr; enum NavigationZoomStyle { NAVIGATION_ZOOM_VERTICAL, @@ -375,9 +375,9 @@ private: void _sinput(const Ref<InputEvent> &p_event); void _update_freelook(real_t delta); - Node3DEditor *spatial_editor; + Node3DEditor *spatial_editor = nullptr; - Camera3D *previewing; + Camera3D *previewing = nullptr; Camera3D *preview = nullptr; bool previewing_cinema; @@ -455,7 +455,7 @@ public: Transform3D original_local; Transform3D last_xform; // last transform bool last_xform_dirty; - Node3D *sp; + Node3D *sp = nullptr; RID sbox_instance; RID sbox_instance_offset; RID sbox_instance_xray; @@ -537,13 +537,13 @@ public: }; private: - EditorSelection *editor_selection; + EditorSelection *editor_selection = nullptr; - Node3DEditorViewportContainer *viewport_base; + Node3DEditorViewportContainer *viewport_base = nullptr; Node3DEditorViewport *viewports[VIEWPORTS_COUNT]; - VSplitContainer *shader_split; - HSplitContainer *left_panel_split; - HSplitContainer *right_panel_split; + VSplitContainer *shader_split = nullptr; + HSplitContainer *left_panel_split = nullptr; + HSplitContainer *right_panel_split = nullptr; ///// @@ -588,7 +588,7 @@ private: Ref<StandardMaterial3D> cursor_material; // Scene drag and drop support - Node3D *preview_node; + Node3D *preview_node = nullptr; AABB preview_bounds; struct Gizmo { @@ -628,31 +628,31 @@ private: Button *tool_button[TOOL_MAX]; Button *tool_option_button[TOOL_OPT_MAX]; - MenuButton *transform_menu; - PopupMenu *gizmos_menu; - MenuButton *view_menu; + MenuButton *transform_menu = nullptr; + PopupMenu *gizmos_menu = nullptr; + MenuButton *view_menu = nullptr; - AcceptDialog *accept; + AcceptDialog *accept = nullptr; - ConfirmationDialog *snap_dialog; - ConfirmationDialog *xform_dialog; - ConfirmationDialog *settings_dialog; + ConfirmationDialog *snap_dialog = nullptr; + ConfirmationDialog *xform_dialog = nullptr; + ConfirmationDialog *settings_dialog = nullptr; bool snap_enabled; bool snap_key_enabled; - LineEdit *snap_translate; - LineEdit *snap_rotate; - LineEdit *snap_scale; + LineEdit *snap_translate = nullptr; + LineEdit *snap_rotate = nullptr; + LineEdit *snap_scale = nullptr; LineEdit *xform_translate[3]; LineEdit *xform_rotate[3]; LineEdit *xform_scale[3]; - OptionButton *xform_type; + OptionButton *xform_type = nullptr; - VBoxContainer *settings_vbc; - SpinBox *settings_fov; - SpinBox *settings_znear; - SpinBox *settings_zfar; + VBoxContainer *settings_vbc = nullptr; + SpinBox *settings_fov = nullptr; + SpinBox *settings_znear = nullptr; + SpinBox *settings_zfar = nullptr; void _snap_changed(); void _snap_update(); @@ -662,14 +662,14 @@ private: void _menu_gizmo_toggled(int p_option); void _update_camera_override_button(bool p_game_running); void _update_camera_override_viewport(Object *p_viewport); - HBoxContainer *hbc_menu; + HBoxContainer *hbc_menu = nullptr; // Used for secondary menu items which are displayed depending on the currently selected node // (such as MeshInstance's "Mesh" menu). - PanelContainer *context_menu_container; - HBoxContainer *hbc_context_menu; + PanelContainer *context_menu_container = nullptr; + HBoxContainer *hbc_context_menu = nullptr; void _generate_selection_boxes(); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; int camera_override_viewport_id; @@ -683,13 +683,13 @@ private: void _toggle_maximize_view(Object *p_viewport); - Node *custom_camera; + Node *custom_camera = nullptr; Object *_get_editor_data(Object *p_what); Ref<Environment> viewport_environment; - Node3D *selected; + Node3D *selected = nullptr; void _request_gizmo(Object *p_obj); void _set_subgizmo_selection(Object *p_obj, Ref<Node3DGizmo> p_gizmo, int p_id, Transform3D p_transform = Transform3D()); @@ -712,18 +712,18 @@ private: uint32_t world_env_count = 0; uint32_t directional_light_count = 0; - Button *sun_button; - Label *sun_state; - Label *sun_title; - VBoxContainer *sun_vb; - Popup *sun_environ_popup; - Control *sun_direction; - EditorSpinSlider *sun_angle_altitude; - EditorSpinSlider *sun_angle_azimuth; - ColorPickerButton *sun_color; - EditorSpinSlider *sun_energy; - EditorSpinSlider *sun_max_distance; - Button *sun_add_to_scene; + Button *sun_button = nullptr; + Label *sun_state = nullptr; + Label *sun_title = nullptr; + VBoxContainer *sun_vb = nullptr; + Popup *sun_environ_popup = nullptr; + Control *sun_direction = nullptr; + EditorSpinSlider *sun_angle_altitude = nullptr; + EditorSpinSlider *sun_angle_azimuth = nullptr; + ColorPickerButton *sun_color = nullptr; + EditorSpinSlider *sun_energy = nullptr; + EditorSpinSlider *sun_max_distance = nullptr; + Button *sun_add_to_scene = nullptr; void _sun_direction_draw(); void _sun_direction_input(const Ref<InputEvent> &p_event); @@ -734,23 +734,23 @@ private: Ref<Shader> sun_direction_shader; Ref<ShaderMaterial> sun_direction_material; - Button *environ_button; - Label *environ_state; - Label *environ_title; - VBoxContainer *environ_vb; - ColorPickerButton *environ_sky_color; - ColorPickerButton *environ_ground_color; - EditorSpinSlider *environ_energy; - Button *environ_ao_button; - Button *environ_glow_button; - Button *environ_tonemap_button; - Button *environ_gi_button; - Button *environ_add_to_scene; - - Button *sun_environ_settings; - - DirectionalLight3D *preview_sun; - WorldEnvironment *preview_environment; + Button *environ_button = nullptr; + Label *environ_state = nullptr; + Label *environ_title = nullptr; + VBoxContainer *environ_vb = nullptr; + ColorPickerButton *environ_sky_color = nullptr; + ColorPickerButton *environ_ground_color = nullptr; + EditorSpinSlider *environ_energy = nullptr; + Button *environ_ao_button = nullptr; + Button *environ_glow_button = nullptr; + Button *environ_tonemap_button = nullptr; + Button *environ_gi_button = nullptr; + Button *environ_add_to_scene = nullptr; + + Button *sun_environ_settings = nullptr; + + DirectionalLight3D *preview_sun = nullptr; + WorldEnvironment *preview_environment = nullptr; Ref<Environment> environment; Ref<ProceduralSkyMaterial> sky_material; @@ -770,7 +770,7 @@ private: protected: void _notification(int p_what); //void _gui_input(InputEvent p_event); - virtual void unhandled_key_input(const Ref<InputEvent> &p_event) override; + virtual void shortcut_input(const Ref<InputEvent> &p_event) override; static void _bind_methods(); @@ -868,7 +868,7 @@ public: class Node3DEditorPlugin : public EditorPlugin { GDCLASS(Node3DEditorPlugin, EditorPlugin); - Node3DEditor *spatial_editor; + Node3DEditor *spatial_editor = nullptr; public: Node3DEditor *get_spatial_editor() { return spatial_editor; } diff --git a/editor/plugins/occluder_instance_3d_editor_plugin.h b/editor/plugins/occluder_instance_3d_editor_plugin.h index 24f31b2ea8..360b7297cf 100644 --- a/editor/plugins/occluder_instance_3d_editor_plugin.h +++ b/editor/plugins/occluder_instance_3d_editor_plugin.h @@ -40,11 +40,11 @@ class EditorFileDialog; class OccluderInstance3DEditorPlugin : public EditorPlugin { GDCLASS(OccluderInstance3DEditorPlugin, EditorPlugin); - OccluderInstance3D *occluder_instance; + OccluderInstance3D *occluder_instance = nullptr; - Button *bake; + Button *bake = nullptr; - EditorFileDialog *file_dialog; + EditorFileDialog *file_dialog = nullptr; void _bake_select_file(const String &p_file); void _bake(); diff --git a/editor/plugins/ot_features_plugin.cpp b/editor/plugins/ot_features_plugin.cpp index 9cd428a2d4..27b35d803c 100644 --- a/editor/plugins/ot_features_plugin.cpp +++ b/editor/plugins/ot_features_plugin.cpp @@ -96,10 +96,19 @@ OpenTypeFeaturesEditor::OpenTypeFeaturesEditor() { /*************************************************************************/ void OpenTypeFeaturesAdd::_add_feature(int p_option) { - get_edited_object()->set("opentype_features/" + TS->tag_to_name(p_option), 1); + edited_object->set("opentype_features/" + TS->tag_to_name(p_option), 1); } -void OpenTypeFeaturesAdd::update_property() { +void OpenTypeFeaturesAdd::_features_menu() { + Size2 size = get_size(); + menu->set_position(get_screen_position() + Size2(0, size.height * get_global_transform().get_scale().y)); + menu->reset_size(); + menu->popup(); +} + +void OpenTypeFeaturesAdd::setup(Object *p_object) { + edited_object = p_object; + menu->clear(); menu_ss->clear(); menu_cv->clear(); @@ -107,7 +116,7 @@ void OpenTypeFeaturesAdd::update_property() { bool have_ss = false; bool have_cv = false; bool have_cu = false; - Dictionary features = Object::cast_to<Control>(get_edited_object())->get_theme_font(SNAME("font"))->get_feature_list(); + Dictionary features = Object::cast_to<Control>(edited_object)->get_theme_font(SNAME("font"))->get_feature_list(); for (const Variant *ftr = features.next(nullptr); ftr != nullptr; ftr = features.next(ftr)) { String ftr_name = TS->tag_to_name(*ftr); if (ftr_name.begins_with("stylistic_set_")) { @@ -134,20 +143,11 @@ void OpenTypeFeaturesAdd::update_property() { } } -void OpenTypeFeaturesAdd::_features_menu() { - Size2 size = get_size(); - menu->set_position(get_screen_position() + Size2(0, size.height * get_global_transform().get_scale().y)); - menu->reset_size(); - menu->popup(); -} - void OpenTypeFeaturesAdd::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_ENTER_TREE: { - set_label(""); - button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - button->set_size(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))->get_size()); + set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); } break; } } @@ -156,6 +156,8 @@ void OpenTypeFeaturesAdd::_bind_methods() { } OpenTypeFeaturesAdd::OpenTypeFeaturesAdd() { + set_text(TTR("Add Feature...")); + menu = memnew(PopupMenu); add_child(menu); @@ -171,13 +173,7 @@ OpenTypeFeaturesAdd::OpenTypeFeaturesAdd() { menu_cu->set_name("CUMenu"); menu->add_child(menu_cu); - button = memnew(Button); - button->set_flat(true); - button->set_text(RTR("Add feature...")); - button->set_tooltip(RTR("Add feature...")); - add_child(button); - - button->connect("pressed", callable_mp(this, &OpenTypeFeaturesAdd::_features_menu)); + connect("pressed", callable_mp(this, &OpenTypeFeaturesAdd::_features_menu)); menu->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); menu_cv->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); menu_ss->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); @@ -193,7 +189,8 @@ bool EditorInspectorPluginOpenTypeFeatures::can_handle(Object *p_object) { bool EditorInspectorPluginOpenTypeFeatures::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) { if (p_path == "opentype_features/_new") { OpenTypeFeaturesAdd *editor = memnew(OpenTypeFeaturesAdd); - add_property_editor(p_path, editor); + editor->setup(p_object); + add_custom_control(editor); return true; } else if (p_path.begins_with("opentype_features")) { OpenTypeFeaturesEditor *editor = memnew(OpenTypeFeaturesEditor); diff --git a/editor/plugins/ot_features_plugin.h b/editor/plugins/ot_features_plugin.h index 8c38d888de..6639148080 100644 --- a/editor/plugins/ot_features_plugin.h +++ b/editor/plugins/ot_features_plugin.h @@ -38,7 +38,7 @@ class OpenTypeFeaturesEditor : public EditorProperty { GDCLASS(OpenTypeFeaturesEditor, EditorProperty); - EditorSpinSlider *spin; + EditorSpinSlider *spin = nullptr; bool setting = true; void _value_changed(double p_val); Button *button = nullptr; @@ -56,10 +56,10 @@ public: /*************************************************************************/ -class OpenTypeFeaturesAdd : public EditorProperty { - GDCLASS(OpenTypeFeaturesAdd, EditorProperty); +class OpenTypeFeaturesAdd : public Button { + GDCLASS(OpenTypeFeaturesAdd, Button); - Button *button = nullptr; + Object *edited_object = nullptr; PopupMenu *menu = nullptr; PopupMenu *menu_ss = nullptr; PopupMenu *menu_cv = nullptr; @@ -73,7 +73,7 @@ protected: static void _bind_methods(); public: - virtual void update_property() override; + void setup(Object *p_object); OpenTypeFeaturesAdd(); }; diff --git a/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h index 926a859f8b..ff74aeedf7 100644 --- a/editor/plugins/path_2d_editor_plugin.h +++ b/editor/plugins/path_2d_editor_plugin.h @@ -40,14 +40,14 @@ class CanvasItemEditor; class Path2DEditor : public HBoxContainer { GDCLASS(Path2DEditor, HBoxContainer); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; - CanvasItemEditor *canvas_item_editor; - Panel *panel; - Path2D *node; + CanvasItemEditor *canvas_item_editor = nullptr; + Panel *panel = nullptr; + Path2D *node = nullptr; - HBoxContainer *base_hb; - Separator *sep; + HBoxContainer *base_hb = nullptr; + Separator *sep = nullptr; enum Mode { MODE_CREATE, @@ -58,12 +58,12 @@ class Path2DEditor : public HBoxContainer { }; Mode mode; - Button *curve_create; - Button *curve_edit; - Button *curve_edit_curve; - Button *curve_del; - Button *curve_close; - MenuButton *handle_menu; + Button *curve_create = nullptr; + Button *curve_edit = nullptr; + Button *curve_edit_curve = nullptr; + Button *curve_del = nullptr; + Button *curve_close = nullptr; + MenuButton *handle_menu = nullptr; bool mirror_handle_angle; bool mirror_handle_length; @@ -110,7 +110,7 @@ public: class Path2DEditorPlugin : public EditorPlugin { GDCLASS(Path2DEditorPlugin, EditorPlugin); - Path2DEditor *path2d_editor; + Path2DEditor *path2d_editor = nullptr; public: virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) override { return path2d_editor->forward_gui_input(p_event); } diff --git a/editor/plugins/path_3d_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h index 3c6ca65437..72c24732c0 100644 --- a/editor/plugins/path_3d_editor_plugin.h +++ b/editor/plugins/path_3d_editor_plugin.h @@ -40,7 +40,7 @@ class Path3DGizmo : public EditorNode3DGizmo { GDCLASS(Path3DGizmo, EditorNode3DGizmo); - Path3D *path; + Path3D *path = nullptr; mutable Vector3 original; mutable float orig_in_length; mutable float orig_out_length; @@ -70,14 +70,14 @@ public: class Path3DEditorPlugin : public EditorPlugin { GDCLASS(Path3DEditorPlugin, EditorPlugin); - Separator *sep; - Button *curve_create; - Button *curve_edit; - Button *curve_del; - Button *curve_close; - MenuButton *handle_menu; + Separator *sep = nullptr; + Button *curve_create = nullptr; + Button *curve_edit = nullptr; + Button *curve_del = nullptr; + Button *curve_close = nullptr; + MenuButton *handle_menu = nullptr; - Path3D *path; + Path3D *path = nullptr; void _update_theme(); diff --git a/editor/plugins/physical_bone_3d_editor_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index e815a9c9f6..9dc89133c4 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -82,8 +82,7 @@ void PhysicalBone3DEditor::show() { spatial_editor_hb->show(); } -PhysicalBone3DEditorPlugin::PhysicalBone3DEditorPlugin() : - physical_bone_editor() {} +PhysicalBone3DEditorPlugin::PhysicalBone3DEditorPlugin() {} void PhysicalBone3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { diff --git a/editor/plugins/physical_bone_3d_editor_plugin.h b/editor/plugins/physical_bone_3d_editor_plugin.h index 4051644b54..93e722a432 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.h +++ b/editor/plugins/physical_bone_3d_editor_plugin.h @@ -39,8 +39,8 @@ class PhysicalBone3DEditor : public Object { GDCLASS(PhysicalBone3DEditor, Object); - HBoxContainer *spatial_editor_hb; - Button *button_transform_joint; + HBoxContainer *spatial_editor_hb = nullptr; + Button *button_transform_joint = nullptr; PhysicalBone3D *selected = nullptr; diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 2812c4aaaf..8566e92b22 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1228,9 +1228,7 @@ Vector2 Polygon2DEditor::snap_point(Vector2 p_target) const { return p_target; } -Polygon2DEditor::Polygon2DEditor() : - AbstractPolygon2DEditor() { - node = nullptr; +Polygon2DEditor::Polygon2DEditor() { snap_offset = EditorSettings::get_singleton()->get_project_metadata("polygon_2d_uv_editor", "snap_offset", Vector2()); snap_step = EditorSettings::get_singleton()->get_project_metadata("polygon_2d_uv_editor", "snap_step", Vector2(10, 10)); use_snap = EditorSettings::get_singleton()->get_project_metadata("polygon_2d_uv_editor", "snap_enabled", false); diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h index 0a5def902c..4403d1e9c7 100644 --- a/editor/plugins/polygon_2d_editor_plugin.h +++ b/editor/plugins/polygon_2d_editor_plugin.h @@ -68,38 +68,38 @@ class Polygon2DEditor : public AbstractPolygon2DEditor { Button *uv_edit_mode[4]; Ref<ButtonGroup> uv_edit_group; - Polygon2D *node; + Polygon2D *node = nullptr; UVMode uv_mode; - AcceptDialog *uv_edit; + AcceptDialog *uv_edit = nullptr; Button *uv_button[UV_MODE_MAX]; - Button *b_snap_enable; - Button *b_snap_grid; - Panel *uv_edit_draw; - HSlider *uv_zoom; - SpinBox *uv_zoom_value; - HScrollBar *uv_hscroll; - VScrollBar *uv_vscroll; - MenuButton *uv_menu; - TextureRect *uv_icon_zoom; + Button *b_snap_enable = nullptr; + Button *b_snap_grid = nullptr; + Panel *uv_edit_draw = nullptr; + HSlider *uv_zoom = nullptr; + SpinBox *uv_zoom_value = nullptr; + HScrollBar *uv_hscroll = nullptr; + VScrollBar *uv_vscroll = nullptr; + MenuButton *uv_menu = nullptr; + TextureRect *uv_icon_zoom = nullptr; Ref<ViewPanner> uv_panner; void _uv_scroll_callback(Vector2 p_scroll_vec, bool p_alt); void _uv_pan_callback(Vector2 p_scroll_vec); void _uv_zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin, bool p_alt); - VBoxContainer *bone_scroll_main_vb; - ScrollContainer *bone_scroll; - VBoxContainer *bone_scroll_vb; - Button *sync_bones; - HSlider *bone_paint_strength; - SpinBox *bone_paint_radius; - Label *bone_paint_radius_label; + VBoxContainer *bone_scroll_main_vb = nullptr; + ScrollContainer *bone_scroll = nullptr; + VBoxContainer *bone_scroll_vb = nullptr; + Button *sync_bones = nullptr; + HSlider *bone_paint_strength = nullptr; + SpinBox *bone_paint_radius = nullptr; + Label *bone_paint_radius_label = nullptr; bool bone_painting; int bone_painting_bone; Vector<float> prev_weights; Vector2 bone_paint_pos; - AcceptDialog *grid_settings; + AcceptDialog *grid_settings = nullptr; void _sync_bones(); void _update_bone_list(); @@ -123,9 +123,9 @@ class Polygon2DEditor : public AbstractPolygon2DEditor { Vector2 uv_drag_from; bool updating_uv_scroll; - AcceptDialog *error; + AcceptDialog *error = nullptr; - Button *button_uv; + Button *button_uv = nullptr; bool use_snap; bool snap_show_grid; diff --git a/editor/plugins/polygon_3d_editor_plugin.h b/editor/plugins/polygon_3d_editor_plugin.h index e92dcaf319..3ad7a4df58 100644 --- a/editor/plugins/polygon_3d_editor_plugin.h +++ b/editor/plugins/polygon_3d_editor_plugin.h @@ -41,7 +41,7 @@ class CanvasItemEditor; class Polygon3DEditor : public HBoxContainer { GDCLASS(Polygon3DEditor, HBoxContainer); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; enum Mode { MODE_CREATE, MODE_EDIT, @@ -50,21 +50,21 @@ class Polygon3DEditor : public HBoxContainer { Mode mode; - Button *button_create; - Button *button_edit; + Button *button_create = nullptr; + Button *button_edit = nullptr; Ref<StandardMaterial3D> line_material; Ref<StandardMaterial3D> handle_material; - Panel *panel; - Node3D *node; + Panel *panel = nullptr; + Node3D *node = nullptr; Ref<Resource> node_resource; Ref<ImmediateMesh> imesh; - MeshInstance3D *imgeom; - MeshInstance3D *pointsm; + MeshInstance3D *imgeom = nullptr; + MeshInstance3D *pointsm = nullptr; Ref<ArrayMesh> m; - MenuButton *options; + MenuButton *options = nullptr; int edited_point; Vector2 edited_point_pos; @@ -98,7 +98,7 @@ public: class Polygon3DEditorPlugin : public EditorPlugin { GDCLASS(Polygon3DEditorPlugin, EditorPlugin); - Polygon3DEditor *polygon_editor; + Polygon3DEditor *polygon_editor = nullptr; public: virtual EditorPlugin::AfterGUIInput forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) override { return polygon_editor->forward_spatial_gui_input(p_camera, p_event); } diff --git a/editor/plugins/replication_editor_plugin.cpp b/editor/plugins/replication_editor_plugin.cpp index e4c1c69804..2a7b3c7a55 100644 --- a/editor/plugins/replication_editor_plugin.cpp +++ b/editor/plugins/replication_editor_plugin.cpp @@ -217,7 +217,7 @@ void ReplicationEditor::update_keying() { /// TODO make keying usable. #if 0 bool keying_enabled = false; - EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); + EditorSelectionHistory *editor_history = EditorNode::get_singleton()->get_editor_selection_history(); if (is_visible_in_tree() && config.is_valid() && editor_history->get_path_size() > 0) { Object *obj = ObjectDB::get_instance(editor_history->get_path_object(0)); keying_enabled = Object::cast_to<Node>(obj) != nullptr; @@ -305,7 +305,7 @@ void ReplicationEditor::property_keyed(const String &p_property) { ERR_FAIL_COND(!current || config.is_null()); Node *root = current->get_node(current->get_root_path()); ERR_FAIL_COND(!root); - EditorHistory *history = EditorNode::get_singleton()->get_editor_history(); + EditorSelectionHistory *history = EditorNode::get_singleton()->get_editor_selection_history(); ERR_FAIL_COND(history->get_path_size() == 0); Node *node = Object::cast_to<Node>(ObjectDB::get_instance(history->get_path_object(0))); ERR_FAIL_COND(!node); diff --git a/editor/plugins/replication_editor_plugin.h b/editor/plugins/replication_editor_plugin.h index 46274d188c..08e86d1617 100644 --- a/editor/plugins/replication_editor_plugin.h +++ b/editor/plugins/replication_editor_plugin.h @@ -51,7 +51,7 @@ private: Ref<SceneReplicationConfig> config; NodePath deleting; - Tree *tree; + Tree *tree = nullptr; bool keying = false; Ref<Texture2D> _get_class_icon(const Node *p_node); @@ -84,7 +84,7 @@ class ReplicationEditorPlugin : public EditorPlugin { GDCLASS(ReplicationEditorPlugin, EditorPlugin); private: - ReplicationEditor *repl_editor; + ReplicationEditor *repl_editor = nullptr; void _node_removed(Node *p_node); void _keying_changed(); diff --git a/editor/plugins/resource_preloader_editor_plugin.h b/editor/plugins/resource_preloader_editor_plugin.h index 8e81239f1b..0b799c13c6 100644 --- a/editor/plugins/resource_preloader_editor_plugin.h +++ b/editor/plugins/resource_preloader_editor_plugin.h @@ -47,16 +47,16 @@ class ResourcePreloaderEditor : public PanelContainer { BUTTON_REMOVE }; - Button *load; - Button *paste; - Tree *tree; + Button *load = nullptr; + Button *paste = nullptr; + Tree *tree = nullptr; bool loading_scene; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - AcceptDialog *dialog; + AcceptDialog *dialog = nullptr; - ResourcePreloader *preloader; + ResourcePreloader *preloader = nullptr; void _load_pressed(); void _files_load_request(const Vector<String> &p_paths); @@ -66,7 +66,7 @@ class ResourcePreloaderEditor : public PanelContainer { void _cell_button_pressed(Object *p_item, int p_column, int p_id); void _item_edited(); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; @@ -87,8 +87,8 @@ public: class ResourcePreloaderEditorPlugin : public EditorPlugin { GDCLASS(ResourcePreloaderEditorPlugin, EditorPlugin); - ResourcePreloaderEditor *preloader_editor; - Button *button; + ResourcePreloaderEditor *preloader_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "ResourcePreloader"; } diff --git a/editor/plugins/root_motion_editor_plugin.h b/editor/plugins/root_motion_editor_plugin.h index c2866f269b..5b8c1d77b3 100644 --- a/editor/plugins/root_motion_editor_plugin.h +++ b/editor/plugins/root_motion_editor_plugin.h @@ -38,12 +38,12 @@ class EditorPropertyRootMotion : public EditorProperty { GDCLASS(EditorPropertyRootMotion, EditorProperty); - Button *assign; - Button *clear; + Button *assign = nullptr; + Button *clear = nullptr; NodePath base_hint; - ConfirmationDialog *filter_dialog; - Tree *filters; + ConfirmationDialog *filter_dialog = nullptr; + Tree *filters = nullptr; void _confirmed(); void _node_assign(); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 2da5978fab..0f45415c4d 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1232,9 +1232,6 @@ void ScriptEditor::_menu_option(int p_option) { if (ResourceLoader::get_resource_type(res_path) == "PackedScene") { if (!EditorNode::get_singleton()->is_scene_open(res_path)) { EditorNode::get_singleton()->load_scene(res_path); - script_editor->call_deferred(SNAME("_menu_option"), p_option); - previous_scripts.push_back(path); //repeat the operation - return; } } else { EditorNode::get_singleton()->load_resource(res_path); @@ -1250,7 +1247,6 @@ void ScriptEditor::_menu_option(int p_option) { edit(scr); file_dialog_option = -1; - return; } else { Error error; Ref<TextFile> text_file = _load_text_file(path, &error); @@ -1261,7 +1257,6 @@ void ScriptEditor::_menu_option(int p_option) { if (text_file.is_valid()) { edit(text_file); file_dialog_option = -1; - return; } } } break; @@ -1348,7 +1343,7 @@ void ScriptEditor::_menu_option(int p_option) { } if (script != nullptr) { - const Vector<DocData::ClassDoc> &documentations = script->get_documentation(); + Vector<DocData::ClassDoc> documentations = script->get_documentation(); for (int j = 0; j < documentations.size(); j++) { const DocData::ClassDoc &doc = documentations.get(j); if (EditorHelp::get_doc_data()->has_doc(doc.name)) { @@ -1361,7 +1356,7 @@ void ScriptEditor::_menu_option(int p_option) { EditorNode::get_singleton()->save_resource_as(resource); if (script != nullptr) { - const Vector<DocData::ClassDoc> &documentations = script->get_documentation(); + Vector<DocData::ClassDoc> documentations = script->get_documentation(); for (int j = 0; j < documentations.size(); j++) { const DocData::ClassDoc &doc = documentations.get(j); EditorHelp::get_doc_data()->add_doc(doc); @@ -2464,7 +2459,7 @@ void ScriptEditor::save_current_script() { } if (script != nullptr) { - const Vector<DocData::ClassDoc> &documentations = script->get_documentation(); + Vector<DocData::ClassDoc> documentations = script->get_documentation(); for (int j = 0; j < documentations.size(); j++) { const DocData::ClassDoc &doc = documentations.get(j); if (EditorHelp::get_doc_data()->has_doc(doc.name)) { @@ -2486,7 +2481,7 @@ void ScriptEditor::save_current_script() { } if (script != nullptr) { - const Vector<DocData::ClassDoc> &documentations = script->get_documentation(); + Vector<DocData::ClassDoc> documentations = script->get_documentation(); for (int j = 0; j < documentations.size(); j++) { const DocData::ClassDoc &doc = documentations.get(j); EditorHelp::get_doc_data()->add_doc(doc); @@ -2537,7 +2532,7 @@ void ScriptEditor::save_all_scripts() { } if (script != nullptr) { - const Vector<DocData::ClassDoc> &documentations = script->get_documentation(); + Vector<DocData::ClassDoc> documentations = script->get_documentation(); for (int j = 0; j < documentations.size(); j++) { const DocData::ClassDoc &doc = documentations.get(j); if (EditorHelp::get_doc_data()->has_doc(doc.name)) { @@ -2549,7 +2544,7 @@ void ScriptEditor::save_all_scripts() { EditorNode::get_singleton()->save_resource(edited_res); //external script, save it if (script != nullptr) { - const Vector<DocData::ClassDoc> &documentations = script->get_documentation(); + Vector<DocData::ClassDoc> documentations = script->get_documentation(); for (int j = 0; j < documentations.size(); j++) { const DocData::ClassDoc &doc = documentations.get(j); EditorHelp::get_doc_data()->add_doc(doc); @@ -3024,7 +3019,7 @@ void ScriptEditor::input(const Ref<InputEvent> &p_event) { } } -void ScriptEditor::unhandled_key_input(const Ref<InputEvent> &p_event) { +void ScriptEditor::shortcut_input(const Ref<InputEvent> &p_event) { ERR_FAIL_COND(p_event.is_null()); if (!is_visible_in_tree() || !p_event->is_pressed() || p_event->is_echo()) { @@ -3296,15 +3291,8 @@ void ScriptEditor::_help_class_open(const String &p_class) { void ScriptEditor::_help_class_goto(const String &p_desc) { String cname = p_desc.get_slice(":", 1); - for (int i = 0; i < tab_container->get_tab_count(); i++) { - EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_tab_control(i)); - - if (eh && eh->get_class() == cname) { - _go_to_tab(i); - eh->go_to_help(p_desc); - _update_script_names(); - return; - } + if (_help_tab_goto(cname, p_desc)) { + return; } EditorHelp *eh = memnew(EditorHelp); @@ -3318,6 +3306,22 @@ void ScriptEditor::_help_class_goto(const String &p_desc) { _sort_list_on_update = true; _update_script_names(); _save_layout(); + + call_deferred("_help_tab_goto", cname, p_desc); +} + +bool ScriptEditor::_help_tab_goto(const String &p_name, const String &p_desc) { + for (int i = 0; i < tab_container->get_tab_count(); i++) { + EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_tab_control(i)); + + if (eh && eh->get_class() == p_name) { + _go_to_tab(i); + eh->go_to_help(p_desc); + _update_script_names(); + return true; + } + } + return false; } void ScriptEditor::update_doc(const String &p_name) { @@ -3606,6 +3610,7 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_update_script_connections", &ScriptEditor::_update_script_connections); ClassDB::bind_method("_help_class_open", &ScriptEditor::_help_class_open); + ClassDB::bind_method("_help_tab_goto", &ScriptEditor::_help_tab_goto); ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts); ClassDB::bind_method("_update_members_overview", &ScriptEditor::_update_members_overview); ClassDB::bind_method("_update_recent_scripts", &ScriptEditor::_update_recent_scripts); @@ -3745,7 +3750,7 @@ ScriptEditor::ScriptEditor() { ED_SHORTCUT("script_editor/next_script", TTR("Next Script"), KeyModifierMask::CMD | KeyModifierMask::SHIFT | Key::PERIOD); ED_SHORTCUT("script_editor/prev_script", TTR("Previous Script"), KeyModifierMask::CMD | KeyModifierMask::SHIFT | Key::COMMA); set_process_input(true); - set_process_unhandled_key_input(true); + set_process_shortcut_input(true); file_menu = memnew(MenuButton); file_menu->set_text(TTR("File")); @@ -3960,7 +3965,7 @@ void ScriptEditorPlugin::edit(Object *p_object) { Script *p_script = Object::cast_to<Script>(p_object); String res_path = p_script->get_path().get_slice("::", 0); - if (p_script->is_built_in()) { + if (p_script->is_built_in() && !res_path.is_empty()) { if (ResourceLoader::get_resource_type(res_path) == "PackedScene") { if (!EditorNode::get_singleton()->is_scene_open(res_path)) { EditorNode::get_singleton()->load_scene(res_path); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index a99e269d46..7885ffe2c5 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -102,8 +102,8 @@ public: class ScriptEditorQuickOpen : public ConfirmationDialog { GDCLASS(ScriptEditorQuickOpen, ConfirmationDialog); - LineEdit *search_box; - Tree *search_options; + LineEdit *search_box = nullptr; + Tree *search_options = nullptr; String function; void _update_search(); @@ -242,55 +242,55 @@ class ScriptEditor : public PanelContainer { DISPLAY_FULL_PATH, }; - HBoxContainer *menu_hb; - MenuButton *file_menu; - MenuButton *edit_menu; - MenuButton *script_search_menu; - MenuButton *debug_menu; - PopupMenu *context_menu; - Timer *autosave_timer; + HBoxContainer *menu_hb = nullptr; + MenuButton *file_menu = nullptr; + MenuButton *edit_menu = nullptr; + MenuButton *script_search_menu = nullptr; + MenuButton *debug_menu = nullptr; + PopupMenu *context_menu = nullptr; + Timer *autosave_timer = nullptr; uint64_t idle; - PopupMenu *recent_scripts; - PopupMenu *theme_submenu; - - Button *help_search; - Button *site_search; - EditorHelpSearch *help_search_dialog; - - ItemList *script_list; - HSplitContainer *script_split; - ItemList *members_overview; - LineEdit *filter_scripts; - LineEdit *filter_methods; - VBoxContainer *scripts_vbox; - VBoxContainer *overview_vbox; - HBoxContainer *buttons_hbox; - Label *filename; - Button *members_overview_alphabeta_sort_button; + PopupMenu *recent_scripts = nullptr; + PopupMenu *theme_submenu = nullptr; + + Button *help_search = nullptr; + Button *site_search = nullptr; + EditorHelpSearch *help_search_dialog = nullptr; + + ItemList *script_list = nullptr; + HSplitContainer *script_split = nullptr; + ItemList *members_overview = nullptr; + LineEdit *filter_scripts = nullptr; + LineEdit *filter_methods = nullptr; + VBoxContainer *scripts_vbox = nullptr; + VBoxContainer *overview_vbox = nullptr; + HBoxContainer *buttons_hbox = nullptr; + Label *filename = nullptr; + Button *members_overview_alphabeta_sort_button = nullptr; bool members_overview_enabled; - ItemList *help_overview; + ItemList *help_overview = nullptr; bool help_overview_enabled; - VSplitContainer *list_split; - TabContainer *tab_container; - EditorFileDialog *file_dialog; - AcceptDialog *error_dialog; - ConfirmationDialog *erase_tab_confirm; - ScriptCreateDialog *script_create_dialog; - Button *scripts_visible; - FindReplaceBar *find_replace_bar; + VSplitContainer *list_split = nullptr; + TabContainer *tab_container = nullptr; + EditorFileDialog *file_dialog = nullptr; + AcceptDialog *error_dialog = nullptr; + ConfirmationDialog *erase_tab_confirm = nullptr; + ScriptCreateDialog *script_create_dialog = nullptr; + Button *scripts_visible = nullptr; + FindReplaceBar *find_replace_bar = nullptr; String current_theme; - TextureRect *script_icon; - Label *script_name_label; + TextureRect *script_icon = nullptr; + Label *script_name_label = nullptr; - Button *script_back; - Button *script_forward; + Button *script_back = nullptr; + Button *script_forward = nullptr; - FindInFilesDialog *find_in_files_dialog; - FindInFilesPanel *find_in_files; - Button *find_in_files_button; + FindInFilesDialog *find_in_files_dialog = nullptr; + FindInFilesPanel *find_in_files = nullptr; + Button *find_in_files_button = nullptr; enum { SCRIPT_EDITOR_FUNC_MAX = 32, @@ -320,8 +320,8 @@ class ScriptEditor : public PanelContainer { bool _has_script_tab() const; void _prepare_file_menu(); - Tree *disk_changed_list; - ConfirmationDialog *disk_changed; + Tree *disk_changed_list = nullptr; + ConfirmationDialog *disk_changed = nullptr; bool restoring_layout; @@ -361,7 +361,7 @@ class ScriptEditor : public PanelContainer { void _update_selected_editor_menu(); - EditorScriptCodeCompletionCache *completion_cache; + EditorScriptCodeCompletionCache *completion_cache = nullptr; void _editor_stop(); @@ -426,7 +426,7 @@ class ScriptEditor : public PanelContainer { void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); virtual void input(const Ref<InputEvent> &p_event) override; - virtual void unhandled_key_input(const Ref<InputEvent> &p_event) override; + virtual void shortcut_input(const Ref<InputEvent> &p_event) override; void _script_list_gui_input(const Ref<InputEvent> &ev); void _make_script_list_context_menu(); @@ -440,6 +440,7 @@ class ScriptEditor : public PanelContainer { void _help_class_open(const String &p_class); void _help_class_goto(const String &p_desc); + bool _help_tab_goto(const String &p_name, const String &p_desc); void _update_history_arrows(); void _save_history(); void _go_to_tab(int p_idx); @@ -528,7 +529,7 @@ public: class ScriptEditorPlugin : public EditorPlugin { GDCLASS(ScriptEditorPlugin, EditorPlugin); - ScriptEditor *script_editor; + ScriptEditor *script_editor = nullptr; public: virtual String get_name() const override { return "Script"; } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 30ca1c605f..4626f10b8d 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -684,12 +684,12 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo } } -void ScriptTextEditor::_code_complete_scripts(void *p_ud, const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force) { +void ScriptTextEditor::_code_complete_scripts(void *p_ud, const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_force) { ScriptTextEditor *ste = (ScriptTextEditor *)p_ud; ste->_code_complete_script(p_code, r_options, r_force); } -void ScriptTextEditor::_code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force) { +void ScriptTextEditor::_code_complete_script(const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_force) { if (color_panel->is_visible()) { return; } @@ -699,6 +699,9 @@ void ScriptTextEditor::_code_complete_script(const String &p_code, List<ScriptCo } String hint; Error err = script->get_language()->complete_code(p_code, script->get_path(), base, r_options, r_force, hint); + + r_options->sort_custom_inplace<CodeCompletionOptionCompare>(); + if (err == OK) { code_editor->get_text_editor()->set_code_hint(hint); } @@ -771,7 +774,7 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c _goto_line(p_row); switch (result.type) { - case ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION: { + case ScriptLanguage::LOOKUP_RESULT_SCRIPT_LOCATION: { if (result.script.is_valid()) { emit_signal(SNAME("request_open_script_at_line"), result.script, result.location - 1); } else { @@ -779,10 +782,10 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c goto_line_centered(result.location - 1); } } break; - case ScriptLanguage::LookupResult::RESULT_CLASS: { + case ScriptLanguage::LOOKUP_RESULT_CLASS: { emit_signal(SNAME("go_to_help"), "class_name:" + result.class_name); } break; - case ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT: { + case ScriptLanguage::LOOKUP_RESULT_CLASS_CONSTANT: { StringName cname = result.class_name; bool success; while (true) { @@ -798,11 +801,11 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c emit_signal(SNAME("go_to_help"), "class_constant:" + result.class_name + ":" + result.class_member); } break; - case ScriptLanguage::LookupResult::RESULT_CLASS_PROPERTY: { + case ScriptLanguage::LOOKUP_RESULT_CLASS_PROPERTY: { emit_signal(SNAME("go_to_help"), "class_property:" + result.class_name + ":" + result.class_member); } break; - case ScriptLanguage::LookupResult::RESULT_CLASS_METHOD: { + case ScriptLanguage::LOOKUP_RESULT_CLASS_METHOD: { StringName cname = result.class_name; while (true) { @@ -817,7 +820,7 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c emit_signal(SNAME("go_to_help"), "class_method:" + result.class_name + ":" + result.class_member); } break; - case ScriptLanguage::LookupResult::RESULT_CLASS_ENUM: { + case ScriptLanguage::LOOKUP_RESULT_CLASS_ENUM: { StringName cname = result.class_name; StringName success; while (true) { @@ -833,9 +836,11 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c emit_signal(SNAME("go_to_help"), "class_enum:" + result.class_name + ":" + result.class_member); } break; - case ScriptLanguage::LookupResult::RESULT_CLASS_TBD_GLOBALSCOPE: { + case ScriptLanguage::LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE: { emit_signal(SNAME("go_to_help"), "class_global:" + result.class_name + ":" + result.class_member); } break; + default: { + } } } else if (ProjectSettings::get_singleton()->has_autoload(p_symbol)) { // Check for Autoload scenes. diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index 1e2284b403..c1c4b0af54 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -162,8 +162,8 @@ protected: void _update_bookmark_list(); void _bookmark_item_pressed(int p_idx); - static void _code_complete_scripts(void *p_ud, const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force); - void _code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force); + static void _code_complete_scripts(void *p_ud, const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_force); + void _code_complete_script(const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_force); void _load_theme_settings(); void _set_theme_for_script(); @@ -256,4 +256,51 @@ public: ~ScriptTextEditor(); }; +const int KIND_COUNT = 10; +// The order in which to sort code completion options. +const ScriptLanguage::CodeCompletionKind KIND_SORT_ORDER[KIND_COUNT] = { + ScriptLanguage::CODE_COMPLETION_KIND_VARIABLE, + ScriptLanguage::CODE_COMPLETION_KIND_MEMBER, + ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, + ScriptLanguage::CODE_COMPLETION_KIND_ENUM, + ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, + ScriptLanguage::CODE_COMPLETION_KIND_CONSTANT, + ScriptLanguage::CODE_COMPLETION_KIND_CLASS, + ScriptLanguage::CODE_COMPLETION_KIND_NODE_PATH, + ScriptLanguage::CODE_COMPLETION_KIND_FILE_PATH, + ScriptLanguage::CODE_COMPLETION_KIND_PLAIN_TEXT, +}; + +// The custom comparer which will sort completion options. +struct CodeCompletionOptionCompare { + _FORCE_INLINE_ bool operator()(const ScriptLanguage::CodeCompletionOption &l, const ScriptLanguage::CodeCompletionOption &r) const { + if (l.location == r.location) { + // If locations are same, sort on kind + if (l.kind == r.kind) { + // If kinds are same, sort alphanumeric + return l.display < r.display; + } + + // Sort kinds based on the const sorting array defined above. Lower index = higher priority. + int l_index = -1; + int r_index = -1; + for (int i = 0; i < KIND_COUNT; i++) { + const ScriptLanguage::CodeCompletionKind kind = KIND_SORT_ORDER[i]; + l_index = kind == l.kind ? i : l_index; + r_index = kind == r.kind ? i : r_index; + + if (l_index != -1 && r_index != -1) { + return l_index < r_index; + } + } + + // This return should never be hit unless something goes wrong. + // l and r should always have a Kind which is in the sort order array. + return l.display < r.display; + } + + return l.location < r.location; + } +}; + #endif // SCRIPT_TEXT_EDITOR_H diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index dbe6ca192c..070f1fac1e 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -222,7 +222,7 @@ static ShaderLanguage::DataType _get_global_variable_type(const StringName &p_va return (ShaderLanguage::DataType)RS::global_variable_type_get_shader_datatype(gvt); } -void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options) { +void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options) { _check_shader_mode(); ShaderLanguage sl; diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index b1391e4f66..067711c75c 100644 --- a/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -65,7 +65,7 @@ protected: static void _bind_methods(); virtual void _load_theme_settings() override; - virtual void _code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options) override; + virtual void _code_complete_script(const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options) override; public: virtual void _validate_script() override; @@ -108,19 +108,19 @@ class ShaderEditor : public PanelContainer { HELP_DOCS, }; - MenuButton *edit_menu; - MenuButton *search_menu; - PopupMenu *bookmarks_menu; - MenuButton *help_menu; - PopupMenu *context_menu; + MenuButton *edit_menu = nullptr; + MenuButton *search_menu = nullptr; + PopupMenu *bookmarks_menu = nullptr; + MenuButton *help_menu = nullptr; + PopupMenu *context_menu = nullptr; RichTextLabel *warnings_panel = nullptr; uint64_t idle; - GotoLineDialog *goto_line_dialog; - ConfirmationDialog *erase_tab_confirm; - ConfirmationDialog *disk_changed; + GotoLineDialog *goto_line_dialog = nullptr; + ConfirmationDialog *erase_tab_confirm = nullptr; + ConfirmationDialog *disk_changed = nullptr; - ShaderTextEditor *shader_editor; + ShaderTextEditor *shader_editor = nullptr; void _menu_option(int p_option); mutable Ref<Shader> shader; @@ -161,8 +161,8 @@ class ShaderEditorPlugin : public EditorPlugin { GDCLASS(ShaderEditorPlugin, EditorPlugin); bool _2d; - ShaderEditor *shader_editor; - Button *button; + ShaderEditor *shader_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "Shader"; } diff --git a/editor/plugins/shader_file_editor_plugin.h b/editor/plugins/shader_file_editor_plugin.h index 5ee2d01dbf..1ebd644282 100644 --- a/editor/plugins/shader_file_editor_plugin.h +++ b/editor/plugins/shader_file_editor_plugin.h @@ -48,10 +48,10 @@ class ShaderFileEditor : public PanelContainer { Ref<RDShaderFile> shader_file; - HBoxContainer *stage_hb; - ItemList *versions; + HBoxContainer *stage_hb = nullptr; + ItemList *versions = nullptr; Button *stages[RD::SHADER_STAGE_MAX]; - RichTextLabel *error_text; + RichTextLabel *error_text = nullptr; void _update_version(const StringName &p_version_txt, const RenderingDevice::ShaderStage p_stage); void _version_selected(int p_stage); @@ -74,8 +74,8 @@ public: class ShaderFileEditorPlugin : public EditorPlugin { GDCLASS(ShaderFileEditorPlugin, EditorPlugin); - ShaderFileEditor *shader_editor; - Button *button; + ShaderFileEditor *shader_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "ShaderFile"; } diff --git a/editor/plugins/skeleton_2d_editor_plugin.h b/editor/plugins/skeleton_2d_editor_plugin.h index 004dac7b05..295725b751 100644 --- a/editor/plugins/skeleton_2d_editor_plugin.h +++ b/editor/plugins/skeleton_2d_editor_plugin.h @@ -43,10 +43,10 @@ class Skeleton2DEditor : public Control { MENU_OPTION_MAKE_REST, }; - Skeleton2D *node; + Skeleton2D *node = nullptr; - MenuButton *options; - AcceptDialog *err_dialog; + MenuButton *options = nullptr; + AcceptDialog *err_dialog = nullptr; void _menu_option(int p_option); @@ -65,7 +65,7 @@ public: class Skeleton2DEditorPlugin : public EditorPlugin { GDCLASS(Skeleton2DEditorPlugin, EditorPlugin); - Skeleton2DEditor *sprite_editor; + Skeleton2DEditor *sprite_editor = nullptr; public: virtual String get_name() const override { return "Skeleton2D"; } diff --git a/editor/plugins/skeleton_3d_editor_plugin.h b/editor/plugins/skeleton_3d_editor_plugin.h index 2dbb552428..911e39a34f 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.h +++ b/editor/plugins/skeleton_3d_editor_plugin.h @@ -60,10 +60,10 @@ class BoneTransformEditor : public VBoxContainer { Rect2 background_rects[5]; - Skeleton3D *skeleton; + Skeleton3D *skeleton = nullptr; // String property; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool toggle_enabled = false; bool updating = false; @@ -108,26 +108,26 @@ class Skeleton3DEditor : public VBoxContainer { Transform3D relative_rest; // Relative to skeleton node. }; - EditorInspectorPluginSkeleton *editor_plugin; + EditorInspectorPluginSkeleton *editor_plugin = nullptr; - Skeleton3D *skeleton; + Skeleton3D *skeleton = nullptr; Tree *joint_tree = nullptr; BoneTransformEditor *rest_editor = nullptr; BoneTransformEditor *pose_editor = nullptr; - VSeparator *separator; + VSeparator *separator = nullptr; MenuButton *skeleton_options = nullptr; - Button *edit_mode_button; + Button *edit_mode_button = nullptr; bool edit_mode = false; - HBoxContainer *animation_hb; - Button *key_loc_button; - Button *key_rot_button; - Button *key_scale_button; - Button *key_insert_button; - Button *key_insert_all_button; + HBoxContainer *animation_hb = nullptr; + Button *key_loc_button = nullptr; + Button *key_rot_button = nullptr; + Button *key_scale_button = nullptr; + Button *key_insert_button = nullptr; + Button *key_insert_all_button = nullptr; EditorFileDialog *file_dialog = nullptr; @@ -163,7 +163,7 @@ class Skeleton3DEditor : public VBoxContainer { void set_bone_options_enabled(const bool p_bone_options_enabled); // Handle. - MeshInstance3D *handles_mesh_instance; + MeshInstance3D *handles_mesh_instance = nullptr; Ref<ImmediateMesh> handles_mesh; Ref<ShaderMaterial> handle_material; Ref<Shader> handle_shader; @@ -220,7 +220,7 @@ class EditorInspectorPluginSkeleton : public EditorInspectorPlugin { friend class Skeleton3DEditorPlugin; - Skeleton3DEditor *skel_editor; + Skeleton3DEditor *skel_editor = nullptr; public: virtual bool can_handle(Object *p_object) override; @@ -230,7 +230,7 @@ public: class Skeleton3DEditorPlugin : public EditorPlugin { GDCLASS(Skeleton3DEditorPlugin, EditorPlugin); - EditorInspectorPluginSkeleton *skeleton_plugin; + EditorInspectorPluginSkeleton *skeleton_plugin = nullptr; public: virtual EditorPlugin::AfterGUIInput forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) override; diff --git a/editor/plugins/skeleton_ik_3d_editor_plugin.h b/editor/plugins/skeleton_ik_3d_editor_plugin.h index f71e788232..26aead6d67 100644 --- a/editor/plugins/skeleton_ik_3d_editor_plugin.h +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.h @@ -38,9 +38,9 @@ class SkeletonIK3D; class SkeletonIK3DEditorPlugin : public EditorPlugin { GDCLASS(SkeletonIK3DEditorPlugin, EditorPlugin); - SkeletonIK3D *skeleton_ik; + SkeletonIK3D *skeleton_ik = nullptr; - Button *play_btn; + Button *play_btn = nullptr; void _play(); diff --git a/editor/plugins/sprite_2d_editor_plugin.h b/editor/plugins/sprite_2d_editor_plugin.h index 46953b0937..8e3dc19c7e 100644 --- a/editor/plugins/sprite_2d_editor_plugin.h +++ b/editor/plugins/sprite_2d_editor_plugin.h @@ -47,16 +47,16 @@ class Sprite2DEditor : public Control { Menu selected_menu_item; - Sprite2D *node; + Sprite2D *node = nullptr; - MenuButton *options; + MenuButton *options = nullptr; - ConfirmationDialog *outline_dialog; + ConfirmationDialog *outline_dialog = nullptr; - AcceptDialog *err_dialog; + AcceptDialog *err_dialog = nullptr; - ConfirmationDialog *debug_uv_dialog; - Control *debug_uv; + ConfirmationDialog *debug_uv_dialog = nullptr; + Control *debug_uv = nullptr; Vector<Vector2> uv_lines; Vector<Vector<Vector2>> outline_lines; Vector<Vector<Vector2>> computed_outline_lines; @@ -64,10 +64,10 @@ class Sprite2DEditor : public Control { Vector<Vector2> computed_uv; Vector<int> computed_indices; - SpinBox *simplification; - SpinBox *grow_pixels; - SpinBox *shrink_pixels; - Button *update_preview; + SpinBox *simplification = nullptr; + SpinBox *grow_pixels = nullptr; + SpinBox *shrink_pixels = nullptr; + Button *update_preview = nullptr; void _menu_option(int p_option); @@ -98,7 +98,7 @@ public: class Sprite2DEditorPlugin : public EditorPlugin { GDCLASS(Sprite2DEditorPlugin, EditorPlugin); - Sprite2DEditor *sprite_editor; + Sprite2DEditor *sprite_editor = nullptr; public: virtual String get_name() const override { return "Sprite2D"; } diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 872a88e262..b0213012a2 100644 --- a/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -48,48 +48,48 @@ class EditorFileDialog; class SpriteFramesEditor : public HSplitContainer { GDCLASS(SpriteFramesEditor, HSplitContainer); - Button *load; - Button *load_sheet; - Button *_delete; - Button *copy; - Button *paste; - Button *empty; - Button *empty2; - Button *move_up; - Button *move_down; - Button *zoom_out; - Button *zoom_reset; - Button *zoom_in; - ItemList *tree; + Button *load = nullptr; + Button *load_sheet = nullptr; + Button *_delete = nullptr; + Button *copy = nullptr; + Button *paste = nullptr; + Button *empty = nullptr; + Button *empty2 = nullptr; + Button *move_up = nullptr; + Button *move_down = nullptr; + Button *zoom_out = nullptr; + Button *zoom_reset = nullptr; + Button *zoom_in = nullptr; + ItemList *tree = nullptr; bool loading_scene; int sel; - Button *new_anim; - Button *remove_anim; + Button *new_anim = nullptr; + Button *remove_anim = nullptr; - Tree *animations; - SpinBox *anim_speed; - CheckButton *anim_loop; + Tree *animations = nullptr; + SpinBox *anim_speed = nullptr; + CheckButton *anim_loop = nullptr; - EditorFileDialog *file; + EditorFileDialog *file = nullptr; - AcceptDialog *dialog; + AcceptDialog *dialog = nullptr; - SpriteFrames *frames; + SpriteFrames *frames = nullptr; StringName edited_anim; - ConfirmationDialog *delete_dialog; - - ConfirmationDialog *split_sheet_dialog; - ScrollContainer *split_sheet_scroll; - TextureRect *split_sheet_preview; - SpinBox *split_sheet_h; - SpinBox *split_sheet_v; - Button *split_sheet_zoom_out; - Button *split_sheet_zoom_reset; - Button *split_sheet_zoom_in; - EditorFileDialog *file_split_sheet; + ConfirmationDialog *delete_dialog = nullptr; + + ConfirmationDialog *split_sheet_dialog = nullptr; + ScrollContainer *split_sheet_scroll = nullptr; + TextureRect *split_sheet_preview = nullptr; + SpinBox *split_sheet_h = nullptr; + SpinBox *split_sheet_v = nullptr; + Button *split_sheet_zoom_out = nullptr; + Button *split_sheet_zoom_reset = nullptr; + Button *split_sheet_zoom_in = nullptr; + EditorFileDialog *file_split_sheet = nullptr; Set<int> frames_selected; Set<int> frames_toggled_by_mouse_hover; int last_frame_selected; @@ -129,7 +129,7 @@ class SpriteFramesEditor : public HSplitContainer { bool updating; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; @@ -164,8 +164,8 @@ public: class SpriteFramesEditorPlugin : public EditorPlugin { GDCLASS(SpriteFramesEditorPlugin, EditorPlugin); - SpriteFramesEditor *frames_editor; - Button *button; + SpriteFramesEditor *frames_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "SpriteFrames"; } diff --git a/editor/plugins/style_box_editor_plugin.h b/editor/plugins/style_box_editor_plugin.h index bdebebbe1c..663440ae31 100644 --- a/editor/plugins/style_box_editor_plugin.h +++ b/editor/plugins/style_box_editor_plugin.h @@ -40,7 +40,7 @@ class StyleBoxPreview : public VBoxContainer { GDCLASS(StyleBoxPreview, VBoxContainer); - Control *preview; + Control *preview = nullptr; Ref<StyleBox> stylebox; void _sb_changed(); diff --git a/editor/plugins/text_control_editor_plugin.h b/editor/plugins/text_control_editor_plugin.h index 1349003a9c..a475f6eba3 100644 --- a/editor/plugins/text_control_editor_plugin.h +++ b/editor/plugins/text_control_editor_plugin.h @@ -100,7 +100,7 @@ public: class TextControlEditorPlugin : public EditorPlugin { GDCLASS(TextControlEditorPlugin, EditorPlugin); - TextControlEditor *text_ctl_editor; + TextControlEditor *text_ctl_editor = nullptr; public: virtual String get_name() const override { return "TextControlFontEditor"; } diff --git a/editor/plugins/texture_3d_editor_plugin.h b/editor/plugins/texture_3d_editor_plugin.h index d418032477..2f7f6f83bb 100644 --- a/editor/plugins/texture_3d_editor_plugin.h +++ b/editor/plugins/texture_3d_editor_plugin.h @@ -39,14 +39,14 @@ class Texture3DEditor : public Control { GDCLASS(Texture3DEditor, Control); - SpinBox *layer; - Label *info; + SpinBox *layer = nullptr; + Label *info = nullptr; Ref<Texture3D> texture; Ref<Shader> shader; Ref<ShaderMaterial> material; - Control *texture_rect; + Control *texture_rect = nullptr; void _make_shaders(); diff --git a/editor/plugins/texture_layered_editor_plugin.h b/editor/plugins/texture_layered_editor_plugin.h index 1c59ec4db0..830916e954 100644 --- a/editor/plugins/texture_layered_editor_plugin.h +++ b/editor/plugins/texture_layered_editor_plugin.h @@ -39,8 +39,8 @@ class TextureLayeredEditor : public Control { GDCLASS(TextureLayeredEditor, Control); - SpinBox *layer; - Label *info; + SpinBox *layer = nullptr; + Label *info = nullptr; Ref<TextureLayered> texture; Ref<Shader> shaders[3]; @@ -48,7 +48,7 @@ class TextureLayeredEditor : public Control { float x_rot = 0; float y_rot = 0; - Control *texture_rect; + Control *texture_rect = nullptr; void _make_shaders(); diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index 041742c28a..1e1cc2b7b2 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -52,23 +52,23 @@ class TextureRegionEditor : public VBoxContainer { }; friend class TextureRegionEditorPlugin; - OptionButton *snap_mode_button; - Button *zoom_in; - Button *zoom_reset; - Button *zoom_out; - HBoxContainer *hb_grid; //For showing/hiding the grid controls when changing the SnapMode - SpinBox *sb_step_y; - SpinBox *sb_step_x; - SpinBox *sb_off_y; - SpinBox *sb_off_x; - SpinBox *sb_sep_y; - SpinBox *sb_sep_x; - Panel *edit_draw; - - VScrollBar *vscroll; - HScrollBar *hscroll; - - UndoRedo *undo_redo; + OptionButton *snap_mode_button = nullptr; + Button *zoom_in = nullptr; + Button *zoom_reset = nullptr; + Button *zoom_out = nullptr; + HBoxContainer *hb_grid = nullptr; //For showing/hiding the grid controls when changing the SnapMode + SpinBox *sb_step_y = nullptr; + SpinBox *sb_step_x = nullptr; + SpinBox *sb_off_y = nullptr; + SpinBox *sb_off_x = nullptr; + SpinBox *sb_sep_y = nullptr; + SpinBox *sb_sep_x = nullptr; + Panel *edit_draw = nullptr; + + VScrollBar *vscroll = nullptr; + HScrollBar *hscroll = nullptr; + + UndoRedo *undo_redo = nullptr; Vector2 draw_ofs; float draw_zoom; @@ -79,9 +79,9 @@ class TextureRegionEditor : public VBoxContainer { Vector2 snap_step; Vector2 snap_separation; - Sprite2D *node_sprite_2d; - Sprite3D *node_sprite_3d; - NinePatchRect *node_ninepatch; + Sprite2D *node_sprite_2d = nullptr; + Sprite3D *node_sprite_3d = nullptr; + NinePatchRect *node_ninepatch = nullptr; Ref<StyleBoxTexture> obj_styleBox; Ref<AtlasTexture> atlas_tex; @@ -146,8 +146,8 @@ class TextureRegionEditorPlugin : public EditorPlugin { GDCLASS(TextureRegionEditorPlugin, EditorPlugin); bool manually_hidden; - Button *texture_region_button; - TextureRegionEditor *region_editor; + Button *texture_region_button = nullptr; + TextureRegionEditor *region_editor = nullptr; protected: static void _bind_methods(); diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index 7c1b0cda3e..4b49fbb186 100644 --- a/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -75,9 +75,9 @@ class ThemeItemImportTree : public VBoxContainer { Map<ThemeItem, ItemCheckedState> selected_items; - LineEdit *import_items_filter; + LineEdit *import_items_filter = nullptr; - Tree *import_items_tree; + Tree *import_items_tree = nullptr; List<TreeItem *> tree_color_items; List<TreeItem *> tree_constant_items; List<TreeItem *> tree_font_items; @@ -92,57 +92,57 @@ class ThemeItemImportTree : public VBoxContainer { IMPORT_ITEM_DATA = 2, }; - TextureRect *select_colors_icon; - Label *select_colors_label; - Button *select_all_colors_button; - Button *select_full_colors_button; - Button *deselect_all_colors_button; - Label *total_selected_colors_label; - - TextureRect *select_constants_icon; - Label *select_constants_label; - Button *select_all_constants_button; - Button *select_full_constants_button; - Button *deselect_all_constants_button; - Label *total_selected_constants_label; - - TextureRect *select_fonts_icon; - Label *select_fonts_label; - Button *select_all_fonts_button; - Button *select_full_fonts_button; - Button *deselect_all_fonts_button; - Label *total_selected_fonts_label; - - TextureRect *select_font_sizes_icon; - Label *select_font_sizes_label; - Button *select_all_font_sizes_button; - Button *select_full_font_sizes_button; - Button *deselect_all_font_sizes_button; - Label *total_selected_font_sizes_label; - - TextureRect *select_icons_icon; - Label *select_icons_label; - Button *select_all_icons_button; - Button *select_full_icons_button; - Button *deselect_all_icons_button; - Label *total_selected_icons_label; - - TextureRect *select_styleboxes_icon; - Label *select_styleboxes_label; - Button *select_all_styleboxes_button; - Button *select_full_styleboxes_button; - Button *deselect_all_styleboxes_button; - Label *total_selected_styleboxes_label; - - HBoxContainer *select_icons_warning_hb; - TextureRect *select_icons_warning_icon; - Label *select_icons_warning; - - Button *import_collapse_types_button; - Button *import_expand_types_button; - Button *import_select_all_button; - Button *import_select_full_button; - Button *import_deselect_all_button; + TextureRect *select_colors_icon = nullptr; + Label *select_colors_label = nullptr; + Button *select_all_colors_button = nullptr; + Button *select_full_colors_button = nullptr; + Button *deselect_all_colors_button = nullptr; + Label *total_selected_colors_label = nullptr; + + TextureRect *select_constants_icon = nullptr; + Label *select_constants_label = nullptr; + Button *select_all_constants_button = nullptr; + Button *select_full_constants_button = nullptr; + Button *deselect_all_constants_button = nullptr; + Label *total_selected_constants_label = nullptr; + + TextureRect *select_fonts_icon = nullptr; + Label *select_fonts_label = nullptr; + Button *select_all_fonts_button = nullptr; + Button *select_full_fonts_button = nullptr; + Button *deselect_all_fonts_button = nullptr; + Label *total_selected_fonts_label = nullptr; + + TextureRect *select_font_sizes_icon = nullptr; + Label *select_font_sizes_label = nullptr; + Button *select_all_font_sizes_button = nullptr; + Button *select_full_font_sizes_button = nullptr; + Button *deselect_all_font_sizes_button = nullptr; + Label *total_selected_font_sizes_label = nullptr; + + TextureRect *select_icons_icon = nullptr; + Label *select_icons_label = nullptr; + Button *select_all_icons_button = nullptr; + Button *select_full_icons_button = nullptr; + Button *deselect_all_icons_button = nullptr; + Label *total_selected_icons_label = nullptr; + + TextureRect *select_styleboxes_icon = nullptr; + Label *select_styleboxes_label = nullptr; + Button *select_all_styleboxes_button = nullptr; + Button *select_full_styleboxes_button = nullptr; + Button *deselect_all_styleboxes_button = nullptr; + Label *total_selected_styleboxes_label = nullptr; + + HBoxContainer *select_icons_warning_hb = nullptr; + TextureRect *select_icons_warning_icon = nullptr; + Label *select_icons_warning = nullptr; + + Button *import_collapse_types_button = nullptr; + Button *import_expand_types_button = nullptr; + Button *import_select_all_button = nullptr; + Button *import_select_full_button = nullptr; + Button *import_deselect_all_button = nullptr; void _update_items_tree(); void _toggle_type_items(bool p_collapse); @@ -186,31 +186,31 @@ class ThemeTypeEditor; class ThemeItemEditorDialog : public AcceptDialog { GDCLASS(ThemeItemEditorDialog, AcceptDialog); - ThemeTypeEditor *theme_type_editor; + ThemeTypeEditor *theme_type_editor = nullptr; Ref<Theme> edited_theme; - TabContainer *tc; + TabContainer *tc = nullptr; enum TypesTreeAction { TYPES_TREE_REMOVE_ITEM, }; - Tree *edit_type_list; - LineEdit *edit_add_type_value; + Tree *edit_type_list = nullptr; + LineEdit *edit_add_type_value = nullptr; String edited_item_type; - Button *edit_items_add_color; - Button *edit_items_add_constant; - Button *edit_items_add_font; - Button *edit_items_add_font_size; - Button *edit_items_add_icon; - Button *edit_items_add_stylebox; - Button *edit_items_remove_class; - Button *edit_items_remove_custom; - Button *edit_items_remove_all; - Tree *edit_items_tree; - Label *edit_items_message; + Button *edit_items_add_color = nullptr; + Button *edit_items_add_constant = nullptr; + Button *edit_items_add_font = nullptr; + Button *edit_items_add_font_size = nullptr; + Button *edit_items_add_icon = nullptr; + Button *edit_items_add_stylebox = nullptr; + Button *edit_items_remove_class = nullptr; + Button *edit_items_remove_custom = nullptr; + Button *edit_items_remove_all = nullptr; + Tree *edit_items_tree = nullptr; + Label *edit_items_message = nullptr; enum ItemsTreeAction { ITEMS_TREE_RENAME_ITEM, @@ -218,10 +218,10 @@ class ThemeItemEditorDialog : public AcceptDialog { ITEMS_TREE_REMOVE_DATA_TYPE, }; - ConfirmationDialog *edit_theme_item_dialog; - VBoxContainer *edit_theme_item_old_vb; - Label *theme_item_old_name; - LineEdit *theme_item_name; + ConfirmationDialog *edit_theme_item_dialog = nullptr; + VBoxContainer *edit_theme_item_old_vb = nullptr; + Label *theme_item_old_name = nullptr; + LineEdit *theme_item_name = nullptr; enum ItemPopupMode { CREATE_THEME_ITEM, @@ -233,15 +233,15 @@ class ThemeItemEditorDialog : public AcceptDialog { String edit_item_old_name; Theme::DataType edit_item_data_type = Theme::DATA_TYPE_MAX; - ThemeItemImportTree *import_default_theme_items; - ThemeItemImportTree *import_editor_theme_items; - ThemeItemImportTree *import_other_theme_items; + ThemeItemImportTree *import_default_theme_items = nullptr; + ThemeItemImportTree *import_editor_theme_items = nullptr; + ThemeItemImportTree *import_other_theme_items = nullptr; - LineEdit *import_another_theme_value; - Button *import_another_theme_button; - EditorFileDialog *import_another_theme_dialog; + LineEdit *import_another_theme_value = nullptr; + Button *import_another_theme_button = nullptr; + EditorFileDialog *import_another_theme_dialog = nullptr; - ConfirmationDialog *confirm_closing_dialog; + ConfirmationDialog *confirm_closing_dialog = nullptr; void ok_pressed() override; void _close_dialog(); @@ -288,9 +288,9 @@ class ThemeTypeDialog : public ConfirmationDialog { String pre_submitted_value; - LineEdit *add_type_filter; - ItemList *add_type_options; - ConfirmationDialog *add_type_confirmation; + LineEdit *add_type_filter = nullptr; + ItemList *add_type_options = nullptr; + ConfirmationDialog *add_type_confirmation = nullptr; void _dialog_about_to_show(); void ok_pressed() override; @@ -332,22 +332,22 @@ class ThemeTypeEditor : public MarginContainer { LeadingStylebox leading_stylebox; - OptionButton *theme_type_list; - Button *add_type_button; + OptionButton *theme_type_list = nullptr; + Button *add_type_button = nullptr; - CheckButton *show_default_items_button; + CheckButton *show_default_items_button = nullptr; - TabContainer *data_type_tabs; - VBoxContainer *color_items_list; - VBoxContainer *constant_items_list; - VBoxContainer *font_items_list; - VBoxContainer *font_size_items_list; - VBoxContainer *icon_items_list; - VBoxContainer *stylebox_items_list; + TabContainer *data_type_tabs = nullptr; + VBoxContainer *color_items_list = nullptr; + VBoxContainer *constant_items_list = nullptr; + VBoxContainer *font_items_list = nullptr; + VBoxContainer *font_size_items_list = nullptr; + VBoxContainer *icon_items_list = nullptr; + VBoxContainer *stylebox_items_list = nullptr; - LineEdit *type_variation_edit; - Button *type_variation_button; - Label *type_variation_locked; + LineEdit *type_variation_edit = nullptr; + Button *type_variation_button = nullptr; + Label *type_variation_locked = nullptr; enum TypeDialogMode { ADD_THEME_TYPE, @@ -355,10 +355,10 @@ class ThemeTypeEditor : public MarginContainer { }; TypeDialogMode add_type_mode = ADD_THEME_TYPE; - ThemeTypeDialog *add_type_dialog; + ThemeTypeDialog *add_type_dialog = nullptr; Vector<Control *> focusables; - Timer *update_debounce_timer; + Timer *update_debounce_timer = nullptr; VBoxContainer *_create_item_list(Theme::DataType p_data_type); void _update_type_list(); @@ -417,15 +417,15 @@ class ThemeEditor : public VBoxContainer { Ref<Theme> theme; - TabBar *preview_tabs; - PanelContainer *preview_tabs_content; - Button *add_preview_button; - EditorFileDialog *preview_scene_dialog; + TabBar *preview_tabs = nullptr; + PanelContainer *preview_tabs_content = nullptr; + Button *add_preview_button = nullptr; + EditorFileDialog *preview_scene_dialog = nullptr; - ThemeTypeEditor *theme_type_editor; + ThemeTypeEditor *theme_type_editor = nullptr; - Label *theme_name; - ThemeItemEditorDialog *theme_edit_dialog; + Label *theme_name = nullptr; + ThemeItemEditorDialog *theme_edit_dialog = nullptr; void _theme_save_button_cbk(bool p_save_as); void _theme_edit_button_cbk(); @@ -452,8 +452,8 @@ public: class ThemeEditorPlugin : public EditorPlugin { GDCLASS(ThemeEditorPlugin, EditorPlugin); - ThemeEditor *theme_editor; - Button *button; + ThemeEditor *theme_editor = nullptr; + Button *button = nullptr; public: virtual String get_name() const override { return "Theme"; } diff --git a/editor/plugins/theme_editor_preview.h b/editor/plugins/theme_editor_preview.h index 48111df399..d05916afae 100644 --- a/editor/plugins/theme_editor_preview.h +++ b/editor/plugins/theme_editor_preview.h @@ -41,10 +41,10 @@ class ThemeEditorPreview : public VBoxContainer { GDCLASS(ThemeEditorPreview, VBoxContainer); - ScrollContainer *preview_container; - ColorRect *preview_bg; - MarginContainer *preview_overlay; - Control *picker_overlay; + ScrollContainer *preview_container = nullptr; + ColorRect *preview_bg = nullptr; + MarginContainer *preview_overlay = nullptr; + Control *picker_overlay = nullptr; Control *hovered_control = nullptr; struct ThemeCache { @@ -69,9 +69,9 @@ class ThemeEditorPreview : public VBoxContainer { void _reset_picker_overlay(); protected: - HBoxContainer *preview_toolbar; - MarginContainer *preview_content; - Button *picker_button; + HBoxContainer *preview_toolbar = nullptr; + MarginContainer *preview_content = nullptr; + Button *picker_button = nullptr; void add_preview_overlay(Control *p_overlay); @@ -96,7 +96,7 @@ class SceneThemeEditorPreview : public ThemeEditorPreview { Ref<PackedScene> loaded_scene; - Button *reload_scene_button; + Button *reload_scene_button = nullptr; void _reload_scene(); diff --git a/editor/plugins/tiles/atlas_merging_dialog.h b/editor/plugins/tiles/atlas_merging_dialog.h index 6cf555247d..9502d93f6b 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.h +++ b/editor/plugins/tiles/atlas_merging_dialog.h @@ -49,19 +49,19 @@ private: LocalVector<Map<Vector2i, Vector2i>> merged_mapping; Ref<TileSet> tile_set; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; // Settings. int next_line_after_column = 30; // GUI. - ItemList *atlas_merging_atlases_list; - EditorPropertyVector2i *texture_region_size_editor_property; - EditorPropertyInteger *columns_editor_property; - TextureRect *preview; - Label *select_2_atlases_label; - EditorFileDialog *editor_file_dialog; - Button *merge_button; + ItemList *atlas_merging_atlases_list = nullptr; + EditorPropertyVector2i *texture_region_size_editor_property = nullptr; + EditorPropertyInteger *columns_editor_property = nullptr; + TextureRect *preview = nullptr; + Label *select_2_atlases_label = nullptr; + EditorFileDialog *editor_file_dialog = nullptr; + Button *merge_button = nullptr; void _property_changed(const StringName &p_property, const Variant &p_value, const String &p_field, bool p_changing); diff --git a/editor/plugins/tiles/tile_atlas_view.h b/editor/plugins/tiles/tile_atlas_view.h index caf3ef9e4b..6e74858b08 100644 --- a/editor/plugins/tiles/tile_atlas_view.h +++ b/editor/plugins/tiles/tile_atlas_view.h @@ -45,8 +45,8 @@ class TileAtlasView : public Control { GDCLASS(TileAtlasView, Control); private: - TileSet *tile_set; - TileSetAtlasSource *tile_set_atlas_source; + TileSet *tile_set = nullptr; + TileSetAtlasSource *tile_set_atlas_source = nullptr; int source_id = TileSet::INVALID_SOURCE; enum DragType { @@ -55,9 +55,9 @@ private: }; DragType drag_type = DRAG_TYPE_NONE; float previous_zoom = 1.0; - EditorZoomWidget *zoom_widget; - Button *button_center_view; - CenterContainer *center_container; + EditorZoomWidget *zoom_widget = nullptr; + Button *button_center_view = nullptr; + CenterContainer *center_container = nullptr; Vector2 panning; void _update_zoom_and_panning(bool p_zoom_on_mouse_pos = false); void _zoom_widget_changed(); @@ -72,41 +72,41 @@ private: Map<Vector2, Map<int, Rect2i>> alternative_tiles_rect_cache; void _update_alternative_tiles_rect_cache(); - MarginContainer *margin_container; + MarginContainer *margin_container = nullptr; int margin_container_paddings[4] = { 0, 0, 0, 0 }; - HBoxContainer *hbox; - Label *missing_source_label; + HBoxContainer *hbox = nullptr; + Label *missing_source_label = nullptr; // Background - Control *background_left; + Control *background_left = nullptr; void _draw_background_left(); - Control *background_right; + Control *background_right = nullptr; void _draw_background_right(); // Left side. - Control *base_tiles_root_control; + Control *base_tiles_root_control = nullptr; void _base_tiles_root_control_gui_input(const Ref<InputEvent> &p_event); - Control *base_tiles_drawing_root; + Control *base_tiles_drawing_root = nullptr; - Control *base_tiles_draw; + Control *base_tiles_draw = nullptr; void _draw_base_tiles(); - Control *base_tiles_texture_grid; + Control *base_tiles_texture_grid = nullptr; void _draw_base_tiles_texture_grid(); - Control *base_tiles_shape_grid; + Control *base_tiles_shape_grid = nullptr; void _draw_base_tiles_shape_grid(); Size2i _compute_base_tiles_control_size(); // Right side. - Control *alternative_tiles_root_control; + Control *alternative_tiles_root_control = nullptr; void _alternative_tiles_root_control_gui_input(const Ref<InputEvent> &p_event); - Control *alternative_tiles_drawing_root; + Control *alternative_tiles_drawing_root = nullptr; - Control *alternatives_draw; + Control *alternatives_draw = nullptr; void _draw_alternatives(); Size2i _compute_alternative_tiles_control_size(); diff --git a/editor/plugins/tiles/tile_data_editors.h b/editor/plugins/tiles/tile_data_editors.h index 99724760a7..3ac9eacb05 100644 --- a/editor/plugins/tiles/tile_data_editors.h +++ b/editor/plugins/tiles/tile_data_editors.h @@ -93,7 +93,7 @@ private: bool multiple_polygon_mode = false; bool use_undo_redo = true; - UndoRedo *editor_undo_redo; + UndoRedo *editor_undo_redo = nullptr; // UI int hovered_polygon_index = -1; @@ -113,20 +113,20 @@ private: Vector2 drag_last_pos; PackedVector2Array drag_old_polygon; - HBoxContainer *toolbar; + HBoxContainer *toolbar = nullptr; Ref<ButtonGroup> tools_button_group; - Button *button_create; - Button *button_edit; - Button *button_delete; - Button *button_pixel_snap; - MenuButton *button_advanced_menu; + Button *button_create = nullptr; + Button *button_edit = nullptr; + Button *button_delete = nullptr; + Button *button_pixel_snap = nullptr; + MenuButton *button_advanced_menu = nullptr; Vector<Point2> in_creation_polygon; - Panel *panel; - Control *base_control; - EditorZoomWidget *editor_zoom_widget; - Button *button_center_view; + Panel *panel = nullptr; + Control *base_control = nullptr; + EditorZoomWidget *editor_zoom_widget = nullptr; + Button *button_center_view = nullptr; Vector2 panning; Ref<Texture2D> background_texture; @@ -188,12 +188,12 @@ class TileDataDefaultEditor : public TileDataEditor { private: // Toolbar HBoxContainer *toolbar = memnew(HBoxContainer); - Button *picker_button; + Button *picker_button = nullptr; // UI Ref<Texture2D> tile_bool_checked; Ref<Texture2D> tile_bool_unchecked; - Label *label; + Label *label = nullptr; EditorProperty *property_editor = nullptr; @@ -214,7 +214,7 @@ private: protected: DummyObject *dummy_object = memnew(DummyObject); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; StringName type; String property; @@ -268,7 +268,7 @@ private: int occlusion_layer = -1; // UI - GenericTilePolygonEditor *polygon_editor; + GenericTilePolygonEditor *polygon_editor = nullptr; void _polygon_changed(PackedVector2Array p_polygon); @@ -279,7 +279,7 @@ private: virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _tile_set_changed() override; @@ -299,7 +299,7 @@ class TileDataCollisionEditor : public TileDataDefaultEditor { int physics_layer = -1; // UI - GenericTilePolygonEditor *polygon_editor; + GenericTilePolygonEditor *polygon_editor = nullptr; DummyObject *dummy_object = memnew(DummyObject); Map<StringName, EditorProperty *> property_editors; @@ -314,7 +314,7 @@ class TileDataCollisionEditor : public TileDataDefaultEditor { virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _tile_set_changed() override; @@ -335,7 +335,7 @@ class TileDataTerrainsEditor : public TileDataEditor { private: // Toolbar HBoxContainer *toolbar = memnew(HBoxContainer); - Button *picker_button; + Button *picker_button = nullptr; // Painting state. enum DragType { @@ -352,7 +352,7 @@ private: Variant drag_painted_value; // UI - Label *label; + Label *label = nullptr; DummyObject *dummy_object = memnew(DummyObject); EditorPropertyEnum *terrain_set_property_editor = nullptr; EditorPropertyEnum *terrain_property_editor = nullptr; @@ -366,7 +366,7 @@ protected: void _notification(int p_what); - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; public: virtual Control *get_toolbar() override { return toolbar; }; @@ -388,7 +388,7 @@ private: PackedVector2Array navigation_polygon; // UI - GenericTilePolygonEditor *polygon_editor; + GenericTilePolygonEditor *polygon_editor = nullptr; void _polygon_changed(PackedVector2Array p_polygon); @@ -399,7 +399,7 @@ private: virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, Map<TileMapCell, Variant> p_previous_values, Variant p_new_value) override; protected: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; virtual void _tile_set_changed() override; diff --git a/editor/plugins/tiles/tile_map_editor.h b/editor/plugins/tiles/tile_map_editor.h index d09061015f..3a0293f48f 100644 --- a/editor/plugins/tiles/tile_map_editor.h +++ b/editor/plugins/tiles/tile_map_editor.h @@ -51,8 +51,8 @@ class UndoRedo; class TileMapEditorPlugin : public Object { public: struct TabData { - Control *toolbar; - Control *panel; + Control *toolbar = nullptr; + Control *panel = nullptr; }; virtual Vector<TabData> get_tabs() const { @@ -69,33 +69,33 @@ class TileMapEditorTilesPlugin : public TileMapEditorPlugin { GDCLASS(TileMapEditorTilesPlugin, TileMapEditorPlugin); private: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; ObjectID tile_map_id; int tile_map_layer = -1; virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) override; ///// Toolbar ///// - HBoxContainer *toolbar; + HBoxContainer *toolbar = nullptr; Ref<ButtonGroup> tool_buttons_group; - Button *select_tool_button; - Button *paint_tool_button; - Button *line_tool_button; - Button *rect_tool_button; - Button *bucket_tool_button; + Button *select_tool_button = nullptr; + Button *paint_tool_button = nullptr; + Button *line_tool_button = nullptr; + Button *rect_tool_button = nullptr; + Button *bucket_tool_button = nullptr; - HBoxContainer *tools_settings; + HBoxContainer *tools_settings = nullptr; - VSeparator *tools_settings_vsep; - Button *picker_button; - Button *erase_button; + VSeparator *tools_settings_vsep = nullptr; + Button *picker_button = nullptr; + Button *erase_button = nullptr; - VSeparator *tools_settings_vsep_2; - CheckBox *bucket_contiguous_checkbox; - CheckBox *random_tile_checkbox; + VSeparator *tools_settings_vsep_2 = nullptr; + CheckBox *bucket_contiguous_checkbox = nullptr; + CheckBox *random_tile_checkbox = nullptr; float scattering = 0.0; - Label *scatter_label; - SpinBox *scatter_spinbox; + Label *scatter_label = nullptr; + SpinBox *scatter_spinbox = nullptr; void _on_random_tile_checkbox_toggled(bool p_pressed); void _on_scattering_spinbox_changed(double p_value); @@ -148,12 +148,12 @@ private: void _tab_changed(); ///// Bottom panel tiles //// - VBoxContainer *tiles_bottom_panel; - Label *missing_source_label; - Label *invalid_source_label; + VBoxContainer *tiles_bottom_panel = nullptr; + Label *missing_source_label = nullptr; + Label *invalid_source_label = nullptr; - ItemList *sources_list; - MenuButton *source_sort_button; + ItemList *sources_list = nullptr; + MenuButton *source_sort_button = nullptr; Ref<Texture2D> missing_atlas_texture_icon; void _update_tile_set_sources_list(); @@ -162,18 +162,18 @@ private: // Atlas sources. TileMapCell hovered_tile; - TileAtlasView *tile_atlas_view; - HSplitContainer *atlas_sources_split_container; + TileAtlasView *tile_atlas_view = nullptr; + HSplitContainer *atlas_sources_split_container = nullptr; bool tile_set_dragging_selection = false; Vector2i tile_set_drag_start_mouse_pos; - Control *tile_atlas_control; + Control *tile_atlas_control = nullptr; void _tile_atlas_control_mouse_exited(); void _tile_atlas_control_gui_input(const Ref<InputEvent> &p_event); void _tile_atlas_control_draw(); - Control *alternative_tiles_control; + Control *alternative_tiles_control = nullptr; void _tile_alternatives_control_draw(); void _tile_alternatives_control_mouse_exited(); void _tile_alternatives_control_gui_input(const Ref<InputEvent> &p_event); @@ -182,7 +182,7 @@ private: void _set_source_sort(int p_sort); // Scenes collection sources. - ItemList *scene_tiles_list; + ItemList *scene_tiles_list = nullptr; void _update_scenes_collection_view(); void _scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud); @@ -190,9 +190,9 @@ private: void _scenes_list_nothing_selected(); ///// Bottom panel patterns //// - VBoxContainer *patterns_bottom_panel; - ItemList *patterns_item_list; - Label *patterns_help_label; + VBoxContainer *patterns_bottom_panel = nullptr; + ItemList *patterns_item_list = nullptr; + Label *patterns_help_label = nullptr; void _patterns_item_list_gui_input(const Ref<InputEvent> &p_event); void _pattern_preview_done(Ref<TileMapPattern> p_pattern, Ref<Texture2D> p_texture); bool select_last_pattern = false; @@ -220,32 +220,32 @@ class TileMapEditorTerrainsPlugin : public TileMapEditorPlugin { GDCLASS(TileMapEditorTerrainsPlugin, TileMapEditorPlugin); private: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; ObjectID tile_map_id; int tile_map_layer = -1; virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) override; // Toolbar. - HBoxContainer *toolbar; + HBoxContainer *toolbar = nullptr; Ref<ButtonGroup> tool_buttons_group; - Button *paint_tool_button; - Button *line_tool_button; - Button *rect_tool_button; - Button *bucket_tool_button; + Button *paint_tool_button = nullptr; + Button *line_tool_button = nullptr; + Button *rect_tool_button = nullptr; + Button *bucket_tool_button = nullptr; - HBoxContainer *tools_settings; + HBoxContainer *tools_settings = nullptr; - VSeparator *tools_settings_vsep; - Button *picker_button; - Button *erase_button; + VSeparator *tools_settings_vsep = nullptr; + Button *picker_button = nullptr; + Button *erase_button = nullptr; - VSeparator *tools_settings_vsep_2; - CheckBox *bucket_contiguous_checkbox; + VSeparator *tools_settings_vsep_2 = nullptr; + CheckBox *bucket_contiguous_checkbox = nullptr; void _update_toolbar(); // Main vbox. - VBoxContainer *main_vbox_container; + VBoxContainer *main_vbox_container = nullptr; // TileMap editing. bool has_mouse = false; @@ -278,8 +278,8 @@ private: void _update_selection(); // Bottom panel. - Tree *terrains_tree; - ItemList *terrains_tile_list; + Tree *terrains_tree = nullptr; + ItemList *terrains_tile_list = nullptr; // Cache. LocalVector<LocalVector<Set<TileSet::TerrainsPattern>>> per_terrain_terrains_patterns; @@ -306,7 +306,7 @@ class TileMapEditor : public VBoxContainer { GDCLASS(TileMapEditor, VBoxContainer); private: - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool tileset_changed_needs_update = false; ObjectID tile_map_id; int tile_map_layer = -1; @@ -315,24 +315,24 @@ private: Vector<TileMapEditorPlugin *> tile_map_editor_plugins; // Toolbar. - HBoxContainer *tile_map_toolbar; + HBoxContainer *tile_map_toolbar = nullptr; - PopupMenu *layers_selection_popup; - Button *layers_selection_button; - Button *toogle_highlight_selected_layer_button; + PopupMenu *layers_selection_popup = nullptr; + Button *layers_selection_button = nullptr; + Button *toogle_highlight_selected_layer_button = nullptr; void _layers_selection_button_draw(); void _layers_selection_button_pressed(); void _layers_selection_id_pressed(int p_id); - Button *toggle_grid_button; + Button *toggle_grid_button = nullptr; void _on_grid_toggled(bool p_pressed); - MenuButton *advanced_menu_button; + MenuButton *advanced_menu_button = nullptr; void _advanced_menu_button_id_pressed(int p_id); // Bottom panel. - Label *missing_tileset_label; - TabBar *tabs_bar; + Label *missing_tileset_label = nullptr; + TabBar *tabs_bar = nullptr; LocalVector<TileMapEditorPlugin::TabData> tabs_data; LocalVector<TileMapEditorPlugin *> tabs_plugins; void _update_bottom_panel(); diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.h b/editor/plugins/tiles/tile_proxies_manager_dialog.h index 3f1461391e..00866544be 100644 --- a/editor/plugins/tiles/tile_proxies_manager_dialog.h +++ b/editor/plugins/tiles/tile_proxies_manager_dialog.h @@ -43,24 +43,24 @@ private: int commited_actions_count = 0; Ref<TileSet> tile_set; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; TileMapCell from; TileMapCell to; // GUI - ItemList *source_level_list; - ItemList *coords_level_list; - ItemList *alternative_level_list; + ItemList *source_level_list = nullptr; + ItemList *coords_level_list = nullptr; + ItemList *alternative_level_list = nullptr; - EditorPropertyInteger *source_from_property_editor; - EditorPropertyVector2i *coords_from_property_editor; - EditorPropertyInteger *alternative_from_property_editor; - EditorPropertyInteger *source_to_property_editor; - EditorPropertyVector2i *coords_to_property_editor; - EditorPropertyInteger *alternative_to_property_editor; + EditorPropertyInteger *source_from_property_editor = nullptr; + EditorPropertyVector2i *coords_from_property_editor = nullptr; + EditorPropertyInteger *alternative_from_property_editor = nullptr; + EditorPropertyInteger *source_to_property_editor = nullptr; + EditorPropertyVector2i *coords_to_property_editor = nullptr; + EditorPropertyInteger *alternative_to_property_editor = nullptr; - PopupMenu *popup_menu; + PopupMenu *popup_menu = nullptr; void _right_clicked(int p_item, Vector2 p_local_mouse_pos, Object *p_item_list); void _menu_id_pressed(int p_id); void _delete_selected_bindings(); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.h b/editor/plugins/tiles/tile_set_atlas_source_editor.h index 4a90b821f8..b26b7edbfa 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.h +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.h @@ -85,7 +85,7 @@ public: GDCLASS(AtlasTileProxyObject, Object); private: - TileSetAtlasSourceEditor *tiles_set_atlas_source_editor; + TileSetAtlasSourceEditor *tiles_set_atlas_source_editor = nullptr; TileSetAtlasSource *tile_set_atlas_source = nullptr; Set<TileSelection> tiles = Set<TileSelection>(); @@ -114,16 +114,16 @@ private: TileSetAtlasSource *tile_set_atlas_source = nullptr; int tile_set_atlas_source_id = TileSet::INVALID_SOURCE; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool tile_set_changed_needs_update = false; // -- Properties painting -- - VBoxContainer *tile_data_painting_editor_container; - Label *tile_data_editors_label; - Button *tile_data_editor_dropdown_button; - Popup *tile_data_editors_popup; - Tree *tile_data_editors_tree; + VBoxContainer *tile_data_painting_editor_container = nullptr; + Label *tile_data_editors_label = nullptr; + Button *tile_data_editor_dropdown_button = nullptr; + Popup *tile_data_editors_popup = nullptr; + Tree *tile_data_editors_tree = nullptr; void _tile_data_editor_dropdown_button_draw(); void _tile_data_editor_dropdown_button_pressed(); @@ -135,21 +135,21 @@ private: void _tile_data_editors_tree_selected(); // -- Inspector -- - AtlasTileProxyObject *tile_proxy_object; - Label *tile_inspector_label; - EditorInspector *tile_inspector; - Label *tile_inspector_no_tile_selected_label; + AtlasTileProxyObject *tile_proxy_object = nullptr; + Label *tile_inspector_label = nullptr; + EditorInspector *tile_inspector = nullptr; + Label *tile_inspector_no_tile_selected_label = nullptr; String selected_property; void _inspector_property_selected(String p_property); - TileSetAtlasSourceProxyObject *atlas_source_proxy_object; - Label *atlas_source_inspector_label; - EditorInspector *atlas_source_inspector; + TileSetAtlasSourceProxyObject *atlas_source_proxy_object = nullptr; + Label *atlas_source_inspector_label = nullptr; + EditorInspector *atlas_source_inspector = nullptr; // -- Atlas view -- - HBoxContainer *toolbox; - Label *tile_atlas_view_missing_source_label; - TileAtlasView *tile_atlas_view; + HBoxContainer *toolbox = nullptr; + Label *tile_atlas_view_missing_source_label = nullptr; + TileAtlasView *tile_atlas_view = nullptr; // Dragging enum DragType { @@ -202,17 +202,17 @@ private: // Tool buttons. Ref<ButtonGroup> tools_button_group; - Button *tool_setup_atlas_source_button; - Button *tool_select_button; - Button *tool_paint_button; - Label *tool_tile_id_label; + Button *tool_setup_atlas_source_button = nullptr; + Button *tool_select_button = nullptr; + Button *tool_paint_button = nullptr; + Label *tool_tile_id_label = nullptr; // Tool settings. - HBoxContainer *tool_settings; - VSeparator *tool_settings_vsep; - HBoxContainer *tool_settings_tile_data_toolbar_container; - Button *tools_settings_erase_button; - MenuButton *tool_advanced_menu_buttom; + HBoxContainer *tool_settings = nullptr; + VSeparator *tool_settings_vsep = nullptr; + HBoxContainer *tool_settings_tile_data_toolbar_container = nullptr; + Button *tools_settings_erase_button = nullptr; + MenuButton *tool_advanced_menu_buttom = nullptr; // Selection. Set<TileSelection> selection; @@ -223,12 +223,12 @@ private: // A control on the tile atlas to draw and handle input events. Vector2i hovered_base_tile_coords = TileSetSource::INVALID_ATLAS_COORDS; - PopupMenu *base_tile_popup_menu; - PopupMenu *empty_base_tile_popup_menu; + PopupMenu *base_tile_popup_menu = nullptr; + PopupMenu *empty_base_tile_popup_menu = nullptr; Ref<Texture2D> resize_handle; Ref<Texture2D> resize_handle_disabled; - Control *tile_atlas_control; - Control *tile_atlas_control_unscaled; + Control *tile_atlas_control = nullptr; + Control *tile_atlas_control_unscaled = nullptr; void _tile_atlas_control_draw(); void _tile_atlas_control_unscaled_draw(); void _tile_atlas_control_mouse_exited(); @@ -238,9 +238,9 @@ private: // A control over the alternative tiles. Vector3i hovered_alternative_tile_coords = Vector3i(TileSetSource::INVALID_ATLAS_COORDS.x, TileSetSource::INVALID_ATLAS_COORDS.y, TileSetSource::INVALID_TILE_ALTERNATIVE); - PopupMenu *alternative_tile_popup_menu; - Control *alternative_tiles_control; - Control *alternative_tiles_control_unscaled; + PopupMenu *alternative_tile_popup_menu = nullptr; + Control *alternative_tiles_control = nullptr; + Control *alternative_tiles_control_unscaled = nullptr; void _tile_alternatives_control_draw(); void _tile_alternatives_control_unscaled_draw(); void _tile_alternatives_control_mouse_exited(); @@ -264,7 +264,7 @@ private: // -- Misc -- void _auto_create_tiles(); void _auto_remove_tiles(); - AcceptDialog *confirm_auto_create_tiles; + AcceptDialog *confirm_auto_create_tiles = nullptr; void _tile_set_changed(); void _tile_proxy_object_changed(String p_what); @@ -293,7 +293,7 @@ class EditorPropertyTilePolygon : public EditorProperty { void _add_focusable_children(Node *p_node); - GenericTilePolygonEditor *generic_tile_polygon_editor; + GenericTilePolygonEditor *generic_tile_polygon_editor = nullptr; void _polygons_changed(); public: diff --git a/editor/plugins/tiles/tile_set_editor.h b/editor/plugins/tiles/tile_set_editor.h index b79b37cf2e..e633de37b0 100644 --- a/editor/plugins/tiles/tile_set_editor.h +++ b/editor/plugins/tiles/tile_set_editor.h @@ -47,18 +47,18 @@ class TileSetEditor : public VBoxContainer { private: Ref<TileSet> tile_set; bool tile_set_changed_needs_update = false; - HSplitContainer *split_container; + HSplitContainer *split_container = nullptr; // TabBar. - HBoxContainer *tile_set_toolbar; - TabBar *tabs_bar; + HBoxContainer *tile_set_toolbar = nullptr; + TabBar *tabs_bar = nullptr; // Tiles. - Label *no_source_selected_label; - TileSetAtlasSourceEditor *tile_set_atlas_source_editor; - TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor; + Label *no_source_selected_label = nullptr; + TileSetAtlasSourceEditor *tile_set_atlas_source_editor = nullptr; + TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor = nullptr; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; void _drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; @@ -66,11 +66,11 @@ private: void _update_sources_list(int force_selected_id = -1); // Sources management. - Button *sources_delete_button; - MenuButton *sources_add_button; - MenuButton *source_sort_button; - MenuButton *sources_advanced_menu_button; - ItemList *sources_list; + Button *sources_delete_button = nullptr; + MenuButton *sources_add_button = nullptr; + MenuButton *source_sort_button = nullptr; + MenuButton *sources_advanced_menu_button = nullptr; + ItemList *sources_list = nullptr; Ref<Texture2D> missing_texture_texture; void _source_selected(int p_source_index); void _source_delete_pressed(); @@ -78,12 +78,12 @@ private: void _sources_advanced_menu_id_pressed(int p_id_pressed); void _set_source_sort(int p_sort); - AtlasMergingDialog *atlas_merging_dialog; - TileProxiesManagerDialog *tile_proxies_manager_dialog; + AtlasMergingDialog *atlas_merging_dialog = nullptr; + TileProxiesManagerDialog *tile_proxies_manager_dialog = nullptr; // Patterns. - ItemList *patterns_item_list; - Label *patterns_help_label; + ItemList *patterns_item_list = nullptr; + Label *patterns_help_label = nullptr; void _patterns_item_list_gui_input(const Ref<InputEvent> &p_event); void _pattern_preview_done(Ref<TileMapPattern> p_pattern, Ref<Texture2D> p_texture); bool select_last_pattern = false; diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h index 8904e8524a..657bfca032 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h @@ -70,7 +70,7 @@ private: GDCLASS(SceneTileProxyObject, Object); private: - TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor; + TileSetScenesCollectionSourceEditor *tile_set_scenes_collection_source_editor = nullptr; TileSetScenesCollectionSource *tile_set_scenes_collection_source = nullptr; int source_id; @@ -97,23 +97,23 @@ private: TileSetScenesCollectionSource *tile_set_scenes_collection_source = nullptr; int tile_set_source_id = -1; - UndoRedo *undo_redo; + UndoRedo *undo_redo = nullptr; bool tile_set_scenes_collection_source_changed_needs_update = false; // Source inspector. - TileSetScenesCollectionProxyObject *scenes_collection_source_proxy_object; - Label *scenes_collection_source_inspector_label; - EditorInspector *scenes_collection_source_inspector; + TileSetScenesCollectionProxyObject *scenes_collection_source_proxy_object = nullptr; + Label *scenes_collection_source_inspector_label = nullptr; + EditorInspector *scenes_collection_source_inspector = nullptr; // Tile inspector. - SceneTileProxyObject *tile_proxy_object; - Label *tile_inspector_label; - EditorInspector *tile_inspector; + SceneTileProxyObject *tile_proxy_object = nullptr; + Label *tile_inspector_label = nullptr; + EditorInspector *tile_inspector = nullptr; - ItemList *scene_tiles_list; - Button *scene_tile_add_button; - Button *scene_tile_delete_button; + ItemList *scene_tiles_list = nullptr; + Button *scene_tile_add_button = nullptr; + Button *scene_tile_delete_button = nullptr; void _tile_set_scenes_collection_source_changed(); void _scenes_collection_source_proxy_object_changed(String p_what); diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index 4aabe0e6b7..543304346e 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -56,7 +56,7 @@ void TilesEditorPlugin::_pattern_preview_done() { } void TilesEditorPlugin::_thread_func(void *ud) { - TilesEditorPlugin *te = (TilesEditorPlugin *)ud; + TilesEditorPlugin *te = static_cast<TilesEditorPlugin *>(ud); te->_thread(); } diff --git a/editor/plugins/tiles/tiles_editor_plugin.h b/editor/plugins/tiles/tiles_editor_plugin.h index eeff4da4e9..a22e782b34 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.h +++ b/editor/plugins/tiles/tiles_editor_plugin.h @@ -57,11 +57,11 @@ private: ObjectID tile_map_id; Ref<TileSet> tile_set; - Button *tilemap_editor_button; - TileMapEditor *tilemap_editor; + Button *tilemap_editor_button = nullptr; + TileMapEditor *tilemap_editor = nullptr; - Button *tileset_editor_button; - TileSetEditor *tileset_editor; + Button *tileset_editor_button = nullptr; + TileSetEditor *tileset_editor = nullptr; void _update_editors(); diff --git a/editor/plugins/version_control_editor_plugin.h b/editor/plugins/version_control_editor_plugin.h index 956c5a334f..39a56de772 100644 --- a/editor/plugins/version_control_editor_plugin.h +++ b/editor/plugins/version_control_editor_plugin.h @@ -57,48 +57,48 @@ private: int staged_files_count; List<StringName> available_addons; - PopupMenu *version_control_actions; - ConfirmationDialog *metadata_dialog; - OptionButton *metadata_selection; - AcceptDialog *set_up_dialog; - VBoxContainer *set_up_vbc; - HBoxContainer *set_up_hbc; - Label *set_up_vcs_label; - OptionButton *set_up_choice; - PanelContainer *set_up_init_settings; - Button *set_up_init_button; - RichTextLabel *set_up_vcs_status; - Button *set_up_ok_button; + PopupMenu *version_control_actions = nullptr; + ConfirmationDialog *metadata_dialog = nullptr; + OptionButton *metadata_selection = nullptr; + AcceptDialog *set_up_dialog = nullptr; + VBoxContainer *set_up_vbc = nullptr; + HBoxContainer *set_up_hbc = nullptr; + Label *set_up_vcs_label = nullptr; + OptionButton *set_up_choice = nullptr; + PanelContainer *set_up_init_settings = nullptr; + Button *set_up_init_button = nullptr; + RichTextLabel *set_up_vcs_status = nullptr; + Button *set_up_ok_button = nullptr; HashMap<ChangeType, String> change_type_to_strings; HashMap<ChangeType, Color> change_type_to_color; - VBoxContainer *version_commit_dock; - VBoxContainer *commit_box_vbc; - HSplitContainer *stage_tools; - Tree *stage_files; - TreeItem *new_files; - TreeItem *modified_files; - TreeItem *renamed_files; - TreeItem *deleted_files; - TreeItem *typechange_files; - Label *staging_area_label; - HSplitContainer *stage_buttons; - Button *stage_all_button; - Button *stage_selected_button; - Button *refresh_button; - TextEdit *commit_message; - Button *commit_button; - Label *commit_status; - - PanelContainer *version_control_dock; - Button *version_control_dock_button; - VBoxContainer *diff_vbc; - HBoxContainer *diff_hbc; - Button *diff_refresh_button; - Label *diff_file_name; - Label *diff_heading; - RichTextLabel *diff; + VBoxContainer *version_commit_dock = nullptr; + VBoxContainer *commit_box_vbc = nullptr; + HSplitContainer *stage_tools = nullptr; + Tree *stage_files = nullptr; + TreeItem *new_files = nullptr; + TreeItem *modified_files = nullptr; + TreeItem *renamed_files = nullptr; + TreeItem *deleted_files = nullptr; + TreeItem *typechange_files = nullptr; + Label *staging_area_label = nullptr; + HSplitContainer *stage_buttons = nullptr; + Button *stage_all_button = nullptr; + Button *stage_selected_button = nullptr; + Button *refresh_button = nullptr; + TextEdit *commit_message = nullptr; + Button *commit_button = nullptr; + Label *commit_status = nullptr; + + PanelContainer *version_control_dock = nullptr; + Button *version_control_dock_button = nullptr; + VBoxContainer *diff_vbc = nullptr; + HBoxContainer *diff_hbc = nullptr; + Button *diff_refresh_button = nullptr; + Label *diff_file_name = nullptr; + Label *diff_heading = nullptr; + RichTextLabel *diff = nullptr; void _populate_available_vcs_names(); void _create_vcs_metadata_files(); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 50773836db..1e7648bc43 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -2061,10 +2061,8 @@ void VisualShaderEditor::_set_node_size(int p_type, int p_node, const Vector2 &p if (!expression_node.is_null() && text_box) { Size2 box_size = size; - if (gn != nullptr) { - if (box_size.x < 150 * EDSCALE || box_size.y < 0) { - box_size.x = gn->get_size().x; - } + if (box_size.x < 150 * EDSCALE || box_size.y < 0) { + box_size.x = gn->get_size().x; } box_size.x -= text_box->get_offset(SIDE_LEFT); box_size.x -= 28 * EDSCALE; @@ -4945,198 +4943,198 @@ VisualShaderEditor::VisualShaderEditor() { // INPUT - const String input_param_shader_modes = TTR("'%s' input parameter for all shader modes."); + const String translation_gdsl = "\n\n" + TTR("Translated to '%s' in Godot Shading Language."); + const String input_param_shader_modes = TTR("'%s' input parameter for all shader modes.") + translation_gdsl; // NODE3D-FOR-ALL - add_options.push_back(AddOption("InvProjectionMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "inv_projection_matrix"), { "inv_projection_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("InvViewMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "inv_view_matrix"), { "inv_view_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ModelMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "model_matrix"), { "model_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Normal", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "normal"), { "normal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("OutputIsSRGB", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "output_is_srgb"), { "output_is_srgb" }, VisualShaderNode::PORT_TYPE_BOOLEAN, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ProjectionMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "projection_matrix"), { "projection_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Time", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "time"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("UV", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "uv"), { "uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("UV2", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "uv2"), { "uv2" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "view_matrix"), { "view_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewportSize", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "viewport_size"), { "viewport_size" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("InvProjectionMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "inv_projection_matrix", "INV_PROJECTION_MATRIX"), { "inv_projection_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("InvViewMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "inv_view_matrix", "INV_VIEW_MATRIX"), { "inv_view_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ModelMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "model_matrix", "MODEL_MATRIX"), { "model_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Normal", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "normal", "NORMAL"), { "normal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("OutputIsSRGB", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "output_is_srgb", "OUTPUT_IS_SRGB"), { "output_is_srgb" }, VisualShaderNode::PORT_TYPE_BOOLEAN, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ProjectionMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "projection_matrix", "PROJECTION_MATRIX"), { "projection_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Time", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "time", "TIME"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("UV", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "uv", "UV"), { "uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("UV2", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "uv2", "UV2"), { "uv2" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewMatrix", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "view_matrix", "VIEW_MATRIX"), { "view_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewportSize", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "viewport_size", "VIEWPORT_SIZE"), { "viewport_size" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_SPATIAL)); // CANVASITEM-FOR-ALL - add_options.push_back(AddOption("Alpha", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "alpha"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Color", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "color"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("TexturePixelSize", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "texture_pixel_size"), { "texture_pixel_size" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Time", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "time"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("UV", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "uv"), { "uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Alpha", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "alpha", "COLOR.a"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Color", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "color", "COLOR.rgb"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("TexturePixelSize", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "texture_pixel_size", "TEXTURE_PIXEL_SIZE"), { "texture_pixel_size" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Time", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "time", "TIME"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("UV", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "uv", "UV"), { "uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, -1, Shader::MODE_CANVAS_ITEM)); // PARTICLES-FOR-ALL - add_options.push_back(AddOption("Active", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "active"), { "active" }, VisualShaderNode::PORT_TYPE_BOOLEAN, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Alpha", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "alpha"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("AttractorForce", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "attractor_force"), { "attractor_force" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Color", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "color"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Custom", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "custom"), { "custom" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("CustomAlpha", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "custom_alpha"), { "custom_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Delta", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "delta"), { "delta" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("EmissionTransform", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "emission_transform"), { "emission_transform" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Index", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "index"), { "index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("LifeTime", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "lifetime"), { "lifetime" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Restart", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "restart"), { "restart" }, VisualShaderNode::PORT_TYPE_BOOLEAN, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Time", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "time"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Transform", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "transform"), { "transform" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("Velocity", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "velocity"), { "velocity" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Active", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "active", "ACTIVE"), { "active" }, VisualShaderNode::PORT_TYPE_BOOLEAN, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Alpha", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "alpha", "COLOR.a"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("AttractorForce", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "attractor_force", "ATTRACTOR_FORCE"), { "attractor_force" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Color", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "color", "COLOR.rgb"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Custom", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "custom", "CUSTOM.rgb"), { "custom" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("CustomAlpha", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "custom_alpha", "CUSTOM.a"), { "custom_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Delta", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "delta", "DELTA"), { "delta" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("EmissionTransform", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "emission_transform", "EMISSION_TRANSFORM"), { "emission_transform" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Index", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "index", "INDEX"), { "index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("LifeTime", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "lifetime", "LIFETIME"), { "lifetime" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Restart", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "restart", "RESTART"), { "restart" }, VisualShaderNode::PORT_TYPE_BOOLEAN, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Time", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "time", "TIME"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Transform", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "transform", "TRANSFORM"), { "transform" }, VisualShaderNode::PORT_TYPE_TRANSFORM, -1, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("Velocity", "Input", "All", "VisualShaderNodeInput", vformat(input_param_shader_modes, "velocity", "VELOCITY"), { "velocity" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, -1, Shader::MODE_PARTICLES)); ///////////////// add_options.push_back(AddOption("Input", "Input", "Common", "VisualShaderNodeInput", TTR("Input parameter."))); - const String input_param_for_vertex_and_fragment_shader_modes = TTR("'%s' input parameter for vertex and fragment shader modes."); - const String input_param_for_fragment_and_light_shader_modes = TTR("'%s' input parameter for fragment and light shader modes."); - const String input_param_for_fragment_shader_mode = TTR("'%s' input parameter for fragment shader mode."); - const String input_param_for_sky_shader_mode = TTR("'%s' input parameter for sky shader mode."); - const String input_param_for_fog_shader_mode = TTR("'%s' input parameter for fog shader mode."); - const String input_param_for_light_shader_mode = TTR("'%s' input parameter for light shader mode."); - const String input_param_for_vertex_shader_mode = TTR("'%s' input parameter for vertex shader mode."); - const String input_param_for_start_shader_mode = TTR("'%s' input parameter for start shader mode."); - const String input_param_for_process_shader_mode = TTR("'%s' input parameter for process shader mode."); - const String input_param_for_collide_shader_mode = TTR("'%s' input parameter for collide shader mode."); - const String input_param_for_start_and_process_shader_mode = TTR("'%s' input parameter for start and process shader modes."); - const String input_param_for_process_and_collide_shader_mode = TTR("'%s' input parameter for process and collide shader modes."); - const String input_param_for_vertex_and_fragment_shader_mode = TTR("'%s' input parameter for vertex and fragment shader modes."); + const String input_param_for_vertex_and_fragment_shader_modes = TTR("'%s' input parameter for vertex and fragment shader modes.") + translation_gdsl; + const String input_param_for_fragment_and_light_shader_modes = TTR("'%s' input parameter for fragment and light shader modes.") + translation_gdsl; + const String input_param_for_fragment_shader_mode = TTR("'%s' input parameter for fragment shader mode.") + translation_gdsl; + const String input_param_for_sky_shader_mode = TTR("'%s' input parameter for sky shader mode.") + translation_gdsl; + const String input_param_for_fog_shader_mode = TTR("'%s' input parameter for fog shader mode.") + translation_gdsl; + const String input_param_for_light_shader_mode = TTR("'%s' input parameter for light shader mode.") + translation_gdsl; + const String input_param_for_vertex_shader_mode = TTR("'%s' input parameter for vertex shader mode.") + translation_gdsl; + const String input_param_for_start_shader_mode = TTR("'%s' input parameter for start shader mode.") + translation_gdsl; + const String input_param_for_process_shader_mode = TTR("'%s' input parameter for process shader mode.") + translation_gdsl; + const String input_param_for_collide_shader_mode = TTR("'%s' input parameter for collide shader mode." + translation_gdsl); + const String input_param_for_start_and_process_shader_mode = TTR("'%s' input parameter for start and process shader modes.") + translation_gdsl; + const String input_param_for_process_and_collide_shader_mode = TTR("'%s' input parameter for process and collide shader modes.") + translation_gdsl; + const String input_param_for_vertex_and_fragment_shader_mode = TTR("'%s' input parameter for vertex and fragment shader modes.") + translation_gdsl; // NODE3D INPUTS - add_options.push_back(AddOption("Alpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "alpha"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Binormal", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "binormal"), { "binormal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Color", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "color"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("InstanceId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_id"), { "instance_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("InstanceCustom", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom"), { "instance_custom" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("InstanceCustomAlpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom_alpha"), { "instance_custom_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ModelViewMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "modelview_matrix"), { "modelview_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("PointSize", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "point_size"), { "point_size" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Tangent", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_mode, "tangent"), { "tangent" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Vertex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "vertex"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("VertexId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "vertex_id"), { "vertex_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewIndex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_index"), { "view_index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewMonoLeft", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_mono_left"), { "view_mono_left" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewRight", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_right"), { "view_right" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); - - add_options.push_back(AddOption("Alpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "alpha"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Binormal", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "binormal"), { "binormal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "color"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("DepthTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "depth_texture"), { "depth_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("FragCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("FrontFacing", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "front_facing"), { "front_facing" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("PointCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "point_coord"), { "point_coord" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ScreenTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_texture"), { "screen_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_uv"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Tangent", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "tangent"), { "tangent" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Vertex", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "vertex"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("View", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "view"), { "view" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewIndex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_index"), { "view_index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewMonoLeft", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_mono_left"), { "view_mono_left" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ViewRight", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_right"), { "view_right" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); - - add_options.push_back(AddOption("Albedo", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "albedo"), { "albedo" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Attenuation", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "attenuation"), { "attenuation" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Backlight", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "backlight"), { "backlight" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Diffuse", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "diffuse"), { "diffuse" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("FragCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Light", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light"), { "light" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("LightColor", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_color"), { "light_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Metallic", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "metallic"), { "metallic" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Roughness", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "roughness"), { "roughness" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("ShadowAttenuation", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "shadow_attenuation"), { "shadow_attenuation" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("Specular", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "specular"), { "specular" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); - add_options.push_back(AddOption("View", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "view"), { "view" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Alpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "alpha", "COLOR.a"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Binormal", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "binormal", "BINORMAL"), { "binormal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Color", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "color", "COLOR.rgb"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("InstanceId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_id", "INSTANCE_ID"), { "instance_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("InstanceCustom", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom", "INSTANCE_CUSTOM.rgb"), { "instance_custom" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("InstanceCustomAlpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom_alpha", "INSTANCE_CUSTOM.a"), { "instance_custom_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ModelViewMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "modelview_matrix", "MODELVIEW_MATRIX"), { "modelview_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("PointSize", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "point_size", "POINT_SIZE"), { "point_size" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Tangent", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_mode, "tangent", "TANGENT"), { "tangent" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Vertex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "vertex", "VERTEX"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("VertexId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "vertex_id", "VERTEX_ID"), { "vertex_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewIndex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_index", "VIEW_INDEX"), { "view_index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewMonoLeft", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_mono_left", "VIEW_MONO_LEFT"), { "view_mono_left" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewRight", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_right", "VIEW_RIGHT"), { "view_right" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_SPATIAL)); + + add_options.push_back(AddOption("Alpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "alpha", "COLOR.a"), { "alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Binormal", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "binormal", "BINORMAL"), { "binormal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Color", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "color", "COLOR.rgb"), { "color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("DepthTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "depth_texture", "DEPTH_TEXTURE"), { "depth_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("FragCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord", "FRAGCOORD.xyz"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("FrontFacing", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "front_facing", "FRONT_FACING"), { "front_facing" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("PointCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "point_coord", "POINT_COORD"), { "point_coord" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ScreenTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_texture", "SCREEN_TEXTURE"), { "screen_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_uv", "SCREEN_UV"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Tangent", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "tangent", "TANGENT"), { "tangent" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Vertex", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "vertex", "VERTEX"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("View", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "view", "VIEW"), { "view" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewIndex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_index", "VIEW_INDEX"), { "view_index" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewMonoLeft", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_mono_left", "VIEW_MONO_LEFT"), { "view_mono_left" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("ViewRight", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "view_right", "VIEW_RIGHT"), { "view_right" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_FRAGMENT, Shader::MODE_SPATIAL)); + + add_options.push_back(AddOption("Albedo", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "albedo", "ALBEDO"), { "albedo" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Attenuation", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "attenuation", "ATTENUATION"), { "attenuation" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Backlight", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "backlight", "BACKLIGHT"), { "backlight" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Diffuse", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "diffuse", "DIFFUSE_LIGHT"), { "diffuse" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("FragCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord", "FRAGCOORD.xyz"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Light", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light", "LIGHT"), { "light" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("LightColor", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_color", "LIGHT_COLOR"), { "light_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Metallic", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "metallic", "METALLIC"), { "metallic" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Roughness", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "roughness", "ROUGHNESS"), { "roughness" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("Specular", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "specular", "SPECULAR_LIGHT"), { "specular" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); + add_options.push_back(AddOption("View", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "view", "VIEW"), { "view" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_SPATIAL)); // CANVASITEM INPUTS - add_options.push_back(AddOption("AtLightPass", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "at_light_pass"), { "at_light_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("CanvasMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "canvas_matrix"), { "canvas_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("InstanceCustom", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom"), { "instance_custom" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("InstanceCustomAlpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom_alpha"), { "instance_custom_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("InstanceId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_id"), { "instance_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ModelMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "model_matrix"), { "model_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("PointSize", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "point_size"), { "point_size" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ScreenMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "screen_matrix"), { "screen_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Vertex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_mode, "vertex"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("VertexId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "vertex_id"), { "vertex_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); - - add_options.push_back(AddOption("AtLightPass", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "at_light_pass"), { "at_light_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("FragCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("NormalTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "normal_texture"), { "normal_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("PointCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "point_coord"), { "point_coord" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ScreenPixelSize", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_pixel_size"), { "screen_pixel_size" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ScreenTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_texture"), { "screen_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "screen_uv"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("SpecularShininess", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess"), { "specular_shininess" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("SpecularShininessAlpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess_alpha"), { "specular_shininess_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("SpecularShininessTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "specular_shininess_texture"), { "specular_shininess_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Texture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "texture"), { "texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Vertex", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_mode, "vertex"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); - - add_options.push_back(AddOption("FragCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Light", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light"), { "light" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("LightAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_alpha"), { "light_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("LightColor", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_color"), { "light_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("LightColorAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_color_alpha"), { "light_color_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("LightPosition", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_position"), { "light_position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("LightVertex", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "light_vertex"), { "light_vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Normal", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "normal"), { "normal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("PointCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "point_coord"), { "point_coord" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ScreenUV", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "screen_uv"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Shadow", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "shadow"), { "shadow" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("ShadowAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "shadow_alpha"), { "shadow_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("SpecularShininess", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess"), { "specular_shininess" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("SpecularShininessAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess_alpha"), { "specular_shininess_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); - add_options.push_back(AddOption("Texture", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "texture"), { "texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("AtLightPass", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "at_light_pass", "AT_LIGHT_PASS"), { "at_light_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("CanvasMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "canvas_matrix", "CANVAS_MATRIX"), { "canvas_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("InstanceCustom", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom", "INSTANCE_CUSTOM.rgb"), { "instance_custom" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("InstanceCustomAlpha", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_custom_alpha", "INSTANCE_CUSTOM.a"), { "instance_custom_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("InstanceId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "instance_id", "INSTANCE_ID"), { "instance_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ModelMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "model_matrix", "MODEL_MATRIX"), { "model_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("PointSize", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "point_size", "POINT_SIZE"), { "point_size" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ScreenMatrix", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "screen_matrix", "SCREEN_MATRIX"), { "screen_matrix" }, VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Vertex", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_mode, "vertex", "VERTEX"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("VertexId", "Input", "Vertex", "VisualShaderNodeInput", vformat(input_param_for_vertex_shader_mode, "vertex_id", "VERTEX_ID"), { "vertex_id" }, VisualShaderNode::PORT_TYPE_SCALAR_INT, TYPE_FLAGS_VERTEX, Shader::MODE_CANVAS_ITEM)); + + add_options.push_back(AddOption("AtLightPass", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_modes, "at_light_pass", "AT_LIGHT_PASS"), { "at_light_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("FragCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord", "FRAGCOORD.xyz"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("NormalTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "normal_texture", "NORMAL_TEXTURE"), { "normal_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("PointCoord", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "point_coord", "POINT_COORD"), { "point_coord" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ScreenPixelSize", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_pixel_size", "SCREEN_PIXEL_SIZE"), { "screen_pixel_size" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ScreenTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "screen_texture", "SCREEN_TEXTURE"), { "screen_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ScreenUV", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "screen_uv", "SCREEN_UV"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("SpecularShininess", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess", "SPECULAR_SHININESS.rgb"), { "specular_shininess" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("SpecularShininessAlpha", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess_alpha", "SPECULAR_SHININESS.a"), { "specular_shininess_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("SpecularShininessTexture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_shader_mode, "specular_shininess_texture", "SPECULAR_SHININESS_TEXTURE"), { "specular_shininess_texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Texture", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "texture", "TEXTURE"), { "texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Vertex", "Input", "Fragment", "VisualShaderNodeInput", vformat(input_param_for_vertex_and_fragment_shader_mode, "vertex", "VERTEX"), { "vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_FRAGMENT, Shader::MODE_CANVAS_ITEM)); + + add_options.push_back(AddOption("FragCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "fragcoord", "FRAGCOORD.xyz"), { "fragcoord" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Light", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light", "LIGHT.rgb"), { "light" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("LightAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_alpha", "LIGHT.a"), { "light_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("LightColor", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_color", "LIGHT_COLOR.rgb"), { "light_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("LightColorAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_color_alpha", "LIGHT_COLOR.a"), { "light_color_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("LightPosition", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "light_position", "LIGHT_POSITION"), { "light_position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("LightVertex", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "light_vertex", "LIGHT_VERTEX"), { "light_vertex" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Normal", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "normal", "NORMAL"), { "normal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("PointCoord", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "point_coord", "POINT_COORD"), { "point_coord" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ScreenUV", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "screen_uv", "SCREEN_UV"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Shadow", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "shadow", "SHADOW_MODULATE.rgb"), { "shadow" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("ShadowAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_light_shader_mode, "shadow_alpha", "SHADOW_MODULATE.a"), { "shadow_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("SpecularShininess", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess", "SPECULAR_SHININESS.rgb"), { "specular_shininess" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("SpecularShininessAlpha", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "specular_shininess_alpha", "SPECULAR_SHININESS.a"), { "specular_shininess_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); + add_options.push_back(AddOption("Texture", "Input", "Light", "VisualShaderNodeInput", vformat(input_param_for_fragment_and_light_shader_modes, "texture", "TEXTURE"), { "texture" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_LIGHT, Shader::MODE_CANVAS_ITEM)); // SKY INPUTS - add_options.push_back(AddOption("AtCubeMapPass", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "at_cubemap_pass"), { "at_cubemap_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("AtHalfResPass", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "at_half_res_pass"), { "at_half_res_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("AtQuarterResPass", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "at_quarter_res_pass"), { "at_quarter_res_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("EyeDir", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "eyedir"), { "eyedir" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("HalfResColor", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "half_res_color"), { "half_res_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("HalfResAlpha", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "half_res_alpha"), { "half_res_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light0Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_color"), { "light0_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light0Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_direction"), { "light0_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light0Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_enabled"), { "light0_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light0Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_energy"), { "light0_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light1Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_color"), { "light1_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light1Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_direction"), { "light1_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light1Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_enabled"), { "light1_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light1Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_energy"), { "light1_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light2Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_color"), { "light2_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light2Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_direction"), { "light2_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light2Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_enabled"), { "light2_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light2Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_energy"), { "light2_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light3Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_color"), { "light3_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light3Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_direction"), { "light3_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light3Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_enabled"), { "light3_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Light3Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_energy"), { "light3_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Position", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "position"), { "position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("QuarterResColor", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "quarter_res_color"), { "quarter_res_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("QuarterResAlpha", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "quarter_res_alpha"), { "quarter_res_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Radiance", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "radiance"), { "radiance" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("ScreenUV", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "screen_uv"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("SkyCoords", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "sky_coords"), { "sky_coords" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); - add_options.push_back(AddOption("Time", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "time"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("AtCubeMapPass", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "at_cubemap_pass", "AT_CUBEMAP_PASS"), { "at_cubemap_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("AtHalfResPass", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "at_half_res_pass", "AT_HALF_RES_PASS"), { "at_half_res_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("AtQuarterResPass", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "at_quarter_res_pass", "AT_QUARTER_RES_PASS"), { "at_quarter_res_pass" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("EyeDir", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "eyedir", "EYEDIR"), { "eyedir" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("HalfResColor", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "half_res_color", "HALF_RES_COLOR.rgb"), { "half_res_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("HalfResAlpha", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "half_res_alpha", "HALF_RES_COLOR.a"), { "half_res_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_color", "LIGHT0_COLOR"), { "light0_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_direction", "LIGHT0_DIRECTION"), { "light0_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_enabled", "LIGHT0_ENABLED"), { "light0_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light0Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light0_energy", "LIGHT0_ENERGY"), { "light0_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_color", "LIGHT1_COLOR"), { "light1_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_direction", "LIGHT1_DIRECTION"), { "light1_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_enabled", "LIGHT1_ENABLED"), { "light1_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light1Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light1_energy", "LIGHT1_ENERGY"), { "light1_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_color", "LIGHT2_COLOR"), { "light2_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_direction", "LIGHT2_DIRECTION"), { "light2_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_enabled", "LIGHT2_ENABLED"), { "light2_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light2Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light2_energy", "LIGHT2_ENERGY"), { "light2_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Color", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_color", "LIGHT3_COLOR"), { "light3_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Direction", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_direction", "LIGHT3_DIRECTION"), { "light3_direction" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Enabled", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_enabled", "LIGHT3_ENABLED"), { "light3_enabled" }, VisualShaderNode::PORT_TYPE_BOOLEAN, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Light3Energy", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "light3_energy", "LIGHT3_ENERGY"), { "light3_energy" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Position", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "position", "POSITION"), { "position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("QuarterResColor", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "quarter_res_color", "QUARTER_RES_COLOR.rgb"), { "quarter_res_color" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("QuarterResAlpha", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "quarter_res_alpha", "QUARTER_RES_COLOR.a"), { "quarter_res_alpha" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Radiance", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "radiance", "RADIANCE"), { "radiance" }, VisualShaderNode::PORT_TYPE_SAMPLER, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("ScreenUV", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "screen_uv", "SCREEN_UV"), { "screen_uv" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("SkyCoords", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "sky_coords", "SKY_COORDS"), { "sky_coords" }, VisualShaderNode::PORT_TYPE_VECTOR_2D, TYPE_FLAGS_SKY, Shader::MODE_SKY)); + add_options.push_back(AddOption("Time", "Input", "Sky", "VisualShaderNodeInput", vformat(input_param_for_sky_shader_mode, "time", "TIME"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_SKY, Shader::MODE_SKY)); // FOG INPUTS - add_options.push_back(AddOption("WorldPosition", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "world_position"), { "world_position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); - add_options.push_back(AddOption("ObjectPosition", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "object_position"), { "object_position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); - add_options.push_back(AddOption("UVW", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "uvw"), { "uvw" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); - add_options.push_back(AddOption("Extents", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "extents"), { "extents" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); - add_options.push_back(AddOption("SDF", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "sdf"), { "sdf" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FOG, Shader::MODE_FOG)); - add_options.push_back(AddOption("Time", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "time"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FOG, Shader::MODE_FOG)); + add_options.push_back(AddOption("WorldPosition", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "world_position", "WORLD_POSITION"), { "world_position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); + add_options.push_back(AddOption("ObjectPosition", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "object_position", "OBJECT_POSITION"), { "object_position" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); + add_options.push_back(AddOption("UVW", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "uvw", "UVW"), { "uvw" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); + add_options.push_back(AddOption("Extents", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "extents", "EXTENTS"), { "extents" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_FOG, Shader::MODE_FOG)); + add_options.push_back(AddOption("SDF", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "sdf", "SDF"), { "sdf" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FOG, Shader::MODE_FOG)); + add_options.push_back(AddOption("Time", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "time", "TIME"), { "time" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FOG, Shader::MODE_FOG)); // PARTICLES INPUTS - add_options.push_back(AddOption("CollisionDepth", "Input", "Collide", "VisualShaderNodeInput", vformat(input_param_for_collide_shader_mode, "collision_depth"), { "collision_depth" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_COLLIDE, Shader::MODE_PARTICLES)); - add_options.push_back(AddOption("CollisionNormal", "Input", "Collide", "VisualShaderNodeInput", vformat(input_param_for_collide_shader_mode, "collision_normal"), { "collision_normal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_COLLIDE, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("CollisionDepth", "Input", "Collide", "VisualShaderNodeInput", vformat(input_param_for_collide_shader_mode, "collision_depth", "COLLISION_DEPTH"), { "collision_depth" }, VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_COLLIDE, Shader::MODE_PARTICLES)); + add_options.push_back(AddOption("CollisionNormal", "Input", "Collide", "VisualShaderNodeInput", vformat(input_param_for_collide_shader_mode, "collision_normal", "COLLISION_NORMAL"), { "collision_normal" }, VisualShaderNode::PORT_TYPE_VECTOR_3D, TYPE_FLAGS_COLLIDE, Shader::MODE_PARTICLES)); // PARTICLES @@ -6035,8 +6033,8 @@ void VisualShaderNodePortPreview::_shader_changed() { //find if a material is also being edited and copy parameters to this one - for (int i = EditorNode::get_singleton()->get_editor_history()->get_path_size() - 1; i >= 0; i--) { - Object *object = ObjectDB::get_instance(EditorNode::get_singleton()->get_editor_history()->get_path_object(i)); + for (int i = EditorNode::get_singleton()->get_editor_selection_history()->get_path_size() - 1; i >= 0; i--) { + Object *object = ObjectDB::get_instance(EditorNode::get_singleton()->get_editor_selection_history()->get_path_object(i)); ShaderMaterial *src_mat; if (!object) { continue; diff --git a/editor/plugins/voxel_gi_editor_plugin.h b/editor/plugins/voxel_gi_editor_plugin.h index 67bd1d5105..621e98beef 100644 --- a/editor/plugins/voxel_gi_editor_plugin.h +++ b/editor/plugins/voxel_gi_editor_plugin.h @@ -41,12 +41,12 @@ struct EditorProgress; class VoxelGIEditorPlugin : public EditorPlugin { GDCLASS(VoxelGIEditorPlugin, EditorPlugin); - VoxelGI *voxel_gi; + VoxelGI *voxel_gi = nullptr; - HBoxContainer *bake_hb; - Button *bake; + HBoxContainer *bake_hb = nullptr; + Button *bake = nullptr; - EditorFileDialog *probe_file; + EditorFileDialog *probe_file = nullptr; static EditorProgress *tmp_progress; static void bake_func_begin(int p_steps); |