Repository: godotengine/godot
File: editor/plugins/path_2d_editor_plugin.h (C/C++)

Code before:
		ACTION_NONE,
		ACTION_MOVING_POINT,
		ACTION_MOVING_IN,
		ACTION_MOVING_OUT,
	};

	Action action;
	int action_point = 0;
	Point2 moving_from;
	Point2 moving_screen_from;
	float orig_in_length = 0.0f;
	float orig_out_length = 0.0f;
	Vector2 edge_point;

	void _mode_selected(int p_mode);
	void _handle_option_pressed(int p_option);

	void _node_visibility_changed();
	friend class Path2DEditorPlugin;

protected:
	void _notification(int p_what);
	void _node_removed(Node *p_node);
	static void _bind_methods();

public:
	bool forward_gui_input(const Ref<InputEvent> &p_event);
	void forward_canvas_draw_over_viewport(Control *p_overlay);
	void edit(Node *p_path2d);
	Path2DEditor();
};

class Path2DEditorPlugin : public EditorPlugin {
	GDCLASS(Path2DEditorPlugin, EditorPlugin);

	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); }
	virtual void forward_canvas_draw_over_viewport(Control *p_overlay) override { path2d_editor->forward_canvas_draw_over_viewport(p_overlay); }

	virtual String get_name() const override { return "Path2D"; }
	bool has_main_screen() const override { return false; }
	virtual void edit(Object *p_object) override;
	virtual bool handles(Object *p_object) const override;
	virtual void make_visible(bool p_visible) override;

	Path2DEditorPlugin();
	~Path2DEditorPlugin();
};


Review comment (suggestion):
```suggestion
	void _confirm_clear_points();
	void _clear_curve_points(Path2D *p_path2d);
	void _restore_curve_points(Path2D *p_path2d, const PackedVector2Array &p_points);
```
Private methods should begin with underscore.

Code after:
		HANDLE_OPTION_ANGLE,
		HANDLE_OPTION_LENGTH,
	};

	enum Action {
		ACTION_NONE,
		ACTION_MOVING_POINT,
		ACTION_MOVING_IN,
		ACTION_MOVING_OUT,
	};

	Action action;
	int action_point = 0;
	Point2 moving_from;
	Point2 moving_screen_from;
	float orig_in_length = 0.0f;
	float orig_out_length = 0.0f;
	Vector2 edge_point;

	void _mode_selected(int p_mode);
	void _handle_option_pressed(int p_option);

	void _node_visibility_changed();

	void _confirm_clear_points();
	void _clear_curve_points(Path2D *p_path2d);
	void _restore_curve_points(Path2D *p_path2d, const PackedVector2Array &p_points);

protected:
	void _notification(int p_what);
	void _node_removed(Node *p_node);
	static void _bind_methods();

public:
	bool forward_gui_input(const Ref<InputEvent> &p_event);
	void forward_canvas_draw_over_viewport(Control *p_overlay);
	void edit(Node *p_path2d);
	Path2DEditor();
};

class Path2DEditorPlugin : public EditorPlugin {
	GDCLASS(Path2DEditorPlugin, EditorPlugin);

	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); }
	virtual void forward_canvas_draw_over_viewport(Control *p_overlay) override { path2d_editor->forward_canvas_draw_over_viewport(p_overlay); }

	virtual String get_name() const override { return "Path2D"; }
	bool has_main_screen() const override { return false; }