1 #ifndef TEXTURE_EDITOR_PLUGIN_H 2 #define TEXTURE_EDITOR_PLUGIN_H 3 4 #include "editor/editor_node.h" 5 #include "editor/editor_plugin.h" 6 #include "scene/resources/texture.h" 7 8 class TextureEditor : public Control { 9 10 OBJ_TYPE(TextureEditor, Control); 11 12 Ref<Texture> texture; 13 14 protected: 15 void _notification(int p_what); 16 void _input_event(InputEvent p_event); 17 static void _bind_methods(); 18 19 public: 20 void edit(Ref<Texture> p_texture); 21 TextureEditor(); 22 }; 23 24 class TextureEditorPlugin : public EditorPlugin { 25 26 OBJ_TYPE(TextureEditorPlugin, EditorPlugin); 27 28 TextureEditor *texture_editor; 29 EditorNode *editor; 30 31 public: get_name()32 virtual String get_name() const { return "Texture"; } has_main_screen()33 bool has_main_screen() const { return false; } 34 virtual void edit(Object *p_node); 35 virtual bool handles(Object *p_node) const; 36 virtual void make_visible(bool p_visible); 37 38 TextureEditorPlugin(EditorNode *p_node); 39 ~TextureEditorPlugin(); 40 }; 41 42 #endif // TEXTURE_EDITOR_PLUGIN_H 43