You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Generate script resource preview without parsing
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#include "core/templates/safe_refcount.h"
|
||||
#include "editor/editor_resource_preview.h"
|
||||
|
||||
class ScriptLanguage;
|
||||
|
||||
void post_process_preview(Ref<Image> p_image);
|
||||
|
||||
class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
|
||||
@@ -112,9 +114,12 @@ public:
|
||||
class EditorScriptPreviewPlugin : public EditorResourcePreviewGenerator {
|
||||
GDCLASS(EditorScriptPreviewPlugin, EditorResourcePreviewGenerator);
|
||||
|
||||
Ref<Texture2D> _generate_from_source_code(const ScriptLanguage *p_language, const String &p_source_code, const Size2 &p_size, Dictionary &p_metadata) const;
|
||||
|
||||
public:
|
||||
virtual bool handles(const String &p_type) const override;
|
||||
virtual Ref<Texture2D> generate(const Ref<Resource> &p_from, const Size2 &p_size, Dictionary &p_metadata) const override;
|
||||
virtual Ref<Texture2D> generate_from_path(const String &p_path, const Size2 &p_size, Dictionary &p_metadata) const override;
|
||||
|
||||
EditorScriptPreviewPlugin();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user