summaryrefslogtreecommitdiffstats
path: root/editor/plugins/gradient_editor_plugin.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-05-17 18:02:16 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-05-17 18:03:05 -0300
commit4b5227ff7755aa19aa57452c49e9466252fcb4a0 (patch)
tree2adcced443c368d5d2ad2c71e2fae631af1e2411 /editor/plugins/gradient_editor_plugin.h
parent3183375135e7e9d7bdab2b318dd74f672ebda27d (diff)
downloadredot-engine-4b5227ff7755aa19aa57452c49e9466252fcb4a0.tar.gz
-Ability to open resources in the same window
-Plenty of fixes and improvements to new inspector -Fixes that were needed to make inspector work better
Diffstat (limited to 'editor/plugins/gradient_editor_plugin.h')
-rw-r--r--editor/plugins/gradient_editor_plugin.h35
1 files changed, 23 insertions, 12 deletions
diff --git a/editor/plugins/gradient_editor_plugin.h b/editor/plugins/gradient_editor_plugin.h
index 52f4c59575..0c878b168f 100644
--- a/editor/plugins/gradient_editor_plugin.h
+++ b/editor/plugins/gradient_editor_plugin.h
@@ -35,28 +35,39 @@
#include "editor/editor_plugin.h"
#include "scene/gui/gradient_edit.h"
-class GradientEditorPlugin : public EditorPlugin {
+class GradientEditor : public GradientEdit {
+ GDCLASS(GradientEditor, GradientEdit)
- GDCLASS(GradientEditorPlugin, EditorPlugin);
+ bool editing;
+ Ref<Gradient> gradient;
- Ref<Gradient> gradient_ref;
- GradientEdit *ramp_editor;
- EditorNode *editor;
+ void _gradient_changed();
+ void _ramp_changed();
protected:
static void _bind_methods();
- void _ramp_changed();
- void _undo_redo_gradient(const Vector<float> &offsets, const Vector<Color> &colors);
+
+public:
+ virtual Size2 get_minimum_size() const;
+ void set_gradient(const Ref<Gradient> &p_gradient);
+ GradientEditor();
+};
+
+class EditorInspectorPluginGradient : public EditorInspectorPlugin {
+ GDCLASS(EditorInspectorPluginGradient, EditorInspectorPlugin)
+public:
+ virtual bool can_handle(Object *p_object);
+ virtual void parse_begin(Object *p_object);
+};
+
+class GradientEditorPlugin : public EditorPlugin {
+
+ GDCLASS(GradientEditorPlugin, EditorPlugin);
public:
virtual String get_name() const { return "ColorRamp"; }
- bool has_main_screen() const { return false; }
- virtual void edit(Object *p_object);
- virtual bool handles(Object *p_object) const;
- virtual void make_visible(bool p_visible);
GradientEditorPlugin(EditorNode *p_node);
- ~GradientEditorPlugin();
};
#endif /* TOOLS_EDITOR_PLUGINS_COLOR_RAMP_EDITOR_PLUGIN_H_ */