You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
This commit is contained in:
@@ -29,26 +29,23 @@
|
||||
#ifndef VISUALSCRIPT_EDITOR_H
|
||||
#define VISUALSCRIPT_EDITOR_H
|
||||
|
||||
#include "editor/plugins/script_editor_plugin.h"
|
||||
#include "visual_script.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "scene/gui/graph_edit.h"
|
||||
#include "editor/create_dialog.h"
|
||||
#include "editor/plugins/script_editor_plugin.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "editor/property_selector.h"
|
||||
#include "scene/gui/graph_edit.h"
|
||||
#include "visual_script.h"
|
||||
class VisualScriptEditorSignalEdit;
|
||||
class VisualScriptEditorVariableEdit;
|
||||
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
|
||||
class VisualScriptEditor : public ScriptEditorBase {
|
||||
GDCLASS(VisualScriptEditor,ScriptEditorBase)
|
||||
GDCLASS(VisualScriptEditor, ScriptEditorBase)
|
||||
|
||||
enum {
|
||||
TYPE_SEQUENCE=1000,
|
||||
INDEX_BASE_SEQUENCE=1024
|
||||
|
||||
TYPE_SEQUENCE = 1000,
|
||||
INDEX_BASE_SEQUENCE = 1024
|
||||
|
||||
};
|
||||
|
||||
@@ -115,7 +112,7 @@ class VisualScriptEditor : public ScriptEditorBase {
|
||||
|
||||
bool updating_graph;
|
||||
|
||||
void _show_hint(const String& p_hint);
|
||||
void _show_hint(const String &p_hint);
|
||||
void _hide_timer();
|
||||
|
||||
CreateDialog *select_base_type;
|
||||
@@ -124,18 +121,17 @@ class VisualScriptEditor : public ScriptEditorBase {
|
||||
String name;
|
||||
Variant::Type ret;
|
||||
bool ret_variant;
|
||||
Vector< Pair<Variant::Type,String> > args;
|
||||
Vector<Pair<Variant::Type, String> > args;
|
||||
};
|
||||
|
||||
Map<int,VirtualInMenu> virtuals_in_menu;
|
||||
Map<int, VirtualInMenu> virtuals_in_menu;
|
||||
|
||||
PopupMenu *new_function_menu;
|
||||
|
||||
|
||||
StringName edited_func;
|
||||
|
||||
void _update_graph_connections();
|
||||
void _update_graph(int p_only_id=-1);
|
||||
void _update_graph(int p_only_id = -1);
|
||||
|
||||
bool updating_members;
|
||||
|
||||
@@ -143,12 +139,12 @@ class VisualScriptEditor : public ScriptEditorBase {
|
||||
|
||||
StringName selected;
|
||||
|
||||
String _validate_name(const String& p_name) const;
|
||||
String _validate_name(const String &p_name) const;
|
||||
|
||||
struct Clipboard {
|
||||
|
||||
Map<int,Ref<VisualScriptNode> > nodes;
|
||||
Map<int,Vector2 > nodes_positions;
|
||||
Map<int, Ref<VisualScriptNode> > nodes;
|
||||
Map<int, Vector2> nodes_positions;
|
||||
|
||||
Set<VisualScript::SequenceConnection> sequence_connections;
|
||||
Set<VisualScript::DataConnection> data_connections;
|
||||
@@ -164,15 +160,14 @@ class VisualScriptEditor : public ScriptEditorBase {
|
||||
Vector2 port_action_pos;
|
||||
int port_action_new_node;
|
||||
void _port_action_menu(int p_option);
|
||||
void _selected_connect_node_method_or_setget(const String& p_text);
|
||||
|
||||
void _selected_connect_node_method_or_setget(const String &p_text);
|
||||
|
||||
int error_line;
|
||||
|
||||
void _node_selected(Node* p_node);
|
||||
void _node_selected(Node *p_node);
|
||||
void _center_on_node(int p_id);
|
||||
|
||||
void _node_filter_changed(const String& p_text);
|
||||
void _node_filter_changed(const String &p_text);
|
||||
void _change_base_type_callback();
|
||||
void _change_base_type();
|
||||
void _member_selected();
|
||||
@@ -181,82 +176,78 @@ class VisualScriptEditor : public ScriptEditorBase {
|
||||
|
||||
void _begin_node_move();
|
||||
void _end_node_move();
|
||||
void _move_node(String func,int p_id,const Vector2& p_to);
|
||||
void _move_node(String func, int p_id, const Vector2 &p_to);
|
||||
|
||||
void _node_moved(Vector2 p_from,Vector2 p_to, int p_id);
|
||||
void _node_moved(Vector2 p_from, Vector2 p_to, int p_id);
|
||||
void _remove_node(int p_id);
|
||||
void _graph_connected(const String& p_from,int p_from_slot,const String& p_to,int p_to_slot);
|
||||
void _graph_disconnected(const String& p_from,int p_from_slot,const String& p_to,int p_to_slot);
|
||||
void _graph_connect_to_empty(const String& p_from,int p_from_slot,const Vector2& p_release_pos);
|
||||
void _graph_connected(const String &p_from, int p_from_slot, const String &p_to, int p_to_slot);
|
||||
void _graph_disconnected(const String &p_from, int p_from_slot, const String &p_to, int p_to_slot);
|
||||
void _graph_connect_to_empty(const String &p_from, int p_from_slot, const Vector2 &p_release_pos);
|
||||
|
||||
void _node_ports_changed(const String& p_func,int p_id);
|
||||
void _node_ports_changed(const String &p_func, int p_id);
|
||||
void _available_node_doubleclicked();
|
||||
|
||||
void _update_available_nodes();
|
||||
|
||||
void _member_button(Object *p_item, int p_column, int p_button);
|
||||
|
||||
void _expression_text_changed(const String& p_text,int p_id);
|
||||
|
||||
void _expression_text_changed(const String &p_text, int p_id);
|
||||
|
||||
String revert_on_drag;
|
||||
|
||||
void _input(const InputEvent& p_event);
|
||||
void _input(const InputEvent &p_event);
|
||||
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, 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);
|
||||
|
||||
int editing_id;
|
||||
int editing_input;
|
||||
|
||||
void _default_value_changed();
|
||||
void _default_value_edited(Node * p_button,int p_id,int p_input_port);
|
||||
void _default_value_edited(Node *p_button, int p_id, int p_input_port);
|
||||
|
||||
void _menu_option(int p_what);
|
||||
|
||||
void _graph_ofs_changed(const Vector2& p_ofs);
|
||||
void _comment_node_resized(const Vector2& p_new_size,int p_node);
|
||||
void _graph_ofs_changed(const Vector2 &p_ofs);
|
||||
void _comment_node_resized(const Vector2 &p_new_size, int p_node);
|
||||
|
||||
int selecting_method_id;
|
||||
void _selected_method(const String& p_method);
|
||||
void _selected_method(const String &p_method);
|
||||
|
||||
void _draw_color_over_button(Object* obj,Color p_color);
|
||||
void _button_resource_previewed(const String& p_path,const Ref<Texture>& p_preview,Variant p_ud);
|
||||
|
||||
VisualScriptNode::TypeGuess _guess_output_type(int p_port_action_node,int p_port_action_output,Set<int> &visited_nodes);
|
||||
void _draw_color_over_button(Object *obj, Color p_color);
|
||||
void _button_resource_previewed(const String &p_path, const Ref<Texture> &p_preview, Variant p_ud);
|
||||
|
||||
VisualScriptNode::TypeGuess _guess_output_type(int p_port_action_node, int p_port_action_output, Set<int> &visited_nodes);
|
||||
|
||||
protected:
|
||||
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
public:
|
||||
|
||||
public:
|
||||
virtual void apply_code();
|
||||
virtual Ref<Script> get_edited_script() const;
|
||||
virtual Vector<String> get_functions();
|
||||
virtual void set_edited_script(const Ref<Script>& p_script);
|
||||
virtual void set_edited_script(const Ref<Script> &p_script);
|
||||
virtual void reload_text();
|
||||
virtual String get_name();
|
||||
virtual Ref<Texture> get_icon();
|
||||
virtual bool is_unsaved();
|
||||
virtual Variant get_edit_state();
|
||||
virtual void set_edit_state(const Variant& p_state);
|
||||
virtual void goto_line(int p_line,bool p_with_error=false);
|
||||
virtual void set_edit_state(const Variant &p_state);
|
||||
virtual void goto_line(int p_line, bool p_with_error = false);
|
||||
virtual void trim_trailing_whitespace();
|
||||
virtual void ensure_focus();
|
||||
virtual void tag_saved_version();
|
||||
virtual void reload(bool p_soft);
|
||||
virtual void get_breakpoints(List<int> *p_breakpoints);
|
||||
virtual bool goto_method(const String& p_method);
|
||||
virtual void add_callback(const String& p_function,PoolStringArray p_args);
|
||||
virtual bool goto_method(const String &p_method);
|
||||
virtual void add_callback(const String &p_function, PoolStringArray p_args);
|
||||
virtual void update_settings();
|
||||
virtual void set_debugger_active(bool p_active);
|
||||
virtual void set_tooltip_request_func(String p_method,Object* p_obj);
|
||||
virtual void set_tooltip_request_func(String p_method, Object *p_obj);
|
||||
virtual Control *get_edit_menu();
|
||||
virtual bool can_lose_focus_on_node_selection() { return false; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user