载入中...
搜索中...
未找到
ScriptEditorTool.h
浏览该文件的文档.
1#pragma once
2
3#include "editor/EditorTool.h"
4
5#include <memory>
6
7namespace ssq { class Object; }
8
9namespace eve::editor {
10
17class ScriptEditorTool final : public IEditorTool {
18public:
20 ScriptEditorTool(std::string id, std::string label);
25
27 const ToolDescriptor &descriptor() const override;
29 void setShortcut(const std::string &shortcut);
31 void setActivateCallback(ssq::Object callback);
33 void setDeactivateCallback(ssq::Object callback);
35 void setPointerCallback(ssq::Object callback);
37 void setKeyCallback(ssq::Object callback);
39 void setUpdateCallback(ssq::Object callback);
41 void setCancelCallback(ssq::Object callback);
42
44 void activate(EditorContext &context) override;
46 void deactivate(EditorContext &context) override;
52 void update(EditorContext &context, float dt) override;
54 void cancel(EditorContext &context) override;
55
56private:
57 struct Impl;
58 std::unique_ptr<Impl> impl_;
59};
60
61} // namespace eve::editor
std::string label
const VegetationPresetContext & context
ViewPreparation callback
Context supplied by EditorSession to tools.
Definition EditorTool.h:71
Protocol implemented by every editor tool.
Definition EditorTool.h:110
IEditorTool adapter whose lifecycle and input callbacks are Squirrel closures.
ToolResponse keyEvent(EditorContext &context, const EditorKeyEvent &event) override
Key event.
void update(EditorContext &context, float dt) override
Updates .
const ToolDescriptor & descriptor() const override
Descriptor.
void activate(EditorContext &context) override
Activate.
void setActivateCallback(ssq::Object callback)
Set a closure invoked when the tool becomes active.
~ScriptEditorTool() override
Releases ScriptEditorTool resources.
void setKeyCallback(ssq::Object callback)
Set a closure invoked for normalized key input.
ScriptEditorTool(const ScriptEditorTool &)=delete
void deactivate(EditorContext &context) override
Deactivate.
ScriptEditorTool & operator=(const ScriptEditorTool &)=delete
void setUpdateCallback(ssq::Object callback)
Set a closure invoked every active frame with delta time.
void cancel(EditorContext &context) override
Cancel.
void setShortcut(const std::string &shortcut)
Set the shortcut shown by hosts.
ToolResponse pointerEvent(EditorContext &context, const EditorPointerEvent &event) override
Pointer event.
void setDeactivateCallback(ssq::Object callback)
Set a closure invoked when the tool becomes inactive.
void setPointerCallback(ssq::Object callback)
Set a closure invoked for normalized pointer input.
void setCancelCallback(ssq::Object callback)
Set a closure invoked when the current gesture is cancelled.
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:14
Keyboard input normalized by the editor host.
Definition EditorTool.h:40
Pointer input normalized by an editor viewport adapter.
Definition EditorTool.h:20
UI-facing metadata supplied by a tool implementation.
Definition EditorTool.h:98
Result returned by a tool after processing input.
Definition EditorTool.h:50