mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Merge pull request #92576 from aaronfranke/shader-lang-editors
Make shader language editors inherit the same base class
This commit is contained in:
commit
d6175a43da
8 changed files with 120 additions and 61 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "editor/editor_properties.h"
|
||||
#include "editor/plugins/editor_plugin.h"
|
||||
#include "editor/plugins/editor_resource_conversion_plugin.h"
|
||||
#include "editor/plugins/shader/shader_editor.h"
|
||||
#include "scene/gui/graph_edit.h"
|
||||
#include "scene/resources/syntax_highlighter.h"
|
||||
#include "scene/resources/visual_shader.h"
|
||||
|
|
@ -195,8 +196,8 @@ public:
|
|||
VisualShaderEditedProperty() {}
|
||||
};
|
||||
|
||||
class VisualShaderEditor : public VBoxContainer {
|
||||
GDCLASS(VisualShaderEditor, VBoxContainer);
|
||||
class VisualShaderEditor : public ShaderEditor {
|
||||
GDCLASS(VisualShaderEditor, ShaderEditor);
|
||||
friend class VisualShaderGraphPlugin;
|
||||
|
||||
PopupPanel *property_editor_popup = nullptr;
|
||||
|
|
@ -596,6 +597,12 @@ protected:
|
|||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
virtual void edit_shader(const Ref<Shader> &p_shader) override;
|
||||
virtual void apply_shaders() override;
|
||||
virtual bool is_unsaved() const override;
|
||||
virtual void save_external_data(const String &p_str = "") override;
|
||||
virtual void validate_script() override;
|
||||
|
||||
void add_plugin(const Ref<VisualShaderNodePlugin> &p_plugin);
|
||||
void remove_plugin(const Ref<VisualShaderNodePlugin> &p_plugin);
|
||||
|
||||
|
|
@ -609,11 +616,8 @@ public:
|
|||
|
||||
virtual Size2 get_minimum_size() const override;
|
||||
|
||||
void edit(VisualShader *p_visual_shader);
|
||||
Ref<VisualShader> get_visual_shader() const { return visual_shader; }
|
||||
|
||||
void validate_script();
|
||||
|
||||
VisualShaderEditor();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue