Codebase Enhancements and Performance Improvements

We've made several updates to improve our codebase and application performance.

- Clang format was applied for better readability and consistency, aiding other developers in understanding and contributing to the code.
- We resolved issues that were causing visual script compilation failure. The visual script now compiles successfully, ensuring application functionality.
- Broken sections within the codebase were fixed, improving overall stability.
- Built-in functions from the visual script were removed to simplify the code and enhance readability.
- Generic search performance was improved to provide faster results, enhancing user experience.
- Missing flow nodes were added to the Visual Script, ensuring all necessary components are present for correct functioning.

In an effort to streamline the codebase:

- `VisualScriptComment` class and related code were removed, reducing complexity and improving maintainability.
- Error messages were optimized for quicker feedback when errors occur.
- Licenses were updated to reflect recent changes, ensuring legal compliance and project transparency.
- The `get_global_name()` override in `visual_script.h` was fixed, and `TYPE_BUILTIN_FUNC` in `visual_script_expression.h` was removed, improving code functionality.
- Search logic was refactored to avoid double searching, enhancing performance.
- Documentation was updated to reflect recent changes, providing accurate information to users and developers.
- Property selection logic in `VisualScriptPropertySelector` was refactored for easier understanding and modification.
- Code was refactored to avoid variable shadowing, improving readability and reducing potential errors.
- `.clang-format` and `.clang-tidy` configuration files were added to ensure consistent code styling.

To make the code more robust and easier to understand:

- Variable names were corrected for clarity, and error handling in `visual_script_expression.cpp` was improved.
- Function and variable names were refactored for better readability and maintainability.
- Member editing logic in `VisualScriptEditor` was simplified.
- Name variables were updated to be unique, avoiding potential conflicts and errors.
- The `VisualScriptSubCall` class was refactored for simplicity and ease of understanding.

For macOS workflow:

- It was updated to use the latest version and correct path for installing Vulkan SDK, enabling the application to leverage the latest features and improvements from the Vulkan SDK.
- Mac Vulkan SDK was installed to support Vulkan-based functionalities.

Lastly, we made necessary changes to pass CI/CD tests, ensuring the code quality and stability of the application.
This commit is contained in:
K. S. Ernest (iFire) Lee
2023-08-15 09:34:34 -07:00
parent 40bdeebc80
commit 9a4df15d3e
78 changed files with 5752 additions and 6218 deletions

View File

@@ -1,32 +1,32 @@
/*************************************************************************/
/* visual_script_editor.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
/**************************************************************************/
/* visual_script_editor.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef VISUAL_SCRIPT_EDITOR_H
#define VISUAL_SCRIPT_EDITOR_H
@@ -35,6 +35,7 @@
#include "editor/create_dialog.h"
#include "editor/editor_inspector.h"
#include "editor/plugins/script_editor_plugin.h"
#include "scene/resources/style_box_flat.h"
#include "visual_script_property_selector.h"
class GraphEdit;
@@ -131,7 +132,7 @@ class VisualScriptEditor : public ScriptEditorBase {
EditorProperty *default_property_editor = nullptr;
Ref<VisualScriptEditedProperty> edited_default_property_holder;
Ref<EditorUndoRedoManager> undo_redo;
EditorUndoRedoManager *undo_redo = nullptr;
Tree *members = nullptr;
AcceptDialog *function_name_edit = nullptr;
LineEdit *function_name_box = nullptr;
@@ -183,10 +184,10 @@ class VisualScriptEditor : public ScriptEditorBase {
PopupMenu *popup_menu = nullptr;
PopupMenu *member_popup = nullptr;
MemberType member_type;
MemberType member_type{};
String member_name;
PortAction port_action;
PortAction port_action{};
int port_action_node = 0;
int port_action_output = 0;
Vector2 port_action_pos;
@@ -291,11 +292,9 @@ class VisualScriptEditor : public ScriptEditorBase {
void _on_nodes_delete();
void _on_nodes_duplicate();
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;
void drop_data_fw(const Point2 &p_point, const Variant &p_data,
Control *p_from);
Variant get_drag_data_fw(const Point2 &p_point);
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data);
int editing_id = 0;
int editing_input = 0;
@@ -304,6 +303,8 @@ class VisualScriptEditor : public ScriptEditorBase {
int data_disconnect_node = 0;
int data_disconnect_port = 0;
String current_base_type;
void _default_value_changed(const StringName &p_property,
const Variant &p_value, const String &p_field,
bool p_changing);
@@ -329,6 +330,10 @@ class VisualScriptEditor : public ScriptEditorBase {
void _toggle_scripts_pressed();
void _set_base_type_and_script(Ref<VisualScriptNode> &node,
const String &base_type,
const String &base_script);
protected:
void _notification(int p_what);
static void _bind_methods();
@@ -339,6 +344,7 @@ public:
virtual void
set_syntax_highlighter(Ref<EditorSyntaxHighlighter> p_highlighter) override;
virtual void convert_indent() override;
virtual void apply_code() override;
virtual Ref<Resource> get_edited_resource() const override;
virtual void set_edited_resource(const Ref<Resource> &p_res) override;
@@ -355,8 +361,6 @@ public:
virtual void clear_executing_line() override;
virtual void trim_trailing_whitespace() override;
virtual void insert_final_newline() override;
virtual void convert_indent_to_spaces() override;
virtual void convert_indent_to_tabs() override;
virtual void ensure_focus() override;
virtual void tag_saved_version() override;
virtual void reload(bool p_soft) override;